Skip to content

fix(#805): refuse a git-tracked or symlinked rotated memory slice - #811

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/803
Sep 26, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/803

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

What

Adds an _remember_may_inject guard call to the rotated-slices listing loop in
scripts/lib-memory-context.sh'''s _remember_render_memory_section -- previously that loop, unlike its two sibling loops in the same function (the main memory-file loop and the compact-mode deferred-file loop from #777), had NO injection-guard call at all, so a git-tracked or symlinked archive-*.md/recent-*.md was listed under the "rotated memory slices" header as if it were an ordinary, safe entry.

A refused slice now prints under a new, third header -- "--- refused, not listed as a rotated slice (not injected) ---" -- deliberately distinct from #790'''s own two headers to avoid misattributing populations (this exact self-review finding from #790 is cited in #805'''s own issue text).

Reopens the intent of #791 (closed by the maintainer as a deliberate duplicate-avoidance move in favor of trap.d/777.rotated-slices-no-guard.md as the record; #805 exists because that trap.d fragment is now being resolved/deleted by a curation pass and #1736'''s own rule requires a durable record to replace it).

Test plan

  • New test file tests/test_rotated_slices_guard_805.py (3 tests: tracked-file refusal, symlinked-file refusal, positive control for an ordinary untracked slice).
  • RED at 69ff8d3 (before the fix): 2 failed, 1 passed.
  • GREEN after the fix (and a same-lane self-review follow-up adding a blank-line separator before the new header, per reviewer finding): 3 passed.
  • Adjacent regression sweep (test_rotated_archive_recall.py, test_compact_deferred_guard_777.py, test_injection_guard_754_755_756.py): 34 passed, no regressions.
  • docs/windows-skip-triage.md updated with a row for the new test file'''s win32 blanket skip; changelog.d/805.security.md added.

Note: #803, also carried by this lane, was investigated in depth but NOT fixed and stays open -- it is unrelated to this change and is not closed by this PR.

Closes #805

🤖 Generated with Claude Code

[AI-generated]

fdaviddpt and others added 2 commits September 26, 2026 23:55
`_remember_render_memory_section`'s rotated-slices loop
(lib-memory-context.sh) listed every archive-*.md/recent-*.md path with no
`_remember_may_inject` call at all -- unlike the main memory-file loop and
the compact-mode deferred-file loop (#777) in the same function, both of
which call the guard before listing a path. A git-tracked or symlinked
rotated slice was still named under the "rotated memory slices" header,
implying a safe, ordinary listing and inviting a follow-up read of content
the guard exists to keep out of session context.

Reopens the intent of #791 (closed as a duplicate-avoidance move in favor of
trap.d/777.rotated-slices-no-guard.md, which curation is now resolving).

Red before the fix (2 failed, 1 passed -- the positive control), green
after (3 passed) -- see tests/test_rotated_slices_guard_805.py.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…lank line

Explore's self-review of 0b0c76e found the new "--- refused, not listed as
a rotated slice ---" header ran straight into the preceding content with no
blank line -- either the "rotated memory slices" header itself (when every
slice in the top-10 window was refused) or the last accepted path's own
line (when some were accepted). Every other header transition in this
function separates sections with one blank line; this one did not.

tests/test_rotated_slices_guard_805.py already passed 3/3 before this fix
(its own `_rotated_section` helper had to special-case the missing blank
line to scope its assertions correctly) and still passes 3/3 after.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@fdaviddpt
fdaviddpt merged commit de83ad3 into main Sep 26, 2026
16 checks passed
@fdaviddpt
fdaviddpt deleted the fix/803 branch September 26, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rotated memory slices are still listed with no injection guard (reopens the intent of #791)

1 participant