@mmerterden/multi-agent-pipeline 17.6.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 +310 -0
- package/README.md +76 -18
- package/README.tr.md +55 -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/0011-dormant-ci.md +25 -1
- 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/server-readiness.md +188 -0
- package/docs/token-budget-history.md +3 -1
- package/index.js +18 -3
- package/install/_codex-agents.mjs +1 -1
- package/install/_common.mjs +42 -17
- package/install/_dev-only-files.mjs +8 -0
- package/install/_unattended-profile.mjs +113 -0
- package/install/index.mjs +48 -0
- 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 +1065 -0
- package/package.json +6 -3
- 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 +54 -23
- 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/_jira-auth.sh +8 -0
- package/pipeline/lib/analysis-jira-write.sh +32 -0
- package/pipeline/lib/ask-choice.sh +13 -2
- package/pipeline/lib/autopilot-state.sh +8 -0
- package/pipeline/lib/credential-inventory.sh +1 -1
- package/pipeline/lib/fatal.mjs +129 -0
- package/pipeline/lib/fetch-fortify.sh +1 -1
- package/pipeline/lib/figma-mcp-refresh.sh +18 -0
- package/pipeline/lib/figma-screenshot.sh +18 -0
- package/pipeline/lib/invoked-directly.mjs +43 -0
- package/pipeline/lib/jira-publish.sh +42 -0
- package/pipeline/lib/md2confluence-v3.py +47 -0
- package/pipeline/lib/model-rung.sh +142 -0
- package/pipeline/lib/outbound-gate.mjs +175 -0
- package/pipeline/lib/phase-schema.mjs +88 -0
- package/pipeline/lib/plan-todos.sh +32 -11
- package/pipeline/lib/post-pr-review.sh +77 -8
- package/pipeline/lib/repo-hygiene.sh +8 -3
- package/pipeline/lib/require-jq.sh +40 -0
- package/pipeline/lib/route-state.sh +161 -0
- package/pipeline/lib/run-paths.sh +335 -0
- 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 +74 -4
- package/pipeline/multi-agent-refs/features/code-graph.md +5 -5
- package/pipeline/multi-agent-refs/features/cost-analysis.md +93 -0
- 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 +47 -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/verify.md +83 -0
- 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 +21 -10
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +25 -25
- 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/unattended-contract.md +129 -0
- 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 +372 -0
- package/pipeline/scripts/_smoke-root.sh +1 -1
- package/pipeline/scripts/aggregate-metrics.mjs +65 -65
- package/pipeline/scripts/autopilot-arming.mjs +2 -1
- package/pipeline/scripts/autopilot-intake.mjs +2 -1
- package/pipeline/scripts/autopilot-runner.mjs +206 -2
- package/pipeline/scripts/build-references.mjs +2 -1
- package/pipeline/scripts/build-stack-plugins.mjs +10 -2
- package/pipeline/scripts/capture-evidence.sh +7 -2
- package/pipeline/scripts/capture-flush.sh +8 -8
- package/pipeline/scripts/capture-resume.sh +3 -3
- package/pipeline/scripts/classify-plan-safety.mjs +3 -2
- package/pipeline/scripts/cost-analyze.mjs +600 -0
- package/pipeline/scripts/cost-budget-check.mjs +4 -12
- package/pipeline/scripts/council-view.mjs +2 -1
- package/pipeline/scripts/crush-json.mjs +2 -1
- package/pipeline/scripts/diff-explain.mjs +7 -10
- package/pipeline/scripts/diff-risk-score.mjs +2 -1
- package/pipeline/scripts/doctor.mjs +140 -6
- package/pipeline/scripts/evidence-gate.mjs +9 -3
- package/pipeline/scripts/feedback-send.mjs +12 -2
- package/pipeline/scripts/gc-abandoned.sh +32 -16
- package/pipeline/scripts/gc-tmp.sh +1 -1
- package/pipeline/scripts/gc-worktrees.sh +12 -5
- 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/github-ssh-setup.sh +64 -7
- package/pipeline/scripts/graph-mermaid.mjs +4 -2
- package/pipeline/scripts/graph-report.mjs +1 -1
- package/pipeline/scripts/jira-attach.sh +1 -1
- package/pipeline/scripts/keychain-save.sh +101 -30
- package/pipeline/scripts/learn-from-transcripts.mjs +3 -2
- package/pipeline/scripts/learning-curve.mjs +36 -31
- package/pipeline/scripts/log-metric.sh +17 -4
- package/pipeline/scripts/make-manifest.mjs +199 -0
- package/pipeline/scripts/memory-save.sh +1 -1
- package/pipeline/scripts/migrate-prefs.mjs +24 -6
- package/pipeline/scripts/migrate-state.mjs +94 -4
- package/pipeline/scripts/phase-banner.sh +26 -22
- package/pipeline/scripts/phase-tracker.sh +48 -10
- package/pipeline/scripts/plan-coverage-gate.mjs +8 -4
- package/pipeline/scripts/pre-commit-check.sh +7 -0
- package/pipeline/scripts/pre-push-check.sh +7 -0
- package/pipeline/scripts/purge.sh +23 -6
- package/pipeline/scripts/render-agent-log-cost.sh +10 -3
- package/pipeline/scripts/render-cost-summary.sh +9 -2
- package/pipeline/scripts/render-work-summary.sh +14 -7
- package/pipeline/scripts/review-file-filter.mjs +5 -3
- package/pipeline/scripts/review-scope.mjs +2 -1
- package/pipeline/scripts/routine-registry.mjs +2 -1
- package/pipeline/scripts/run-aggregator.mjs +26 -20
- package/pipeline/scripts/run-metrics.mjs +4 -2
- package/pipeline/scripts/runs-index.mjs +353 -0
- package/pipeline/scripts/scorecard-snapshot.mjs +178 -0
- package/pipeline/scripts/search-logs.sh +18 -0
- package/pipeline/scripts/smoke-cross-cli-behavior.sh +6 -6
- package/pipeline/scripts/smoke-schema-validation.sh +26 -7
- package/pipeline/scripts/test-gap-scan.mjs +2 -1
- package/pipeline/scripts/test-integrity-gate.mjs +2 -1
- package/pipeline/scripts/token-budget-report.mjs +13 -2
- package/pipeline/scripts/triage-memory.mjs +2 -2
- package/pipeline/scripts/update-issue-progress.sh +56 -7
- package/pipeline/scripts/usage-report.mjs +12 -1
- package/pipeline/scripts/validate-analysis-doc.mjs +75 -18
- package/pipeline/scripts/validate-code-graph.mjs +6 -3
- package/pipeline/scripts/validate-complaint-doc.mjs +2 -1
- package/pipeline/scripts/validate-diff-risk.mjs +6 -3
- 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-test-gap.mjs +6 -3
- package/pipeline/scripts/validate-triage.mjs +6 -4
- package/pipeline/scripts/verify-citations.mjs +4 -2
- package/pipeline/scripts/verify.mjs +327 -0
- package/pipeline/scripts/worktree-finalize.sh +18 -9
- package/pipeline/scripts/write-state.mjs +154 -15
- package/pipeline/skills/.skill-manifest.json +37 -21
- package/pipeline/skills/.skills-index.json +104 -5
- package/pipeline/skills/shared/README.md +15 -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 +35 -11
- 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/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +4 -1
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +4 -1
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +2 -1
- package/pipeline/skills/skills-index.md +13 -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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* state-2.1.0-to-2.2.0.mjs - agent-state migration
|
|
3
|
+
*
|
|
4
|
+
* v19.0.0 collapsed the eight-phase contract (0..7) into six (0..5). This is
|
|
5
|
+
* the first migration in the repo that rewrites phase NUMBERS, so it is also
|
|
6
|
+
* the first one where two source keys can land on one target key.
|
|
7
|
+
*
|
|
8
|
+
* 0 Init -> 0 Init
|
|
9
|
+
* 1 Analysis -> 1 Plan
|
|
10
|
+
* 2 Planning -> 1 Plan
|
|
11
|
+
* 3 Dev -> 2 Dev
|
|
12
|
+
* 4 Review -> 3 Review
|
|
13
|
+
* 5 Test -> 3 Review
|
|
14
|
+
* 6 Commit -> 4 Commit
|
|
15
|
+
* 7 Report -> 5 Report
|
|
16
|
+
*
|
|
17
|
+
* Collision rule for `phases{}`: the furthest-along status wins, retryCount
|
|
18
|
+
* takes the max, files[] union, startedAt earliest, finishedAt latest. Taking
|
|
19
|
+
* the max of retryCount rather than the sum matters - the schema caps it at 3
|
|
20
|
+
* and a sum of two 2s would emit an invalid state.
|
|
21
|
+
*
|
|
22
|
+
* The migration also repairs three defects the 62-file live corpus carries
|
|
23
|
+
* today, because a run that cannot be validated cannot be resumed either:
|
|
24
|
+
* - `status: "completed"` -> "complete" (never was in the enum)
|
|
25
|
+
* - `status: "awaiting-user-test-main-checkout"` -> "awaiting_input"
|
|
26
|
+
* (the schema's own description spells this substitution out)
|
|
27
|
+
* - missing `currentPhase` / `status` -> explicit defaults, so the file
|
|
28
|
+
* validates instead of failing on absence
|
|
29
|
+
*
|
|
30
|
+
* @param {object} data - parsed agent-state.json
|
|
31
|
+
* @returns {object} - migrated data with schemaVersion "2.2.0"
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const PHASE_MAP = { 0: 0, 1: 1, 2: 1, 3: 2, 4: 3, 5: 3, 6: 4, 7: 5 };
|
|
35
|
+
|
|
36
|
+
// Furthest-along wins. A phase that failed outranks one still pending: the
|
|
37
|
+
// failure is the fact a resume needs, and losing it would make the merged
|
|
38
|
+
// phase look untouched.
|
|
39
|
+
const STATUS_RANK = { pending: 0, skipped: 1, in_progress: 2, failed: 3, done: 4 };
|
|
40
|
+
|
|
41
|
+
const RUN_STATUS_FIX = {
|
|
42
|
+
completed: "complete",
|
|
43
|
+
"awaiting-user-test-main-checkout": "awaiting_input",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function earlier(a, b) {
|
|
47
|
+
if (!a) return b;
|
|
48
|
+
if (!b) return a;
|
|
49
|
+
return a < b ? a : b;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function later(a, b) {
|
|
53
|
+
if (!a) return b;
|
|
54
|
+
if (!b) return a;
|
|
55
|
+
return a > b ? a : b;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function mergePhase(into, from) {
|
|
59
|
+
if (!into) return { ...from };
|
|
60
|
+
const out = { ...into };
|
|
61
|
+
|
|
62
|
+
const rankA = STATUS_RANK[into.status] ?? -1;
|
|
63
|
+
const rankB = STATUS_RANK[from.status] ?? -1;
|
|
64
|
+
if (rankB > rankA) out.status = from.status;
|
|
65
|
+
|
|
66
|
+
if (from.retryCount !== undefined || into.retryCount !== undefined) {
|
|
67
|
+
out.retryCount = Math.max(into.retryCount ?? 0, from.retryCount ?? 0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (Array.isArray(into.files) || Array.isArray(from.files)) {
|
|
71
|
+
out.files = [...new Set([...(into.files ?? []), ...(from.files ?? [])])];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const startedAt = earlier(into.startedAt, from.startedAt);
|
|
75
|
+
if (startedAt) out.startedAt = startedAt;
|
|
76
|
+
const finishedAt = later(into.finishedAt, from.finishedAt);
|
|
77
|
+
if (finishedAt) out.finishedAt = finishedAt;
|
|
78
|
+
|
|
79
|
+
// Notes are prose from two different phases; concatenating keeps both
|
|
80
|
+
// rather than silently picking one.
|
|
81
|
+
if (into.notes && from.notes && into.notes !== from.notes) {
|
|
82
|
+
out.notes = `${into.notes}\n${from.notes}`;
|
|
83
|
+
} else if (from.notes && !into.notes) {
|
|
84
|
+
out.notes = from.notes;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Every remaining key the later source carries and the earlier one does not.
|
|
88
|
+
for (const [k, v] of Object.entries(from)) {
|
|
89
|
+
if (out[k] === undefined) out[k] = v;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default function migrate(data) {
|
|
96
|
+
const out = JSON.parse(JSON.stringify(data));
|
|
97
|
+
|
|
98
|
+
out.schemaVersion = "2.2.0";
|
|
99
|
+
|
|
100
|
+
if (Number.isInteger(out.currentPhase) && PHASE_MAP[out.currentPhase] !== undefined) {
|
|
101
|
+
out.currentPhase = PHASE_MAP[out.currentPhase];
|
|
102
|
+
} else if (!Number.isInteger(out.currentPhase)) {
|
|
103
|
+
// 9 of the 62 live files have no currentPhase at all. Resume keys on this
|
|
104
|
+
// field, so absence is not a neutral state - it is a file resume cannot
|
|
105
|
+
// read. Init is the only phase that is safe to re-enter unconditionally.
|
|
106
|
+
out.currentPhase = 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (out.phases && typeof out.phases === "object" && !Array.isArray(out.phases)) {
|
|
110
|
+
const merged = {};
|
|
111
|
+
// Ascending key order so the later phase merges INTO the earlier one and
|
|
112
|
+
// `notes` concatenate in the order they were written.
|
|
113
|
+
const keys = Object.keys(out.phases).sort((a, b) => Number(a) - Number(b));
|
|
114
|
+
for (const key of keys) {
|
|
115
|
+
const mappedKey = PHASE_MAP[Number(key)];
|
|
116
|
+
if (mappedKey === undefined) continue; // unmappable key is dropped, not guessed
|
|
117
|
+
merged[String(mappedKey)] = mergePhase(merged[String(mappedKey)], out.phases[key]);
|
|
118
|
+
}
|
|
119
|
+
out.phases = merged;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof out.status === "string" && RUN_STATUS_FIX[out.status]) {
|
|
123
|
+
out.status = RUN_STATUS_FIX[out.status];
|
|
124
|
+
} else if (typeof out.status !== "string") {
|
|
125
|
+
out.status = "failed";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/phases.json",
|
|
4
|
+
"description": "The phase contract, in one place. Before this file the phase list existed as eight independent copies - gen-mode-dispatch.mjs, phases.md twice, phase-tracker.sh, render-work-summary.sh, agent-state.schema.json, token-budget.json, docs/architecture.md - and none derived from another, so a renumbering meant eight hand edits and the count in prose was guarded by nothing. smoke-phase-contract.sh reads this file and holds every other copy to it. Adding or merging a phase means editing here; everywhere else either reads this or is checked against it. Ceilings are re-measured after the docs merge (Faz F), not summed from the old ones: smoke-token-budget.sh fails a ceiling more than 25% above the measurement, so summing would ship a stale ceiling by construction.",
|
|
5
|
+
"contractVersion": "2.0.0",
|
|
6
|
+
"phaseSchema": 2,
|
|
7
|
+
"phaseSchemaNote": "The phase vocabulary generation. metrics.jsonl is append-only and v19.0.0 renumbered the phases, so every line written from v19.0.0 on carries this number and a line without the field is generation 1. Aggregators pick their name table from it; without it phase 3 means Dev in old rows and Review in new ones and no reader can tell them apart.",
|
|
8
|
+
"legacyPhaseNames": {
|
|
9
|
+
"note": "Generation 1 phase names, kept so an aggregator can label a historical metrics.jsonl row correctly instead of printing the current name for a number that meant something else. Read-only history: nothing emits these any more. The generation 1 -> 2 number map is not repeated here, it is the `was` array on each phase above.",
|
|
10
|
+
"0": "Init",
|
|
11
|
+
"1": "Analysis",
|
|
12
|
+
"2": "Planning",
|
|
13
|
+
"3": "Dev",
|
|
14
|
+
"4": "Review",
|
|
15
|
+
"5": "Test",
|
|
16
|
+
"6": "Commit",
|
|
17
|
+
"7": "Report"
|
|
18
|
+
},
|
|
19
|
+
"phases": [
|
|
20
|
+
{
|
|
21
|
+
"id": 0,
|
|
22
|
+
"name": "Init",
|
|
23
|
+
"doc": "phase-0-init.md",
|
|
24
|
+
"maxTokens": 13400,
|
|
25
|
+
"was": [0]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": 1,
|
|
29
|
+
"name": "Plan",
|
|
30
|
+
"doc": "phase-1-plan.md",
|
|
31
|
+
"maxTokens": 10000,
|
|
32
|
+
"was": [1, 2]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": 2,
|
|
36
|
+
"name": "Dev",
|
|
37
|
+
"doc": "phase-2-dev.md",
|
|
38
|
+
"maxTokens": 10650,
|
|
39
|
+
"was": [3]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": 3,
|
|
43
|
+
"name": "Review",
|
|
44
|
+
"doc": "phase-3-review.md",
|
|
45
|
+
"maxTokens": 17200,
|
|
46
|
+
"was": [4, 5]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": 4,
|
|
50
|
+
"name": "Commit",
|
|
51
|
+
"doc": "phase-4-commit.md",
|
|
52
|
+
"maxTokens": 6500,
|
|
53
|
+
"was": [6]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": 5,
|
|
57
|
+
"name": "Report",
|
|
58
|
+
"doc": "phase-5-report.md",
|
|
59
|
+
"maxTokens": 5550,
|
|
60
|
+
"was": [7]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"totalMaxTokens": 63300,
|
|
64
|
+
"modes": {
|
|
65
|
+
"full": {
|
|
66
|
+
"phases": [0, 1, 2, 3, 4, 5],
|
|
67
|
+
"local": false,
|
|
68
|
+
"autopilot": false,
|
|
69
|
+
"depth": true
|
|
70
|
+
},
|
|
71
|
+
"autopilot": {
|
|
72
|
+
"phases": [0, 1, 2, 3, 4, 5],
|
|
73
|
+
"local": false,
|
|
74
|
+
"autopilot": true
|
|
75
|
+
},
|
|
76
|
+
"local": {
|
|
77
|
+
"phases": [0, 1, 2, 3, 4, 5],
|
|
78
|
+
"local": true,
|
|
79
|
+
"autopilot": false,
|
|
80
|
+
"depth": true
|
|
81
|
+
},
|
|
82
|
+
"local-autopilot": {
|
|
83
|
+
"phases": [0, 1, 2, 3, 4, 5],
|
|
84
|
+
"local": true,
|
|
85
|
+
"autopilot": true
|
|
86
|
+
},
|
|
87
|
+
"full-local": {
|
|
88
|
+
"phases": [0, 1, 2, 3, 4, 5],
|
|
89
|
+
"local": true,
|
|
90
|
+
"autopilot": false,
|
|
91
|
+
"depth": true
|
|
92
|
+
},
|
|
93
|
+
"analysis": {
|
|
94
|
+
"phases": [0, 1, 3, 4, 5],
|
|
95
|
+
"local": false,
|
|
96
|
+
"autopilot": false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"thresholds": {
|
|
100
|
+
"waitingFromPhase": 4,
|
|
101
|
+
"mcpAllowedThroughPhase": 1,
|
|
102
|
+
"shortRunFromPhase": 2,
|
|
103
|
+
"note": "Phase numbers other code compares against, named here so a renumbering moves them with the contract. waitingFromPhase: runs-index.mjs groups a run as 'waiting on you' from Commit on. mcpAllowedThroughPhase: Figma MCP is reachable only through Plan; smoke-no-mcp-in-dev-phases.sh fails any recorded call at a higher phase. Its literal threshold is unchanged from the eight-phase contract on purpose - Analysis was 1 and is now inside Plan, also 1, so the permitted set {0,1} is identical. shortRunFromPhase: the depth picker's Short set starts here."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://example.com/pipeline/plan-todos.schema.json",
|
|
4
4
|
"title": "Plan Todo List",
|
|
5
|
-
"description": "Structured representation of Phase 2's plan. Persists into agent-state under `.plan.todos[]` and survives across phases. Phase 3 (Dev) iterates step-by-step; Phase 4 (Review) verifies completed steps against criteria; Phase
|
|
5
|
+
"description": "Structured representation of Phase 2's plan. Persists into agent-state under `.plan.todos[]` and survives across phases. Phase 3 (Dev) iterates step-by-step; Phase 4 (Review) verifies completed steps against criteria; Phase 5 (Report) renders a per-step rollup. The plan is broken into a live, structured Todo list for step-by-step tracking across phases.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["title", "todos"],
|
|
9
9
|
"properties": {
|
|
10
10
|
"title": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"description": "One-line plan summary, mirrors the task title. Surfaced in Phase 3 progress lines and Phase
|
|
12
|
+
"description": "One-line plan summary, mirrors the task title. Surfaced in Phase 3 progress lines and Phase 5 report."
|
|
13
13
|
},
|
|
14
14
|
"createdAt": {
|
|
15
15
|
"type": "string",
|
|
16
16
|
"format": "date-time",
|
|
17
|
-
"description": "ISO-8601 timestamp Phase 2 emitted this plan. Used by Phase
|
|
17
|
+
"description": "ISO-8601 timestamp Phase 2 emitted this plan. Used by Phase 5 for elapsed-time math."
|
|
18
18
|
},
|
|
19
19
|
"todos": {
|
|
20
20
|
"type": "array",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"completedAt": { "type": "string", "format": "date-time" },
|
|
50
50
|
"notes": {
|
|
51
51
|
"type": "string",
|
|
52
|
-
"description": "Free-text outcome - commit hash, test count, anything Phase
|
|
52
|
+
"description": "Free-text outcome - commit hash, test count, anything Phase 5 should echo."
|
|
53
53
|
},
|
|
54
54
|
"failureReason": { "type": "string" },
|
|
55
55
|
"skipReason": { "type": "string" },
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"estimatedMinutes": {
|
|
62
62
|
"type": "integer",
|
|
63
63
|
"minimum": 1,
|
|
64
|
-
"description": "Optional Phase 2 estimate for the step. Phase
|
|
64
|
+
"description": "Optional Phase 2 estimate for the step. Phase 5 compares against actual duration."
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/planning-output.schema.json",
|
|
4
4
|
"version": "1.0.0",
|
|
5
|
-
"title": "Multi-Agent Pipeline - Phase
|
|
5
|
+
"title": "Multi-Agent Pipeline - Phase 1 planning output",
|
|
6
6
|
"description": "Contract for Phase 2 task decomposition. Consumed by Phase 3 TDD cycles - each task becomes one red→green→refactor iteration.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|