@jaggerxtrm/specialists 3.16.0 → 3.18.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 +268 -132
- package/config/mandatory-rules/json-only-final-output.md +13 -0
- package/config/mandatory-rules/research-tool-routing.md +4 -0
- package/config/mandatory-rules/service-skills-diff-scan-mandatory.md +26 -0
- package/config/mandatory-rules/service-skills-gitnexus-triage.md +5 -0
- package/config/mandatory-rules/test-runner-execution-scope.md +1 -1
- package/config/skills/setup-specialists/SKILL.md +556 -0
- package/config/skills/specialists-creator/SKILL.md +160 -5
- package/config/skills/specialists-creator/scripts/audit-spec-uniformity.mjs +1 -1
- package/config/skills/using-specialists-auto/SKILL.md +1 -1
- package/config/skills/using-specialists-v2/SKILL.md +7 -7
- package/config/skills/using-specialists-v3/SKILL.md +223 -147
- package/config/specialists/bare.specialist.json +3 -3
- package/config/specialists/changelog-drafter.specialist.json +9 -6
- package/config/specialists/changelog-keeper.specialist.json +10 -7
- package/config/specialists/debugger.specialist.json +8 -6
- package/config/specialists/executor.specialist.json +9 -7
- package/config/specialists/explorer.specialist.json +8 -6
- package/config/specialists/memory-processor.specialist.json +7 -5
- package/config/specialists/node-coordinator.specialist.json +7 -5
- package/config/specialists/obligations-scanner.specialist.json +149 -0
- package/config/specialists/overthinker.specialist.json +7 -5
- package/config/specialists/planner.specialist.json +8 -6
- package/config/specialists/quant-methodologist.specialist.json +145 -0
- package/config/specialists/quant-researcher.specialist.json +144 -0
- package/config/specialists/researcher.specialist.json +14 -9
- package/config/specialists/reviewer.specialist.json +11 -9
- package/config/specialists/seconder.specialist.json +170 -0
- package/config/specialists/security-auditor.specialist.json +6 -4
- package/config/specialists/service-skills-sync.specialist.json +93 -0
- package/config/specialists/specialists-creator.specialist.json +9 -7
- package/config/specialists/sync-docs.specialist.json +6 -4
- package/config/specialists/test-engineer.specialist.json +134 -0
- package/config/specialists/test-runner.specialist.json +11 -9
- package/config/specialists/transcriber.specialist.json +59 -0
- package/config/specialists/xt-merge.specialist.json +7 -5
- package/dist/asset-contract.json +39 -8
- package/dist/index.js +37083 -26912
- package/dist/lib.js +9850 -6147
- package/dist/types/cli/console/components.d.ts +83 -0
- package/dist/types/cli/console/components.d.ts.map +1 -0
- package/dist/types/cli/console/config-source.d.ts +58 -0
- package/dist/types/cli/console/config-source.d.ts.map +1 -0
- package/dist/types/cli/console/forensic.d.ts +11 -0
- package/dist/types/cli/console/forensic.d.ts.map +1 -0
- package/dist/types/cli/console/git.d.ts +28 -0
- package/dist/types/cli/console/git.d.ts.map +1 -0
- package/dist/types/cli/console/help.d.ts +2 -0
- package/dist/types/cli/console/help.d.ts.map +1 -0
- package/dist/types/cli/console/log.d.ts +13 -0
- package/dist/types/cli/console/log.d.ts.map +1 -0
- package/dist/types/cli/console/repo-config.d.ts +26 -0
- package/dist/types/cli/console/repo-config.d.ts.map +1 -0
- package/dist/types/cli/console/repo-discovery.d.ts +12 -0
- package/dist/types/cli/console/repo-discovery.d.ts.map +1 -0
- package/dist/types/cli/console/runtime.d.ts +12 -0
- package/dist/types/cli/console/runtime.d.ts.map +1 -0
- package/dist/types/cli/console/subscribe-prototype.d.ts +18 -0
- package/dist/types/cli/console/subscribe-prototype.d.ts.map +1 -0
- package/dist/types/cli/console/theme.d.ts +91 -0
- package/dist/types/cli/console/theme.d.ts.map +1 -0
- package/dist/types/cli/console/types.d.ts +231 -0
- package/dist/types/cli/console/types.d.ts.map +1 -0
- package/dist/types/cli/console/view-model.d.ts +252 -0
- package/dist/types/cli/console/view-model.d.ts.map +1 -0
- package/dist/types/cli/console.d.ts +2 -0
- package/dist/types/cli/console.d.ts.map +1 -0
- package/dist/types/cli/db.d.ts.map +1 -1
- package/dist/types/cli/doctor.d.ts.map +1 -1
- package/dist/types/cli/edit.d.ts.map +1 -1
- package/dist/types/cli/epic.d.ts.map +1 -1
- package/dist/types/cli/feed.d.ts.map +1 -1
- package/dist/types/cli/forensic.d.ts +2 -0
- package/dist/types/cli/forensic.d.ts.map +1 -0
- package/dist/types/cli/format-helpers.d.ts +4 -2
- package/dist/types/cli/format-helpers.d.ts.map +1 -1
- package/dist/types/cli/help.d.ts.map +1 -1
- package/dist/types/cli/init.d.ts +10 -0
- package/dist/types/cli/init.d.ts.map +1 -1
- package/dist/types/cli/list.d.ts.map +1 -1
- package/dist/types/cli/log.d.ts +2 -0
- package/dist/types/cli/log.d.ts.map +1 -0
- package/dist/types/cli/metrics.d.ts +2 -0
- package/dist/types/cli/metrics.d.ts.map +1 -0
- package/dist/types/cli/ps.d.ts.map +1 -1
- package/dist/types/cli/result.d.ts.map +1 -1
- package/dist/types/cli/resume.d.ts.map +1 -1
- package/dist/types/cli/run.d.ts +1 -0
- package/dist/types/cli/run.d.ts.map +1 -1
- package/dist/types/cli/script.d.ts +3 -0
- package/dist/types/cli/script.d.ts.map +1 -1
- package/dist/types/cli/serve.d.ts.map +1 -1
- package/dist/types/cli/setup.d.ts +19 -1
- package/dist/types/cli/setup.d.ts.map +1 -1
- package/dist/types/cli/status.d.ts.map +1 -1
- package/dist/types/cli/steer.d.ts.map +1 -1
- package/dist/types/cli/version-check.d.ts +1 -0
- package/dist/types/cli/version-check.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/pi/session.d.ts +11 -1
- package/dist/types/pi/session.d.ts.map +1 -1
- package/dist/types/server.d.ts +15 -0
- package/dist/types/server.d.ts.map +1 -1
- package/dist/types/specialist/benchmarks.d.ts +37 -0
- package/dist/types/specialist/benchmarks.d.ts.map +1 -0
- package/dist/types/specialist/chain-identity.d.ts +7 -1
- package/dist/types/specialist/chain-identity.d.ts.map +1 -1
- package/dist/types/specialist/control.d.ts.map +1 -1
- package/dist/types/specialist/forensic-events.d.ts +138 -0
- package/dist/types/specialist/forensic-events.d.ts.map +1 -0
- package/dist/types/specialist/forensic-renderer.d.ts +34 -0
- package/dist/types/specialist/forensic-renderer.d.ts.map +1 -0
- package/dist/types/specialist/git-diff-evidence.d.ts +28 -0
- package/dist/types/specialist/git-diff-evidence.d.ts.map +1 -0
- package/dist/types/specialist/global-config.d.ts +389 -0
- package/dist/types/specialist/global-config.d.ts.map +1 -0
- package/dist/types/specialist/job-file-output.d.ts +2 -0
- package/dist/types/specialist/job-file-output.d.ts.map +1 -1
- package/dist/types/specialist/launch.d.ts +1 -0
- package/dist/types/specialist/launch.d.ts.map +1 -1
- package/dist/types/specialist/live-aggregates.d.ts +46 -0
- package/dist/types/specialist/live-aggregates.d.ts.map +1 -0
- package/dist/types/specialist/loader.d.ts +50 -1
- package/dist/types/specialist/loader.d.ts.map +1 -1
- package/dist/types/specialist/model-chain.d.ts +7 -0
- package/dist/types/specialist/model-chain.d.ts.map +1 -0
- package/dist/types/specialist/model-probes.d.ts +28 -0
- package/dist/types/specialist/model-probes.d.ts.map +1 -0
- package/dist/types/specialist/node-contract.d.ts +18 -18
- package/dist/types/specialist/node-supervisor.d.ts.map +1 -1
- package/dist/types/specialist/observability-db.d.ts +1 -1
- package/dist/types/specialist/observability-db.d.ts.map +1 -1
- package/dist/types/specialist/observability-sqlite.d.ts +25 -0
- package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
- package/dist/types/specialist/preset-resolver.d.ts +56 -0
- package/dist/types/specialist/preset-resolver.d.ts.map +1 -0
- package/dist/types/specialist/prometheus-projection.d.ts +25 -0
- package/dist/types/specialist/prometheus-projection.d.ts.map +1 -0
- package/dist/types/specialist/runner.d.ts +29 -1
- package/dist/types/specialist/runner.d.ts.map +1 -1
- package/dist/types/specialist/schema.d.ts +181 -63
- package/dist/types/specialist/schema.d.ts.map +1 -1
- package/dist/types/specialist/script-runner.d.ts +5 -1
- package/dist/types/specialist/script-runner.d.ts.map +1 -1
- package/dist/types/specialist/snapshot-diff.d.ts +8 -0
- package/dist/types/specialist/snapshot-diff.d.ts.map +1 -0
- package/dist/types/specialist/source-queue.d.ts +13 -0
- package/dist/types/specialist/source-queue.d.ts.map +1 -0
- package/dist/types/specialist/supervisor.d.ts +39 -2
- package/dist/types/specialist/supervisor.d.ts.map +1 -1
- package/dist/types/specialist/timeline-events.d.ts +88 -2
- package/dist/types/specialist/timeline-events.d.ts.map +1 -1
- package/dist/types/tools/specialist/resume_specialist.tool.d.ts +4 -4
- package/dist/types/tools/specialist/specialist_status.tool.d.ts +1 -1
- package/dist/types/tools/specialist/steer_specialist.tool.d.ts +4 -4
- package/dist/types/tools/specialist/use_specialist.tool.d.ts +16 -16
- package/docs/ARCHITECTURE.md +1176 -0
- package/docs/TODO.md +9 -0
- package/docs/architecture.md +11 -0
- package/docs/archive/2026-03-13-bd-decision-context-template-plan.md +96 -0
- package/docs/archive/AGENT-HANDOFF.md +351 -0
- package/docs/archive/PARITY-ANALYSIS.md +296 -0
- package/docs/archive/SPECIALISTS_REFACTOR.md.md +30 -0
- package/docs/archive/cc-programmatic.md +216 -0
- package/docs/archive/claude-agent-sdk.md +594 -0
- package/docs/archive/decision-specialist-directory.md +41 -0
- package/docs/archive/discoveries.md +148 -0
- package/docs/archive/executor-benchmark-protocol.md +198 -0
- package/docs/archive/future-features.md +66 -0
- package/docs/archive/gzrx-completion-critique.md +183 -0
- package/docs/archive/gzrx-research-notes.md +401 -0
- package/docs/archive/gzrx-tool-catalog.md +760 -0
- package/docs/archive/iron-review-hardening-qa-chain-substrate.md +322 -0
- package/docs/archive/iron-review-hardening.html +1004 -0
- package/docs/archive/issuetracking.md +312 -0
- package/docs/archive/qa-v3.0.2.md +220 -0
- package/docs/archive/restructure.md +231 -0
- package/docs/archive/script-specialists.md +1254 -0
- package/docs/archive/spec-v3.md +792 -0
- package/docs/archive/specialist-stats.md +127 -0
- package/docs/archive/specialists-friction-audit.md +1347 -0
- package/docs/archive/specialists-runtime-critique.md +170 -0
- package/docs/archive/specialists-service-evaluation.md +713 -0
- package/docs/archive/specialists-substrate-alignment.md +255 -0
- package/docs/archive/substrate-review.md +1288 -0
- package/docs/archive/test-writer-specialist.md +254 -0
- package/docs/archive/using-specialists-v3-improvements-2026-05-09.md +600 -0
- package/docs/archive/xtrm-specialists-analysis.md +314 -0
- package/docs/authoring.md +701 -0
- package/docs/background-jobs.md +203 -0
- package/docs/bare-specialists.md +83 -0
- package/docs/benchmarks/executor-benchmark-runner.md +66 -0
- package/docs/bootstrap.md +161 -0
- package/docs/cli-reference.md +1645 -0
- package/docs/deploying-alongside.md +155 -0
- package/docs/design/README.md +36 -0
- package/docs/design/darth-feedor-migration.md +290 -0
- package/docs/design/roadmap/README.md +32 -0
- package/docs/design/roadmap/chain-templates/README.md +146 -0
- package/docs/design/roadmap/chain-templates/code-quick.formula.json +27 -0
- package/docs/design/roadmap/chain-templates/code-standard.formula.json +126 -0
- package/docs/design/roadmap/chain-templates/code-with-advisors.formula.json +128 -0
- package/docs/design/roadmap/chain-templates/code-with-tests.formula.json +76 -0
- package/docs/design/roadmap/chain-templates/debug.formula.json +128 -0
- package/docs/design/roadmap/chain-templates/doc-sync.formula.json +28 -0
- package/docs/design/roadmap/chain-templates/memory-hygiene.formula.json +27 -0
- package/docs/design/roadmap/chain-templates/planning.formula.json +27 -0
- package/docs/design/roadmap/chain-templates/premortem.formula.json +26 -0
- package/docs/design/roadmap/chain-templates/release-prep.formula.json +36 -0
- package/docs/design/roadmap/chain-templates/research-only.formula.json +28 -0
- package/docs/design/roadmap/chain-templates/restitch.formula.json +125 -0
- package/docs/design/roadmap/chain-templates/security-deep.formula.json +161 -0
- package/docs/design/roadmap/chain-templates/test-only.formula.json +52 -0
- package/docs/design/roadmap/chain-templates/triage.formula.json +35 -0
- package/docs/design/roadmap/history/handoff-from-substrate-design.md +87 -0
- package/docs/design/roadmap/history/substrate-reconciliation.md +105 -0
- package/docs/design/roadmap/specialists-roadmap.md +1193 -0
- package/docs/design/sp-console-subscribe-via-materializer.md +231 -0
- package/docs/design/sp-console-tui-mock-v2.html +293 -0
- package/docs/design/sp-console-tui-mock.html +120 -0
- package/docs/design/sp-console-tui.md +340 -0
- package/docs/design/specialist-agentops-suite.md +323 -0
- package/docs/design/substrate/channels.md +14 -0
- package/docs/design/substrate/devops-platform-engineering-prd.md +446 -0
- package/docs/design/substrate/html-design-example.md +339 -0
- package/docs/design/xtrm-tiers-architecture.svg +132 -0
- package/docs/devops/dependency-verdict-materialization.md +46 -0
- package/docs/epic-readiness.md +75 -0
- package/docs/examples/mercury-atomic-summarizer.specialist.json +26 -0
- package/docs/examples/smoke-echo-text-expected-keys.specialist.json +25 -0
- package/docs/examples/smoke-echo.specialist.json +25 -0
- package/docs/features.md +1577 -0
- package/docs/hooks.md +81 -0
- package/docs/installation.md +142 -0
- package/docs/manifest.md +184 -0
- package/docs/mcp-servers.md +73 -0
- package/docs/mcp-tools.md +71 -0
- package/docs/nodes.md +231 -0
- package/docs/observability-metrics.md +152 -0
- package/docs/operator/sp-console-v2-walkthrough.md +410 -0
- package/docs/overrides-guide.md +306 -0
- package/docs/pi-rpc-boundary.md +118 -0
- package/docs/pi-session.md +195 -0
- package/docs/release.md +22 -0
- package/docs/skills.md +132 -0
- package/docs/specialists/handoff-schema.md +181 -0
- package/docs/specialists-catalog.md +99 -0
- package/docs/specialists-service-install.md +226 -0
- package/docs/specialists-service.md +363 -0
- package/docs/surface-ownership.md +138 -0
- package/docs/upgrade-notes/kan-90-global-user-config.md +114 -0
- package/docs/upgrade-notes/kan-91-expanded-overrides.md +261 -0
- package/docs/workflow.md +114 -0
- package/docs/worktree.md +71 -0
- package/docs/worktrees.md +309 -0
- package/package.json +17 -12
- package/config/specialists/code-sanity.specialist.json +0 -108
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
> **ARCHIVED 2026-05-27** — content superseded by:
|
|
2
|
+
> - `docs/design/substrate/specialists-roadmap-revised.md` (canonical specialists roadmap; absorbed this file in §0/§3.2/§12/§13)
|
|
3
|
+
> - `docs/design/substrate/substrate.md` rev10 (canonical substrate design)
|
|
4
|
+
> - `docs/design/chain-templates/` (13 evidence-backed bd formulas)
|
|
5
|
+
>
|
|
6
|
+
> Preserved for historical context. Do not edit. Do not cite as authoritative.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Specialists ↔ Substrate Alignment — What `sp` Can Adopt Today
|
|
11
|
+
|
|
12
|
+
> **⚠️ STATUS: SUPERSEDED — consolidated into `specialists-friction-audit.md` §3 (Substrate-aligned patch roadmap) and §10 (Master sequenced rollout).**
|
|
13
|
+
>
|
|
14
|
+
> The nine alignment opportunities described here have been folded into the canonical consolidated friction-audit, with each opportunity enriched by (a) the friction tag it closes, (b) the architectural asymmetry it removes, (c) explicit reads-forward note to a substrate rev-9 section. The sequencing has been unified with the orthogonal hook/hint/bootstrap layers into a single master rollout. New work should reference the consolidated audit, not this file. This file is preserved for git-history continuity (it shows the reasoning step that produced the alignment thinking) but is no longer source-of-truth.
|
|
15
|
+
>
|
|
16
|
+
> **Canonical replacements:**
|
|
17
|
+
> - `docs/design/specialists-friction-audit.md` §3 (opportunities, enriched with cross-references)
|
|
18
|
+
> - `docs/design/specialists-friction-audit.md` §10 (master sequenced rollout)
|
|
19
|
+
> - `docs/design/specialists-friction-audit.md` §11 (open questions, consolidated)
|
|
20
|
+
>
|
|
21
|
+
> ---
|
|
22
|
+
>
|
|
23
|
+
> *Original purpose (historical):* Substrate revision 9 has resolved the six architectural asymmetries called out in `specialists-runtime-critique.md`. The full container model is months away. This doc identifies the **alignment opportunities** — patches `sp` can take *today*, without substrate, that (a) reduce concrete friction now and (b) read forward unchanged into the rev-9 model, so we are not building bridges we'll demolish.
|
|
24
|
+
>
|
|
25
|
+
> **Method.** Cross-reference rev-9 specifically §3 / §6.9.2 / §6.9.5 / §6.9.6 / §6.9.7 / §11 against the current sp runtime (`src/specialist/{chain-identity,supervisor,runner,worktree}.ts`, `src/cli/{run,finalize}.ts`).
|
|
26
|
+
>
|
|
27
|
+
> **Selection criterion.** Each opportunity must (1) be implementable without the substrate daemon or `containers` table, (2) survive into the rev-9 world without rework, (3) close a friction the audit catalogued or remove an asymmetry the critique named.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## How rev-9 maps to the critique
|
|
32
|
+
|
|
33
|
+
For reference. Each asymmetry from `specialists-runtime-critique.md` has a rev-9 home:
|
|
34
|
+
|
|
35
|
+
| Asymmetry | Rev-9 answer |
|
|
36
|
+
|---|---|
|
|
37
|
+
| 1 — Executor as chain bootstrapper | §6.9.5 chain composition is an explicit step (`sb chain review` / `approve`); first dispatch is daemon-driven from resolved shape |
|
|
38
|
+
| 2 — Worktree owned by job | §6.9.6 worktree **lease** — owned by container, acquired by writer-steps, released on quiescence |
|
|
39
|
+
| 3 — Chain has no entity row | §6.9.2 resolved shape persisted on the container; §13.3 has the rows |
|
|
40
|
+
| 4 — Keep-alive paradox | §6.9.6 lease releases on `agent_end` (pi quiescence per §19) — pi keep-alive decouples from workspace persistence |
|
|
41
|
+
| 5 — `--bead` conflates contract+key | §6.9.2 dual contract: root carries **change-contract**, step carries **step-contract** (different shapes for different things) |
|
|
42
|
+
| 6 — Reviewer-as-parasite | §6.9.6 read-only steps **do not acquire** the lease; can coexist or run alone |
|
|
43
|
+
|
|
44
|
+
Now the bridges.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Opportunity 1 — Worktree lease as a shimmed column on chain-identity
|
|
49
|
+
|
|
50
|
+
**Now.** Add `worktree_lease_held_by` and `worktree_lease_state` columns to the chain-identity / status row (today: jobs table; later: containers table). Patch `sp run`:
|
|
51
|
+
|
|
52
|
+
- Writer-step (executor, debugger) + lease is `free` → acquire on dispatch, release on `agent_end` (supervisor.ts:1658 is already the right hook).
|
|
53
|
+
- Writer-step + lease is `held` by another live job → **queue** the dispatch (refuse with `WAIT: lease held by <job>; queued, will dispatch on release`).
|
|
54
|
+
- Read-only step (anything tagged `permission: READ_ONLY` in its `.specialist.json`) → **do not touch** the lease; bind to the worktree path directly.
|
|
55
|
+
|
|
56
|
+
**Why.** Closes Asymmetry 2 + a big part of Asymmetry 4 and 6 in one shot. The `--worktree` and `--job` mutually-exclusive rule (CLAUDE.md gotcha) becomes derivable from lease state rather than from a flag combination. Debugger-restitch becomes natural: executor releases on quiescence, debugger acquires.
|
|
57
|
+
|
|
58
|
+
**Reads forward.** Rev-9 §6.9.6 *is* this column, moved from job to container. Implementation today on jobs table → migration is a rename + ownership transfer, no semantic change.
|
|
59
|
+
|
|
60
|
+
**Cost.** ~1 day. SQLite migration + 3 patches in supervisor/run/finalize.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Opportunity 2 — READ_ONLY specialists bind by path, decoupled from owner keep-alive
|
|
65
|
+
|
|
66
|
+
**Now.** Today: reviewer/code-sanity using `--job <exec-job>` requires the executor to be in `keep-alive` (waiting state). The reason is workspace handle, not LLM-state reuse (audit §8.1, critique Asymmetry 4). Patch:
|
|
67
|
+
|
|
68
|
+
- When the dispatched specialist is `permission: READ_ONLY`, runner binds to the worktree **path** stored on `--job <owner>` (read once, cached) instead of requiring the owner to be alive.
|
|
69
|
+
- Owner can be `done`, `closed`, even kill -9'd — the read-only reviewer enters the worktree on its own pi session, reads the diff against the lease's base, produces evidence.
|
|
70
|
+
- `--job <owner>` becomes purely **workspace pointer**, no longer **liveness pointer**, for read-only roles.
|
|
71
|
+
|
|
72
|
+
**Why.** Removes the most expensive single dependency in the current runtime: forcing executor's pi session to stay loaded in memory only so reviewer can `--job` into it. Closes Asymmetry 6 (reviewer-as-parasite). Reduces resource leak when operator forgets `sp finalize` — executor can be reaped earlier.
|
|
73
|
+
|
|
74
|
+
**Reads forward.** Rev-9 §6.9.6: "read-only steps do not acquire the lease, do not require any writer to be live." Patch today implements the same semantics with `--job` becoming a workspace-path lookup. When containers land, the lookup target moves from job→container; the surface is identical.
|
|
75
|
+
|
|
76
|
+
**Cost.** ~1 day. Runner change + `permission: READ_ONLY` audit on each specialist .json (already exists per SKILL §Specialist File Locations).
|
|
77
|
+
|
|
78
|
+
**This is the highest-leverage runtime patch in the alignment set.**
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Opportunity 3 — Persist resolved chain shape as data, not as job-graph projection
|
|
83
|
+
|
|
84
|
+
**Now.** Add a thin `chain_shapes` table (or `~/.specialists/chains/<chain-id>.json` files) storing the *resolved* sequence of steps for a chain at the moment composition completed:
|
|
85
|
+
|
|
86
|
+
```jsonc
|
|
87
|
+
{
|
|
88
|
+
"chain_id": "feature/forge-eorh.48", // current chain-identity key
|
|
89
|
+
"template_name": "code-standard", // one of the 6 from review §25.3
|
|
90
|
+
"resolved_steps": [
|
|
91
|
+
{ "role": "executor", "status": "completed", "job_id": "cc5fcc" },
|
|
92
|
+
{ "role": "code-sanity", "status": "completed", "job_id": "d6eacc" },
|
|
93
|
+
{ "role": "obligations-scanner", "status": "completed", "job_id": "..." },
|
|
94
|
+
{ "role": "reviewer", "status": "running", "job_id": "7b3775" }
|
|
95
|
+
],
|
|
96
|
+
"composed_at_ms": 0,
|
|
97
|
+
"composed_by": "orchestrator:auto" // or "operator:explicit"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Written when the orchestrator dispatches the first step (or via the new `sp chain plan` command — Opportunity 5). Updated as steps run.
|
|
102
|
+
|
|
103
|
+
**Why.** Closes Asymmetry 3 (no entity row). Unlocks `sp chain <bead>` (audit §3.4) as a primary-key lookup instead of a graph walk. Makes the daemon-advances-chain promise of rev-9 §3 implementable on a small scale today — the daemon can read this row and know "next step is X" without orchestrator instruction.
|
|
104
|
+
|
|
105
|
+
**Reads forward.** Rev-9 §6.9.2 "resolved shape persisted as container state" *is* this row, attached to a container instead of a chain-identity blob. Migration: rename column, attach to container row.
|
|
106
|
+
|
|
107
|
+
**Cost.** ~2 days. Table + writer in `sp run`'s dispatch path + reader in `sp ps` / proposed `sp chain`.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Opportunity 4 — `sp chain plan <bead>` as the composition gate, today
|
|
112
|
+
|
|
113
|
+
**Now.** New command. Resolves the chain shape for a bead before any `sp run`:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
$ sp chain plan forge-eorh.48
|
|
117
|
+
Resolved template: code-standard (matched type=task, scrutiny=medium, scope=production)
|
|
118
|
+
1. executor (gpt-5.4-mini, ~3-6m)
|
|
119
|
+
2. code-sanity (gpt-5.4-mini, ~1-3m) [mandatory gate, READ_ONLY]
|
|
120
|
+
3. obligations-scanner (gpt-5.4-mini, ~30s) [mandatory gate, READ_ONLY]
|
|
121
|
+
4. reviewer (gpt-5.3-codex, ~2-4m) [scrutiny may auto-escalate]
|
|
122
|
+
|
|
123
|
+
Run `sp chain dispatch forge-eorh.48` to execute.
|
|
124
|
+
Run `sp chain insert forge-eorh.48 --role <r> --before <step>` to modify.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The plan is *persisted* (Opportunity 3) once approved. Dispatch follows the persisted shape.
|
|
128
|
+
|
|
129
|
+
**Why.** Closes Asymmetry 1 (executor as bootstrapper) — chain composition becomes an explicit operator action *before* any role is dispatched. The `executor` is no longer special; it's just the first step that happens to be next per the resolved template. Forces the orchestrator to articulate the chain shape (instead of "dispatch executor, see what happens").
|
|
130
|
+
|
|
131
|
+
**Reads forward.** Rev-9 §6.9.5 / §11.1 `sb chain review` + `sb chain approve` are exactly this command shape. Today's `sp chain plan/dispatch/insert` maps 1:1 to tomorrow's `sb chain review/approve/insert`. The CLI verbs survive the migration; just the binary changes (`sp` → `sb`) and the data layer flips (jobs-table → containers-table).
|
|
132
|
+
|
|
133
|
+
**Cost.** ~2 days. New CLI surface + reader of Opportunity 3 data + integration with the 6 hard-coded templates from review §25.3.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Opportunity 5 — Split step contracts from root contracts in bd today
|
|
138
|
+
|
|
139
|
+
**Now.** Convention + tooling, not schema change:
|
|
140
|
+
|
|
141
|
+
- A **root bead** continues to use the change-contract sections (`PROBLEM/SCOPE/NON_GOALS/VALIDATION/ACCEPTANCE`).
|
|
142
|
+
- A **step bead** uses a different section set: `MANDATE/INPUTS/OUTPUTS/SCOPE/NON_GOALS`. Detected by tag `kind:step` or by title pattern `<role>:<root-id>` (e.g. `code-sanity:forge-eorh.48`).
|
|
143
|
+
- The Claude Code hook on `bd create` (friction-audit §7.3) detects the title pattern and proposes the step-contract template instead of the change-contract template.
|
|
144
|
+
- SKILL.md teaches the distinction; existing reviewer/code-sanity tracking-beads can be migrated lazily as they get touched.
|
|
145
|
+
|
|
146
|
+
**Why.** Closes Asymmetry 5 (`--bead` conflates contract+key). Reviewer beads stop producing the bad-fit "problem: do the review" — they have the right shape from the start. Operator can no longer confuse tracking-bead with target-bead because they *look different* (different sections rendered).
|
|
147
|
+
|
|
148
|
+
**Reads forward.** Rev-9 §6.9.2 dual-contract is exactly this split, formalized as schema. Today's tag-and-template convention reads into the rev-9 issue store cleanly — every step bead becomes a `class: step` issue with its `step_contract` populated from the existing fields.
|
|
149
|
+
|
|
150
|
+
**Cost.** ~1 day on the hook side; SKILL.md update is no-code. The migration of existing step-beads happens organically as they're touched.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Opportunity 6 — Derive worktree/branch names from chain identity, not from creator role
|
|
155
|
+
|
|
156
|
+
**Now.** Today: branches named `feature/<bead-id>-<role>` (role of creator). Switch to `chain/<bead-id>` for the writer-branch — no role suffix. The worktree mirrors: `.worktrees/chain-<bead-id>`.
|
|
157
|
+
|
|
158
|
+
If a debugger takes over (post-executor quiescence per Opportunity 1), the branch name doesn't change — the *role of the current writer* moves through the same branch. This matches the rev-9 §6.9.6 "worktree handed off, not renamed."
|
|
159
|
+
|
|
160
|
+
**Why.** Closes part of Asymmetry 3. Stops surprising naming when a chain's identity-of-the-moment changes (executor → debugger). Aligns with rev-9 §6.9.7 names-derive-from-membership.
|
|
161
|
+
|
|
162
|
+
**Reads forward.** Rev-9 §6.9.7 names are `wt/epic-<id>/chain-<id>` — extends our `chain-<id>` cleanly when epics land. The names get richer as containers nest; the chain layer stays the same.
|
|
163
|
+
|
|
164
|
+
**Cost.** Half-day. Branch-naming template in worktree.ts.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Opportunity 7 — `--accept-stale-base --reason` rename (audit §B5, restated as alignment)
|
|
169
|
+
|
|
170
|
+
**Now.** Per friction-audit §B5: rename `--force-stale-base` → `--accept-stale-base --reason "<text>"`. Refusal envelope gains structured fields (`{ ok: false, error_code: 'stale_base', blocked_by: [...], next_safe_action: 'diagnose|accept|abandon-chain' }`).
|
|
171
|
+
|
|
172
|
+
**Why.** Already documented; named here for completeness.
|
|
173
|
+
|
|
174
|
+
**Reads forward.** Rev-9 §21 (precondition violation as §6.4 gate) wraps this exactly. The refusal envelope matches channels.md §10.2 shape used throughout substrate. The `--accept --reason` pattern survives unchanged into `sb dispatch <issue> --allow-unready --reason "..."` of §11.2.
|
|
175
|
+
|
|
176
|
+
**Cost.** Half-day (the audit's existing estimate).
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Opportunity 8 — Emit a `step_completed` event with workflow-derived next-step recommendation
|
|
181
|
+
|
|
182
|
+
**Now.** When a specialist finishes (pi `agent_end`), supervisor already writes a status row. Extend with a `next_step_recommendation`:
|
|
183
|
+
|
|
184
|
+
- Look up Opportunity 3's resolved-shape row for this chain
|
|
185
|
+
- Find the just-completed step's index
|
|
186
|
+
- Compute the next step from the template
|
|
187
|
+
- Emit a `runner_event` of kind `step_completed` with `{ completed: <role>, next: <role-or-null>, next_dispatch_command: "sp run <next> --bead <root> --job <this-job> --background" }`
|
|
188
|
+
|
|
189
|
+
`sp result` (friction-audit §3.2) reads this and prints the next-step suggestion.
|
|
190
|
+
|
|
191
|
+
**Why.** Bridges to rev-9 §3's "daemon advances the chain on member agent_end" promise. Today it's a *recommendation* (the orchestrator still types the `sp run`); under substrate it becomes an *automatic dispatch*. Same data, two consumption modes.
|
|
192
|
+
|
|
193
|
+
**Reads forward.** When substrate's daemon takes over advancement, the same event payload flows into the daemon's auto-dispatch path. No data-shape change.
|
|
194
|
+
|
|
195
|
+
**Cost.** ~1 day. Supervisor write + sp-result read.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Opportunity 9 — Composition-nudge table as a tooling layer
|
|
200
|
+
|
|
201
|
+
**Now.** Rev-9 §6.9.5 L1 nudges (programmatic deterministic suggestions: "no explorer-evidence in scope → consider explorer") are a small lookup table. Implementable today:
|
|
202
|
+
|
|
203
|
+
- `~/.config/specialists/composition-nudges.yaml`: rules with `applies_when` matchers (the same matcher syntax substrate uses everywhere — §5.2/§6.9.3) producing "consider X because Y" hints.
|
|
204
|
+
- Consumed by the `sp chain plan` command (Opportunity 4) and by the Claude Code hook on bd create (audit §7.3).
|
|
205
|
+
- The nudge is *informational*, not refusal. Same shape as substrate's L1 nudge.
|
|
206
|
+
|
|
207
|
+
**Why.** Closes the "orchestrator forgets the explorer on a HIGH blast" category of B-class friction (B2). The rule is in a config file, can be tuned per-repo. Most importantly: the rule *raises the question*, doesn't auto-add — preserving the orchestrator's judgment.
|
|
208
|
+
|
|
209
|
+
**Reads forward.** Rev-9 §6.9.5 L1 is the same table, evaluated by substrate's composition-gate. Today's YAML is the schema substrate adopts as-is.
|
|
210
|
+
|
|
211
|
+
**Cost.** ~1 day. YAML schema + matcher engine (reuse the matcher from existing seed-invite logic if any; otherwise minimal glob/regex/keyword evaluator).
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Sequencing — what to land first
|
|
216
|
+
|
|
217
|
+
Each opportunity is independent and reversible. Suggested order, by leverage-per-day:
|
|
218
|
+
|
|
219
|
+
| Stage | Opportunity | Cost | Unlocks |
|
|
220
|
+
|---|---|---|---|
|
|
221
|
+
| **0** | #2 — READ_ONLY binds by path, decouples from keep-alive | 1 day | Removes most expensive single asymmetry (4+6 partial); enables forgotten-finalize cleanup |
|
|
222
|
+
| **1** | #1 — Worktree lease columns | 1 day | Closes Asymmetry 2; makes #4 + #6 fully implementable |
|
|
223
|
+
| **2** | #3 — Persist resolved chain shape | 2 days | Closes Asymmetry 3; enables #4 and #8 |
|
|
224
|
+
| **3** | #4 — `sp chain plan` command + #8 next-step events | 2-3 days combined | Closes Asymmetry 1; gives `sp chain <bead>` from audit §3.4 |
|
|
225
|
+
| **4** | #5 — Step bead conventions in Claude hook | 1 day | Closes Asymmetry 5 (cheap, mostly tooling) |
|
|
226
|
+
| **5** | #6 — Branch name derives from chain | Half-day | Closes the naming part of Asymmetry 3 |
|
|
227
|
+
| **6** | #7 — `--accept-stale-base --reason` rename | Half-day | Friction audit B5 |
|
|
228
|
+
| **7** | #9 — Composition-nudge YAML | 1 day | Friction audit B2 + bridges L1 nudges to substrate |
|
|
229
|
+
|
|
230
|
+
**Total: ~10 days of focused work** to retire all 6 asymmetries' bridges and leave sp in a shape that maps 1:1 onto rev-9 when substrate's daemon and store land.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## What this does NOT do
|
|
235
|
+
|
|
236
|
+
Honesty about scope:
|
|
237
|
+
|
|
238
|
+
- **Does not implement the seed/planning container.** Seed lives in substrate proper (§5 of rev-9). The composition we're doing here is Moment 2 only (chain pre-dispatch); Moment 1 (seed → root issues) waits.
|
|
239
|
+
- **Does not implement the channel primitive.** Channels stay where they are (specialists already has the v0 sketch per channels.md §11 sequencing); the alignment work here is on chain shape and worktree, not on inter-specialist messaging.
|
|
240
|
+
- **Does not introduce a containers table.** All 9 opportunities work against the current chain-identity row shape, extended. The containers table comes with substrate Stage 4 of §15 sequencing.
|
|
241
|
+
- **Does not remove `sp finalize`.** Until container-level transactional close (substrate §22 of the review) lands, `sp finalize` is the close trigger. Opportunity 2 reduces the *urgency* of forgetting it (read-only specialists no longer hold executor alive), but the command itself stays for now.
|
|
242
|
+
|
|
243
|
+
These are the things to *not build bridges for*. They survive substrate intact; bridging them now means double-work.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Open question for rev-9 author
|
|
248
|
+
|
|
249
|
+
When the containers table lands (substrate §15 Stage 4), the migration from "chain-identity row on jobs" to "containers table" needs to preserve evidence ordering and chain history. The current job table has implicit "first job = chain root" semantics; the containers table will have explicit `parent_id` + `opened_by` + `owned_by` (§2.6). Suggested migration path:
|
|
250
|
+
|
|
251
|
+
1. Stage 4 ships `containers` table empty.
|
|
252
|
+
2. Each existing `chain-identity` row is migrated to a synthetic container with `kind: chain`, `opened_by: <first-job-id>`, member jobs re-linked via `container_id`.
|
|
253
|
+
3. The 9 opportunities above produce data (#3, #5, #6, #8) in shapes that migrate trivially — they're already container-flavored even when sitting on jobs.
|
|
254
|
+
|
|
255
|
+
The migration is mechanical because the alignment work made the data already substrate-shaped. That is the value of the bridge: no double-write, no shim layer, just a rename pass when substrate is ready.
|