Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

ProposalGC ABSORBED matches a 60-char prefix, not the verbatim entry its header promises — `--auto` (implies `--apply`) deletes the live half of an extended directive

Open Bowlerjim opened this issue 2 months ago • 2 comments

Observed on 7.54.0.

What

ProposalGC.ts states its own invariant in its header:

SAFETY (non-negotiable): only three removal classes, each PROVABLE, never a judgment call. It never merges meaning and never touches a distinct rule, so the worst case is a no-op — it cannot drop a live directive.

  1. ABSORBED — the entry's substantive text already appears verbatim in the file's canonical body (above the proposals section).

The code does not implement "verbatim". It implements a 60-character prefix match:

// LIFEOS/TOOLS/ProposalGC.ts:89
function core(entry: string): string {
  return normalize(entry).slice(0, 60);
}

// LIFEOS/TOOLS/ProposalGC.ts:118
} else if (core(e.text).length >= 30 && bodyNorm.includes(core(e.text))) {
  removals.push({ file: relPath, reason: "absorbed", text: e.text.trim() });

So any proposal whose first 60 normalized characters appear in the body is deleted whole. The colliding case is the ordinary one: the memory reviewer restating an existing rule in order to extend it. The restatement matches; the extension is destroyed.

This is not gated on a human. --auto is the documented scheduled entry point and implies --apply:

// LIFEOS/TOOLS/ProposalGC.ts:195
const auto = args.has("--auto");
const apply = args.has("--apply") || auto;

Repro

Body of an always-loaded file contains:

Back up the work repo to the remote every night at 03:30 local.

Proposals section contains:

- Back up the work repo to the remote every night at 03:30 local, AND additionally push an encrypted copy offsite every Sunday, verifying byte-identical restore before trusting it.
bun LIFEOS/TOOLS/ProposalGC.ts --json   # -> {"reason":"absorbed", ...}
bun LIFEOS/TOOLS/ProposalGC.ts --apply  # -> proposals section now empty

The offsite/verify half of the directive is gone, recorded nowhere but git.

Expected

The entry is kept: its substantive content is not in the body. At minimum, an unattended pass never removes it.

Fix sketch

Require the entire normalized entry to appear in bodyNorm before classifying ABSORBED:

} else if (normalize(e.text).length >= 30 && bodyNorm.includes(normalize(e.text))) {

A prefix heuristic is a judgment call, which is exactly what the header forbids this job from making. If a fuzzier match is wanted for the interactive path, it belongs behind --route as an advisory flag, never in the --auto write path.

Bowlerjim avatar Sep 21 '26 03:09 Bowlerjim

This is Shiva, Eugene's AI Assistant, reporting on Eugene's behalf.

Confirmed — core() truncated to 60 chars, so ABSORBED matched a prefix, not the verbatim entry its own header promises, and --auto (implies --apply) could delete the live half of an extended directive. This runs unattended via cron on our install. Replaced with a full-string normalize() comparison.

Environment: ThinkPad, Ubuntu 24.04.4 LTS, Ryzen AI 9 HX PRO 370, Bun 1.3.11.

waveman2020-sudo avatar Sep 23 '26 19:09 waveman2020-sudo

Thanks @Bowlerjim. Confirmed: a 60-character prefix match broke the header's promise that only verbatim matches are removed. ABSORBED now requires the whole normalized entry to appear in the body, ported from your PR #2197 (LIFEOS/TOOLS/ProposalGC.ts). Next release carries it.

danielmiessler avatar Oct 03 '26 04:10 danielmiessler