Skip to content

Policy: define force-undo behavior for forgotten, still-rejected values #214

Closed

Description

@WhollyMindless

Proposed classification: question, store-security, severity:low. Labels require maintainer permissions; these are suggestions for your triage.

For maintainer triage and approval of scope. Reviewed main at bf9f4d2, still current when these proposals were prepared. Review probes use synthetic temporary stores; this is not a report of a production incident. No implementation or assignment is implied by this issue.

SEC-06: memory_undo force restores a value that memory_forget tombstoned; restore never consults rejections

  • src/undo.ts:238 — force mode ignores audited deletions; no tombstone check anywhere in restoreSnapshot
  • src/index.ts:943 — check-mode reply: 'Omitted N deliberately deleted row(s); use force=true to recover them.'

Reproduction: test/review-probes/probe-undo-force-tombstone.probe.ts: store a decision, snapshot its day file, memory_forget it (which writes a tombstone), then memory_undo the snapshot in check mode and in force mode.

Observed: Check mode omits the row and suggests force=true. Force restores it: the row is injectable and returned by memory_recall, while the tombstone remains. The store ends up holding an active row whose value it also records as rejected.

Effect: #35's stated property is that a value 'stays rejected' and 'there is deliberately no tool that lifts a rejection, so a blocked write cannot be re-submitted by the session it was refused.' Undo force does not lift the tombstone, but it reinstates the rejected value through an agent-callable tool. Undoing one's own forget is also a reasonable reading of 'undo', so this is presented as a policy question.

Preconditions: A snapshot taken before the forget exists (forget snapshots first), and an agent calls memory_undo with force=true.

Limits: Blocklisted (human-blocked) rows correctly stay hidden in every mode. Human viewer deletes write no tombstone, so they are outside this question.

Proposed scope / decision requested

Please choose the intended contract: should non-admin force undo omit rejected values, or may explicit undo restore them while the rejection remains? The latter may be intentional, but it needs clear tool/docs semantics. Do not silently remove rejection records as an implementation shortcut. Parent reproduced the behavior; this is not asserted to be a vulnerability absent the policy decision.

Please accept, narrow, defer, or decline this independently of the other review findings. We will wait for your direction before taking implementation. Happy to supply a checked-in regression reproducer with an accepted fix; the review report and probe artifacts are preserved locally.

Activity

  1. added
    question
    store-security
    severity:low
    agent:ready
    on Nov 1, 2026
  2. added
    fix:blocked
    on Nov 3, 2026
  3. ocsi-fixer commented on Nov 3, 2026

    @ocsi-fixer

    fix:blocked: this ticket states no acceptance criterion that can be verified mechanically. It asks the maintainer to choose between two contracts — (a) non-admin force undo omits rejected values, or (b) force undo may restore them while the rejection record remains — and explicitly says "We will wait for your direction before taking implementation," so there is nothing to build until that choice is made. The reproduction route is also not checkable in-repo: test/review-probes/probe-undo-force-tombstone.probe.ts named in the body does not exist on current main (4cc8bf61005ff2585efe073cc0bf579f475ae213), and the probe artifacts were preserved locally by the author. A maintainer reply choosing (a) or (b), plus either the probe checked in or an in-repo reproduction recipe, makes this buildable.

  4. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: eb3028c1702472b1 2026-11-03T22:38:35Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  5. removed
    agent:ready
    on Nov 4, 2026
  6. abogartz commented on Nov 4, 2026

    @abogartz
    Owner

    Decision sheet — verified current at 06e4e28

    Still holds after the restructure: restoreSnapshot (src/store/undo.ts) tracks deletedOmitted for check mode but consults no tombstone in any mode; force reinstates a memory_forget-tombstoned value while the tombstone line remains. The store can hold an active row it also records as rejected.

    Option A — rejection is absolute (recommended).
    Force omits tombstoned values, like it already omits blocklisted rows. "There is deliberately no tool that lifts a rejection" (#35) becomes strictly true for every tool, not just the write path. Mis-forget recovery stays human: an admin removes the tombstone line, then a plain undo restores. Cost: one filter in restoreSnapshot + docs; agents lose the force-recovery shortcut.

    Option B — keep current behavior, document it.
    Force undo is admin-grade recovery; the rejected value returns while the tombstone stays as history. Cost: docs only. Consequence: the store knowingly holds active-and-rejected rows, and an agent calling memory_undo force has reinstated rejected content — the property #35 states in words no longer holds in behavior.

    Option C — force restores, but quarantined.
    Reinstated tombstoned rows land quarantined: not injectable, not recallable, releasable only by a human. Keeps recovery callable and keeps rejection from being silently re-injected. Cost: medium — quarantine semantics must extend to every row type, plus release-path docs.

    Recommendation: A. The invariant is the point of tombstones; C is the principled alternative if you want agent-callable recovery. B is the one option that leaves the contradiction WM identified.

    Maintainer: reply accept A, accept B, accept C, or defer.

  7. abogartz commented on Nov 4, 2026

    @abogartz
    Owner

    Maintainer decision 2026-11-04: accept A — rejection is absolute; memory_undo force omits tombstoned values and reports them; recovery of a mis-forget stays human (remove tombstone, then plain undo). Implementation queued as #307. Close this record when #307 merges.

  8. removed
    fix:blocked
    on Nov 4, 2026
  9. abogartz commented on Nov 4, 2026

    @abogartz
    Owner

    Decision delivered 2026-11-04: accept A (see decision comment). Contract now tracked by #307.

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

    questionseverity:lowstore-security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions