fix(coding-agents): stop unsafe gitlog cleanup - #3879
Open
r266-tech wants to merge 1 commit into
Open
Conversation
Strix Security ReviewWarning This pull request has 1 commit after the last Strix review ( No security issues found. Updated for Reviewed by Strix |
r266-tech
force-pushed
the
fix/coding-agents-safe-gitlog-cleanup
branch
from
August 29, 2026 16:57
c4c9524 to
762a6f8
Compare
koriyoshi2041
approved these changes
Aug 30, 2026
koriyoshi2041
left a comment
Contributor
There was a problem hiding this comment.
Verified at 762a6f8. The destructive bank-wide cleanup is gone, internal tag probes use strict matching, and the current-HEAD check now requires this repository's canonical document ID. I also ran the 69 focused tests, TypeScript typecheck, package build, and diff hygiene successfully.
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.
Summary
source:git-logdocuments during syncall_strict, while preservinglistDocumentIds()'s existing public defaultFixes #3877.
Why
The document listing endpoint can include untagged documents for the legacy inclusive
allmode. The old deepen path then treated every returned non-canonical document as stale and deleted it. Because document deletion cascades to facts, a routine coding-agents sync could remove unrelated memories from a shared bank.This change removes that destructive cleanup entirely. Git-log sync now owns only its canonical document and never deletes other document IDs.
Compatibility and remaining limitation
The optional
tags_matchparameter defaults toall, matching the existing client behavior for external callers. Coding-agents' internal strategy checks opt intoall_strictexplicitly.Canonical git-log IDs remain
gitlog:<repoName>for backward compatibility. Consequently, unrelated same-named repositories or forks can still share that legacy ID; changing the namespace safely requires a separate ownership/migration design. This patch prevents cross-document deletion but does not attempt that migration.Validation
npx tsc --noEmitnpx vitest run src/core/hindsight.test.ts src/core/git.gitlog.test.ts src/core/status.test.ts src/core/session-start.test.ts(69 tests)npm test(663 tests)npm run buildgit diff --checkThe repository-wide lint hook could not load the control-plane
@eslint/jsdependency from this sparse worktree; the package typecheck, complete test suite, build, and diff checks pass.