brainclaw 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -263
- package/dist/brainclaw-vscode.vsix +0 -0
- package/dist/cli/register-capture.js +209 -0
- package/dist/cli/register-code-map.js +19 -0
- package/dist/cli/register-coordination.js +472 -0
- package/dist/cli/register-federation.js +258 -0
- package/dist/cli/register-lifecycle.js +436 -0
- package/dist/cli/register-memory-context.js +502 -0
- package/dist/cli/register-planning.js +167 -0
- package/dist/cli/register-review.js +149 -0
- package/dist/cli/shared.js +5 -0
- package/dist/cli.js +212 -2015
- package/dist/commands/dispatch-watch.js +25 -2
- package/dist/commands/harvest.js +31 -6
- package/dist/commands/mcp-catalog.js +1438 -0
- package/dist/commands/mcp-contract.js +33 -0
- package/dist/commands/mcp-presentation.js +27 -0
- package/dist/commands/mcp-read-handlers.js +72 -36
- package/dist/commands/mcp-write-admin.js +328 -0
- package/dist/commands/mcp-write-claims.js +864 -0
- package/dist/commands/mcp-write-coordination.js +1825 -0
- package/dist/commands/mcp-write-entities.js +620 -0
- package/dist/commands/mcp-write-memory.js +451 -0
- package/dist/commands/mcp-write-sequences.js +116 -0
- package/dist/commands/mcp-write-support.js +367 -0
- package/dist/commands/mcp.js +261 -5570
- package/dist/commands/update-handoff.js +28 -42
- package/dist/core/agent-capability.js +31 -14
- package/dist/core/agent-files.js +1 -1
- package/dist/core/agent-registry.js +51 -3
- package/dist/core/claims.js +18 -0
- package/dist/core/coordination.js +5 -2
- package/dist/core/cross-project.js +35 -1
- package/dist/core/dispatcher.js +34 -20
- package/dist/core/entity-operations.js +335 -12
- package/dist/core/entity-registry.js +72 -9
- package/dist/core/execution.js +28 -4
- package/dist/core/facade-schema.js +30 -4
- package/dist/core/federation-cloud.js +142 -11
- package/dist/core/federation-outbox.js +292 -0
- package/dist/core/federation-signing.js +115 -0
- package/dist/core/handoff-review.js +35 -0
- package/dist/core/io.js +6 -0
- package/dist/core/protocol-tool-policy.js +113 -0
- package/dist/core/review-loop-close.js +115 -0
- package/dist/core/schema.js +25 -2
- package/dist/core/security-detectors.js +35 -6
- package/dist/core/security.js +32 -12
- package/dist/core/worktree.js +98 -9
- package/dist/facts.js +13 -11
- package/dist/facts.json +12 -10
- package/docs/PROTOCOL.md +7 -3
- package/docs/concepts/coordinator-runbook.md +3 -0
- package/docs/concepts/dispatch-lifecycle.md +4 -4
- package/docs/concepts/loop-engine.md +3 -1
- package/docs/concepts/troubleshooting.md +1 -1
- package/docs/integrations/codex.md +3 -3
- package/docs/integrations/overview.md +1 -1
- package/docs/mcp-schema-changelog.md +153 -2
- package/docs/playbooks/orchestration.md +1 -1
- package/docs/product/entity-model-audit.md +3 -2
- package/docs/security.md +22 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -255,8 +255,10 @@ bclaw_coordinate({
|
|
|
255
255
|
targetAgents: ["claude-code"]
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
// 4. The
|
|
259
|
-
|
|
258
|
+
// 4. The reviewer's verdict is harvested from its LANE-RESULT.json and the loop
|
|
259
|
+
// auto-closes on approve — no manual advance needed for the approve path.
|
|
260
|
+
// (bclaw_loop remains available to drive the request_changes fix cycle by hand.)
|
|
261
|
+
bclaw_loop({ intent: "get", loop_id: "lop_abc" }); // inspect status any time
|
|
260
262
|
```
|
|
261
263
|
|
|
262
264
|
## The Loop Engine (Multi-Turn Workflows)
|
|
@@ -268,6 +270,8 @@ Brainclaw's Loop Engine moves beyond manual ping-pong by formalizing multi-turn
|
|
|
268
270
|
|
|
269
271
|
Each loop maintains a structured lifecycle, explicit phases, iteration bounds, and per-phase memory filters, executed seamlessly via `bclaw_loop`.
|
|
270
272
|
|
|
273
|
+
**Autonomous convergence (pln#628 Focus 4B):** a dispatched reviewer doesn't need to be driven by hand. It writes its verdict (`review_verdict: approve | request_changes`) into its `LANE-RESULT.json`; when the coordinator harvests the lane, brainclaw records the verdict on the loop and **auto-closes it on approve** — the review loop reaches `reviewer_green` with no human ping-pong. `request_changes` advances to the author phase (the automated fix→re-review cycle is a planned follow-up).
|
|
274
|
+
|
|
271
275
|
## Enterprise Ready: Mono-repo & Micro-services
|
|
272
276
|
|
|
273
277
|
Brainclaw is designed to scale across complex environments. Using the **`project_mode`** setting, Brainclaw seamlessly auto-detects folder boundaries for mono-repos and applies proper environment bootstrapping.
|
|
@@ -306,7 +310,7 @@ Recent releases have moved a lot of multi-agent parallel work from "risky" to "s
|
|
|
306
310
|
|
|
307
311
|
- **Per-claim auto-worktree** — each dispatched lane gets its own isolated git worktree; the coordinator integrates with an octopus merge.
|
|
308
312
|
- **Sequenced parallel execute** — `bclaw_dispatch(intent="execute")` fans out independent lanes across several agent instances and integrates the result.
|
|
309
|
-
- **Symmetric review-fix loops** — `bclaw_coordinate(intent="review", open_loop=true, review_mode="symmetric")` runs an alternating review-and-fix conversation across two slots without shared-checkout collisions.
|
|
313
|
+
- **Symmetric review-fix loops** — `bclaw_coordinate(intent="review", open_loop=true, review_mode="symmetric")` runs an alternating review-and-fix conversation across two slots without shared-checkout collisions. The reviewer's verdict is harvested from `LANE-RESULT.json` and the loop **auto-closes on approve** — no manual round-trip to converge the approve path.
|
|
310
314
|
- **Cross-platform spawn** — OS-aware prompt delivery (stdin pipe / inline arg) plus a brief-ack file handshake, so spawned workers can be detected and timed out reliably on Windows and Unix.
|
|
311
315
|
- **Worktree GC is scope-bounded** — symlinks and junctions are no longer followed during cleanup, so post-merge sweeps can't wipe `node_modules` or other neighboring directories.
|
|
312
316
|
- **MCP runtime self-heal** — when the runtime is corrupted, the server logs an actionable repair pointer; `brainclaw doctor --repair` rebuilds dist in one step.
|
|
@@ -315,6 +319,7 @@ Still sharp:
|
|
|
315
319
|
|
|
316
320
|
1. **Same-checkout concurrent edits** — running two agents in the *same* working tree (no per-claim worktree) is still the wrong answer. Use the dispatch path (auto-worktree per claim) instead of raw concurrent CLI sessions.
|
|
317
321
|
2. **Cross-machine sync** — federation across machines is on the roadmap, not in v1.x. Today brainclaw's store is local and one-machine-per-project.
|
|
322
|
+
3. **Next.js / Turbopack dev server in a worktree** — the provisioned `node_modules` symlink points outside the worktree root, which `next dev` (Turbopack) rejects (build/tsc/vitest are fine). brainclaw warns; `npm install` in the worktree or smoke-test on the merged branch. A Turbopack-compatible dependency mode is a planned follow-up.
|
|
318
323
|
3. **Spawn-and-forget assumptions** — spawned workers don't always commit their work cleanly. The brief-ack file confirms the spawn started; in the worst case the coordinator harvests open changes.
|
|
319
324
|
4. **Live state for hook-less agents** — supported hook-less file surfaces such as Cline, Windsurf, Continue, Antigravity/Gemini CLI, and Mistral Vibe can get live context via `.live.md` companions regenerated on session-end and handoff, not via real-time push.
|
|
320
325
|
|
|
@@ -344,6 +349,8 @@ Maven, Gradle, and Cargo are intentionally excluded — their dependency caches
|
|
|
344
349
|
|
|
345
350
|
Build outputs like `dist` are **not** symlinked — they must be per-worktree to avoid EBUSY errors when other processes hold handles on the output directory.
|
|
346
351
|
|
|
352
|
+
> **Next.js / Turbopack caveat.** The `node_modules` link is a symlink to the main worktree, i.e. it points **outside** the agent worktree's root. `tsc`, `vitest`, and production `build` follow it fine, but `next dev` (Turbopack) panics on a `node_modules` link outside the worktree root. brainclaw detects Next.js projects and surfaces a `symlink_warnings` note at worktree creation. Workaround for dev-server work: run `npm install` inside the worktree (optionally with `BRAINCLAW_NO_LINK_DEPS=1`), or smoke-test on the merged branch. A Turbopack-compatible per-worktree dependency mode is a planned follow-up.
|
|
353
|
+
|
|
347
354
|
Override detection in `.brainclaw/config.yaml`:
|
|
348
355
|
|
|
349
356
|
```yaml
|
|
@@ -429,266 +436,12 @@ npm run test:coverage # with coverage report
|
|
|
429
436
|
|
|
430
437
|
## Changelog
|
|
431
438
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
- **Coordination hygiene v1** (pln#602) — family-level TTL sweep (park-don't-delete, `config.hygiene`-overridable), lazy at the `bclaw_work` read path (zero extra reads on a healthy store) + full at session-start, K-times aging of stale warnings/hints into one actionable aggregate, and `brainclaw doctor --hygiene`.
|
|
439
|
-
- **Worktree creation for in-tree projects** (pln#614) — `bclaw_coordinate(assign|review)` on a project dir that isn't the git root (app inside a monorepo) now resolves the real toplevel (`resolveGitToplevel` with a parent-walk past an invalid nested `.git`), so it spawns instead of failing with "not a git repository". Standalone projects unchanged; validated E2E on the reporting monorepo.
|
|
440
|
-
- **Dispatch-supervisor round-3 spec** (pln#545, docs) — `docs/concepts/dispatch-supervisor.md`: honest worker-liveness attribution (Node supervisor + `run_id`-keyed sentinels), A0→B hard dependency, Windows Job Object FAIL-CLOSED, complete behavior matrix. Implementation lands later as A0-first increments.
|
|
441
|
-
|
|
442
|
-
### v1.13.0
|
|
443
|
-
|
|
444
|
-
Operator-maturity batch from two days of heavy multi-agent dogfooding — dispatch/worktree lifecycle, claim parity, write-path auto-repair, model routing, benchmark gate, 2× faster context reads:
|
|
445
|
-
|
|
446
|
-
- **Model selection for codex and copilot spawns** (pln#606) — `dispatch run --model <m>` now reaches codex (`exec -m`) and copilot argv, verified on the installed binaries. The codex `--add-dir` writable-roots spike closed negative on Windows: file-first stays the codex transport.
|
|
447
|
-
- **Auto-repair identity & session on canonical writes** (pln#608) — `bclaw_create`/`update`/`remove`/`transition` auto-register + auto-session instead of throwing "Start a session first", with an explicit `session auto-created` warning; the trust boundary for unknown identities is unchanged.
|
|
448
|
-
- **Time-to-first-value benchmark with blocking CI budgets** (pln#604) — seeded synthetic stores, three scenarios (cold_onboard / warm_work / first_edit), budgets versioned in `bench-budgets.json`.
|
|
449
|
-
- **Claim lifecycle parity** (trp#928) — `bclaw_transition(entity='claim')` wired, `coordinator_override` (trusted+) on release/transition, cascade release with per-claim logging on plan-done / loop close / assignment-completed / harvest, entity-scoped `bclaw_find` filter rejections.
|
|
450
|
-
- **Squash-aware worktree GC + junction-safe removal** (trp#926) — squash-merged lanes are finally collected (content-based detection), and the Windows `node_modules`-junction wipe class is closed for good; `dispatch_status` compares against the worktree's creation ref.
|
|
451
|
-
- **VS Code extension** — Backlog pagination (recent plans were invisible, trp#925) and probe/spawn parity with classified, actionable resolver failures (trp#927).
|
|
452
|
-
- **Context read 2× faster on large stores** (pln#578) — 3 of the 4 full-store read passes per context build eliminated (disabled-reputation sweep ×2, estimation reload, triple candidate scan): 23.9 s → 11.9 s, 196 MB → 49 MB parsed, byte-identical output.
|
|
453
|
-
|
|
454
|
-
### v1.12.0
|
|
455
|
-
|
|
456
|
-
Auto-localized execution writes for multi-project workspaces (pln#597), from DGX-Spark dogfooding:
|
|
457
|
-
|
|
458
|
-
- **Execution writes auto-localize into a workspace sibling named by `project=X`** — `bclaw_create`/`bclaw_transition` (plan & claim), `bclaw_claim`, the step tools and `bclaw_delete_plan` open a session + sticky switch into a workspace store-chain child instead of rejecting with "limited to signaling entities", echoing `auto_switched`. The signaling-vs-execution boundary is re-scoped to federation (`cross_project_links`): federated links and unknown names stay blocked.
|
|
459
|
-
|
|
460
|
-
### v1.11.1
|
|
461
|
-
|
|
462
|
-
Agent-identity & session-hook resilience, from a fresh-CLI dogfood on a monorepo:
|
|
463
|
-
|
|
464
|
-
- **Session hooks no longer spam `UserPromptSubmit hook error` on every prompt.** Root cause was an agent-identity error whose own remediation (`register-agent --set-current`) the resolver ignored, swallowed by `2>/dev/null`. Now: the error hint points at what actually works (`--agent` / `$BRAINCLAW_AGENT_NAME`), a **single registered agent auto-resolves** with no env signal, and `session-start`/`context-diff`/`session-end` run with `--hook` so they degrade to exit 0 + `~/.brainclaw/hook.log` instead of erroring the prompt loop. Multi-agent safety (pln#562) is unchanged.
|
|
465
|
-
- **`brainclaw doctor --fix-hooks`** purges stale/broken/duplicate brainclaw hooks across all Claude Code settings scopes (user + cwd) and rewrites the canonical ones — for the broken hooks that accumulate where `setup`'s git-repo discovery never reached.
|
|
466
|
-
- **`setup` repo discovery recurses** (bounded, skipping `node_modules`/build dirs) so repos nested deep in a workspace are found instead of silently missed, and it registers the detected agent so the hooks it installs can resolve an identity.
|
|
467
|
-
|
|
468
|
-
### v1.11.0
|
|
469
|
-
|
|
470
|
-
Monorepo project-resolution + Code Map, cross-project relocation, and dispatch-worktree hygiene — from a multi-project (monorepo) dogfood:
|
|
471
|
-
|
|
472
|
-
- **`bclaw_switch` to the monorepo root now works, and a switch is honored everywhere.** An agent inside a child project could not switch *up* to the workspace-root project, and a session-scoped switch was silently lost (sessions are stored per-cwd, but the resolver read them only at the workspace anchor). The resolver now matches the root project by `project_name`/`project_id` and probes the anchor / physical cwd / workspace root for the session, so `bclaw_switch` is authoritative for every subsequent call — including Code Map — without `--cwd`.
|
|
473
|
-
- **`code-map refresh --cascade`** — monorepo-native, per-project indexing: one command at the root refreshes **every** nested project into its own store plus a child-scoped root store, with **zero double-indexing** (even under nesting). `code-map status --cascade` adds a per-child recap. Opt-in; single-project repos are unchanged.
|
|
474
|
-
- **`brainclaw move <entity> <id> --to <project>` / `bclaw_move`** — id-preserving cross-project relocation, closing the gap the switch bug exposed (items created in the wrong store). Execution-local entities (claim/assignment/agent_run/session) stay put; refuses id collisions and active-claim moves; audits both stores.
|
|
475
|
-
- **Sub-agent worktrees auto-clean on loop close** — a completed review/dispatch loop garbage-collects its worktrees (junction-safe; keeps any that are alive, un-harvested, or carry unmerged commits). Opt out with `BRAINCLAW_NO_WORKTREE_GC=1`.
|
|
476
|
-
|
|
477
|
-
### v1.10.2
|
|
478
|
-
|
|
479
|
-
Dispatch worktree-creation hardening (parallel-lane dispatch on a large repo): the claim-scope branch slug is length-capped *before* its trailing-dot strip (a scope ending in `…Page.astro` no longer truncates to an invalid `feat/…Page.` ref), and `git worktree add` gets a dedicated timeout (120s default; override `BRAINCLAW_WORKTREE_ADD_TIMEOUT_MS`) so a several-hundred-file checkout isn't SIGTERM-killed mid-materialize.
|
|
480
|
-
|
|
481
|
-
### v1.10.1
|
|
482
|
-
|
|
483
|
-
Code Map fast-follows from the 1.10.0 dogfood, plus a lint cleanup:
|
|
484
|
-
|
|
485
|
-
- A git branch switch now flags the index stale (new `stale_git_head` freshness reason); `refresh` honors `.gitignore` (gitignored output dirs no longer indexed); `brief("<path>")` resolves the exact file instead of token-flooding; and the freshness badge distinguishes index freshness from a call's spot-check (`index_status`).
|
|
486
|
-
- The `brainclaw-session` skill + agent instruction surface now point agents at `bclaw_code_find` / `bclaw_code_brief` before grep. Lint baseline cleared to zero (stylistic rules ratcheted to `error`); README doc links clickable; `docs/code-map.md` lists JS / TS / JSX / TSX · Python · PHP · Java.
|
|
487
|
-
|
|
488
|
-
### v1.10.0
|
|
489
|
-
|
|
490
|
-
- **Code Map** — a new per-project [Tree-sitter](docs/code-map.md) symbol + import
|
|
491
|
-
index for **JS / TS / TSX, Python, PHP, and Java**. Ask *"where is X / what should I
|
|
492
|
-
read first"* before editing: `bclaw_code_find`, `bclaw_code_brief`,
|
|
493
|
-
`bclaw_code_status`, `bclaw_code_refresh` (CLI: `brainclaw code-map …`). Pull-based
|
|
494
|
-
freshness with a per-response badge; never blocks `bclaw_work`; monorepo-aware. See
|
|
495
|
-
[code map](docs/code-map.md).
|
|
496
|
-
- **Monorepo multi-project safety** — agents working in different child projects of a
|
|
497
|
-
monorepo are now genuinely independent:
|
|
498
|
-
- an anchored agent working *inside* a child project resolves **that** child, not the
|
|
499
|
-
repo root — no more "plans / index target the repo root";
|
|
500
|
-
- CLI `brainclaw switch` is **session-scoped by default** (two agents no longer clobber
|
|
501
|
-
a shared pointer); the new `--global` flag is the only path that sets the shared
|
|
502
|
-
workspace default; `switch --list` / show are session-aware;
|
|
503
|
-
- a session-less agent physically inside a child project beats a stale shared global
|
|
504
|
-
pointer (resolves the child it is in);
|
|
505
|
-
- dispatched / CoDev workers spawn with a **clean identity** — the coordinator's
|
|
506
|
-
session / project / agent env no longer leaks into a worker.
|
|
507
|
-
- Internal — MCP public surface fingerprint re-pinned for the Code Map tools (additive;
|
|
508
|
-
no tool removed or renamed).
|
|
509
|
-
|
|
510
|
-
### v1.9.1
|
|
511
|
-
|
|
512
|
-
- **Multi-project scoping fixes for monorepos** — MCP reads/writes resolve the
|
|
513
|
-
effective project from an explicit arg, the MCP session, `BRAINCLAW_CWD`, or
|
|
514
|
-
the global active project (in that order), so commands target the right store
|
|
515
|
-
inside a monorepo; `bclaw_find` legacy-filter diagnostics report how many
|
|
516
|
-
`provenance.kind="legacy"` records the default filter excluded.
|
|
517
|
-
- **Case-insensitive agent names** — `targetAgents=["Codex"]` (any casing) now
|
|
518
|
-
resolves like `codex`; dispatch/coordinate no longer silently drop a reviewer
|
|
519
|
-
over a capital letter, and an unresolved name reports a distinct `unknown_agent`
|
|
520
|
-
reason instead of the misleading "no CLI spawn template (IDE-only?)".
|
|
521
|
-
- **Docs** — revamped Loop Engine, Git Worktrees, Cross-Project Signals, and the
|
|
522
|
-
Orchestration Playbook, corrected against actual behavior (`bclaw_work` =
|
|
523
|
-
session + context + claim, not worktree provisioning; worktrees come from
|
|
524
|
-
dispatch/coordinate; plans via `bclaw_create(entity="plan")`).
|
|
525
|
-
|
|
526
|
-
### v1.9.0
|
|
527
|
-
|
|
528
|
-
- **Release hardening for npm publishing + agent-surface coherence** (pln#571).
|
|
529
|
-
A dedicated CI **Release Package Check** builds the CLI, builds the optional
|
|
530
|
-
VS Code extension, runs the extension tests, and verifies the published tarball
|
|
531
|
-
contents; `version --publish-local`/`prepublishOnly` now run `build:release` +
|
|
532
|
-
`pack:check` before `npm pack`. The `.vsix` ships as an *optional* IDE
|
|
533
|
-
companion (local CLI builds skip it; release builds stay strict). Generated
|
|
534
|
-
agent surfaces no longer pin the npm semver (stable `Managed by brainclaw`
|
|
535
|
-
banner), and `.brainclaw/project.md` is documented as a legacy derived view —
|
|
536
|
-
root `PROJECT.md` is the durable project vision; live claims/plans/handoffs
|
|
537
|
-
live in `agent-board` / MCP context.
|
|
538
|
-
- **Coordination & safety fixes** — strict claim isolation (a duplicate active
|
|
539
|
-
claim on the same scope now fails inside the mutation lock instead of warning),
|
|
540
|
-
`JsonStore` entity-id validation to prevent path traversal (pln#571), and
|
|
541
|
-
`reflect --batch` no longer swallows identity/security errors so a strict
|
|
542
|
-
import can never silently skip sensitive content (pln#572).
|
|
543
|
-
- **Concurrency & CI robustness** — the journal append waits fairly under
|
|
544
|
-
contention so a multi-process kill-9 storm converges without seq reuse
|
|
545
|
-
(pln#573/#574), and `merge-risk` reconciles Windows 8.3 short-name worktree
|
|
546
|
-
paths so a claim matches its lane on Windows runners (pln#576).
|
|
547
|
-
- **Docs** — Roo, Continue, Windsurf, Copilot, OpenClaw, quickstart, and the
|
|
548
|
-
agent-integration docs now match the current export formats and setup behavior
|
|
549
|
-
(pln#571/#575).
|
|
550
|
-
|
|
551
|
-
### v1.8.0
|
|
552
|
-
|
|
553
|
-
- **Multi-agent dispatch convergence — "worktree-as-contract"** (from a real
|
|
554
|
-
cross-project field session where a sandboxed worker could neither commit nor
|
|
555
|
-
reach MCP). The worker's contract shrinks to "edit files in this worktree +
|
|
556
|
-
drop `LANE-RESULT.json`": `brainclaw harvest --integrate` commits the worktree
|
|
557
|
-
diff on behalf of a worker that can't self-commit (hard-guarded to the linked
|
|
558
|
-
worktree, never the main repo), then completes the assignment and releases the
|
|
559
|
-
claim with plan cascade. A `LANE-RESULT.json` is now the #1 verdict signal in
|
|
560
|
-
`bclaw_dispatch_status` (worker FINISHED, even without self-update); the
|
|
561
|
-
dispatcher refuses to spawn without an isolated worktree; `open_loop` reviews
|
|
562
|
-
pre-flight each reviewer agent with a trivial validation spawn (clear
|
|
563
|
-
boot-failure reason instead of a generic loop timeout); and decisions/traps
|
|
564
|
-
gain `verified_at`/`verify_cmd` so perishable facts can be flagged stale.
|
|
565
|
-
Additive + opt-in throughout. (pln#530, pln#531, pln#532, pln#533, pln#534, trp#468)
|
|
566
|
-
|
|
567
|
-
### v1.7.5
|
|
568
|
-
|
|
569
|
-
- **Security patch (recommended upgrade)** — fixes a git command-injection / RCE
|
|
570
|
-
vector flagged by Socket AI: several commands interpolated a git ref (notably
|
|
571
|
-
one derived from the persisted session `git_sha`) into `execSync` shell
|
|
572
|
-
strings. All git calls now use `execFileSync` (no shell) and `git_sha` is
|
|
573
|
-
validated as a hex SHA. No functional change. (session-end, release-claims,
|
|
574
|
-
release-notes, sync)
|
|
575
|
-
|
|
576
|
-
### v1.7.4
|
|
577
|
-
|
|
578
|
-
- **Dispatch observability + worker DX hardening** (from a real cross-project
|
|
579
|
-
field session) — `bclaw_dispatch_status` and the reconciler now derive liveness
|
|
580
|
-
from filesystem activity (log + worktree mtime), so a worker actively editing
|
|
581
|
-
files is no longer falsely flagged `stalled`, and known codex boot-failure
|
|
582
|
-
stderr signatures get a targeted diagnosis; briefs are transport-aware (a
|
|
583
|
-
sandboxed agent without MCP/commit gets the file protocol, not instructions it
|
|
584
|
-
can't follow), backed by a derived capability matrix
|
|
585
|
-
(`dispatchHasMcp`/`dispatchCanCommit`); `bclaw_claim` gains an advisory
|
|
586
|
-
(no-worktree) mode; `bclaw_find` payloads are size-bounded with pagination
|
|
587
|
-
metadata; an opt-in per-worktree `tsc --noEmit` pre-commit gate; gated ready
|
|
588
|
-
lanes carry a code-propagation advisory; the reconciler auto-releases the claim
|
|
589
|
-
of a run it infers failed; and `plan.related_paths` is now updatable.
|
|
590
|
-
(pln#479, pln#491, pln#527, pln#528, pln#529, trp#291, trp#431, trp#433, trp#434)
|
|
591
|
-
|
|
592
|
-
### v1.7.3
|
|
593
|
-
|
|
594
|
-
- **Multi-agent dispatch hardening for JS/TS monorepos** — dispatched worktrees
|
|
595
|
-
junction-link per-package `node_modules` (npm / yarn / pnpm workspaces), not
|
|
596
|
-
just the root, and surface failed links instead of swallowing them; `brainclaw worktree clean` now garbage-collects merged worktrees past birth-noise instead
|
|
597
|
-
of skipping them all; the agent inventory reports an agent `spawnable` when its
|
|
598
|
-
binary is on PATH even if `--version` is slow to start; dispatch-verification
|
|
599
|
-
guidance leads with `bclaw_dispatch_status` (not the untrustworthy Windows
|
|
600
|
-
wrapper pid); and a new `LANE-RESULT.json` convention + `brainclaw harvest <assignment_id>` give workers a standard, MCP-free result channel. The dispatch
|
|
601
|
-
dirty-guard also ignores `.claude/`, `.cursor/`, and `.codex/` agent-local
|
|
602
|
-
config. (pln#523, pln#524, pln#525, pln#526, trp#371, trp#427, trp#428)
|
|
603
|
-
|
|
604
|
-
### v1.7.2
|
|
605
|
-
|
|
606
|
-
- **Sequence MCP tools are agent-first by default** — sequence creation,
|
|
607
|
-
listing, update, and deletion tools are now in the default MCP catalog, with
|
|
608
|
-
explicit lane item schemas (`planId`, optional `stepId`, `rank`,
|
|
609
|
-
dependencies, lane metadata) and matching canonical CRUD validation for
|
|
610
|
-
`entity="sequence"`.
|
|
611
|
-
|
|
612
|
-
### v1.7.1
|
|
613
|
-
|
|
614
|
-
- **MCP project context isolation fix** — `bclaw_switch` now keeps MCP switches
|
|
615
|
-
session-scoped even when the agent session has to be resolved or created on
|
|
616
|
-
the fly. Session lookup honors explicit session IDs, avoids adopting another
|
|
617
|
-
live process's session, detects Codex via native `CODEX_*` runtime variables,
|
|
618
|
-
and `bclaw_switch(list=true)` reports the session active project with
|
|
619
|
-
`active_source`.
|
|
620
|
-
|
|
621
|
-
### v1.7.0
|
|
622
|
-
|
|
623
|
-
- **Dispatch reliability + scope-aware dirty guard** — evidence-first
|
|
624
|
-
`agent_run` reconciliation avoids false terminal states, `bclaw_coordinate`
|
|
625
|
-
accepts pinned refs and a scope-aware `allow_dirty` guard, and the Hermes
|
|
626
|
-
agent integration joins the supported surfaces.
|
|
627
|
-
|
|
628
|
-
### v1.6.0
|
|
629
|
-
|
|
630
|
-
- **Bootstrap loop + cross-project agent workflow** — the bootstrap ideation
|
|
631
|
-
preset can materialize `PROJECT.md`, `bclaw_init_project` initializes and links
|
|
632
|
-
arbitrary project paths, and `project=` routing reaches `bclaw_work` /
|
|
633
|
-
`bclaw_loop` for linked-project operations.
|
|
634
|
-
|
|
635
|
-
### v1.5.3
|
|
636
|
-
|
|
637
|
-
- **Cross-project canonical grammar + CLI parity** (pln#359, all phases) — the canonical grammar (`bclaw_find / get / create / update / remove / transition`), `bclaw_context`, and `bclaw_coordinate` now accept an optional `project: <name>` argument that routes the operation to a linked project. Two link kinds are recognised: `cross_project_links` (sibling/peer projects in `config.yaml`, `brainclaw link list`) and workspace store-chain children. Arbitrary directory paths are rejected — adoption requires an explicit link, which gives the user a single point of control over what an agent can reach. Identity is sourced from the caller's home registry; entity writes + audit log entries land in the target. Unknown project names throw `validation_error` with a hint listing the configured links — no silent fallback. Cross-project `bclaw_coordinate` is **inbox-only**: claim/assignment/message all land in the target, the target agent picks the brief up async via its own `bclaw_work`, and auto-spawn from the source process is force-disabled because the spawn cwd / worktree are tied to the target's git repo (a warning surfaces in `FacadeResponse.warnings`). The CLI exposes the same as a global `--project <name>` flag, mutually exclusive with `--cwd`. Refs: helper `resolveProjectCwd` in `src/core/cross-project.ts`, MCP write/read handler dispatch in `src/commands/mcp.ts` and `src/commands/mcp-read-handlers.ts`, `--project` plumbing in `src/cli.ts` preAction, surface advertisement in `src/core/instruction-templates.ts`, plus tests in `tests/unit/cross-project.test.ts` (10 unit cases on the helper), `tests/unit/bclaw-coordinate.test.ts` (4 cross-project routing cases), and `tests/cli-cross-project.test.ts` (5 e2e cases). Closes the `--cwd` workaround pattern that had been the day-to-day shape of multi-project sessions.
|
|
638
|
-
- **Site facts contract** (umbrella `pln_7fdfd70d` sprint 0) — new `scripts/emit-site-facts.mjs` emits `dist/facts.{js,json}` from `MCP_TOOL_NAMES` + `ENTITY_NAMES` so the brainclaw-site (and any consumer) can pull live tool/entity counts at build time without forking the values into a hand-maintained config. The package `files` list ships `dist/facts.json`; build:cli runs the emitter as part of the chain.
|
|
639
|
-
|
|
640
|
-
### v1.5.2
|
|
641
|
-
|
|
642
|
-
- **Grammar fix: `bclaw_update` no longer silently drops patches** (trp#187, pln#500) — the canonical CRUD surface promised that `EntityRegistry.updatable` listed every patchable field, but the legacy impls behind the dispatch (`updatePlan`, `updateMemoryItem`) only handled a typed subset. A `as UpdatePlanInput` cast in `entity-operations.ts` masked the gap from TypeScript: callers passed `{text, tags, severity, …}`, validation accepted them, and the function bodies never read them. Empirically reproduced this session on `pln#359` (text+tags drop) and `trp#187` itself (severity drop). Fix adds a generic-patch escape-hatch (`patch?: Partial<…>`) on `UpdatePlanInput` and `UpdateMemoryInput`, applied via `Object.assign` after the typed fields so legacy CLI callers keep their behaviour. The dispatch in `entity-operations.ts` now passes the full patch through that escape-hatch for plan/decision/constraint/trap. `runtime_note`, `candidate`, and `cross_project_link` were already correct. New `tests/unit/entity-update-coverage.test.ts` is parametric: for every `(entity, field)` pair in `EntityRegistry.updatable`, create + patch + get + assert the field actually persisted (29 cases). Adding a new updatable field will require adding a coverage row, so the contract stays honest.
|
|
643
|
-
|
|
644
|
-
### v1.5.1
|
|
645
|
-
|
|
646
|
-
- **Cross-project link CLI + grammar parity** (pln#454 step 2) — new `brainclaw link add/list/remove` subcommands and a stateless `cross_project_link` entity wired into the canonical CRUD verbs (`bclaw_create / find / get / update / remove`). The pain point was small (config.yaml is hand-editable) but the asymmetry — runtime cross-project signaling shipped, management UX did not — meant federation peers had no first-class affordance. Storage stays in `config.cross_project_links`; the entity is intentionally stateless (no transitions). Refs: `src/commands/link.ts`, `src/core/cross-project.ts` (new `addCrossProjectLink` / `removeCrossProjectLink`), `src/core/entity-registry.ts` (new `xpl` prefix), `src/core/entity-operations.ts` dispatch cases, `tests/unit/link.test.ts` + `tests/unit/cross-project-link-grammar.test.ts` (26 new cases).
|
|
647
|
-
- **Agent registry pruned** (pln#454 step 1) — 8 synthetic profiles (antigravity, copilot-vscode, claude-opus, copilot-identity, copilot, claude-sonnet, visionnaire, copilot-codev) and 11 abandoned sessions archived under `.brainclaw/archive/agents/2026-05-07/`. The whitelist that survives matches `feedback_allowed_dispatch_agents.md`: `claude-code`, `codex`, `github-copilot`, plus `jberdah` (curator). Auto-re-registration in `detectAiAgent` is intentionally preserved — if a real surface starts a session, the registry auto-rebuilds for it. Pure store cleanup, no code change.
|
|
648
|
-
- **Inbox + assignment lifecycle reconciliation** (housekeeping) — 89 stale inbox messages and 7 orphan offered-assignments closed with retroactive lifecycle updates. The plans they backed (pln#478 mcp self-heal, pln#480 multi-stack worktree, pln#483 bclaw_work compact, pln#471 tier-B live companions) had all merged weeks earlier without the dispatch path calling `bclaw_assignment_update`. Captured as `feedback_dispatch_test_inbox_debris` so future drift is mass-acked instead of triaged per-message.
|
|
649
|
-
|
|
650
|
-
### v1.5.0
|
|
651
|
-
|
|
652
|
-
- **Ideation loop MVP** (pln#492) — new `bclaw_coordinate(intent='ideate')` opens a memory-confrontation loop: critic reads only adversarial categories (traps + feedback + runtime_notes + critique_history) and gets a BM25-ranked, context-filtered, 12k-token-capped brief assembled from project memory. Single-agent (champion drives manually) or multi-agent (auto-dispatch a turn per critic). Iteration block (cycle, max_iterations, exit_when), phase-advance gate (≥3 critique artifacts before leaving critique), system events (`phase_advance_blocked`, `max_iterations_reached`). Full design: [docs/concepts/ideation-loop.md](docs/concepts/ideation-loop.md).
|
|
653
|
-
- **Reliable dispatch + autonomy contract** (pln#496) — codex / sandboxed task-based agents now emit the full lifecycle (accepted → started → progress → completed). `briefMode` resolution corrected: `task-based && hasMcp → 'full'` (not 'compact', which silently dropped the protocol section). Lazy reconciliation pattern: `agentrun-reconciler` runs at every read path (`bclaw_assignment_events`, `bclaw_loop intent='get'`, `doctor --dispatch`) instead of a daemon; first run auto-recovered 9 historical orphan agent_runs in <1s. New autonomy contract section in instruction surfaces — agents execute protocol-defined transitions instead of pausing to ask. New `buildClaimEnvPrefix` consolidates cross-shell env injection (Windows defaults to cmd, POSIX uses unquoted bytes per PATH conventions). New `brainclaw doctor --dispatch` for operator-facing dispatch health.
|
|
654
|
-
- **Worktree junction wipe fix** (pln#498) — `detachWorktreeJunctions` runs before `git worktree remove` on Windows so git's recursive rm cannot follow the `node_modules` junction back into the main repo. Closes the recurring post-merge wipe trap; validated empirically on multiple back-to-back merges in the v1.5.0 session.
|
|
655
|
-
- **Methodological lessons** captured as user auto-memory feedback memos: bisect historical state before bisecting code (regression vs. always-broken-but-hidden), lazy reconcile at read paths beats daemon polling, codex briefs MUST include the Protocol section (implicit instructions don't propagate to sandboxed CLIs).
|
|
656
|
-
|
|
657
|
-
### v1.2.0
|
|
658
|
-
|
|
659
|
-
- **zod 3 → 4 migration** (pln#486) — schemas are semantically equivalent but the JSON Schema emitted by `tools/list` shifted shape; downstream MCP clients that snapshot schemas should re-pin. See `docs/mcp-schema-changelog.md` for the public surface fingerprint.
|
|
660
|
-
|
|
661
|
-
### v1.1.0
|
|
662
|
-
|
|
663
|
-
- **Node 20+ baseline** (pln#485) — `engines.node` is now `>=20.0.0` (Node 18 reached EOL in April 2025). CI matrix runs Node 22 and 24 on Linux; Windows on Node 24. Node 20 remains the minimum installable runtime but is no longer CI-verified.
|
|
664
|
-
- **commander 13 → 14** (requires Node 20+).
|
|
665
|
-
- **@types/node 22 → 24** (LTS-aligned).
|
|
666
|
-
|
|
667
|
-
### v1.0.15
|
|
668
|
-
|
|
669
|
-
- **TypeScript 5.8 → 6.0** (pln#484) — migration to `module: "nodenext"` (`Node16` is deprecated in TS 6, scheduled for removal in TS 7); explicit `types: ["node"]` since TS 6 changed the default to `[]`.
|
|
670
|
-
|
|
671
|
-
### v1.0.14
|
|
672
|
-
|
|
673
|
-
- **`bclaw_work` compact payload by default** (pln#483) — avoids exceeding the ~25k MCP token cap on projects with substantial memory. Pass `compact: false` for the full payload, or call `bclaw_context(kind="memory")` after.
|
|
674
|
-
- **MCP runtime self-heal + `doctor --repair`** (pln#478) — when `dist/mcp-worker.js` is missing, the server logs an actionable repair pointer and read-only handlers keep serving in-process. `brainclaw doctor --repair` rebuilds dist in one step.
|
|
675
|
-
- **Tier B/C native live companions** (pln#471) — `.cursor/live.md`, `.clinerules/live.md`, `.windsurf/rules/live.md`, `.github/copilot-instructions.live.md`, `.continue/live.md`, `GEMINI.live.md` regenerated on session-end and handoff. Opt-in via `brainclaw export --include-live --write`.
|
|
676
|
-
|
|
677
|
-
### v1.0.13
|
|
678
|
-
|
|
679
|
-
- **Worktree GC scope hardening** (pln#477) — `safeRemoveWorktreeDir` no longer follows symlinks/junctions during cleanup. Closes a class of post-merge wipes that previously destroyed `node_modules` and other neighboring directories on Windows.
|
|
680
|
-
|
|
681
|
-
### v1.0.10–v1.0.12
|
|
682
|
-
|
|
683
|
-
- **GitHub Copilot CLI is spawnable** (pln#440) — Copilot CLI 1.0.35+ supports `-p "<prompt>" --allow-all --no-ask-user`; tier promoted to A.
|
|
684
|
-
- **Codex spawn on Windows: stdin pipe + 30s handshake TTL** (pln#475) — fixes embedded backticks/`#`/multi-line content getting mis-parsed by `cmd.exe` when a prompt is passed as an inline argument.
|
|
685
|
-
- **Brief-ack file handshake** (pln#476) — `.brainclaw/coordination/runtime/ack/<assignmentId>.ack` proves a spawned worker started, decoupling the handshake from MCP availability inside the worker (important for Codex in `--sandbox workspace-write`).
|
|
686
|
-
- **`bclaw_loop(intent="open")` orphan-gate** (pln#461) — refuses to open a loop without dispatch unless `allow_orphan: true` is explicit. Use `bclaw_coordinate(intent="review", open_loop: true)` instead.
|
|
687
|
-
- **Kilocode** — Tier B integration with native MCP config and live companion (pln#464).
|
|
688
|
-
|
|
689
|
-
### v1.0.0
|
|
690
|
-
|
|
691
|
-
- **Canonical grammar promoted to standard tier** — `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition`, plus the entry facades `bclaw_work` and `bclaw_context`, the multi-agent facades `bclaw_coordinate` and `bclaw_dispatch`, and the loop facade `bclaw_loop`. Legacy per-entity tools removed from the discoverable surface (still callable as a migration escape hatch). See `docs/concepts/mcp-governance.md` for tier rules and the deprecation policy.
|
|
439
|
+
Full version history lives in **[CHANGELOG.md](CHANGELOG.md)** (Keep a Changelog
|
|
440
|
+
format, Semantic Versioning). MCP protocol / schema changes and the public surface
|
|
441
|
+
fingerprint are tracked separately in
|
|
442
|
+
**[docs/mcp-schema-changelog.md](docs/mcp-schema-changelog.md)**. For releases
|
|
443
|
+
predating the changelog file, `git log` on `master` is the source of truth — each
|
|
444
|
+
release commit follows the `chore(release): bump version to <semver>` convention.
|
|
692
445
|
|
|
693
446
|
---
|
|
694
447
|
|
|
Binary file
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { runDecision } from '../commands/decision.js';
|
|
2
|
+
import { runConstraint } from '../commands/constraint.js';
|
|
3
|
+
import { runTrap } from '../commands/trap.js';
|
|
4
|
+
import { runHandoff } from '../commands/handoff.js';
|
|
5
|
+
import { runUpdateHandoff } from '../commands/update-handoff.js';
|
|
6
|
+
import { runReflect } from '../commands/reflect.js';
|
|
7
|
+
import { runReflectRuntimeNote } from '../commands/reflect-runtime-note.js';
|
|
8
|
+
import { runInstruction } from '../commands/instruction.js';
|
|
9
|
+
import { runListInstructions } from '../commands/list-instructions.js';
|
|
10
|
+
import { runRuntimeNote } from '../commands/runtime-note.js';
|
|
11
|
+
import { runRuntimeStatus } from '../commands/runtime-status.js';
|
|
12
|
+
import { collect } from './shared.js';
|
|
13
|
+
export function registerCaptureCommands(program) {
|
|
14
|
+
// --- decision ---
|
|
15
|
+
program
|
|
16
|
+
.command('decision <text>')
|
|
17
|
+
.description('Add a recent decision')
|
|
18
|
+
.option('--outcome <outcome>', 'Outcome: approved, rejected, deferred, pending')
|
|
19
|
+
.option('--tag <tags...>', 'Tags for this decision')
|
|
20
|
+
.option('--path <paths...>', 'Related file paths')
|
|
21
|
+
.option('--author <author>', 'Author name')
|
|
22
|
+
.option('--plan <id>', 'Optional linked plan item ID')
|
|
23
|
+
.option('--store <target>', 'Target store level: local (default), repo, workspace, user')
|
|
24
|
+
.action((text, options) => {
|
|
25
|
+
runDecision(text, options);
|
|
26
|
+
});
|
|
27
|
+
// --- constraint ---
|
|
28
|
+
program
|
|
29
|
+
.command('constraint <text>')
|
|
30
|
+
.description('Add an active constraint')
|
|
31
|
+
.option('--category <category>', 'Category: architecture, performance, security, reliability, compatibility, process, other')
|
|
32
|
+
.option('--tag <tags...>', 'Tags for this constraint')
|
|
33
|
+
.option('--path <paths...>', 'Related file paths')
|
|
34
|
+
.option('--author <author>', 'Author name')
|
|
35
|
+
.option('--store <target>', 'Target store level: local (default), repo, workspace, user')
|
|
36
|
+
.action((text, options) => {
|
|
37
|
+
runConstraint(text, options);
|
|
38
|
+
});
|
|
39
|
+
// --- trap ---
|
|
40
|
+
program
|
|
41
|
+
.command('trap <text>')
|
|
42
|
+
.description('Add a known trap')
|
|
43
|
+
.option('--status <status>', 'Status: active, resolved, expired', 'active')
|
|
44
|
+
.option('--severity <severity>', 'Severity: low, medium, high', 'medium')
|
|
45
|
+
.option('--visibility <visibility>', 'Visibility: shared, machine, private', 'shared')
|
|
46
|
+
.option('--host <host>', 'Optional host identifier override for machine/private traps')
|
|
47
|
+
.option('--tag <tags...>', 'Tags for this trap')
|
|
48
|
+
.option('--path <paths...>', 'Related file paths')
|
|
49
|
+
.option('--author <author>', 'Author name')
|
|
50
|
+
.option('--ttl <duration>', 'Time-to-live: 30m, 2h, 7d (trap auto-expires after this duration)')
|
|
51
|
+
.option('--store <target>', 'Target store level: local (default), repo, workspace, user')
|
|
52
|
+
.action((text, options) => {
|
|
53
|
+
runTrap(text, options);
|
|
54
|
+
});
|
|
55
|
+
// --- handoff ---
|
|
56
|
+
program
|
|
57
|
+
.command('handoff <text>')
|
|
58
|
+
.description('Create a handoff')
|
|
59
|
+
.requiredOption('--from <from>', 'Source of the handoff')
|
|
60
|
+
.requiredOption('--to <to>', 'Destination of the handoff')
|
|
61
|
+
.option('--tag <tags...>', 'Tags for this handoff')
|
|
62
|
+
.option('--path <paths...>', 'Related file paths')
|
|
63
|
+
.option('--project <project>', 'Optional project namespace')
|
|
64
|
+
.option('--plan <id>', 'Optional linked plan item ID')
|
|
65
|
+
.option('--author <author>', 'Author name')
|
|
66
|
+
.option('--capture-diff', 'Capture current git diff into the handoff snapshot')
|
|
67
|
+
.option('--files <files...>', 'Files touched in this handoff')
|
|
68
|
+
.option('--pre-condition <conditions...>', 'Pre-conditions for the receiving agent')
|
|
69
|
+
.option('--post-condition <conditions...>', 'Post-conditions the receiving agent must satisfy')
|
|
70
|
+
.option('--test <tests...>', 'Tests the receiving agent should verify')
|
|
71
|
+
.option('--linked-plan <plans...>', 'Linked plan IDs')
|
|
72
|
+
.action((text, options) => {
|
|
73
|
+
runHandoff(text, options);
|
|
74
|
+
});
|
|
75
|
+
// --- update-handoff ---
|
|
76
|
+
program
|
|
77
|
+
.command('update-handoff <id>')
|
|
78
|
+
.description('Update the status, recipient, or review state of a handoff')
|
|
79
|
+
.option('--status <status>', 'Status: open, accepted, closed')
|
|
80
|
+
.option('--to <agent>', 'Change the receiving agent')
|
|
81
|
+
.option('--narrative <text>', 'Update the narrative attached to the handoff')
|
|
82
|
+
.option('--reviewer <agent>', 'Set or override the assigned reviewer')
|
|
83
|
+
.option('--review-verdict <verdict>', 'Set review verdict: approve or request_changes')
|
|
84
|
+
.option('--reviewed-by <agent>', 'Set the reviewer identity that produced the verdict')
|
|
85
|
+
.option('--review-summary <text>', 'Attach a short review summary')
|
|
86
|
+
.option('--blocking-issue <text>', 'Add a blocking review issue (repeatable)', collect, [])
|
|
87
|
+
.option('--suggestion <text>', 'Add a non-blocking review suggestion (repeatable)', collect, [])
|
|
88
|
+
.action((id, options) => {
|
|
89
|
+
runUpdateHandoff(id, {
|
|
90
|
+
...options,
|
|
91
|
+
review_verdict: options.reviewVerdict,
|
|
92
|
+
reviewed_by: options.reviewedBy,
|
|
93
|
+
review_summary: options.reviewSummary,
|
|
94
|
+
blocking_issues: options.blockingIssue,
|
|
95
|
+
suggestions: options.suggestion,
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
// --- reflect ---
|
|
99
|
+
program
|
|
100
|
+
.command('reflect [text]')
|
|
101
|
+
.description('Create a memory candidate for review')
|
|
102
|
+
.option('--type <type>', 'Type: constraint, decision, trap, handoff')
|
|
103
|
+
.option('--batch <file>', 'Import runtime events from JSON file')
|
|
104
|
+
.option('--session <id>', 'Import runtime events by session id from .brainclaw/runtime/')
|
|
105
|
+
.option('--tag <tags...>', 'Tags')
|
|
106
|
+
.option('--author <author>', 'Author name')
|
|
107
|
+
.option('--source <source>', 'Source context (e.g. agent name)')
|
|
108
|
+
.option('--severity <severity>', 'Severity for traps: low, medium, high')
|
|
109
|
+
.option('--from <from>', 'Handoff source')
|
|
110
|
+
.option('--to <to>', 'Handoff destination')
|
|
111
|
+
.option('--path <paths...>', 'Related file paths')
|
|
112
|
+
.action((text, options) => {
|
|
113
|
+
runReflect(text, options);
|
|
114
|
+
});
|
|
115
|
+
// --- reflect-runtime-note ---
|
|
116
|
+
program
|
|
117
|
+
.command('reflect-runtime-note <id> [text]')
|
|
118
|
+
.description('Turn a visible runtime note into a shared review candidate')
|
|
119
|
+
.option('--type <type>', 'Type: constraint, decision, trap, handoff')
|
|
120
|
+
.option('--host <host>', 'Look up machine-local runtime note for a specific host')
|
|
121
|
+
.option('--all-hosts', 'Look up runtime notes across all hosts')
|
|
122
|
+
.option('--suggest', 'Show candidate type suggestions before or instead of creation')
|
|
123
|
+
.option('--json', 'Output suggestions as JSON when used with --suggest or without --type')
|
|
124
|
+
.option('--tag <tags...>', 'Additional tags to merge with the runtime note tags')
|
|
125
|
+
.option('--author <author>', 'Author name for the candidate')
|
|
126
|
+
.option('--source <source>', 'Source context for the candidate')
|
|
127
|
+
.option('--severity <severity>', 'Severity for traps: low, medium, high')
|
|
128
|
+
.option('--from <from>', 'Handoff source')
|
|
129
|
+
.option('--to <to>', 'Handoff destination')
|
|
130
|
+
.option('--path <paths...>', 'Related file paths')
|
|
131
|
+
.action((id, text, options) => {
|
|
132
|
+
runReflectRuntimeNote(id, text, options);
|
|
133
|
+
});
|
|
134
|
+
// --- instruction ---
|
|
135
|
+
program
|
|
136
|
+
.command('instruction <text>')
|
|
137
|
+
.description('Add a layered shared instruction')
|
|
138
|
+
.option('--layer <layer>', 'Instruction layer: global, project, agent', 'global')
|
|
139
|
+
.option('--project <project>', 'Project namespace when --layer project is used')
|
|
140
|
+
.option('--agent <agent>', 'Agent name when --layer agent is used')
|
|
141
|
+
.option('--tag <tags...>', 'Tags for this instruction')
|
|
142
|
+
.option('--author <author>', 'Author name')
|
|
143
|
+
.option('--supersedes <id>', 'Supersede an older instruction entry')
|
|
144
|
+
.option('--store <target>', 'Target store level: local (default), repo, workspace, user')
|
|
145
|
+
.action((text, options) => {
|
|
146
|
+
runInstruction(text, options);
|
|
147
|
+
});
|
|
148
|
+
// --- list-instructions ---
|
|
149
|
+
program
|
|
150
|
+
.command('list-instructions')
|
|
151
|
+
.description('List raw or resolved shared instructions')
|
|
152
|
+
.option('--json', 'Output as JSON')
|
|
153
|
+
.option('--layer <layer>', 'Filter by layer: global, project, agent')
|
|
154
|
+
.option('--project <project>', 'Project namespace filter')
|
|
155
|
+
.option('--agent <agent>', 'Agent name filter')
|
|
156
|
+
.option('--active', 'Only show active entries')
|
|
157
|
+
.option('--resolved', 'Resolve effective instructions for the given scope')
|
|
158
|
+
.option('--for <target>', 'Infer project namespace from target path when strategy=folder')
|
|
159
|
+
.action((options) => {
|
|
160
|
+
runListInstructions(options);
|
|
161
|
+
});
|
|
162
|
+
// --- runtime-note ---
|
|
163
|
+
program
|
|
164
|
+
.command('runtime-note <text>')
|
|
165
|
+
.description('Add a runtime note for an agent')
|
|
166
|
+
.option('--agent <agent>', 'Agent name; defaults to the configured current agent')
|
|
167
|
+
.option('--project <project>', 'Optional project namespace')
|
|
168
|
+
.option('--plan <id>', 'Optional linked plan item ID')
|
|
169
|
+
.option('--visibility <visibility>', 'Visibility: shared, machine, private', 'shared')
|
|
170
|
+
.option('--host <host>', 'Optional host identifier override for machine/private runtime notes')
|
|
171
|
+
.option('--tag <tags...>', 'Tags')
|
|
172
|
+
.option('--ttl <duration>', 'Time-to-live: 30m, 2h, 7d (note auto-expires after this duration)')
|
|
173
|
+
.option('--auto-reflect', 'Attempt to turn this runtime note into durable memory immediately')
|
|
174
|
+
.action((text, options) => {
|
|
175
|
+
runRuntimeNote(text, { ...options, autoReflect: options.autoReflect });
|
|
176
|
+
});
|
|
177
|
+
// --- note create ---
|
|
178
|
+
const noteCommand = program
|
|
179
|
+
.command('note')
|
|
180
|
+
.description('Manage runtime notes');
|
|
181
|
+
noteCommand
|
|
182
|
+
.command('create <text>')
|
|
183
|
+
.description('Alias for runtime-note')
|
|
184
|
+
.option('--agent <agent>', 'Agent name; defaults to the configured current agent')
|
|
185
|
+
.option('--project <project>', 'Optional project namespace')
|
|
186
|
+
.option('--plan <id>', 'Optional linked plan item ID')
|
|
187
|
+
.option('--visibility <visibility>', 'Visibility: shared, machine, private', 'shared')
|
|
188
|
+
.option('--host <host>', 'Optional host identifier override for machine/private runtime notes')
|
|
189
|
+
.option('--tag <tags...>', 'Tags')
|
|
190
|
+
.option('--ttl <duration>', 'Time-to-live: 30m, 2h, 7d (note auto-expires after this duration)')
|
|
191
|
+
.option('--auto-reflect', 'Attempt to turn this runtime note into durable memory immediately')
|
|
192
|
+
.action((text, options) => {
|
|
193
|
+
runRuntimeNote(text, { ...options, autoReflect: options.autoReflect });
|
|
194
|
+
});
|
|
195
|
+
// --- runtime-status ---
|
|
196
|
+
program
|
|
197
|
+
.command('runtime-status')
|
|
198
|
+
.description('Show runtime notes')
|
|
199
|
+
.option('--agent <agent>', 'Filter by agent')
|
|
200
|
+
.option('--plan <id>', 'Filter by linked plan item')
|
|
201
|
+
.option('--visibility <visibility>', 'Visibility filter: shared, machine, private, all')
|
|
202
|
+
.option('--host <host>', 'Include machine-local notes for a specific host')
|
|
203
|
+
.option('--all-hosts', 'Include machine-local notes from all hosts')
|
|
204
|
+
.option('--json', 'Output as JSON')
|
|
205
|
+
.action((options) => {
|
|
206
|
+
runRuntimeStatus(options);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=register-capture.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { runCodeMap } from '../commands/code-map.js';
|
|
2
|
+
export function registerCodeMapCommands(program) {
|
|
3
|
+
// --- code-map ---
|
|
4
|
+
program
|
|
5
|
+
.command('code-map <subcommand> [args...]')
|
|
6
|
+
.description('Query the per-project Code Map (status, refresh, find, brief)')
|
|
7
|
+
.option('--json', 'Output as JSON')
|
|
8
|
+
.option('--all', 'For refresh: enumerate all supported files (full refresh)')
|
|
9
|
+
.option('--changed', 'For refresh: only changed files (default)')
|
|
10
|
+
.option('--cascade', 'For refresh/status in a multi-project workspace: cascade across every nested project (each gets its own store; the root store is scoped to files no child owns)')
|
|
11
|
+
.option('--limit <n>', 'Max results for find/brief', (v) => parseInt(v, 10))
|
|
12
|
+
.action((subcommand, args, options) => {
|
|
13
|
+
void runCodeMap(subcommand, args, options).catch((err) => {
|
|
14
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=register-code-map.js.map
|