Skip to content

fix(#748,#759): log silent config-layer/exclusion drops - #787

Merged
fdaviddpt merged 3 commits into
mainfrom
fix/748
Sep 26, 2026
Merged

fdaviddpt merged 3 commits into
mainfrom
fix/748

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Summary

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_DIVERGENCE allowlist 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-file mktemp (a compound failure: mktemp AND the project config both failing in the same call) -- ranked non-blocking (fails-to-preserve) and logged to trap.d/748.marker-signal-dies-if-mktemp-fails.md rather than fixed, per the file's own already-established silent-fallthrough precedent for every other mktemp failure in this file.

Test plan

Closes #748.
Closes #759.

#749 stays open (see Summary above) -- superseded by #741, not this pull request.

🤖 Generated with Claude Code

[AI-generated]

fdaviddpt and others added 3 commits September 26, 2026 03:14
#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant