Repository navigation
Conversation
#748: when sanitizing the untrusted project config layer failed (mktemp, an unreadable project file, or jq/the no-jq Python fallback itself), the whole project layer was correctly dropped (fail closed) but nothing was logged anywhere -- a project's own settings (e.g. handoff_mode) vanished with no explanation. Both the jq path and the Python fallback now report the drop via report_error where it is in scope, falling back to a plain stderr line where it is not (lib-memory-dir.sh is sourced by log.sh before log.sh defines log/report_error). #759: a failed `mkdir -p "$BACKUP_COMMON_DIR/info"` had no else branch, so the config.json exclusion rule in git's info/exclude was silently never written on a read-only filesystem or permissions error, letting `git add -- "$SLUG/"` stage config.json (which can carry a live haiku.oauth_token) exactly as before the #719 fix, with the caller seeing an ordinary success line either way. The mkdir failure now reports a WARNING via report_error, matching every other failure path in this hook. #749 (composition of #730/#719's untrack commit with git-restore's fast-forward) is already fixed by #741 (changelog.d/741.fixed.md) -- 50-git-restore.sh already detects and restores a config.json a fast-forward removed from tracking, logging loudly on both success and failure. No code change needed; reported as already-shipped rather than reopened. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…found broken Self-review (Explore) found that the #748 fix to scripts/lib-memory-dir.sh broke tests/test_case_divergence_298.py::test_the_per_tool_call_path_is_not_touched -- its byte-parity guard against origin/main has no allowance for the new lines, so the test failed against real origin/main. Extends _SANCTIONED_DIVERGENCE's existing lib-memory-dir.sh entries in place rather than nesting new chained pairs inside them: composing directly on top of an already-landed pair (the #757 steady state) the same way, re-deriving each affected pair's old_code to be that steady state rather than the long-superseded #744/#726 forms it used to start from -- the same "fold, don't stack a third pair" precedent the file's own #757 comments already document for this exact site. A first attempt nesting new pairs inside the existing ones passed the real guard test but broke tests/test_sanctioned_divergence_state_440.py's own synthetic canary (a chained pair's old_code duplicating verbatim inside an earlier pair's own already-landed new_code, corrupting it under the synthetic test's naive concatenate-then-substitute construction); re-deriving in place instead passes both. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Non-blocking, ranked fails-to-preserve, "can ship behind a trap.d fragment" per the findings table -- see the fragment for the mechanism and what would settle it. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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
scripts/lib-memory-dir.shsilently dropped the untrusted per-project config layer when sanitizing it failed (jq path and no-jq Python fallback), with nothing logged anywhere. Both paths now callreport_error(falling back to a plain stderr line wherereport_erroris not yet defined -- this file is sourced bylog.shbeforelog.shdefines it).hooks.d/after_save/50-git-backup.sh'''smkdir -p "$BACKUP_COMMON_DIR/info"guard had noelsebranch, so a failed mkdir silently skipped writing the git-exclude rule forconfig.json(which can carry a livehaiku.oauth_token), letting the latergit addstage it. Anelsebranch now reports a WARNING.hooks.d/before_session_start/50-git-restore.shalready detects and restores a trackedconfig.jsonremoved by an incoming fast-forward, logging loudly either way). No code change in this pull request; release-audit: composition of #730/#719 untrack commit + git-restore's fast-forward deletes a peer clone's tracked config.json (fails-to-preserve, non-blocking) #749 stays open here -- recommend closing it separately as a duplicate of release-audit: cross-machine git fast-forward can silently delete .remember/config.json after a git-rm-cached upgrade (fails-to-preserve, reasoned) #741.Self-review
Below-bar finding recorded here per the filing bar: a narrower residual instance of the same class #748 itself fixed remains in the no-jq Python fallback's own marker-file mktemp -- if that mktemp itself fails (full/read-only $TMPDIR), the drop-marker signal cannot be written, so a compound failure (mktemp failure AND the project config also failing to load in the same invocation) reproduces the original silent-drop defect in this narrower case. Judged non-blocking and left as a trap.d fragment (
trap.d/748.marker-signal-dies-if-mktemp-fails.md) rather than fixed, matching this file's own established silent-fallthrough precedent for every other mktemp failure in it.Two reviewers (Explore, oss:auditor) ran in parallel per
agents/developer/review.md. Explore found that the #748 fix broke a byte-parity guard test (tests/test_case_divergence_298.py) that needed its_SANCTIONED_DIVERGENCEallowlist updated for the new lines -- fixed. The auditor found a narrower residual instance of the same silent-drop class in the no-jq Python fallback's own marker-filemktemp(a compound failure: mktemp AND the project config both failing in the same call) -- ranked non-blocking (fails-to-preserve) and logged totrap.d/748.marker-signal-dies-if-mktemp-fails.mdrather than fixed, per the file's own already-established silent-fallthrough precedent for every other mktemp failure in this file.Test plan
tests/test_untrusted_project_haiku_config_726.py) red before fix, green aftertests/test_git_backup_silent_exclude_mkdir_759.py) red before fix, green aftertests/test_case_divergence_298.py(22 tests) andtests/test_sanctioned_divergence_state_440.py(4 tests) green after the self-review fixtest_locale_ranges_695.pygreen (112 passed, 2 skipped for flock unavailability)pytestsuite -- not run locally; CI is the source of truth across the 3-OS/4-interpreter matrixCloses #748.
Closes #759.
#749 stays open (see Summary above) -- superseded by #741, not this pull request.
🤖 Generated with Claude Code
[AI-generated]