Skip to content

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

Closed

Description

@fdaviddpt

What

_remember_render_memory_section's rotated-slices block in scripts/lib-memory-context.sh
prints memory-file paths under a "rotated memory slices" header with no _remember_may_inject
call at all -- unlike the compact-mode deferred-file loop in the same function, which #777/#790
fixed. Still true at HEAD as of this curation pass (2026-09-26): a git-tracked or symlinked file
the injection guard would refuse elsewhere is listed by path under a header implying it is
safe/expected content.

Location

scripts/lib-memory-context.sh, the rotated-slices printing loop (currently around lines 972-983):

for _remember_newest_line in "${_remember_newest_arr[@]}"; do
    _remember_wc_size_get_into _remember_newest_bytes "$_remember_newest_line"
    case "$_remember_newest_bytes" in
        (''|*[!0-9]*) printf '%s (size unknown)' "$_remember_newest_line" ;;
        (*) printf '%s (%s bytes)' "$_remember_newest_line" "$_remember_newest_bytes" ;;
    esac
done

No _remember_may_inject call anywhere in this loop, contrasted with the deferred-file loop a
few dozen lines above it (scripts/lib-memory-context.sh:814), which does call it before listing
a path.

Mechanism

This path is not gated by compact mode -- it fires on every render where rotated slices exist, a
different code path than #777's own fix but the same defect shape: a refused file's path is still
printed, under a header that implies the listing is safe/expected, inviting a follow-up read of
content the guard exists to refuse.

History

Flagged during PR #790's own review as an "Adjacent (not fixed here, out of scope)" finding.
Filed as #791 by the maintainer loop, then closed by the maintainer as a deliberate duplicate-avoidance
move: the review had already routed the same finding to trap.d/777.rotated-slices-no-guard.md
per skills/manager/phases/findings.md's non-blocking routing, and #791 was filed before that
routing decision was visible. This issue exists because that trap.d fragment is now being resolved
by a curation pass and deleted -- #1736's own rule (a decline of a live code defect must never be
the only record of it) requires a durable record to replace it, since #791 was explicitly closed in
favor of the fragment being that record.

What would settle it

Same shape as #790's own fix: call _remember_may_inject per file before including it in the
rotated-slices listing, printing a refused file under its own refusal header instead (reusing
#790's exact header text would misattribute the two populations, per that PR's own self-review
finding) -- with a test on the same pattern as tests/test_compact_deferred_guard_777.py.

[AI-generated]

Activity

  1. added
    priority:medium
    filed-by-loop
    lane-capture
    on Sep 26, 2026
  2. self-assigned this
    on Sep 26, 2026
  3. added a commit that references this issue on Sep 26, 2026
  4. removed their assignment
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    filed-by-looplane-capturepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions