@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,309 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Worktree Isolation
|
|
3
|
+
scope: worktrees
|
|
4
|
+
category: reference
|
|
5
|
+
version: 1.4.1
|
|
6
|
+
updated: 2026-05-15
|
|
7
|
+
synced_at: bf6baf7a
|
|
8
|
+
description: Technical reference for worktree-per-executor isolation — CLI flags, job registry, GC, and chained bead patterns.
|
|
9
|
+
source_of_truth_for:
|
|
10
|
+
- "src/specialist/job-root.ts"
|
|
11
|
+
- "src/specialist/worktree.ts"
|
|
12
|
+
- "src/specialist/worktree-gc.ts"
|
|
13
|
+
- "src/cli/run.ts"
|
|
14
|
+
- "src/specialist/supervisor.ts"
|
|
15
|
+
domain:
|
|
16
|
+
- worktrees
|
|
17
|
+
- jobs
|
|
18
|
+
- isolation
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Worktree Isolation
|
|
22
|
+
|
|
23
|
+
Each edit-permission specialist runs in an isolated git worktree (branch). This prevents concurrent file corruption when multiple executors modify overlapping paths, and produces a clean per-task branch that the orchestrator merges in dependency order.
|
|
24
|
+
|
|
25
|
+
> Design decisions: overthinker bead `abb9`. Implementation: `hgpu.1–hgpu.5`.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## CLI flags
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
specialists run <name> [--worktree] [--job <id>] [--force-stale-base]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Flag | Semantics | Creates worktree? |
|
|
36
|
+
|------|-----------|:-:|
|
|
37
|
+
| `--worktree` | Explicitly provision a new isolated workspace; requires `--bead` | Yes |
|
|
38
|
+
| `--job <id>` | Reuse the workspace of an existing job | No |
|
|
39
|
+
| `--force-stale-base` | Bypass stale-base guard when provisioning worktree | Yes (if `--worktree`) |
|
|
40
|
+
|
|
41
|
+
`--worktree` and `--job` are **mutually exclusive**. Specifying both exits with an error.
|
|
42
|
+
|
|
43
|
+
`--force-stale-base` is only meaningful with `--worktree` — it forces provisioning even when sibling epic chains have unmerged substantive commits.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Isolation guard for edit-capable specialists
|
|
48
|
+
|
|
49
|
+
Specialists with `permission_required = MEDIUM` or `HIGH` can modify files. Launching them in the main checkout creates last-writer-wins races when multiple specialists run concurrently. The **worktree guard** (`unitAI-fdvt`) blocks these runs unless an isolation option is supplied.
|
|
50
|
+
|
|
51
|
+
### Trigger condition
|
|
52
|
+
|
|
53
|
+
Automatic worktree provisioning triggers when **all** of the following are true:
|
|
54
|
+
|
|
55
|
+
1. `specialist.execution.permission_required` is `MEDIUM` or `HIGH`.
|
|
56
|
+
2. `specialist.execution.requires_worktree` is not set to `false`.
|
|
57
|
+
3. `--job <id>` was not passed.
|
|
58
|
+
4. `--bead <id>` is available (required for deterministic branch naming).
|
|
59
|
+
|
|
60
|
+
### Error message
|
|
61
|
+
|
|
62
|
+
If automatic provisioning is required but no `--bead` was supplied:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Error: specialist '<name>' has permission_required=<MEDIUM|HIGH> and requires worktree isolation.
|
|
66
|
+
Provide --bead <id> for automatic worktree provisioning, or use --job <id> to reuse an existing worktree.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The process exits with code `1`.
|
|
70
|
+
|
|
71
|
+
`READ_ONLY` specialists are **never** gated — the requirement only applies to edit-capable specialists with `requires_worktree=true`.
|
|
72
|
+
|
|
73
|
+
### Stale-base guard
|
|
74
|
+
|
|
75
|
+
When `--worktree` provisions a new worktree, the stale-base guard checks whether sibling chains in the same epic have unmerged substantive commits. If detected, dispatch is blocked:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Error: Epic 'unitAI-3f7b' has sibling chains with unmerged changes.
|
|
79
|
+
- impl-a: 2 substantive commits on 'feature/unitAI-impl-a-executor'
|
|
80
|
+
- impl-b: 3 substantive commits on 'feature/unitAI-impl-b-executor'
|
|
81
|
+
Merge sibling chains first via 'sp epic merge unitAI-3f7b', or use --force-stale-base to bypass.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Why this matters**: When parallel chains branch from the same base, Wave B's worktree lacks Wave A's merged changes. If Wave A merges first, Wave B's diff shows reversions. Rebase at merge-time resolves this, but starting from a stale base increases conflict risk.
|
|
85
|
+
|
|
86
|
+
Use `--force-stale-base` to bypass when you knowingly accept merge complexity later.
|
|
87
|
+
|
|
88
|
+
### `--worktree`
|
|
89
|
+
|
|
90
|
+
Optional explicit flag. MEDIUM/HIGH specialists that require isolation now auto-provision without this flag when `--bead` is present.
|
|
91
|
+
|
|
92
|
+
Requires `--bead <id>` — the bead id drives the deterministic branch name.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
specialists run executor --worktree --bead hgpu.3
|
|
96
|
+
# stderr: [worktree created: /repo/.worktrees/hgpu.3/hgpu.3-executor branch: feature/hgpu.3-executor]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If a worktree for that branch already exists (e.g. from a prior interrupted run) it is reused:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# stderr: [worktree reused: /repo/.worktrees/hgpu.3/hgpu.3-executor branch: feature/hgpu.3-executor]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### `--job <id>`
|
|
106
|
+
|
|
107
|
+
Resolves the target job's `worktree_path` from the DB-first runtime state, falling back to legacy `status.json` mirrors when enabled, and uses that directory as `cwd`. The **caller's** `--bead` remains authoritative — only the workspace is borrowed.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
specialists run reviewer --job 49adda --bead hgpu.3-review
|
|
111
|
+
# stderr: [workspace reused from job 49adda: /repo/.worktrees/hgpu.3/hgpu.3-executor]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Hard fail conditions (both exit 1):
|
|
115
|
+
- `status.json` missing or unreadable for the given job id.
|
|
116
|
+
- `worktree_path` absent — the target job was not started with `--worktree`.
|
|
117
|
+
|
|
118
|
+
**Concurrency guard:** READ_ONLY and LOW specialists may run against an active worktree; MEDIUM/HIGH specialists are blocked until the owning job reaches a terminal state. Use `--force-job` to bypass.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## How it works
|
|
123
|
+
|
|
124
|
+
### Branch naming
|
|
125
|
+
|
|
126
|
+
`provisionWorktree()` in `worktree.ts` derives deterministic names:
|
|
127
|
+
|
|
128
|
+
| Artifact | Convention | Example |
|
|
129
|
+
|----------|-----------|---------|
|
|
130
|
+
| Git branch | `feature/<beadId>-<slug>` | `feature/hgpu.3-executor` |
|
|
131
|
+
| Worktree dir | `<beadId>-<slug>` | `hgpu.3-executor` |
|
|
132
|
+
| Parent dir | `<git-common-root>/.worktrees/<beadId>/` | `.worktrees/hgpu.3/` |
|
|
133
|
+
|
|
134
|
+
`<slug>` is the specialist name lowercased with non-alphanumeric runs collapsed to `-`.
|
|
135
|
+
|
|
136
|
+
### Worktree creation
|
|
137
|
+
|
|
138
|
+
`bd worktree create <path> --branch <branch>` is the **only** creation path. There is no silent `git worktree add` fallback — failure throws immediately with the bd stderr included in the message.
|
|
139
|
+
|
|
140
|
+
Reuse detection runs first via `git worktree list --porcelain`; creation is skipped if the branch is already checked out.
|
|
141
|
+
|
|
142
|
+
### Central job registry
|
|
143
|
+
|
|
144
|
+
`resolveJobsDir()` in `job-root.ts` anchors `.specialists/jobs/` to the git **common root** using `git rev-parse --git-common-dir`. From any worktree, `dirname(resolve(cwd, gitCommonDir))` resolves to the main checkout root — all worktrees converge on the same jobs directory.
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
/repo/.git/ ← common git dir
|
|
148
|
+
/repo/.specialists/jobs/ ← shared job registry (all worktrees read/write here)
|
|
149
|
+
/repo/.worktrees/hgpu.3/hgpu.3-executor/ ← isolated cwd for that run
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Persisted metadata
|
|
153
|
+
|
|
154
|
+
`Supervisor` persists `worktree_path` and `branch` in canonical runtime state and, when legacy file mirrors are enabled, also writes them to `status.json` immediately on job start:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"id": "49adda",
|
|
159
|
+
"specialist": "executor",
|
|
160
|
+
"status": "running",
|
|
161
|
+
"worktree_path": "/repo/.worktrees/hgpu.3/hgpu.3-executor",
|
|
162
|
+
"branch": "feature/hgpu.3-executor"
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`--job` resolution uses persisted job metadata — no git scanning required.
|
|
167
|
+
|
|
168
|
+
### Status / steer / resume
|
|
169
|
+
|
|
170
|
+
`status`, `steer`, and `resume` commands all call `resolveJobsDir()` with their local `cwd`, which returns the common-root path regardless of whether they are invoked from a worktree or the main checkout. The job record is always found.
|
|
171
|
+
|
|
172
|
+
### Pi bootstrap
|
|
173
|
+
|
|
174
|
+
Pi extensions are global (`~/.pi/`). No per-worktree bootstrap step is required.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Worktree GC
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
specialists clean # prunes job dirs AND terminal worktrees
|
|
182
|
+
specialists clean --dry-run # preview removals without deleting
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
GC runs automatically as part of `specialists clean`. Candidates must satisfy **all** conditions:
|
|
186
|
+
|
|
187
|
+
1. Job status is `done` or `error` (terminal).
|
|
188
|
+
2. `worktree_path` is recorded in `status.json`.
|
|
189
|
+
3. The directory still exists on disk.
|
|
190
|
+
4. Job status is **not** `starting`, `running`, or `waiting` (active guard runs first, unconditionally).
|
|
191
|
+
|
|
192
|
+
Removal uses `git worktree remove --force` so both the directory and the git registry entry are cleaned atomically. Failures are skipped silently — missing cleanup is preferred over data loss.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Session close: `sp end`
|
|
197
|
+
|
|
198
|
+
`specialists end` closes a worktree session with epic-aware publication.
|
|
199
|
+
|
|
200
|
+
### Synopsis
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
sp end [--bead <id>|--epic <id>] [--pr] [--rebuild]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Epic-aware behavior
|
|
207
|
+
|
|
208
|
+
If the current chain belongs to an unresolved epic (`open`, `resolving`, `merge_ready`):
|
|
209
|
+
|
|
210
|
+
1. `sp end` detects epic membership via `checkEpicUnresolvedGuard()`
|
|
211
|
+
2. Prints redirect message
|
|
212
|
+
3. Delegates to `sp epic merge <epic-id>`
|
|
213
|
+
|
|
214
|
+
Example:
|
|
215
|
+
```
|
|
216
|
+
Chain unitAI-impl belongs to unresolved epic unitAI-3f7b (status: resolving).
|
|
217
|
+
Redirecting session close publication to epic merge (direct mode).
|
|
218
|
+
Epic unitAI-3f7b: resolving -> merge_ready
|
|
219
|
+
Epic unitAI-3f7b: merge_ready -> merged
|
|
220
|
+
Publication successful.
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Direct chain publication
|
|
224
|
+
|
|
225
|
+
For standalone chains NOT belonging to an epic:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
sp end --bead unitAI-55d
|
|
229
|
+
# → merges branch feature/unitAI-55d-executor
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Chained bead review/fix loop
|
|
237
|
+
|
|
238
|
+
A common orchestration pattern with worktree isolation:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# 1. Executor claims bead, provisions worktree, does implementation
|
|
242
|
+
specialists run executor --worktree --bead hgpu.3
|
|
243
|
+
# → executor closes bead as COMPLETE/PARTIAL, job id: 49adda
|
|
244
|
+
|
|
245
|
+
# 2. Reviewer enters the same worktree (read bead notes from the executor's run)
|
|
246
|
+
specialists run reviewer --job 49adda --bead hgpu.3-review
|
|
247
|
+
|
|
248
|
+
# 3. If reviewer returns PARTIAL, fix-it agent re-enters same workspace
|
|
249
|
+
specialists run executor --job 49adda --bead hgpu.3-fix
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Key invariants:
|
|
253
|
+
- Reviewer sees exactly the state the executor left — same branch, same files.
|
|
254
|
+
- Caller's `--bead` controls which bead is opened/closed; `--job` only selects the workspace.
|
|
255
|
+
- The executor's bead is never re-opened by the reviewer — lifecycle stays with the original claimer.
|
|
256
|
+
|
|
257
|
+
For orchestration patterns that compose this loop, see `SKILL.md` and `workflow.md`.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Auto-checkpoint behavior
|
|
262
|
+
|
|
263
|
+
Specialists with `auto_commit: checkpoint_on_waiting` or `checkpoint_on_terminal` automatically commit substantive worktree changes at designated lifecycle points. This prevents lost work if a job crashes or is stopped mid-task.
|
|
264
|
+
|
|
265
|
+
| Policy | When commits happen | Typical use |
|
|
266
|
+
|--------|---------------------|-------------|
|
|
267
|
+
| `never` | Never | Default — no auto-commit |
|
|
268
|
+
| `checkpoint_on_waiting` | Each keep-alive turn entering `waiting` | Executors, debuggers — preserve partial work before review |
|
|
269
|
+
| `checkpoint_on_terminal` | Terminal completion (`done`/`error`) | One-shot specialists — commit only at end |
|
|
270
|
+
|
|
271
|
+
Default specialists with auto-checkpoint enabled:
|
|
272
|
+
- **executor**: `checkpoint_on_waiting`
|
|
273
|
+
- **debugger**: `checkpoint_on_waiting`
|
|
274
|
+
|
|
275
|
+
Commit messages follow the pattern:
|
|
276
|
+
```
|
|
277
|
+
checkpoint(executor): unitAI-55d turn 1
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Status metadata tracks checkpoints:
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"auto_commit_count": 3,
|
|
284
|
+
"last_auto_commit_sha": "a1b2c3d",
|
|
285
|
+
"last_auto_commit_at_ms": 1714020000000
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Auto-checkpoint runs silently — no user action required. The guard persists result + bead notes even on initial waiting turn (unitAI-8b812), ensuring no work is lost before the first checkpoint.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Key files
|
|
294
|
+
|
|
295
|
+
| File | Responsibility |
|
|
296
|
+
|------|---------------|
|
|
297
|
+
| `src/specialist/job-root.ts` | `resolveJobsDir()` — common-root job registry anchor |
|
|
298
|
+
| `src/specialist/worktree.ts` | `provisionWorktree()`, branch/path derivation, `listWorktrees()` |
|
|
299
|
+
| `src/specialist/worktree-gc.ts` | `collectWorktreeGcCandidates()`, `pruneWorktrees()` |
|
|
300
|
+
| `src/cli/run.ts` | `resolveWorkingDirectory()` — `--worktree`/`--job` dispatch |
|
|
301
|
+
| `src/specialist/supervisor.ts` | Persists `worktree_path` + `branch` to DB-first runtime state and legacy mirrors when enabled |
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## See also
|
|
306
|
+
|
|
307
|
+
- [background-jobs.md](background-jobs.md) — job lifecycle, status polling, keep-alive
|
|
308
|
+
- [workflow.md](workflow.md) — orchestration patterns and specialist chaining
|
|
309
|
+
- [worktree.md](worktree.md) — xtrm `xt pi` / `xt end` integration (separate topic)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaggerxtrm/specialists",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "OmniSpecialist — 7-tool MCP orchestration layer powered by the Specialist System. Discover and execute .specialist.yaml files across project/user/system scopes via pi.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/lib.d.ts",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"config/nodes/",
|
|
28
28
|
"config/hooks/",
|
|
29
29
|
"config/presets.json",
|
|
30
|
+
"docs/",
|
|
30
31
|
"LICENSE",
|
|
31
32
|
"!config/benchmarks/",
|
|
32
33
|
"!config/skills/**/evals/",
|
|
@@ -73,28 +74,32 @@
|
|
|
73
74
|
}
|
|
74
75
|
},
|
|
75
76
|
"dependencies": {
|
|
76
|
-
"@earendil-works/pi-tui": "
|
|
77
|
-
"@modelcontextprotocol/sdk": "
|
|
77
|
+
"@earendil-works/pi-tui": "0.75.5",
|
|
78
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
79
|
+
"hono": "4.12.26",
|
|
80
|
+
"qs": "6.15.2",
|
|
78
81
|
"yaml": "2.9.0",
|
|
79
|
-
"zod": "
|
|
80
|
-
"zod-to-json-schema": "
|
|
82
|
+
"zod": "3.25.76",
|
|
83
|
+
"zod-to-json-schema": "3.25.2"
|
|
81
84
|
},
|
|
82
85
|
"devDependencies": {
|
|
83
86
|
"@types/bun": "1.3.14",
|
|
84
|
-
"@types/node": "
|
|
85
|
-
"@vitest/coverage-v8": "
|
|
86
|
-
"tsx": "
|
|
87
|
-
"typescript": "
|
|
88
|
-
"vitest": "
|
|
87
|
+
"@types/node": "25.9.1",
|
|
88
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
89
|
+
"tsx": "4.22.3",
|
|
90
|
+
"typescript": "5.9.3",
|
|
91
|
+
"vitest": "4.1.7",
|
|
92
|
+
"vite": "8.0.16"
|
|
89
93
|
},
|
|
90
94
|
"engines": {
|
|
91
95
|
"bun": ">=1.0.0"
|
|
92
96
|
},
|
|
93
97
|
"overrides": {
|
|
94
98
|
"@hono/node-server": "^1.19.13",
|
|
99
|
+
"esbuild": "^0.28.1",
|
|
95
100
|
"fast-uri": "^3.1.2",
|
|
96
|
-
"hono": "^4.12.18",
|
|
97
101
|
"ip-address": "^10.2.0",
|
|
98
|
-
"path-to-regexp": "^8.4.0"
|
|
102
|
+
"path-to-regexp": "^8.4.0",
|
|
103
|
+
"qs": "6.15.2"
|
|
99
104
|
}
|
|
100
105
|
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"specialist": {
|
|
3
|
-
"metadata": {
|
|
4
|
-
"name": "code-sanity",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"description": "READ_ONLY smell pass after executor and before reviewer. Checks simplicity, type safety, dead code, async/error handling, maintainability.",
|
|
7
|
-
"category": "quality",
|
|
8
|
-
"tags": [
|
|
9
|
-
"code-quality",
|
|
10
|
-
"clean-code",
|
|
11
|
-
"type-safety",
|
|
12
|
-
"simplicity",
|
|
13
|
-
"review",
|
|
14
|
-
"read-only"
|
|
15
|
-
],
|
|
16
|
-
"updated": "2026-05-04"
|
|
17
|
-
},
|
|
18
|
-
"execution": {
|
|
19
|
-
"mode": "tool",
|
|
20
|
-
"model": "openai-codex/gpt-5.4-mini",
|
|
21
|
-
"fallback_model": "zai/glm-5-turbo",
|
|
22
|
-
"timeout_ms": 0,
|
|
23
|
-
"stall_timeout_ms": 120000,
|
|
24
|
-
"response_format": "markdown",
|
|
25
|
-
"output_type": "review",
|
|
26
|
-
"permission_required": "READ_ONLY",
|
|
27
|
-
"interactive": true,
|
|
28
|
-
"thinking_level": "low",
|
|
29
|
-
"max_retries": 0,
|
|
30
|
-
"extensions": {
|
|
31
|
-
"serena": false
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"mandatory_rules": {
|
|
35
|
-
"template_sets": [
|
|
36
|
-
"explorer-readonly",
|
|
37
|
-
"gitnexus-required",
|
|
38
|
-
"code-quality-defaults",
|
|
39
|
-
"per-turn-handoff-schema",
|
|
40
|
-
"bead-id-verbatim"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"permissions": {
|
|
44
|
-
"READ_ONLY": {
|
|
45
|
-
"denied_natives_when_extension": [
|
|
46
|
-
"grep",
|
|
47
|
-
"find",
|
|
48
|
-
"ls"
|
|
49
|
-
],
|
|
50
|
-
"denied_natives_mode": "hard"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"prompt": {
|
|
54
|
-
"system": "You are a READ_ONLY code-sanity specialist. Your job is a cheap, focused implementation-quality smell pass after executor and before final reviewer. You do not decide whether requirements are met; the reviewer owns that merge gate. You do not edit files.\n\n## Scope\n\nInspect an executor job, diff, or explicitly scoped files for implementation sanity only:\n- unnecessary complexity\n- over-abstraction or premature generalization\n- type unsafety (`any`, unsafe casts, non-null assertions, untyped boundaries, ignored unknowns)\n- brittle async/error handling\n- duplicated logic that should be trivially consolidated\n- dead code, unreachable branches, unused exports introduced by the change\n- unclear names or control flow that make the implementation harder than necessary\n- violations of the clean-code guidance that are concrete enough to fix\n\n## Non-goals\n\nDo not validate product requirements, release readiness, security posture, broad architecture, or test coverage. Do not request preference-only rewrites. Do not broaden into a full code review. Do not run broad test suites.\n\n## Tooling approach\n\nUse GitNexus and Serena for precise inspection when available. Prefer symbol/diff-aware navigation over raw file reading. If inspecting changed symbols, use impact/context evidence when useful, but keep the pass bounded. Stop after at most 8 tool calls unless the prompt explicitly asks for deeper analysis.\n\n## Output discipline\n\nDefault to OK when the implementation is simple enough. If findings exist, return at most 5. Each finding must be concrete, actionable, and suitable to paste into `specialists resume <executor-job>`. Cite file/symbol/line evidence where possible. Avoid taste-only comments.\n\n## Required output format\n\n## Code Sanity Verdict\n- Verdict: OK | FINDINGS | BLOCKED\n- Scope reviewed:\n- Confidence: high | medium | low\n\n## Findings\nAt most 5. For each:\n- Location:\n- Issue:\n- Why it matters:\n- Suggested executor instruction:\n\n## Non-findings\nBriefly note any tempting but intentionally ignored concerns because they belong to reviewer/test-runner/security-auditor.\n\n## Handoff\nOne short paragraph for the orchestrator: proceed to reviewer, resume executor with findings, or rerun with clearer scope.\n\n## Machine-readable block\nReturn exactly one JSON object in a single fenced ```json block matching the output_schema.\n\nAfter delivering the report, enter waiting state for follow-up or re-check.",
|
|
55
|
-
"task_template": "Run a code-sanity pass for the following implementation context:\n\n$prompt\n\nWorking directory: $cwd\n\nIf an executor job id is provided, inspect that job's output/diff if available. If only files are provided, inspect only those files. Stay READ_ONLY and return the required bounded report.",
|
|
56
|
-
"output_schema": {
|
|
57
|
-
"type": "object",
|
|
58
|
-
"properties": {
|
|
59
|
-
"verdict": {
|
|
60
|
-
"enum": [
|
|
61
|
-
"OK",
|
|
62
|
-
"FINDINGS",
|
|
63
|
-
"BLOCKED"
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
"findings_count": {
|
|
67
|
-
"type": "number"
|
|
68
|
-
},
|
|
69
|
-
"locations": {
|
|
70
|
-
"type": "array",
|
|
71
|
-
"items": {
|
|
72
|
-
"type": "string"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"executor_instructions": {
|
|
76
|
-
"type": "array",
|
|
77
|
-
"items": {
|
|
78
|
-
"type": "string"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"handoff": {
|
|
82
|
-
"type": "string"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"skills": {
|
|
88
|
-
"paths": [],
|
|
89
|
-
"scripts": []
|
|
90
|
-
},
|
|
91
|
-
"validation": {
|
|
92
|
-
"files_to_watch": [
|
|
93
|
-
"src/specialist/schema.ts",
|
|
94
|
-
"src/specialist/runner.ts",
|
|
95
|
-
".xtrm/skills/active/clean-code/SKILL.md",
|
|
96
|
-
".xtrm/skills/active/gitnexus-impact-analysis/SKILL.md"
|
|
97
|
-
],
|
|
98
|
-
"stale_threshold_days": 30
|
|
99
|
-
},
|
|
100
|
-
"capabilities": {
|
|
101
|
-
"required_tools": [],
|
|
102
|
-
"external_commands": []
|
|
103
|
-
},
|
|
104
|
-
"stall_detection": {},
|
|
105
|
-
"beads_integration": "auto",
|
|
106
|
-
"beads_write_notes": true
|
|
107
|
-
}
|
|
108
|
-
}
|