Repository navigation
Merged
Conversation
…a project-wide last-writer-wins pointer `handoff_mode: "per_session"` published the resolved handoff target to one shared file, `tmp/handoff-path`, overwritten on every SessionStart. The last session to start owned that pointer, so an earlier session's later /remember could silently write into a more-recently-started session's remember.<id>.md. write-handoff.sh never received a session id, so it had no way to tell. session-start-hook.sh now also publishes a copy keyed by that session's own id, tmp/handoff-path.<session_id>; write-handoff.sh identifies its own session via CLAUDE_CODE_SESSION_ID (a live env var Claude Code sets for the Bash tool, never a value the model supplies) and prefers that copy over the shared pointer whenever it exists, falling back exactly as before when no session id reaches it. The new per-session hint files are pruned the same way #373 already prunes remember.delivered.<session_id> records. Co-Authored-By: Claude Sonnet 5 <[email protected]>
`str | None` in a signature is evaluated at definition time on 3.9 and failed collection on every CI leg. Postpone annotation evaluation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The top-level LC_ALL save/restore around the allowlist `case` was not a guard test_locale_ranges_695 recognises, and restored an unset LC_ALL as set-but-empty. `case` patterns are measured not to collate (#698), so use the same plain `case` as session-start-hook.sh:294 and list the site in the same ALLOWLIST under _CASE. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
fdaviddpt
added a commit
that referenced
this pull request
Sep 25, 2026
trap.d's queue (18 pre-existing plus 3 stray uncommitted, from the primary clone's own working tree) plus two new fragments logged for this pass (#739, #746) -- 21 total, all decided, none deferred. New fragments added and curated in this same pass: - 746: two PRs (#734 then #746) each stranded a sanctioned-divergence pair in test_case_divergence_298.py by stacking a new pair on a site an earlier PR had already pinned, going red on origin/main invisibly to either PR's own CI. - 739: a targeted local pytest run missed a Python 3.9 str|None annotation and a new shell bracket-range pattern, both caught only by the full CI matrix. Promoted (12 new rules, all firing-proven both directions via pre-path-hook.sh / pre-tool-hook.sh, plus a known-good control): - paths/00-manual: bash-locale-pin-byte-and-case-ops, dollar-paren-lt-file-is-a- special-case, hand-kept-completeness-list-goes-stale, kill-a-subshell-not-its- forked-child, per-session-value-shared-channel, security-check-three-states- not-two, simulating-tool-absence-on-macos, spawn-counter-splits-on-embedded- newlines, case-divergence-pin-fold-dont-stack - tools/00-manual: supertool-cwd-verify-tree, raw-append-write-unguarded (interim, filed claude-supertool#2699), targeted-pytest-misses-py39-and-scanners Merged into existing rules: - 630, 695.outward-walk-assumes-lexical-scope -> folded into bash-locale-pin-byte-and-case-ops.md as supporting evidence - 705.edit-toml-literal-double-escape -> appended to supertool-literal- backslashes.md Declined, each recorded in the owning layer's 00-README.md: - 695.emit-read-max-is-an-unvalidated-knob (still true, filed #758) - 719.silent-exclude-mkdir-failure (still true, filed #759) - 721.git-dir-symlink-bypasses-tracked-check (still true, filed #761, low-priority: attacker already needs a stronger primitive) - 660.promo-installed-key-array-plugins-shape (still true, filed #762) - 722.edit-tool-cannot-write-raw-unicode-literal (not a code claim; narrow, workaround already obvious) - 725.recon-reads-dirty-sibling-clone-not-origin-main (not this repo's code; filed claude-oss#1745 against oss:recon itself) 721.git-command-failure-reads-as-untracked and 721.case-fold-helper-not-pinned- to-c-locale were promoted rather than declined: both describe a generalizable class (git-gated security checks folding failure into the permissive branch; missing LC_ALL=C pinning) worth teaching beyond the one call site, so each became -- or was folded into -- a promoted rule above, alongside filing the underlying code issue. 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.
Closes #738.
Problem
In
handoff_mode: "per_session",session-start-hook.shresolved a per-session target (remember.<session_id>.md) but published it through one project-wide file,.remember/tmp/handoff-path, rewritten on every SessionStart.write-handoff.shhad no session identity, so the last-started session owned the pointer and every other session's/rememberwrote into its file. Regression from #731.Fix
write-handoff.shderives its own session id fromCLAUDE_CODE_SESSION_ID(same[A-Za-z0-9._-]+allowlist as session-start-hook resolves PREV_JSONL by mtime position, so at source=startup it is off by one — #206's fix 2 is still open, and recovery force-saves the wrong session #270) and reads a session-keyed hinttmp/handoff-path.<id>when present; otherwise it falls back to the previous shared-file behaviour.session-start-hook.shwritestmp/handoff-path.<session_id>alongside the shared hint, and prunes stale ones with the same transcript-existence + 5-minute grace rule as the handoff_mode: per_session writes one remember.delivered.<session_id> per session into $REMEMBER_DIR/tmp and nothing ever removes them #373remember.delivered.<id>sweep.docs/handoff.md,docs/windows-skip-triage.md. Trap logged intrap.d/.Tests (written first)
tests/test_handoff_per_session_pointer_738.py, 5 tests. Againstmain's scripts: 3 failed (session A's note landed inremember.sess-bbb.md). With the fix: all 5 pass, together with the #363 / #720 suites (18/18). Positive controls: the last-started session still writes to its own file; single mode still sharesremember.md; a hint whose transcript exists survives pruning.First CI round failed collection on every leg:
str | Nonein a signature on Python 3.9. Fixed withfrom __future__ import annotations(8acf98c); 3.9 grammar checked withast.parse(feature_version=(3, 9)), no local 3.9 interpreter to run it.Platform
Observed on macOS:
CLAUDE_CODE_SESSION_IDis exported to the Bash tool, and the suite is green. Reasoned, not observed: the same holds on Linux and Windows Git Bash. The new module carries the repo's standard blanketwin32skip, so CI's Windows legs do not cover it.🤖 Generated with Claude Code
[AI-generated]