@mmerterden/multi-agent-pipeline 18.0.0 → 19.0.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/CHANGELOG.md +183 -0
- package/README.md +34 -18
- package/README.tr.md +14 -16
- package/docs/adr/0002-instruction-driven-flag.md +1 -0
- package/docs/adr/0005-lazy-phase-docs.md +11 -1
- package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -0
- package/docs/adr/0010-own-code-graph.md +1 -0
- package/docs/adr/0014-six-phase-consolidation.md +134 -0
- package/docs/adr/README.md +2 -1
- package/docs/architecture.md +37 -38
- package/docs/best-practices.md +1 -1
- package/docs/ecosystem.md +37 -26
- package/docs/engineering.md +1 -1
- package/docs/facts.json +45 -0
- package/docs/features.md +54 -53
- package/docs/performance.md +5 -5
- package/docs/recovery-guide.md +9 -9
- package/docs/token-budget-history.md +3 -1
- package/index.js +2 -2
- package/install/_codex-agents.mjs +1 -1
- package/install/templates/claude-hooks.json +1 -1
- package/install/templates/codex-instructions.md +1 -1
- package/install/templates/copilot-instructions.md +28 -28
- package/manifest.json +209 -193
- package/package.json +2 -2
- package/pipeline/agents/dev-critic.md +3 -3
- package/pipeline/commands/figma-to-swiftui.md +1 -1
- package/pipeline/commands/multi-agent/SKILL.md +8 -8
- package/pipeline/commands/multi-agent/analysis/SKILL.md +9 -9
- package/pipeline/commands/multi-agent/autopilot/SKILL.md +7 -7
- package/pipeline/commands/multi-agent/channels/SKILL.md +15 -15
- package/pipeline/commands/multi-agent/diff-explain/SKILL.md +6 -6
- package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/graph/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/help/SKILL.md +62 -62
- package/pipeline/commands/multi-agent/language/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/local/SKILL.md +11 -11
- package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +13 -13
- package/pipeline/commands/multi-agent/log/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/manual-test/SKILL.md +9 -9
- package/pipeline/commands/multi-agent/model/SKILL.md +69 -0
- package/pipeline/commands/multi-agent/refactor/SKILL.md +3 -3
- package/pipeline/commands/multi-agent/resume/SKILL.md +4 -4
- package/pipeline/commands/multi-agent/resume-local/SKILL.md +19 -17
- package/pipeline/commands/multi-agent/review/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/route-off/SKILL.md +36 -0
- package/pipeline/commands/multi-agent/route-on/SKILL.md +74 -0
- package/pipeline/commands/multi-agent/route-status/SKILL.md +56 -0
- package/pipeline/commands/multi-agent/setup/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/status/SKILL.md +5 -5
- package/pipeline/commands/multi-agent/steer/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/sync/SKILL.md +12 -13
- package/pipeline/commands/multi-agent/test/SKILL.md +1 -1
- package/pipeline/lib/credential-inventory.sh +1 -1
- package/pipeline/lib/fetch-fortify.sh +1 -1
- package/pipeline/lib/model-rung.sh +142 -0
- package/pipeline/lib/phase-schema.mjs +88 -0
- package/pipeline/lib/plan-todos.sh +5 -5
- package/pipeline/lib/route-state.sh +161 -0
- package/pipeline/lib/run-paths.sh +2 -2
- package/pipeline/multi-agent-refs/_account-picker.md +1 -1
- package/pipeline/multi-agent-refs/_dev-context.md +1 -1
- package/pipeline/multi-agent-refs/_input-parser.md +1 -1
- package/pipeline/multi-agent-refs/analysis/evidence.md +0 -9
- package/pipeline/multi-agent-refs/analysis/intake.md +1 -1
- package/pipeline/multi-agent-refs/analysis/locked.md +21 -22
- package/pipeline/multi-agent-refs/analysis/render.md +1 -1
- package/pipeline/multi-agent-refs/analysis/synthesis.md +12 -6
- package/pipeline/multi-agent-refs/android-guide.md +1 -1
- package/pipeline/multi-agent-refs/audit-guide.md +13 -13
- package/pipeline/multi-agent-refs/channels/issue-comment.md +2 -2
- package/pipeline/multi-agent-refs/channels/jira.md +3 -3
- package/pipeline/multi-agent-refs/channels/pr.md +4 -4
- package/pipeline/multi-agent-refs/channels/wiki.md +1 -1
- package/pipeline/multi-agent-refs/component-dispatch.md +3 -3
- package/pipeline/multi-agent-refs/cross-cli-contract.md +31 -6
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
- package/pipeline/multi-agent-refs/features/code-graph.md +5 -5
- package/pipeline/multi-agent-refs/features/design-conformance.md +1 -1
- package/pipeline/multi-agent-refs/features/dev-critic.md +3 -3
- package/pipeline/multi-agent-refs/features/doctor.md +2 -2
- package/pipeline/multi-agent-refs/features/external-context-injection.md +3 -3
- package/pipeline/multi-agent-refs/features/maturity-followup.md +3 -3
- package/pipeline/multi-agent-refs/features/model-fallback.md +5 -5
- package/pipeline/multi-agent-refs/features/plan-todos.md +1 -1
- package/pipeline/multi-agent-refs/features/repo-map.md +1 -1
- package/pipeline/multi-agent-refs/features/review-delta.md +3 -3
- package/pipeline/multi-agent-refs/features/review-multi-repo.md +1 -1
- package/pipeline/multi-agent-refs/features/scope-check.md +4 -4
- package/pipeline/multi-agent-refs/features/skill-conformance.md +2 -2
- package/pipeline/multi-agent-refs/features/stack-skill-routing.md +1 -1
- package/pipeline/multi-agent-refs/features/verify-by-test.md +4 -4
- package/pipeline/multi-agent-refs/features/visual-evidence.md +19 -19
- package/pipeline/multi-agent-refs/features/worktree-finalize.md +6 -6
- package/pipeline/multi-agent-refs/issue-jira-triad.md +10 -10
- package/pipeline/multi-agent-refs/knowledge.md +11 -11
- package/pipeline/multi-agent-refs/multi-repo-integration-build.md +13 -13
- package/pipeline/multi-agent-refs/payload-contracts.md +8 -8
- package/pipeline/multi-agent-refs/phases/log-format.md +10 -10
- package/pipeline/multi-agent-refs/phases/modes.md +30 -30
- package/pipeline/multi-agent-refs/phases/operations.md +8 -8
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +24 -24
- package/pipeline/multi-agent-refs/phases/phase-1-plan.md +599 -0
- package/pipeline/multi-agent-refs/phases/{phase-3-dev.md → phase-2-dev.md} +129 -49
- package/pipeline/multi-agent-refs/phases/{phase-4-review.md → phase-3-review.md} +225 -107
- package/pipeline/multi-agent-refs/phases/{phase-6-commit.md → phase-4-commit.md} +23 -23
- package/pipeline/multi-agent-refs/phases/{phase-7-report.md → phase-5-report.md} +29 -29
- package/pipeline/multi-agent-refs/phases.md +44 -48
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/progress-contract.md +6 -6
- package/pipeline/multi-agent-refs/readiness-review.md +1 -1
- package/pipeline/multi-agent-refs/rules.md +7 -7
- package/pipeline/multi-agent-refs/swiftui-guide.md +2 -2
- package/pipeline/multi-agent-refs/tracker-contract.md +31 -32
- package/pipeline/multi-agent-refs/wiki-capture.md +14 -14
- package/pipeline/preferences-template.json +9 -1
- package/pipeline/rules/outside-the-pipeline.md +1 -1
- package/pipeline/schemas/agent-state.schema.json +50 -50
- package/pipeline/schemas/analysis-output.schema.json +2 -2
- package/pipeline/schemas/autopilot-config.schema.json +1 -1
- package/pipeline/schemas/code-graph.schema.json +1 -1
- package/pipeline/schemas/criteria-manifest.schema.json +1 -1
- package/pipeline/schemas/dev-critic-output.schema.json +1 -1
- package/pipeline/schemas/diff-risk.schema.json +1 -1
- package/pipeline/schemas/migrations/prefs-2.4.0-to-2.5.0.mjs +2 -2
- package/pipeline/schemas/migrations/prefs-2.6.0-to-2.7.0.mjs +31 -0
- package/pipeline/schemas/migrations/state-2.1.0-to-2.2.0.mjs +129 -0
- package/pipeline/schemas/phases.json +105 -0
- package/pipeline/schemas/plan-todos.schema.json +5 -5
- package/pipeline/schemas/planning-output.schema.json +1 -1
- package/pipeline/schemas/prefs.schema.json +100 -56
- package/pipeline/schemas/reviewer-output.schema.json +3 -3
- package/pipeline/schemas/route-config.schema.json +74 -0
- package/pipeline/schemas/scope-check.schema.json +1 -1
- package/pipeline/schemas/test-gap.schema.json +1 -1
- package/pipeline/schemas/token-budget.json +12 -18
- package/pipeline/schemas/triage-output.schema.json +6 -6
- package/pipeline/scripts/README.md +3 -3
- package/pipeline/scripts/_code-graph.mjs +2 -2
- package/pipeline/scripts/_run-paths.mjs +2 -2
- package/pipeline/scripts/_smoke-root.sh +1 -1
- package/pipeline/scripts/aggregate-metrics.mjs +1 -1
- package/pipeline/scripts/capture-flush.sh +8 -8
- package/pipeline/scripts/capture-resume.sh +3 -3
- package/pipeline/scripts/classify-plan-safety.mjs +1 -1
- package/pipeline/scripts/diff-explain.mjs +1 -1
- package/pipeline/scripts/doctor.mjs +2 -2
- package/pipeline/scripts/gc-abandoned.sh +3 -3
- package/pipeline/scripts/gc-tmp.sh +1 -1
- package/pipeline/scripts/gc-worktrees.sh +1 -1
- package/pipeline/scripts/gen-facts.mjs +175 -0
- package/pipeline/scripts/gen-mode-dispatch.mjs +32 -37
- package/pipeline/scripts/gen-ref-toc.mjs +1 -1
- package/pipeline/scripts/graph-report.mjs +1 -1
- package/pipeline/scripts/jira-attach.sh +1 -1
- package/pipeline/scripts/learn-from-transcripts.mjs +1 -1
- package/pipeline/scripts/learning-curve.mjs +2 -2
- package/pipeline/scripts/log-metric.sh +17 -4
- package/pipeline/scripts/memory-save.sh +1 -1
- package/pipeline/scripts/migrate-prefs.mjs +22 -5
- package/pipeline/scripts/phase-banner.sh +20 -20
- package/pipeline/scripts/phase-tracker.sh +7 -7
- package/pipeline/scripts/plan-coverage-gate.mjs +2 -2
- package/pipeline/scripts/render-agent-log-cost.sh +1 -1
- package/pipeline/scripts/render-work-summary.sh +3 -3
- package/pipeline/scripts/review-file-filter.mjs +1 -1
- package/pipeline/scripts/run-aggregator.mjs +13 -6
- package/pipeline/scripts/run-metrics.mjs +1 -1
- package/pipeline/scripts/runs-index.mjs +11 -1
- package/pipeline/scripts/smoke-cross-cli-behavior.sh +6 -6
- package/pipeline/scripts/smoke-schema-validation.sh +26 -7
- package/pipeline/scripts/token-budget-report.mjs +13 -2
- package/pipeline/scripts/triage-memory.mjs +2 -2
- package/pipeline/scripts/validate-analysis-doc.mjs +73 -17
- package/pipeline/scripts/validate-planning.mjs +1 -1
- package/pipeline/scripts/validate-reviewer.mjs +1 -1
- package/pipeline/scripts/validate-state.mjs +45 -5
- package/pipeline/scripts/validate-triage.mjs +3 -3
- package/pipeline/scripts/worktree-finalize.sh +5 -5
- package/pipeline/skills/.skill-manifest.json +37 -21
- package/pipeline/skills/.skills-index.json +49 -5
- package/pipeline/skills/shared/README.md +10 -6
- package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +2 -2
- package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +69 -71
- package/pipeline/skills/shared/core/multi-agent-autopilot/SKILL.md +3 -3
- package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +14 -14
- package/pipeline/skills/shared/core/multi-agent-diff-explain/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +25 -23
- package/pipeline/skills/shared/core/multi-agent-language/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +8 -8
- package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +6 -6
- package/pipeline/skills/shared/core/multi-agent-model/SKILL.md +71 -0
- package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +3 -3
- package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-resume-local/SKILL.md +7 -7
- package/pipeline/skills/shared/core/multi-agent-route-off/SKILL.md +39 -0
- package/pipeline/skills/shared/core/multi-agent-route-on/SKILL.md +76 -0
- package/pipeline/skills/shared/core/multi-agent-route-status/SKILL.md +59 -0
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-status/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-steer/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +6 -5
- package/pipeline/skills/skills-index.md +8 -4
- package/pipeline/multi-agent-refs/phases/phase-1-analysis.md +0 -263
- package/pipeline/multi-agent-refs/phases/phase-2-planning.md +0 -344
- package/pipeline/multi-agent-refs/phases/phase-5-test.md +0 -182
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
### Phase
|
|
1
|
+
### Phase 4: Commit
|
|
2
2
|
|
|
3
3
|
> **TLDR** - Commit with conventional message + ticket ID, push, open PR. Order: (1) identity confirm → (2) commit → (3) push → (4) fetch default reviewers → (5) ask DRAFT-or-READY → (6) build payload with heredoc+rawfile → (7) POST with `reviewers`+`fromRef`+`toRef`+`draft` required on Bitbucket (missing fields wipe defaults).
|
|
4
4
|
|
|
@@ -23,13 +23,13 @@ Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` -
|
|
|
23
23
|
|
|
24
24
|
#### Input contract
|
|
25
25
|
|
|
26
|
-
Phase
|
|
26
|
+
Phase 4 consumes the latest Phase 3 triage output object conforming to `$HOME/.claude/schemas/triage-output.schema.json` (`accepted`, `deferred`, `rejected` buckets) plus the working-tree mutations from Phase 2. The commit body cites only `accepted` findings that were resolved; `deferred` items must be linked in the PR description as follow-up work, never silently dropped. If the triage output reports any unresolved blocking accepted finding, Phase 4 refuses to commit - the pipeline returns to Phase 2 for rework.
|
|
27
27
|
|
|
28
|
-
The "Build passes" checklist item below is evidence-gated, not self-asserted: Phase
|
|
28
|
+
The "Build passes" checklist item below is evidence-gated, not self-asserted: Phase 4 trusts the `buildStatus.ok` that Phase 2 / Phase 3 recorded through `$HOME/.claude/scripts/evidence-gate.mjs` (a pass without a substantiating build/test log is treated as unverified and blocks the commit). The secret scanner (`pre-commit-check.sh`) runs on the staged diff as the final pre-commit gate.
|
|
29
29
|
|
|
30
30
|
#### Step 0a - Plan coverage gate (BLOCKING)
|
|
31
31
|
|
|
32
|
-
Phase
|
|
32
|
+
Phase 3 answers whether the diff is correct, not whether everything the plan promised landed: the criteria manifest counts rule IDs, Step 1.45 counts planned tests, and the per-step rollup is rendered in Phase 5, after this commit.
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
# One --analysis per doc: state.analysis.docPath[] is an array (one per platform),
|
|
@@ -43,7 +43,7 @@ node "$HOME/.claude/scripts/plan-coverage-gate.mjs" --state "$STATE_FILE" \
|
|
|
43
43
|
|
|
44
44
|
A step is accounted for when it is `completed`, `skipped` + `skipReason`, or `failed` + `failureReason`; a bare `pending` / `in_progress` is what this catches. Every Section 14 row tagged `Add new` must name a file that exists in the tree, and an empty `docPath[]` leaves that half reporting `skipped`, never `passed`.
|
|
45
45
|
|
|
46
|
-
On exit 1: show the gate's list verbatim, then either return to Phase
|
|
46
|
+
On exit 1: show the gate's list verbatim, then either return to Phase 2 or have the user mark each step deliberately (`plan-todos.sh` writes the reason). Never proceed without that decision. Exit 2 means the plan was missing or empty: modes without Phase 1 skip this step explicitly.
|
|
47
47
|
|
|
48
48
|
#### Step 0 - Multi-Repo Integration Build
|
|
49
49
|
|
|
@@ -57,7 +57,7 @@ Full contract: `$HOME/.claude/multi-agent-refs/multi-repo-integration-build.md`.
|
|
|
57
57
|
4. **No match** → learn-once prompt: `[1] register host / [2] mark combo as noHost / [3] skip this run only`. Persist choice. Run immediately if host registered.
|
|
58
58
|
5. **Autopilot** refuses to prompt on unknown combos - logs a visible skip and proceeds. Teach via a normal-mode run once.
|
|
59
59
|
|
|
60
|
-
Tracker: `phase-tracker.sh sub
|
|
60
|
+
Tracker: `phase-tracker.sh sub 4 0 "Integration build" <status>` - visible in live tracker. Progress line `→ integrating <host-scheme> with <N> submodules`.
|
|
61
61
|
|
|
62
62
|
Why: codegen mismatches (nested vs flat keys, missing entries) only surface when the full dependency chain builds together. Building repos in isolation gives false confidence and produces post-merge fix PRs.
|
|
63
63
|
|
|
@@ -78,7 +78,7 @@ Branch **deterministically**, no implicit fallback. Read `agent-state.json` and
|
|
|
78
78
|
| `instructionDriven` | `instructionFiles.commit` exists on disk | Action |
|
|
79
79
|
| ------------------- | ---------------------------------------- | ----------------------------------- |
|
|
80
80
|
| `true` | **yes** (file readable) | → Instruction-driven path |
|
|
81
|
-
| `true` | **no** (missing / unreadable) | → **Log error, fall back to standard** + set `state.instructionDrivenFallback: true` for Phase
|
|
81
|
+
| `true` | **no** (missing / unreadable) | → **Log error, fall back to standard** + set `state.instructionDrivenFallback: true` for Phase 5 audit. Do NOT silently ignore. |
|
|
82
82
|
| `false` | - | → Standard path |
|
|
83
83
|
|
|
84
84
|
**Instruction-driven path:**
|
|
@@ -86,34 +86,34 @@ Branch **deterministically**, no implicit fallback. Read `agent-state.json` and
|
|
|
86
86
|
1. Ask: "Want to commit?" (skip in autopilot)
|
|
87
87
|
2. Read commit instruction file (e.g. `.instructions/figma/figma-iteration-commit/SKILL.md`)
|
|
88
88
|
3. Follow its flow (build validation, test, submodule commits, push, PR, issue management)
|
|
89
|
-
4. Log: "Phase
|
|
89
|
+
4. Log: "Phase 4: instruction-driven commit - file={instructionFiles.commit}"
|
|
90
90
|
|
|
91
91
|
**Standard path (also used as fallback when instructionDriven=true but file missing):**
|
|
92
92
|
|
|
93
|
-
1. **Local checkout test prompt** (skip in autopilot): If still in worktree AND Phase
|
|
93
|
+
1. **Local checkout test prompt** (skip in autopilot): If still in worktree AND Phase 3 was skipped, ask the user. Per `$HOME/.claude/multi-agent-refs/rules.md` Language Application matrix: `question`, `label` and `description` follow `outputLanguage`; only `header` stays English (<=12-char chip). Render the picker accordingly:
|
|
94
94
|
- `question` (in `outputLanguage`) - semantically: "Run a quick WIP-checkout test before commit?"
|
|
95
95
|
- `header` (English, ≤12 chars): `"WIP checkout"`
|
|
96
96
|
- `options` (label + description both in `outputLanguage`; the semantics below, not these English strings, are what to render):
|
|
97
97
|
- option 1 - semantically "No, continue to commit" marked `(Recommended)`; description: proceed straight to commit + push + PR
|
|
98
98
|
- option 2 - semantically "Yes, WIP checkout"; description: pause so the user can checkout the branch locally and poke around
|
|
99
99
|
- Default: option 1 (by index, not by label - the label is localized)
|
|
100
|
-
- If the user picks option 2 (WIP checkout): follow Phase
|
|
100
|
+
- If the user picks option 2 (WIP checkout): follow Phase 3 Steps 2-6. On `"fix:"` → Phase 2. On `"ok"` → resume Phase 4.
|
|
101
101
|
2. Commit confirm prompt (skip in autopilot). Same language matrix:
|
|
102
102
|
- `question` in `outputLanguage` (semantic: "Commit now?")
|
|
103
103
|
- labels in `outputLanguage`, semantically "Commit" and "Pause and resume later"; branch on the option index, not on the rendered string
|
|
104
104
|
- No → Pause, user can `resume` later. Yes → continue:
|
|
105
|
-
3. If WIP commit exists from Phase
|
|
105
|
+
3. If WIP commit exists from Phase 3 or Step 1: `git reset HEAD~1` to unstage, then re-commit properly
|
|
106
106
|
4. Stage changes: `git add` with specific files (NOT `git add -A` - avoid sensitive files, `.worktrees/`, agent files)
|
|
107
107
|
5. **Multi-submodule check**: If project has submodules (e.g. uicomponents + common):
|
|
108
108
|
- Detect which submodules have changes: `git -C {worktree} diff --name-only | cut -d'/' -f1-3 | sort -u`
|
|
109
109
|
- For EACH submodule with changes: stage, commit, push separately
|
|
110
110
|
- Commit message uses same convention but scope reflects submodule: `{type}({submodule-scope}): {description} [{jiraId}]`
|
|
111
111
|
6. Commit with convention: `{type}({scope}): {description} [{jiraId}]` or `[#{shortId}]`. **Local-only repos** (state field `projects[i].provider == "local"`) carry the same conventional prefix but drop the `[{jiraId}]` suffix - there is no tracker to reference. The taskId (`LOCAL-...`) goes in the commit body footer instead: `Local-Task: {taskId}`.
|
|
112
|
-
7. Push to remote - **skip per-repo when `projects[i].provider == "local"`** (no `git push`, no upstream config). Log `Phase
|
|
112
|
+
7. Push to remote - **skip per-repo when `projects[i].provider == "local"`** (no `git push`, no upstream config). Log `Phase 4: local-only commit {sha} (no push)` for that repo.
|
|
113
113
|
8. Ask: "Want to open a Pull Request?"
|
|
114
|
-
- **Skip the prompt entirely when `state.offlineOnly == true`** (all repos local - no PR target exists). Proceed to Phase
|
|
114
|
+
- **Skip the prompt entirely when `state.offlineOnly == true`** (all repos local - no PR target exists). Proceed to Phase 5 with `pr.status = "skipped-offline"` for each project.
|
|
115
115
|
- In mixed mode (some local, some remote), only prompt for the remote-backed repos; local ones auto-skip.
|
|
116
|
-
- No -> Phase
|
|
116
|
+
- No -> Phase 5
|
|
117
117
|
- Yes -> Create PR with technical description (see below)
|
|
118
118
|
9. **Worktree finalize (gated by `settings.worktreeAutoRemoveOnPr`, default true)**: run **from the project root** - step 3 leaves the shell inside the worktree and the script refuses there.
|
|
119
119
|
|
|
@@ -124,11 +124,11 @@ Branch **deterministically**, no implicit fallback. Read `agent-state.json` and
|
|
|
124
124
|
--task-id "$TASK_ID" --project "$PROJECT" --branch "$BRANCH")
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
The script salvages before removing, keeps the branch, and does **not** check it out - the user's HEAD and uncommitted work stay put. On success it stamps `worktreeRemovedAt`, `artifactsPath` and `worktreePath: null` into the **salvaged** `agent-state.json` itself. Do NOT write those via `write-state.mjs "$STATE_FILE"`: in single-repo mode that path went away with the worktree, so the write fails, the fields land nowhere, and Phase
|
|
127
|
+
The script salvages before removing, keeps the branch, and does **not** check it out - the user's HEAD and uncommitted work stay put. On success it stamps `worktreeRemovedAt`, `artifactsPath` and `worktreePath: null` into the **salvaged** `agent-state.json` itself. Do NOT write those via `write-state.mjs "$STATE_FILE"`: in single-repo mode that path went away with the worktree, so the write fails, the fields land nowhere, and Phase 5 reads a dead path and silently skips the triage ingest. After a removal re-point `STATE_FILE` at `$(jq -r .artifactsPath <<< "$FIN")/agent-state.json`. Exit 3 is a safe skip (uncommitted changes, unpushed or detached HEAD, `--local`, cwd inside the tree, preference off): report and continue. Never `--force`. Contract: [`features/worktree-finalize.md`]($HOME/.claude/multi-agent-refs/features/worktree-finalize.md).
|
|
128
128
|
|
|
129
129
|
10. **Issue body update** (GitHub Issue only): if the issue body has a `### Pull Requests` section and/or a `### Progress` table, fill in the PR URL(s) (one row per submodule - e.g. `- **common:** {url}`, `- **uicomponents:** {url}`) and flip the Implementation / Testing / Code Connect flags from Pending to Done using whatever marker the template uses (match in place, do NOT introduce new markers). Apply with `gh issue edit {issueNo} --body "{updated body}"` and preserve every other section unchanged.
|
|
130
130
|
11. **NEVER close or resolve the issue** - neither GitHub Issue nor Jira. Issues require team review (4 approvals) before closing. Only post a comment with commit/PR URLs.
|
|
131
|
-
12. Log: "Phase
|
|
131
|
+
12. Log: "Phase 4: Commit {sha} - PR #{number}, worktree {removed|kept: <reason>}"
|
|
132
132
|
|
|
133
133
|
#### Step 2.9 - Resolve the evidence host (UI changes only)
|
|
134
134
|
|
|
@@ -151,15 +151,15 @@ git -C "$TMP_EV" push -u origin "$EVB"
|
|
|
151
151
|
|
|
152
152
|
Stills only. On a GitHub-hosted run no video is recorded (Step 3.55), and an mp4 behind a blob link is a download rather than something a reviewer opens. A failed push is not a phase failure: drop to `host: none` with the error as `hostReason`.
|
|
153
153
|
|
|
154
|
-
Log: `Phase
|
|
154
|
+
Log: `Phase 4 Step 2.9: evidence host = {jira|github-public|github-private|none} ({reason})`
|
|
155
155
|
|
|
156
156
|
#### Step 3 - PR Description (technical detail for reviewers)
|
|
157
157
|
|
|
158
|
-
**Section set + markup dialect: `channels/pr.md` - read it first.** Phase
|
|
158
|
+
**Section set + markup dialect: `channels/pr.md` - read it first.** Phase 5 channels replaces this body with that section set, so build to it. Required reading: `payload-contracts.md`.
|
|
159
159
|
|
|
160
160
|
Generate a structured PR description based on task type. The PR body targets **code reviewers** - it should be technical: what changed, why, architecture decisions, how to verify.
|
|
161
161
|
|
|
162
|
-
Two inputs are read from state and the worktree before writing, not recalled from the conversation: `$WORKTREE/.pipeline/scope-check.json` (Phase
|
|
162
|
+
Two inputs are read from state and the worktree before writing, not recalled from the conversation: `$WORKTREE/.pipeline/scope-check.json` (Phase 2 Step 3.7) supplies the `## Technical Explanation` bullets from `files[].reason` and the "Follow-ups not done in this PR" list under `## Related` from `notDone[]`; `state.diffRisk.signals` (Phase 3 Step 1.75) decides whether the conditional `## Risk and Security` section is required. When a high-stakes signal is present and the section is missing, this step blocks until it is written; a placeholder answer ("TBD") counts as missing. `state.visualEvidence.required` blocks the same way: every required artefact is either attached or carries a recorded reason in `gaps[]` - the gate is against silence, not against an honest "no image on the ticket".
|
|
163
163
|
|
|
164
164
|
**required**: Run all generated text (PR body, commit message) through the `humanizer` skill before posting. This removes AI-generated patterns (inflated language, filler phrases, repetitive structure) and makes the output sound like a developer wrote it.
|
|
165
165
|
|
|
@@ -254,7 +254,7 @@ Active when `state.projects[].length > 1`. The single-repo flow above is preserv
|
|
|
254
254
|
|
|
255
255
|
##### Per-repo commit (shared message, per-repo scope)
|
|
256
256
|
|
|
257
|
-
For each repo in `state.projects[]` (sequentially, in dependency order from Phase
|
|
257
|
+
For each repo in `state.projects[]` (sequentially, in dependency order from Phase 1):
|
|
258
258
|
|
|
259
259
|
1. `cd "$WT_PATH"` - switch into the repo's worktree.
|
|
260
260
|
2. Build the commit message using the **shared subject** + **per-repo scope** rule:
|
|
@@ -291,10 +291,10 @@ For each repo (sequentially), per push attempt:
|
|
|
291
291
|
[1] Resolve conflict manually in $WT_PATH, then resume #{taskId}
|
|
292
292
|
[2] Switch to a different base branch (re-prompt baseBranch, restart push loop)
|
|
293
293
|
[3] Skip this repo - leave commit local, mark state.projects[i].pushStatus = "skipped"
|
|
294
|
-
[4] Pause Phase
|
|
294
|
+
[4] Pause Phase 4, exit cleanly
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
-
Persist `state.projects[i].pushStatus` ∈ `"pushed" | "rebase-pushed" | "skipped" | "paused"`. A `"skipped"` repo must be reported in Phase
|
|
297
|
+
Persist `state.projects[i].pushStatus` ∈ `"pushed" | "rebase-pushed" | "skipped" | "paused"`. A `"skipped"` repo must be reported in Phase 5 with explicit "manual push required" note.
|
|
298
298
|
|
|
299
299
|
The legacy single-repo path uses the same loop with `state.projects[].length === 0`; semantics unchanged.
|
|
300
300
|
|
|
@@ -361,7 +361,7 @@ done
|
|
|
361
361
|
$HOME/.claude/scripts/log-metric.sh "$TASK_ID" 6 multi_repo.completed repos=$REPOS skipped=$SKIPPED
|
|
362
362
|
```
|
|
363
363
|
|
|
364
|
-
**Token forwarding:** the commit-message and PR-body generators run on a model. Forward those calls into the tracker so Phase
|
|
364
|
+
**Token forwarding:** the commit-message and PR-body generators run on a model. Forward those calls into the tracker so Phase 5's Cost Breakdown captures Phase 4:
|
|
365
365
|
|
|
366
366
|
```bash
|
|
367
367
|
LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 6 commit.message_generated \
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
### Phase
|
|
1
|
+
### Phase 5: Report
|
|
2
2
|
|
|
3
3
|
> **TLDR** - Close the loop in two halves: **External delivery** delegated to `/multi-agent:channels` (multi-select kanal + content - always pauses in autopilot, 30-min timeout ends session). **Internal capture** stays inline: `agent-log.md` finalization, telemetry emission, knowledge base + memory update. Channels command is the single source of truth for Jira/Confluence/Wiki/PR-description delivery - full contract in `commands/multi-agent/channels/SKILL.md`.
|
|
4
4
|
|
|
@@ -7,32 +7,32 @@ Progress emission per `$HOME/.claude/multi-agent-refs/progress-contract.md` -
|
|
|
7
7
|
|
|
8
8
|
## Sub-step Tracking (required)
|
|
9
9
|
|
|
10
|
-
Phase
|
|
10
|
+
Phase 5 has **3 ordered sub-steps** (reduced from 5 in v5.7 - external delivery consolidated under channels). Register all of them in the tracker at Phase 5 entry.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
bash ~/.claude/scripts/phase-tracker.sh update
|
|
13
|
+
bash ~/.claude/scripts/phase-tracker.sh update 5 in_progress
|
|
14
14
|
for s in 1:Channels-Dispatch 2:Log+Telemetry 3:Knowledge+Memory; do
|
|
15
|
-
bash ~/.claude/scripts/phase-tracker.sh sub
|
|
15
|
+
bash ~/.claude/scripts/phase-tracker.sh sub 5 "${s%%:*}" "${s#*:}" pending
|
|
16
16
|
done
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
On entry: `phase-tracker.sh sub
|
|
19
|
+
On entry: `phase-tracker.sh sub 5 <N> "<name>" in_progress`. On exit: `completed` / `failed` / `skipped` / `timeout`.
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
## Autopilot pause contract
|
|
24
24
|
|
|
25
|
-
Phase
|
|
25
|
+
Phase 5 is the single exception to the autopilot zero-interaction rule: every mode, Full or Short, attended or autopilot, pauses at the channels multi-select menu. Full contract in `$HOME/.claude/multi-agent-refs/phases/modes.md`:
|
|
26
26
|
|
|
27
27
|
- **30-min timeout** - if user does not respond, session ends cleanly. External delivery is aborted (no silent apply of defaults - prevents accidental Jira comments / Confluence pages). Internal capture (Steps 2 + 3 below) STILL runs so `agent-log.md` + knowledge base are persisted.
|
|
28
28
|
- **Resumable** - state written as `{status: "awaiting_input", phase: 7, waitingFor: "user-channels-choice", channelsInput: <state-bundle>}`. User can `/multi-agent:resume <task-id>` any time later; channels menu re-opens with same inputs.
|
|
29
|
-
- **Timeout log line:** `Phase
|
|
29
|
+
- **Timeout log line:** `Phase 5: channels menu timeout (30 min) - session ended, resume with /multi-agent:resume {taskId}`.
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
33
|
## Step 1 - External Delivery (delegated to channels)
|
|
34
34
|
|
|
35
|
-
Phase
|
|
35
|
+
Phase 5 builds a state bundle and invokes `/multi-agent:channels` (Claude Code) or `multi-agent-channels` (Copilot CLI). This is the ONLY external-delivery step - no inline Jira/Confluence/Wiki/PR-description logic lives in Phase 5 any more.
|
|
36
36
|
|
|
37
37
|
> **Local-only short-circuit**: when `state.offlineOnly == true` (all repos
|
|
38
38
|
> are local - see Phase 0), Step 1 is **skipped entirely**. No channels menu,
|
|
@@ -79,7 +79,7 @@ Kanallar: [x] PR [x] Jira [ ] Confluence [ ] Wiki
|
|
|
79
79
|
|
|
80
80
|
Pre-ticks from `prefs.global.reportChannels` + `prefs.global.reportContent`. Greyed-out rules (pipeline context, PR linked, taskType=component, wiki.enabled) per `channels.md` Step 3.
|
|
81
81
|
|
|
82
|
-
**User selects → channels dispatches → returns per-adapter results. Phase
|
|
82
|
+
**User selects → channels dispatches → returns per-adapter results. Phase 5 records outcomes into tracker + summary block.**
|
|
83
83
|
|
|
84
84
|
### Per-adapter outcomes (from channels return)
|
|
85
85
|
|
|
@@ -92,7 +92,7 @@ Pre-ticks from `prefs.global.reportChannels` + `prefs.global.reportContent`. Gre
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Tracker: `phase-tracker.sh sub
|
|
95
|
+
Tracker: `phase-tracker.sh sub 5 1 "Channels dispatch" completed` (or `failed` if ALL adapters failed; `skipped` if user declined all).
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
@@ -106,15 +106,15 @@ Two paired actions, in order:
|
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
108
|
# 1. Post the canonical comment (template per refs/channels/issue-comment.md).
|
|
109
|
-
bash ~/.claude/scripts/phase-tracker.sh sub
|
|
109
|
+
bash ~/.claude/scripts/phase-tracker.sh sub 5 1.5 "Issue comment" in_progress
|
|
110
110
|
gh issue comment "$ISSUE_NUMBER" --repo "$ORG/$REPO" --body-file /tmp/channels-${TASK_ID}-issue.md
|
|
111
|
-
bash ~/.claude/scripts/phase-tracker.sh sub
|
|
111
|
+
bash ~/.claude/scripts/phase-tracker.sh sub 5 1.5 "Issue comment" completed
|
|
112
112
|
|
|
113
113
|
# 2. Sync the Progress flag table from agent-state.json. Idempotent - the
|
|
114
114
|
# script no-ops if the body already matches.
|
|
115
|
-
bash ~/.claude/scripts/phase-tracker.sh sub
|
|
115
|
+
bash ~/.claude/scripts/phase-tracker.sh sub 5 1.6 "Progress flag sync" in_progress
|
|
116
116
|
bash ~/.claude/scripts/update-issue-progress.sh "$TASK_ID"
|
|
117
|
-
bash ~/.claude/scripts/phase-tracker.sh sub
|
|
117
|
+
bash ~/.claude/scripts/phase-tracker.sh sub 5 1.6 "Progress flag sync" completed
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
Order matters: comment first (timestamp marks the run), flags second (one logical body diff). If the comment fails, do NOT update flags - the channel is incomplete and the user needs to retry.
|
|
@@ -128,7 +128,7 @@ The Progress flag values come from `state.flags`:
|
|
|
128
128
|
| `codeConnect` | Code Connect |
|
|
129
129
|
| `wiki` | Wiki |
|
|
130
130
|
|
|
131
|
-
Each value renders as `done` (`true`), `partial` (`"yellow"`), or `pending` (`false`/missing). Phase
|
|
131
|
+
Each value renders as `done` (`true`), `partial` (`"yellow"`), or `pending` (`false`/missing). Phase 2 / 5 / 6 are responsible for setting these honestly - Phase 5 only mirrors what's already in state.
|
|
132
132
|
|
|
133
133
|
**Hard rule (per `$HOME/.claude/multi-agent-refs/channels/issue-comment.md`):** never run only one of the two actions. The comment is the human-readable audit; flags are the machine-readable status. Either both or neither.
|
|
134
134
|
|
|
@@ -148,7 +148,7 @@ Write `agent-log.md` with ALL sections:
|
|
|
148
148
|
|
|
149
149
|
Rendered via `$HOME/.claude/lib/plan-todos.sh list "$TASK_ID"`. Inline the resulting markdown checklist verbatim - one line per todo with status marker ([x] / [~] / [/] / [!]), ID, task text, and notes when present. Status summary one-liner ("4/6 done, 1 skipped, 1 failed") goes at the top from `plan-todos.sh status`.
|
|
150
150
|
|
|
151
|
-
Skipped sections: when `planTodos.enabled` is false or no `plan.todos[]` was emitted, the Plan Todo block is omitted (no empty header). Phase
|
|
151
|
+
Skipped sections: when `planTodos.enabled` is false or no `plan.todos[]` was emitted, the Plan Todo block is omitted (no empty header). Phase 2 task-by-task progress still appears in the Timeline section either way.
|
|
152
152
|
|
|
153
153
|
## Timeline
|
|
154
154
|
|
|
@@ -165,7 +165,7 @@ Skipped sections: when `planTodos.enabled` is false or no `plan.todos[]` was emi
|
|
|
165
165
|
| Iteration | Blocking | Important | Suggestion | Decision | Still present | Resolved | New |
|
|
166
166
|
| --------- | -------- | --------- | ---------- | -------- | ------------- | -------- | --- |
|
|
167
167
|
|
|
168
|
-
(the last three columns come from `reviewIterations[i].delta.counts` (Phase
|
|
168
|
+
(the last three columns come from `reviewIterations[i].delta.counts` (Phase 3 Step 3.8) and read `-` on iteration 1 and on runs that predate the delta; a tripped circuit-breaker is one extra line under the table: `Circuit-breaker tripped: trigger {n}, {detail}`)
|
|
169
169
|
|
|
170
170
|
## Files Changed
|
|
171
171
|
|
|
@@ -224,12 +224,12 @@ This is independent of the channels-side `reportContent.costSummary` (which gate
|
|
|
224
224
|
bash $HOME/.claude/scripts/capture-flush.sh --state "$STATE_FILE"
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
Every phase boundary already made this call (`operations.md`), so by Phase
|
|
227
|
+
Every phase boundary already made this call (`operations.md`), so by Phase 5 it usually writes 0 rows - and that is the point. These writes used to live ONLY here, in the phase a run is least likely to reach: a run killed in Phase 2 lost every finding it had established. Phase 5 is now the last flush, not the only one.
|
|
228
228
|
|
|
229
229
|
What it does, so this doc stays inspectable:
|
|
230
230
|
|
|
231
|
-
- **Triage ingest** (`triage-memory.mjs ingest`). accepted/deferred/rejected rows into the per-repo corpus, so Phase 1 enrichment and Phase
|
|
232
|
-
- **Ledger distill** (`learnings-ledger.mjs from-triage`). Rejected findings become durable `rejected-preference` entries so reviewers stop re-raising them. Idempotent. Safety: blocking-severity rejections are NOT distilled - a wrong rejection must never permanently suppress that class; `learnings-ledger.mjs forget` clears a stale one. JSONL beside the corpus; its brief replays into Phase 1 and Phase
|
|
231
|
+
- **Triage ingest** (`triage-memory.mjs ingest`). accepted/deferred/rejected rows into the per-repo corpus, so Phase 1 enrichment and Phase 3 prior-art recall them later. Idempotent. Reads the salvaged copy under `artifactsPath` FIRST: Phase 4 removes the worktree, and a worktree-first reader degrades silently for exactly the runs worth rescuing. JSONL at `~/.claude/memory/multi-agent/<repo-slug>/triage-corpus.jsonl`, per-repo, never cross-leaking. Off when `prefs.global.priorArtEnrichment.ingestOnComplete = false`.
|
|
232
|
+
- **Ledger distill** (`learnings-ledger.mjs from-triage`). Rejected findings become durable `rejected-preference` entries so reviewers stop re-raising them. Idempotent. Safety: blocking-severity rejections are NOT distilled - a wrong rejection must never permanently suppress that class; `learnings-ledger.mjs forget` clears a stale one. JSONL beside the corpus; its brief replays into Phase 1 and Phase 3. On by default via `prefs.global.learningsLedger.enabled`.
|
|
233
233
|
|
|
234
234
|
No model runs in the flush - it derives everything from `triage-output.json` plus `agent-state.json`, which is what lets a hook call it. The model-dependent parts of this phase (Step 3 knowledge capture, memory synthesis) stay here, because a hook cannot think.
|
|
235
235
|
|
|
@@ -257,7 +257,7 @@ Commit: abc1234 | PR: #87
|
|
|
257
257
|
Full report: $HOME/.claude/logs/multi-agent/{project}/{task-id}/agent-log.md
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
Tracker: `phase-tracker.sh sub
|
|
260
|
+
Tracker: `phase-tracker.sh sub 5 2 "Log+Telemetry" completed`.
|
|
261
261
|
|
|
262
262
|
## Step 3 - Knowledge Capture (incremental learning)
|
|
263
263
|
|
|
@@ -266,9 +266,9 @@ Extract reusable knowledge from this task and **append** to `$HOME/.claude/knowl
|
|
|
266
266
|
| File | What to Add | Source |
|
|
267
267
|
| ----------------- | ----------------------------------------------- | --------------------------------- |
|
|
268
268
|
| `architecture.md` | Newly discovered modules, relationships, deps | Phase 1 Explore |
|
|
269
|
-
| `patterns.md` | Conventions, naming, recurring structures | Phase 1 + Phase
|
|
270
|
-
| `gotchas.md` | Build errors/solutions, edge cases, workarounds | Phase
|
|
271
|
-
| `decisions.md` | Architectural decisions + rationale | Phase
|
|
269
|
+
| `patterns.md` | Conventions, naming, recurring structures | Phase 1 + Phase 3 |
|
|
270
|
+
| `gotchas.md` | Build errors/solutions, edge cases, workarounds | Phase 2 retries, Phase 3 blocking |
|
|
271
|
+
| `decisions.md` | Architectural decisions + rationale | Phase 1 plan + Phase 3 |
|
|
272
272
|
|
|
273
273
|
**Rules:** Only save reusable knowledge (task-specific details stay in agent-log). Read existing files before appending - no duplicates. Add date: `<!-- captured: {date}, task: {jiraId} -->`. Conflicting info → update old entry, don't delete.
|
|
274
274
|
|
|
@@ -286,7 +286,7 @@ Extract reusable knowledge from this task and **append** to `$HOME/.claude/knowl
|
|
|
286
286
|
|
|
287
287
|
**Code graph refresh:** when `prefs.global.codeGraph.enabled` and `prefs.global.codeGraph.autoRefresh` are both true, rebuild the graph and re-render `GRAPH_REPORT.md` - the branch just changed the code the Phase 1 graph described. Costs no API tokens, never fails the run. Commands: `$HOME/.claude/multi-agent-refs/features/code-graph.md`.
|
|
288
288
|
|
|
289
|
-
**Save preferences**: Update prefs with Phase
|
|
289
|
+
**Save preferences**: Update prefs with Phase 5 selections (via channels return: `reportChannels`, `reportContent`, `confluenceUrls` per-project LRU).
|
|
290
290
|
|
|
291
291
|
**Per-repo memory synthesis (opt-in via `prefs.global.perRepoMemory`):**
|
|
292
292
|
|
|
@@ -310,9 +310,9 @@ done
|
|
|
310
310
|
|
|
311
311
|
Zero new memories is normal and expected. A typical run produces one or none.
|
|
312
312
|
|
|
313
|
-
Tracker: `phase-tracker.sh sub
|
|
313
|
+
Tracker: `phase-tracker.sh sub 5 3 "Knowledge+Memory" completed`.
|
|
314
314
|
|
|
315
|
-
Log: "Phase
|
|
315
|
+
Log: "Phase 5: Knowledge captured ({N} entries to {files})"
|
|
316
316
|
|
|
317
317
|
---
|
|
318
318
|
|
|
@@ -321,7 +321,7 @@ Log: "Phase 7: Knowledge captured ({N} entries to {files})"
|
|
|
321
321
|
If user does not respond at the channels multi-select menu within 30 minutes (wall clock from menu render):
|
|
322
322
|
|
|
323
323
|
1. Channels command aborts its interactive prompt, returns `{status: "timeout"}`.
|
|
324
|
-
2. Phase
|
|
324
|
+
2. Phase 5 records `phase-tracker.sh sub 5 1 "Channels dispatch" timeout`.
|
|
325
325
|
3. **Internal capture still runs** - Steps 2 + 3 write `agent-log.md` (with `channels: timeout` in summary), emit telemetry, update knowledge base.
|
|
326
326
|
4. Session exits cleanly. State persisted: `state.currentPhase=7, state.waitingFor="user-channels-choice", state.channelsTimeout=true`.
|
|
327
327
|
5. Resume contract: `/multi-agent:resume <task-id>` re-opens the channels menu with the original state bundle (pipeline log, PR metadata, prefs pre-ticks).
|
|
@@ -332,7 +332,7 @@ Rationale: silently posting defaults to Jira / Confluence after a timeout would
|
|
|
332
332
|
|
|
333
333
|
#### Output Quality + Metrics Section
|
|
334
334
|
|
|
335
|
-
Append to every Phase
|
|
335
|
+
Append to every Phase 5 report (knowledge-capture pass) a **Quality & Metrics** block built from `metrics.jsonl` and the latest task's artifacts:
|
|
336
336
|
|
|
337
337
|
```
|
|
338
338
|
## Quality & Metrics
|
|
@@ -18,20 +18,18 @@
|
|
|
18
18
|
| Modes (depth picker, autopilot, --local) | `$HOME/.claude/multi-agent-refs/phases/modes.md` |
|
|
19
19
|
| Operations (kill, purge, resume) | `$HOME/.claude/multi-agent-refs/phases/operations.md` |
|
|
20
20
|
| Phase 0: Init | `$HOME/.claude/multi-agent-refs/phases/phase-0-init.md` |
|
|
21
|
-
| Phase 1:
|
|
22
|
-
| Phase 2:
|
|
23
|
-
| Phase 3:
|
|
24
|
-
| Phase 4:
|
|
25
|
-
| Phase 5:
|
|
26
|
-
| Phase 6: Commit & PR | `$HOME/.claude/multi-agent-refs/phases/phase-6-commit.md` |
|
|
27
|
-
| Phase 7: Report | `$HOME/.claude/multi-agent-refs/phases/phase-7-report.md` |
|
|
21
|
+
| Phase 1: Plan | `$HOME/.claude/multi-agent-refs/phases/phase-1-plan.md` |
|
|
22
|
+
| Phase 2: Dev | `$HOME/.claude/multi-agent-refs/phases/phase-2-dev.md` |
|
|
23
|
+
| Phase 3: Review | `$HOME/.claude/multi-agent-refs/phases/phase-3-review.md` |
|
|
24
|
+
| Phase 4: Commit & PR | `$HOME/.claude/multi-agent-refs/phases/phase-4-commit.md` |
|
|
25
|
+
| Phase 5: Report | `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md` |
|
|
28
26
|
| Log format | `$HOME/.claude/multi-agent-refs/phases/log-format.md` |
|
|
29
27
|
|
|
30
28
|
## Pipeline Flow
|
|
31
29
|
|
|
32
30
|
```
|
|
33
|
-
Full: 0-Init -> 1-
|
|
34
|
-
Short: 0-Init -> (1
|
|
31
|
+
Full: 0-Init -> 1-Plan -> 2-Dev -> 3-Review -> 4-Commit -> 5-Report
|
|
32
|
+
Short: 0-Init -> (1 skipped) -> 2-Dev -> 3-Review -> 4-Commit -> 5-Report
|
|
35
33
|
--local: Either of the above with no worktree - works directly on a local branch
|
|
36
34
|
|
|
37
35
|
Full or Short is the Phase 0 Step 7.5 question, not a command name. Autopilot never asks and always runs Full.
|
|
@@ -94,7 +92,7 @@ Phase 0 MUST initialize the tracker and register the active mode's phase set:
|
|
|
94
92
|
|
|
95
93
|
```bash
|
|
96
94
|
$HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
|
|
97
|
-
for p in 0:Init 1:
|
|
95
|
+
for p in 0:Init 1:Plan 2:Dev 3:Review 4:Commit 5:Report; do
|
|
98
96
|
$HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
|
|
99
97
|
done
|
|
100
98
|
```
|
|
@@ -125,7 +123,7 @@ After every LLM call (counts are additive; skipping this is why runs end with du
|
|
|
125
123
|
$HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
|
|
126
124
|
```
|
|
127
125
|
|
|
128
|
-
For sub-phase progress (e.g. Phase 1's parallel Explore agents, Phase
|
|
126
|
+
For sub-phase progress (e.g. Phase 1's parallel Explore agents, Phase 3's reviewer dispatch + triage + validator gate, Phase 4's commit + push + PR sub-steps):
|
|
129
127
|
|
|
130
128
|
```bash
|
|
131
129
|
$HOME/.claude/scripts/phase-tracker.sh sub <N> 1 "<sub name>" pending # register
|
|
@@ -149,7 +147,7 @@ Banner status enum on `end`: `done` | `failed` | `skipped`. Anything else exits
|
|
|
149
147
|
|
|
150
148
|
### TaskCreate registration (Claude Code - required)
|
|
151
149
|
|
|
152
|
-
In Claude Code the agent MUST register one TaskCreate tile per phase at Phase 0 startup (one per phase the current COMMAND runs - `/multi-agent` = 0..
|
|
150
|
+
In Claude Code the agent MUST register one TaskCreate tile per phase at Phase 0 startup (one per phase the current COMMAND runs - `/multi-agent` = 0..5, `:local` and the autopilot entries = 0..5, `:analysis` = 0/1/3/4/5). Capture the returned `taskId`, persist it via `phase-tracker.sh meta <N> tasklist_id "<taskId>"` so `:resume` can rebuild the widget.
|
|
153
151
|
|
|
154
152
|
Per phase boundary:
|
|
155
153
|
|
|
@@ -167,9 +165,9 @@ TaskUpdate({ taskId: <saved>, status: "completed" })
|
|
|
167
165
|
bash phase-tracker.sh update <N> completed
|
|
168
166
|
```
|
|
169
167
|
|
|
170
|
-
A phase outside the command's set gets no TaskCreate at all. Depth is different: it is not known at registration time, because the tracker boots at Step -1 and the depth question runs at Step 7.5. So registration splits - Phase 0 alone at Step -1, the rest at Step 7.5 once the answer says which phases the run has. A Short run never draws
|
|
168
|
+
A phase outside the command's set gets no TaskCreate at all. Depth is different: it is not known at registration time, because the tracker boots at Step -1 and the depth question runs at Step 7.5. So registration splits - Phase 0 alone at Step -1, the rest at Step 7.5 once the answer says which phases the run has. A Short run never draws a Plan tile it will not use. Registering every phase and flipping the skipped one to `skipped` is what this replaced, in v17.5.0: it put a full-width widget on screen beside the question asking whether to run part of it - see the ordering rule below.
|
|
171
169
|
|
|
172
|
-
**(strict) TaskCreate ordering**: All TaskCreate calls MUST fire in strict phase-number order BEFORE any TaskUpdate is applied. The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks (e.g. `1 ✓ ·
|
|
170
|
+
**(strict) TaskCreate ordering**: All TaskCreate calls MUST fire in strict phase-number order BEFORE any TaskUpdate is applied. The native widget renders by creation order, not by phase number - out-of-order calls produce visually scrambled tile stacks (e.g. `1 ✓ · 3 ✓ · 4 ✓ · 0 ▶ · 2 ☐`) even when the underlying state is correct. Pre-marking phases as completed/skipped before Phase 0 starts is FORBIDDEN - register the tile in order with default `pending` status, then flip status via TaskUpdate when the phase actually short-circuits. Full contract in `$HOME/.claude/multi-agent-refs/tracker-contract.md` section "TaskCreate ordering (strict)".
|
|
173
171
|
|
|
174
172
|
**Copilot CLI / plain shell**: do NOT call TaskCreate - the tool does not exist on these CLIs. Instead, after every state update, call `bash phase-tracker.sh render` so the bordered ANSI card prints as the last tool result. That's the equivalent visual signal there.
|
|
175
173
|
|
|
@@ -197,55 +195,53 @@ For operations (status, kill, resume, purge): read operations.md.
|
|
|
197
195
|
|
|
198
196
|
Each phase doc is lazy-loaded - only the current phase's spec is in context. Budget enforced by `smoke-token-budget.sh`.
|
|
199
197
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
| 0: Init | phase-0-init.md | 4,000 | 3,500 |
|
|
203
|
-
| 1: Analysis | phase-1-analysis.md | 1,500 | 1,200 |
|
|
204
|
-
| 2: Planning | phase-2-planning.md | 1,000 | 800 |
|
|
205
|
-
| 3: Dev | phase-3-dev.md | 1,800 | 1,500 |
|
|
206
|
-
| 4: Review | phase-4-review.md | 2,200 | 1,800 |
|
|
207
|
-
| 5: Test | phase-5-test.md | 800 | 600 |
|
|
208
|
-
| 6: Commit | phase-6-commit.md | 2,800 | 2,400 |
|
|
209
|
-
| 7: Report | phase-7-report.md | 3,200 | 2,700 |
|
|
210
|
-
| **Total** | | **17,000** | |
|
|
198
|
+
The live ceilings are in the repo's `schemas/token-budget.json`, derived from
|
|
199
|
+
its `schemas/phases.json`. **They are deliberately not repeated here.**
|
|
211
200
|
|
|
212
|
-
|
|
201
|
+
A table of the same numbers stood in this spot for most of the project's life and
|
|
202
|
+
said the total was 17,000 tokens. The file the gate actually reads said 63,150.
|
|
203
|
+
Nothing compared the two, so the copy drifted by a factor of four and stayed
|
|
204
|
+
wrong through every release. A second copy of an enforced number is not
|
|
205
|
+
documentation; it is a claim with no gate behind it.
|
|
206
|
+
|
|
207
|
+
Token estimate: `ceil(chars / 4)`. The budget covers `phase-*.md` files only.
|
|
208
|
+
Guides, rules, and agents are loaded separately on demand. The repo's
|
|
209
|
+
token-budget gate prints each doc's measurement next to its ceiling, which a
|
|
210
|
+
table here could never do - that is where to look for a current number.
|
|
213
211
|
|
|
214
212
|
**Prompt caching (token learning-curve):** assemble each phase prompt as a stable, cacheable prefix (phase instructions + repo learnings brief + conventions + repo evidence) followed by the volatile task suffix, so repeated runs on a known repo pay cache-read price on the prefix. Full contract: `$HOME/.claude/multi-agent-refs/prompt-assembly.md`. The effect (rising cache ratio, falling tokens/task) is what `learning-curve.mjs` trends.
|
|
215
213
|
|
|
216
214
|
## SubPhase Convention
|
|
217
215
|
|
|
218
|
-
When a specialized skill takes over a main pipeline phase, progress is reported as **SubPhases** nested under the parent. Top-level stays
|
|
216
|
+
When a specialized skill takes over a main pipeline phase, progress is reported as **SubPhases** nested under the parent. Top-level stays 6 phases (0-5); specialized flows get sub-phase detail.
|
|
219
217
|
|
|
220
218
|
**Visual example:**
|
|
221
219
|
|
|
222
220
|
```
|
|
223
221
|
■ Phase 0: Init completed
|
|
224
|
-
■ Phase 1:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
■ SubPhase
|
|
228
|
-
■ SubPhase
|
|
229
|
-
■ SubPhase
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
□ SubPhase
|
|
233
|
-
□ SubPhase
|
|
234
|
-
|
|
235
|
-
□ Phase 4:
|
|
236
|
-
□ Phase 5:
|
|
237
|
-
□
|
|
238
|
-
□
|
|
239
|
-
□ SubPhase
|
|
240
|
-
□ SubPhase
|
|
241
|
-
□ SubPhase
|
|
242
|
-
□ SubPhase 7.4: Report + log pending
|
|
243
|
-
□ SubPhase 7.5: Knowledge capture pending
|
|
222
|
+
■ Phase 1: Plan completed
|
|
223
|
+
* Phase 2: Dev (figma) in progress
|
|
224
|
+
■ SubPhase 2.0: Init completed
|
|
225
|
+
■ SubPhase 2.1: Gather completed
|
|
226
|
+
■ SubPhase 2.4A: Configuration completed
|
|
227
|
+
■ SubPhase 2.4B: View completed
|
|
228
|
+
* SubPhase 2.4F: Wiki writing wiki pages...
|
|
229
|
+
□ SubPhase 2.5A: ViewInspector pending
|
|
230
|
+
□ SubPhase 2.6: Code Connect pending
|
|
231
|
+
□ SubPhase 2.7: Issue Update pending
|
|
232
|
+
□ Phase 3: Review pending
|
|
233
|
+
□ Phase 4: Commit pending
|
|
234
|
+
□ Phase 5: Report pending
|
|
235
|
+
□ SubPhase 5.1: Jira comment pending
|
|
236
|
+
□ SubPhase 5.2: Wiki + screenshots pending
|
|
237
|
+
□ SubPhase 5.3: Confluence pending
|
|
238
|
+
□ SubPhase 5.4: Report + log pending
|
|
239
|
+
□ SubPhase 5.5: Knowledge capture pending
|
|
244
240
|
```
|
|
245
241
|
|
|
246
242
|
**TaskCreate pattern:** Parent phase + SubPhases linked via `addBlockedBy`. SubPhases block parent from completing.
|
|
247
243
|
|
|
248
244
|
**Why SubPhases, not separate phases:**
|
|
249
245
|
|
|
250
|
-
- Main pipeline stays a fixed
|
|
246
|
+
- Main pipeline stays a fixed 6-phase contract (0-5) regardless of task type. Wiki, Confluence, and Figma screenshots all live as SubPhases under Phase 5 Report - external delivery grouped logically, internal report + knowledge after.
|
|
251
247
|
- Conditional phases are a code smell - they force every reader to learn which phase runs when.
|
|
@@ -160,6 +160,6 @@ asked anything, so the only thing that keeps it accountable is being readable af
|
|
|
160
160
|
|
|
161
161
|
## Deterministic gates note
|
|
162
162
|
|
|
163
|
-
Claude Code's `PreToolUse` exit-2 hooks are the HARD blocking gates. Three ship, none needing run-specific arguments so they are naturally hookable: (1) `pre-commit-check.sh` scans the staged diff on every `git commit` and blocks on a detected secret; (2) `agent-guard.sh` runs on `git commit` + `git push` and blocks AI/assistant attribution in a commit message and force-push to a protected branch (main/master/develop); (3) `check-read-size.sh` runs on `Read` and on the shell commands that read a file whole, and routes an oversized read to a cheap worker (`bulk-read.sh`) instead of the caller's own rung. The first two inspect what a run WRITES; the third inspects what it pays to READ, and it is inert until `bulkRead.mode` is set to `observe` or `enforce`, so merging the block changes nothing until the user opts in. Its `observe` mode blocks nothing and only logs, which is how the baseline is measured before anything is routed. All three are self-contained, fail-open on internal error, and never execute the inspected command. Three capture hooks ship in the same block and block nothing: `SessionEnd` runs `capture-flush.sh --if-stale` (writing a killed run's findings into the per-repo stores, since every durable write used to live in Phase
|
|
163
|
+
Claude Code's `PreToolUse` exit-2 hooks are the HARD blocking gates. Three ship, none needing run-specific arguments so they are naturally hookable: (1) `pre-commit-check.sh` scans the staged diff on every `git commit` and blocks on a detected secret; (2) `agent-guard.sh` runs on `git commit` + `git push` and blocks AI/assistant attribution in a commit message and force-push to a protected branch (main/master/develop); (3) `check-read-size.sh` runs on `Read` and on the shell commands that read a file whole, and routes an oversized read to a cheap worker (`bulk-read.sh`) instead of the caller's own rung. The first two inspect what a run WRITES; the third inspects what it pays to READ, and it is inert until `bulkRead.mode` is set to `observe` or `enforce`, so merging the block changes nothing until the user opts in. Its `observe` mode blocks nothing and only logs, which is how the baseline is measured before anything is routed. All three are self-contained, fail-open on internal error, and never execute the inspected command. Three capture hooks ship in the same block and block nothing: `SessionEnd` runs `capture-flush.sh --if-stale` (writing a killed run's findings into the per-repo stores, since every durable write used to live in Phase 5 - the phase a run is least likely to reach) plus `note-session.sh` (the mechanical shape of a non-pipeline session: tools used, commands that failed, calls the user refused - never an argument, never any output), `PreCompact` runs `capture-flush.sh` without `--if-stale` (a compaction summarizes a long phase mid-flight, so it is the moment unflushed findings are at risk; the staleness test exists only so a session exit does not re-flush a finished run, and both store writes are idempotent), and `SessionStart` runs `capture-resume.sh`, at most two lines about an unfinished run and a stale observation queue. None of them calls a model; all exit 0 on every path. The recommended hook block ships at `install/templates/claude-hooks.json`; `multi-agent:setup` offers to merge it into `~/.claude/settings.json`. The other deterministic gates (evidence, consensus, intent, learnings) are invoked by the pipeline phases with per-run arguments (a build-log path, the triage JSON, the free-text input), so they are phase-enforced by contract, not OS-hookable.
|
|
164
164
|
|
|
165
165
|
Copilot CLI has no `PreToolUse` equivalent, so the secret scan there is workflow-enforced (run as a phase step, not OS-blocked) plus a CI smoke-gate step.
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
> **TLDR** - Every non-trivial pipeline action emits an inline "I'm doing X right now" line so the user always knows what's happening. Immediate flush, no batching. One line per action, standard shape. Autopilot prefers verbose. Low overhead. Mirrored in telemetry as `progress.step` events.
|
|
14
14
|
|
|
15
|
-
This contract is consumed by every phase (0-
|
|
15
|
+
This contract is consumed by every phase (0-5) and every dispatched sub-skill (including the marketplace component toolkits when enabled). It is enforced by `smoke-progress-contract.sh` - any phase doc that drops the contract marker or diverges from the line shape fails CI.
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
## Why
|
|
20
20
|
|
|
21
|
-
Today pipeline users see a phase banner (`→ Phase
|
|
21
|
+
Today pipeline users see a phase banner (`→ Phase 2: Dev`) and then silence for 30 s-3 min while subagents churn. Users lose trust, hit ⌃C, or retry identical work. A single-line "current action" fixes it without adding noise: you see exactly what is happening, where, and for how long.
|
|
22
22
|
|
|
23
23
|
## Line shape
|
|
24
24
|
|
|
@@ -88,10 +88,10 @@ Emit a progress line **at least** at every one of these moments:
|
|
|
88
88
|
### Phase 5 (User Test)
|
|
89
89
|
- local-test prompt render; user-answer capture; if local-test selected: repo checkout, build instructions print.
|
|
90
90
|
|
|
91
|
-
### Phase
|
|
91
|
+
### Phase 4 (Commit & PR)
|
|
92
92
|
- squash per repo, commit per repo, push per repo (each retry attempt), PR body generate (humanizer call), PR create per repo, Jira comment post.
|
|
93
93
|
|
|
94
|
-
### Phase
|
|
94
|
+
### Phase 5 (Report)
|
|
95
95
|
- humanizer summary, wiki write (if enabled), Jira comment post (if enabled), Confluence publish (if enabled), metrics rollup, summary render.
|
|
96
96
|
|
|
97
97
|
### Sync / Setup / Utility commands
|
|
@@ -122,7 +122,7 @@ Every emitted progress line also writes one `metrics.jsonl` event:
|
|
|
122
122
|
"ts": "2026-04-16T17:22:04Z",
|
|
123
123
|
"event": "progress.step",
|
|
124
124
|
"taskId": "T-0042",
|
|
125
|
-
"phase": "phase-
|
|
125
|
+
"phase": "phase-2-dev",
|
|
126
126
|
"step": "run-test RED",
|
|
127
127
|
"ms": 2318,
|
|
128
128
|
"ok": true
|
|
@@ -145,7 +145,7 @@ LOG_METRIC_FORWARD_TO_TRACKER=1 $HOME/.claude/scripts/log-metric.sh "$TASK_ID" <
|
|
|
145
145
|
|
|
146
146
|
`LOG_METRIC_FORWARD_TO_TRACKER=1` mirrors the same `tokens_in` / `tokens_out` / `model` into `phase-tracker.sh` so the JSONL metrics line and the tracker's per-phase accumulator stay in sync from one call site. The forward path is best-effort - if the tracker is missing or its file is unwritable, the JSONL write still succeeds. Without the flag the line is purely analytic and the cost block stays empty for that phase.
|
|
147
147
|
|
|
148
|
-
This contract is enforced by `smoke-agent-log-cost.sh` (forwarder unit test) and `smoke-tracker-contract.sh` (Phase
|
|
148
|
+
This contract is enforced by `smoke-agent-log-cost.sh` (forwarder unit test) and `smoke-tracker-contract.sh` (Phase 3 reviewer/triage emission).
|
|
149
149
|
|
|
150
150
|
### Cost budget gate (v9.2+)
|
|
151
151
|
|
|
@@ -61,7 +61,7 @@ Provider dispatch:
|
|
|
61
61
|
- **Jira** (`review-jira`): convert markdown to wiki markup, then post it with
|
|
62
62
|
`bash "$HOME/.claude/lib/jira-publish.sh" --issue "$KEY" --body-file "$F" --target comment`,
|
|
63
63
|
per `channels/jira.md` - that file owns the Jira posting contract and this is
|
|
64
|
-
the same write path a Phase
|
|
64
|
+
the same write path a Phase 5 report takes.
|
|
65
65
|
That script escapes the body and resolves the token itself; do not build the
|
|
66
66
|
`curl`. A readiness comment quotes the ticket's own text back at it, so it is
|
|
67
67
|
the body most likely to contain a `:)` sequence Jira would render as a smiley.
|