Repository navigation
feat(amr): phase 6 CLI group, commitAmrEdits and createAmrTools - #335
Merged
Merged
Conversation
- `memory amr context|check|export|import|commit`: one JSON report per command; exit code 1 on an issue, refusal or failure (exitCode, not process.exit, so piped JSON is not cut). Export/import dry-run by default. - commitAmrEdits: guarded commit of hand-edited .md files; refuses the whole commit on deletion, rename, merge conflict, staged-plus-edited, non-Markdown, bad path or secret; the size check comes before the read. - createAmrTools: fixed root, strict schemas, allowWrite gate, budgets refused above the reader defaults, results bounded like Recursa. - Shared tool scaffolding (defineTool, makeToolSet) moves to recursaToolSupport.ts. - Fix: boundResult could exceed maxBytes (79,754 vs 65,536 bytes). Relay: Haiku builder, Haiku challenger (critiqued the builder diff), Sonnet reviewer (selected and combined, found the committed merge conflict), Opus fixer. junior chain run: yes, 5 of 16 accepted (deepseek-v4.1-flash:cloud) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkAmrLink refused ':' and '\' but allowed '"', '<', '>', '|', '?' and '*'. Windows cannot create such a file, so a note committed on Linux broke a Windows checkout; the commitAmrEdits test for 'q"uote.md' (skipped on win32) failed on the ubuntu and macos CI legs. New reason: windows-char. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 6 of
docs/roadmap/AGENT_MEMORY_REPO_PLAN.md.What
memory amr context|check|export|import|commit(src/cli/commands/amr.ts). One JSON report per command;process.exitCode = 1on an issue, refusal or failure. Export and import are dry runs until--apply; export passes the whole graph and filters only throughtypes(Phase 4 F17).commitAmrEdits(AmrWriter.ts): the guarded commit of hand-edited.mdfiles (plan rule R14). Refuses the whole commit, staging nothing, on deletion, rename, merge conflict (AA), staged-plus-edited (MM, AM), non-Markdown, bad path or secret (text, path and message).GitRunnerallowsstatus --untracked-files=allso a new note in a new folder is seen as a file.createAmrTools(ctx, { root, allowWrite, namespace, maxBytes }): five tools, fixed root, strict schemas (no root or path argument),write_disabledbefore any git or fs call, budgets above the reader defaults refused, results bounded like the Recursa tools.defineToolandmakeToolSetmove torecursaToolSupport.ts, shared by both adapters.ExportFormatdocs: AMR is not an export format; seeexportAmr.Fixed
boundResultcould exceedmaxBytes(79,754 vs 65,536 bytes): separators, keys and escapes now count, and the final size is checked.Route
Haiku builder (tests first) -> Haiku challenger (critiqued the builder diff, proposed alternatives) -> Sonnet reviewer (selected and combined per point, with probes; found that a merge conflict was committed with its markers) -> Opus fixer.
Deferred (todo rows)
GitRunner stdout cap; quadratic
planTargetreaddir; the repo-wideprocess.exitpattern; the scan-vs-git addwindow; AMR tools ignoreAbortSignalafter start; a bad--storagepath gives an unhandled rejection and exit 0.Gates (local)
Full suite 13227 passed, 0 failed. Node 22.16 focused suites 600 passed. Built CLI
amr checkon a dangling link: exit 1, JSON parses. typecheck, lint, build + check-exports, check-duplicates, check-census,repo-tools docs check src(2167/2167), architecture docs (30 claims).junior chain run: yes, 5 of 16 accepted (deepseek-v4.1-flash:cloud). Worker (Haiku): full first pass. Challenger (Haiku): 13 disputes. Reviewer (Sonnet): 7-item fix list, all applied, plus F8 (bounded results).
🤖 Generated with Claude Code