Sync Open Knowledge from agents-private#541
Merged
Merged
Conversation
…(#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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copybara-translated commits from agents-private. Rebase-merge this PR so the prepared commits land directly on public main.