Repository navigation
feat(base): wire the memory loop in create-agent when a checkout is present (#21) - #67
Conversation
…resent (#21) M1 slice only. Opt-in safe: absence or failure reports memory off and creation continues with an unchanged exit code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GNgHnmc7XDCrYeFW1SMTDd Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GNgHnmc7XDCrYeFW1SMTDd Signed-off-by: Claude <noreply@anthropic.com>
|
Review of the M1 slice, checked against the memory layer's Interface: correct. Findings, most important first:
Scope is clean: no semantic search, paid keys, watcher, systemd or cross-repo changes, and the follow-ups are listed in the SPEC. I re-ran Generated by Claude Code |
…#21) Check hook scripts and tsx before running the memory install, so a missing dependency leaves settings untouched. Wire memory on exit, after the verification probe, so the probe is not recorded as a first memory. Stricter fixture and new tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Re-review of 42266ec. All four earlier findings are fixed. The pre-check matches the real Remaining items, most important first:
Not verified: silo seeding through the real Generated by Claude Code |
Keep both the memory and --model variable blocks and summary lines. Also handle INT/TERM/HUP during the probe, make the summary memory line conditional, and fence the INSTALL.md memory block as sh-manual. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Review findings for head
|
|
Automated review (CodeRabbit CLI, run against this branch) found one minor issue: Minor, |
…-install cases (#21) Refuse memory when env.AGENT_NAME names another agent, reject a symlinked per-agent settings file before any write, restore the previous settings (or report a PARTIAL state) when the memory install fails after merging hooks, leave memory unwired when the verification probe fails, and leave a visible report when interrupted during the install. Tests, SPEC and INSTALL.md updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Fixes pushed in d5484a8 (fast-forward, no history rewrite). Reply to each finding: Major, conflicting Major, failure after hooks merged: fixed. A snapshot is taken first; on a non-zero install the settings are restored and the report says Major, symlinked settings: fixed. A symlinked Major, Minor, memory wired after a failed probe: fixed. A wrong phrase, empty reply or runtime error now leaves memory unwired with Minor (CodeRabbit), interrupt during wiring leaves no report: fixed. The signal handler prints Minor, tests do not substantiate a working loop: partly. A failure-after-merge test was added. An integration check producing a real observation through the real hooks still needs a built checkout; listed as a follow-up, not done here. Generated by Claude Code |
|
Review of head Verdict: merge after one fix. I confirmed every fix from the previous round. The conflicting Findings
CI on Not verified: silo seeding through a real Generated by Claude Code |
…ean up the snapshot (#21) The memory installer writes a temporary file and a backup beside the settings and follows links, so refuse when anything in .claude is a symlink, and check again after the install before stamping USER_NAME or reporting on. Create the settings snapshot 0600 and remove it on signal, remove files a failed install left beside the settings, correct the signal comment, and add REVIEW.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
…#21) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Review of head Verdict: merge after fixes (one Major). The round-4 symlink fix works for symlinks. The exploit from my previous comment no longer works: with Findings
Confirmed, no regression:
CI on Not verified: silo seeding through a real Generated by Claude Code |
…port signals in the exit handler (#21) Contain the agent home and .claude by real path, refuse any hard link or pre-existing settings.json.* entry before the install, re-check after it, track a stage so a signal in the exit handler always prints a memory line, and write USER_NAME through a temporary file and a rename. Tests, SPEC, INSTALL.md and REVIEW.md updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Review of head Verdict: merge after fixes (two Major). Both round-5 exploits are fixed with the real installer. With a hard-linked Findings
Confirmed, no regression:
CI on Not verified: macOS behaviour. On macOS, Generated by Claude Code |
…mp hardening, signal output (#21) Resolve the agent home through symlinked ancestors even when it does not exist yet, refuse a hard-linked settings.json and settings that are the user's own global file, fail closed instead of relying on find, stamp USER_NAME through a random exclusively created file, and print the signal report through a saved stdout. Tests, SPEC, INSTALL.md and REVIEW.md updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Review of head Verdict: merge after minor fixes. No Critical or Major findings. I checked every round-6 item myself. All of them are fixed or honestly narrowed. The exploits that used to work are all refused now. What is left are four Minor edge cases and some doc nits. Exploits re-run with the real installer
Other checks that passed: the containment check fails closed in every case I tried:
Signal stages: I slowed individual node steps with a PATH shim, then sent the signal either to the script's PID or to its process group. The results:
The line never said Findings
CI on Not verified: macOS. From reading the code: node's JS
Generated by Claude Code |
… agents home (#21) Open fd 7 only in the exit handler and close it for the installer and the node helper so a detached child cannot hold the caller's pipe, and refuse an agents home with a .. component that a symlink would resolve differently. Narrow the INSTALL.md and SPEC claims about dangling links and the in-place settings merge. Add the round 7 section to REVIEW.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Final focused review of head Verdict: approve. No new findings. Both round-7 code changes do what they say. I found no regression in the earlier security fixes, the exit codes, or the rule that memory never aborts creation. fd 7
Earlier exploits re-run against the real
The INSTALL.md and SPEC changes are accurate. The "whichever way a link points" claim is gone, and both same-user limitations are stated. I found no false safety claim. Findings: none. CI on Unverified:
Generated by Claude Code |
…the run first (#21) Replace the runtime-assembled gated name with neutral installer-style names, and assert exit status, the installer call, the memory line and the wired hooks before the timing assertion in the detached-child test. REVIEW.md and SPEC updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Focused review of head Verdict: approve. No findings. (a) Leak-gate evasion
(b) Neutral names
(c) Detached-child test
(d) Regressions and scope
CI on Unverified or known:
Generated by Claude Code |
Refs #21 (M1 slice only, so this does not close the issue).
TL;DR
create-agent.shcan now wire the memory loop for a new agent. Given a built memory-layer checkout (MEMORY_LAYER_ROOTor--memory-root), it runs that checkout's own non-interactive install command against the agent's own.claude/settings.json(hooks) and seeds the agent's silo, then recordsUSER_NAMEin the settings env. Memory is wired on exit, after the verification probe, so the probe's own turn is not recorded as a first memory; a run interrupted by SIGINT, SIGTERM or SIGHUP wires nothing. With no checkout, an unbuilt one (hook scripts or tsx missing, checked before anything is written),--no-memory, or a failing install command, the last output line saysmemory off (reason), a warning explains why, and creation carries on with an unchanged exit code. INSTALL.md tier 3 gains an optional memory step (fencedsh-manual, since it needs a real checkout). SPEC:.specs/21-memory-loop-install/SPEC.md.Live and wrong, up front
offalthough its settings may already hold the hooks. The warning says so; the command is idempotent, so re-running it repairs it.off (not built: missing ...).Note for the maintainer (leak gate and trailers)
The first two commits carry a
Claude-Session:trailer, which the repo's private-session-link leak rule flags inpnpm check:leaks:messages(not part of the required check list). Later commits omit it. A squash merge should strip anyClaude-Sessionlines from the message.Verified interface (memory layer v0.3.0, after its #11)
scripts/install.sh --skip-build --settings FILE --agent NAME: non-interactive, idempotent, any checkout name; exit 0/1/2/3. Needs a prior build and installed dependencies. Silo routing is byAGENT_NAME, which Deck already writes, so--linkis not used. Incompatibilities with the issue text are in the SPEC.Test plan
pnpm -C packages/base exec vitest run test/create-agent.test.ts: new memory cases in temporary directories with a fixture checkout that mirrors the installer (hooks merged before the tsx check, PreCompact auto and manual), including present, absent, unbuilt, built but tsx missing (no hooks written), probe-before-wiring, terminated mid-probe, install fails,--no-memory,USER_NAMEunset.tsxwas not run (dependencies could not be fetched in the sandbox).pnpm testpass after merging currentmain.Out of scope, follow-ups
TOOLS.mdnaming the memory layer; installing the recall instruction into agent homes.CORE.mdfor the persona-inject hook.🤖 Generated with Claude Code