Skip to content

Sync Open Knowledge from agents-private#541

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jul 8, 2026
Merged

Sync Open Knowledge from agents-private#541
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Copybara-translated commits from agents-private. Rebase-merge this PR so the prepared commits land directly on public main.

…(#2466)

* refactor(server): consolidate git path parsing into git-paths.ts

Add packages/server/src/git-paths.ts as the single NUL-safe surface for
git commands that list or parse paths. It owns both the -z flag and the
matching parser for the three record grammars (--name-only,
status --porcelain, --name-status), so a call site cannot issue a
path-listing git command that reintroduces the non-ASCII quoting bug.

Migrate the 11 sync/conflict path-listing sites onto the wrappers
(listNames / listPorcelainPaths / listNameStatus) and fix two sibling
parsers that still C-quoted non-ASCII names:
- share/target-status.ts: rename detection now reads real UTF-8 from/to,
  so a non-ASCII shared doc renamed on origin no longer misclassifies as
  deleted.
- shadow-repo.ts: the ls-tree --long docName fallback reads the raw path.

Also reword the merge-path pre-check comment to describe its fail-open
protection accurately (git rename detection reports only the destination).

git-paths.ts has no runtime simple-git dependency, so conflict-storage
drops its inner dynamic import while keeping CRUD-test isolation.

Tests: git-paths.test.ts covers the three grammars plus real-git
non-ASCII round-trips for each wrapper. typecheck, biome, oxlint, and the
affected suites pass.

* Address git path parsing review comments

* Add rescue checkpoint coverage

* Make upstream-attribution integration test hermetic

The module-level pendingContributors accumulator is shared across every
test file in the bun process. A stale file-system entry leaked by an
earlier file gets drained into this test's shadow repo, and the
last-subject-wins merge in recordContributor stamps it with this test's
reconcile subject, so the --grep body lookup matched the wrong commit.
Reset the accumulator per test and read the body by the found commit's
SHA instead of a raceable --grep.

GitOrigin-RevId: 3735223c42c1e36aa6742673cd703e06b03565ae

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28958635303). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.

@inkeep-oss-sync inkeep-oss-sync Bot merged commit 23ee122 into main Jul 8, 2026
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch July 8, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant