memory backpass: run the skill as a program, not a prompt #277
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!277
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/memory-backpass-command"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
allod memory backpassruns the memory backward pass as a program: it reads the session traces not yet analyzed, fills the skill's two prompts, calls a bulk-analysis model once per trace and a synthesis model once, quote-checks every finding, writes the ledger lines and prunes, and opens one pull request on the private memory repository. Nothing changes on a running machine: the command exists but nothing runs it until the archetypes timer (the remaining slice of allod/strategy#55) calls it. What stays identical: every other namespace, the skill text inallod/memory, which stays the spec and supplies the prompts at run time. What proves it: the Go tests drive the command end to end against fixture traces, fixture memory repos with their own origins, a fake model seat and a stub forge, covering the funnel, the quote check, the one-line-per-rule-and-session rule, the hash state file, retry and fallback, the timeout, report-only, write mode and the budget-hook drop; the sandboxedgo-checksflake check passes; one cold cross-family review (two reads of the diff, implementation and tests) returned 24 findings, 17 of them verified real and fixed in one round, two declined as fixture-only, the rest comment items handled by the trim. If it is wrong: revert; nothing depends on the namespace yet, and the command never pushes a default branch, so a bad run is one PR to close.Refs allod/strategy#55
Closes allod/tools#276
What it does
allod memory backpass --traces <dir>... [--public <dir>] [--private <dir>] [--bulk-seat <cmd>] [--fallback-seat <cmd>] [--synthesis-seat <cmd>] [--timeout <s>] [--jobs <n>] [--report-only], documented indocs/allod-memory.md.agent-rosterskill); it receives the prompt file path as its last argument and answers on stdout. Exit status is never the gate, parsed content is; every call runs under a hard timeout in its own process group and is killed by group id, never by pattern.skills/memory-backpass/at run time and filled by a single-pass literal substitution that never rescans substituted text, so a trace containing&or{{TRACE}}reaches the model byte for byte. Both must open with the self marker.<traces>/.memory-backpass/analyzed.txtinsha256sumformat; a trace that grew is pending again; a failed trace is never marked.Decisions worth a look
gaplines only: anignoredorharmline names an instruction that is in the index by construction, so a literal coverage check would prune every such sighting on sight. Age pruning applies to all kinds.Risk
R3. The command opens a PR on a memory repository through
allod changeand commits a state file to the traces checkouts; it never pushes a default branch and never merges. The privacy boundary is the traces repository's own; the command sends trace text only to the seats the deployment names.Validation
gofmt -l cmd/allodempty;go vet ./cmd/allod/...cleango test ./cmd/allodok;go test -tags site,secret ./cmd/allodok, run by the integrator after the fix round and again after the comment trimnix build .#checks.x86_64-linux.go-checkspasses on the final tree, which is the witness that the fixture budget hook really executes in the sandbox: the first version passed that build only because the hook could not exec there and the test read the failure as a budget failure; the fix round made the assertion load-bearing (the branch must carry the kept edit)git diff --checkcleanOwner request, recorded before the change: when no seat is given, the command should use whatever model pi itself is configured to use, since that is always the local inference stack. The change: with
--bulk-seator--synthesis-seatabsent (option and environment both), the seat is a built-inpiseat that runsscript -qec "pi -p '@<prompt file>'" /dev/nullunder the same timeout and process-group kill, and the report names it aspiwith the provider and model read from pi's own settings file. A seat value of exactlypiselects the same built-in explicitly. The fallback seat keeps no default. Documented in the usage text anddocs/allod-memory.md; covered by a test with a stubpiandscripton PATH.Owner request, recorded before the change: a bare
allod memory backpassshould do the right thing on each machine, so the long option line is never typed. The change: every input resolves in a fixed order and the report prints what was chosen and why. Traces:--traces, thenALLOD_BACKPASS_TRACES(path list, colon-separated), then every registry entry marked"traces": truewhose checkout is on disk, then~/work/traces-<hostname>, then~/work/traces. Private memory:--private, thenALLOD_BACKPASS_PRIVATE, then the one memory-marked registry entry other thanallod/memory, then~/work/agent-memory. Public memory:--public, thenALLOD_BACKPASS_PUBLIC, then the registry as before. A refusal names every place that was looked at. The registry marker is documented for the inventory to set; a deployment whose checkouts follow the registry convention needs nothing.Both owner requests above are on the branch. A bare
allod memory backpassnow works on a machine whose checkouts follow the registry convention: traces resolve by option,ALLOD_BACKPASS_TRACES, a"traces": trueregistry entry, then~/work/traces-<hostname>and~/work/traces; private memory by option,ALLOD_BACKPASS_PRIVATE, the registry, then~/work/agent-memory; the report opens with an## Inputssection naming each path and its source. With no seat given, the bulk and synthesis seats are a built-inpiseat that runsscript -qec "pi -p '@<prompt>'" /dev/nullunder the same timeout and process-group kill, named in the report aspi (<provider>/<model>)from pi's own settings file. The fallback seat has no default. Covered by tests with a stubpiandscripton PATH and fixture registries; gofmt, vet, both tagged test runs and the sandboxedgo-checksflake check pass on the final tree.1f843e580etoab585578fd