mindforge-cc 11.9.1 → 11.9.3

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.
Files changed (121) hide show
  1. package/.agent/CLAUDE.md +37 -13
  2. package/.agent/hooks/mindforge-block-no-verify.js +61 -13
  3. package/.agent/hooks/mindforge-config-protection.js +82 -3
  4. package/.agent/hooks/mindforge-context-monitor.js +1 -1
  5. package/.agent/hooks/mindforge-workflow-guard.js +2 -2
  6. package/.agent/hooks/run-with-flags.js +190 -20
  7. package/.agent/mindforge/browse.md +2 -2
  8. package/.agent/mindforge/checkpoint.md +1 -1
  9. package/.agent/mindforge/consult.md +1 -1
  10. package/.agent/mindforge/cost-report.md +1 -1
  11. package/.agent/mindforge/harness-audit.md +1 -1
  12. package/.agent/mindforge/orch-add-feature.md +1 -1
  13. package/.agent/mindforge/orch-build-mvp.md +1 -1
  14. package/.agent/mindforge/orch-change-feature.md +1 -1
  15. package/.agent/mindforge/orch-fix-defect.md +1 -1
  16. package/.agent/mindforge/orch-refine-code.md +1 -1
  17. package/.agent/mindforge/qa.md +2 -2
  18. package/.claude/CLAUDE.md +37 -13
  19. package/.claude/commands/mindforge/browse.md +2 -2
  20. package/.claude/commands/mindforge/checkpoint.md +1 -1
  21. package/.claude/commands/mindforge/consult.md +1 -1
  22. package/.claude/commands/mindforge/cost-report.md +1 -1
  23. package/.claude/commands/mindforge/harness-audit.md +1 -1
  24. package/.claude/commands/mindforge/orch-add-feature.md +1 -1
  25. package/.claude/commands/mindforge/orch-build-mvp.md +1 -1
  26. package/.claude/commands/mindforge/orch-change-feature.md +1 -1
  27. package/.claude/commands/mindforge/orch-fix-defect.md +1 -1
  28. package/.claude/commands/mindforge/orch-refine-code.md +1 -1
  29. package/.claude/commands/mindforge/qa.md +2 -2
  30. package/.mindforge/MINDFORGE-SCHEMA.json +126 -13
  31. package/.mindforge/config.json +4 -4
  32. package/.mindforge/engine/autonomous/headless-adapter.md +2 -2
  33. package/.mindforge/engine/cost-tracking/router.md +1 -1
  34. package/.mindforge/engine/cost-tracking/token-ledger.md +21 -24
  35. package/.mindforge/engine/temporal-protocol.md +2 -2
  36. package/.mindforge/governance/change-classifier.md +20 -4
  37. package/.mindforge/memory/sync-manifest.json +1 -1
  38. package/.mindforge/metrics/METRICS-SCHEMA.md +13 -4
  39. package/.mindforge/personas/cost-optimizer.md +2 -2
  40. package/.mindforge/personas/multi-model-bridge.md +1 -1
  41. package/.mindforge/skills/agent-architecture-audit/SKILL.md +2 -2
  42. package/.mindforge/skills/cost-aware-routing/SKILL.md +3 -3
  43. package/.mindforge/skills/multi-llm-consult/SKILL.md +2 -2
  44. package/.mindforge/skills/orch-pipeline/SKILL.md +4 -4
  45. package/CHANGELOG.md +402 -0
  46. package/MINDFORGE.md +13 -6
  47. package/README.md +51 -2
  48. package/RELEASENOTES.md +55 -2
  49. package/SECURITY.md +22 -3
  50. package/bin/autonomous/audit-writer.js +48 -33
  51. package/bin/autonomous/auto-runner.js +65 -2
  52. package/bin/change-classifier.js +151 -16
  53. package/bin/dashboard/api-router.js +28 -47
  54. package/bin/dashboard/error-response.js +44 -0
  55. package/bin/dashboard/frontend/app.js +429 -0
  56. package/bin/dashboard/frontend/index.html +14 -390
  57. package/bin/dashboard/metrics-aggregator.js +75 -30
  58. package/bin/dashboard/revops-api.js +12 -2
  59. package/bin/dashboard/server.js +245 -6
  60. package/bin/dashboard/sse-bridge.js +11 -8
  61. package/bin/dashboard/temporal-api.js +11 -5
  62. package/bin/engine/remediation-engine.js +12 -1
  63. package/bin/engine/sre-manager.js +1 -1
  64. package/bin/engine/temporal-cli.js +56 -6
  65. package/bin/engine/temporal-hub.js +41 -9
  66. package/bin/engine/verification-runner.js +134 -17
  67. package/bin/engine/verify-cli.js +25 -7
  68. package/bin/eval/eval-harness.js +212 -1
  69. package/bin/eval/golden-set-retrieval.json +9 -0
  70. package/bin/governance/approval-record.js +147 -0
  71. package/bin/governance/approve.js +12 -7
  72. package/bin/governance/policy-engine.js +41 -3
  73. package/bin/governance/policy-gate-hardened.js +36 -1
  74. package/bin/governance/verify-approvals.js +163 -0
  75. package/bin/harness-audit.js +224 -10
  76. package/bin/hindsight-injector.js +8 -2
  77. package/bin/hooks/instinct-capture-hook.js +19 -5
  78. package/bin/install.js +63 -3
  79. package/bin/installer/harness-adapter-compliance.js +339 -28
  80. package/bin/installer/hook-registration.js +504 -0
  81. package/bin/installer-core.js +451 -63
  82. package/bin/learning/instinct-cli.js +14 -24
  83. package/bin/memory/knowledge-capture.js +23 -3
  84. package/bin/memory/knowledge-graph.js +70 -31
  85. package/bin/memory/vector-hub.js +500 -44
  86. package/bin/migrations/0.6.0-to-1.0.0.js +30 -25
  87. package/bin/migrations/1.0.0-to-2.0.0.js +22 -23
  88. package/bin/mindforge-cli.js +110 -17
  89. package/bin/models/cost-tracker.js +126 -29
  90. package/bin/models/model-client.js +6 -1
  91. package/bin/models/model-router.js +28 -7
  92. package/bin/models/usage-record.js +71 -0
  93. package/bin/revops/debt-monitor.js +57 -13
  94. package/bin/security/trust-gate-hook.js +50 -6
  95. package/bin/skill-validator.js +6 -1
  96. package/bin/skills-builder/skill-scorer.js +46 -6
  97. package/bin/updater/self-update.js +6 -1
  98. package/bin/updater/version-comparator.js +21 -1
  99. package/bin/utils/file-lock.js +106 -0
  100. package/bin/utils/mindforge-params.js +124 -0
  101. package/bin/utils/mindforge-version.js +99 -0
  102. package/bin/utils/redact-secrets.js +106 -0
  103. package/bin/validate-config.js +75 -17
  104. package/bin/wizard/setup-wizard.js +4 -1
  105. package/bin/wizard/theme.js +9 -1
  106. package/changelogs/index.json +11 -9
  107. package/changelogs/v11.9.2.md +209 -0
  108. package/changelogs/v11.9.3.md +195 -0
  109. package/docs/References/config-reference.md +76 -14
  110. package/docs/References/sdk-api.md +1 -1
  111. package/docs/Templates/Codebase/architecture.md +1 -1
  112. package/docs/commands-reference.md +4 -5
  113. package/docs/faq.md +25 -5
  114. package/docs/getting-started.md +3 -3
  115. package/docs/sdk-reference.md +15 -7
  116. package/docs/troubleshooting.md +10 -6
  117. package/docs/user-guide.md +14 -14
  118. package/examples/sdk-integration/README.md +1 -1
  119. package/package.json +10 -4
  120. package/subagents/.claude-plugin/marketplace.json +1 -1
  121. package/bin/dashboard/approval-handler.js +0 -136
@@ -19,7 +19,7 @@ $ARGUMENTS
19
19
 
20
20
  <process>
21
21
  1. Parse flags: --window (time period, default: current session), --by-model, --by-task, --phase.
22
- 2. Read `.mindforge/metrics/token-ledger.jsonl` for the specified window.
22
+ 2. Read `.mindforge/metrics/token-usage.jsonl` for the specified window.
23
23
  3. **Compute totals:**
24
24
  - Total tokens (input, output, cached)
25
25
  - Total estimated cost (USD)
@@ -31,7 +31,7 @@ LLM layer judges *whether it matters here* and proposes the highest-leverage fix
31
31
 
32
32
  ## Step 3 — Report + AUDIT entry
33
33
 
34
- Summarize the scorecard, then write a Merkle-linked AUDIT.jsonl entry:
34
+ Summarize the scorecard, then write a hash-chained AUDIT.jsonl entry:
35
35
 
36
36
  ```json
37
37
  {
@@ -34,7 +34,7 @@ with `$ARGUMENTS` as the request and `operation = add-feature`. The engine will:
34
34
  3. TDD each task via `mindforge-tdd_extended` (new failing tests → green), then
35
35
  `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
36
36
  if a security trigger is touched).
37
- 4. Commit as conventional `feat(...)` commits, each writing a Merkle-linked
37
+ 4. Commit as conventional `feat(...)` commits, each writing a hash-chained
38
38
  AUDIT.jsonl entry. → **GATE 2** (confirm before commit).
39
39
 
40
40
  Honor both gates — do not write implementation before Gate 1, do not commit
@@ -42,7 +42,7 @@ with `$ARGUMENTS` as the doc path and `operation = build-mvp` (default floor:
42
42
  > the orch-pipeline skill.
43
43
  4. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
44
44
  on any security-trigger slice), then commit the scaffold and each slice as
45
- separate conventional `feat(...)` commits, each writing a Merkle-linked
45
+ separate conventional `feat(...)` commits, each writing a hash-chained
46
46
  AUDIT.jsonl entry. → **GATE 2**.
47
47
 
48
48
  If `$ARGUMENTS` is empty, ask the user for the path to the design/spec doc.
@@ -36,7 +36,7 @@ with `$ARGUMENTS` as the request and `operation = change-feature`. The engine wi
36
36
  first is what makes this a tweak, not a fix.)
37
37
  4. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
38
38
  on a security trigger), then commit as conventional `feat(...)` / `refactor(...)`
39
- + Merkle-linked AUDIT.jsonl entry. → **GATE 2**.
39
+ + hash-chained AUDIT.jsonl entry. → **GATE 2**.
40
40
 
41
41
  Use this only when the feature **works** but should behave differently — not for
42
42
  bugs (`/mindforge:orch-fix-defect`) or net-new capability
@@ -33,7 +33,7 @@ with `$ARGUMENTS` as the request and `operation = fix-defect`. The engine will:
33
33
  this a fix, not a tweak.)
34
34
  3. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
35
35
  if the defect sits in a sensitive path).
36
- 4. Commit as a conventional `fix(...)` commit + Merkle-linked AUDIT.jsonl entry.
36
+ 4. Commit as a conventional `fix(...)` commit + hash-chained AUDIT.jsonl entry.
37
37
  → **GATE 2** (confirm before commit).
38
38
 
39
39
  Use this only when behavior is **broken/wrong** — not for intentional changes
@@ -35,7 +35,7 @@ with `$ARGUMENTS` as the request and `operation = refine-code`. The engine will:
35
35
  — the existing suite proves behavior is unchanged). Dead-code/dup sweeps
36
36
  delegate to `/mindforge:de-slop`.
37
37
  4. `/mindforge:review`, then commit as `refactor(...)` (the diff must be
38
- behavior-neutral) + Merkle-linked AUDIT.jsonl entry. → **GATE 2**.
38
+ behavior-neutral) + hash-chained AUDIT.jsonl entry. → **GATE 2**.
39
39
 
40
40
  Use this only when behavior must **not** change. If behavior should change at
41
41
  all, use `/mindforge:orch-change-feature` or `/mindforge:orch-fix-defect`.
@@ -1,11 +1,11 @@
1
1
  ---
2
- description: @mindforge qa [--phase N] [--auto]
2
+ description: /mindforge:qa [--phase N] [--auto]
3
3
  ---
4
4
 
5
5
  # /mindforge:qa
6
6
 
7
7
  ## Usage
8
- `@mindforge qa [--phase N] [--auto]`
8
+ `/mindforge:qa [--phase N] [--auto]`
9
9
 
10
10
  ## Description
11
11
  Runs systematic visual QA on UI surfaces changed in the current phase.
package/.claude/CLAUDE.md CHANGED
@@ -25,25 +25,37 @@ You are a **Dynamic Multi-Agent Swarm (Agentic Mesh)**. Your mission is to execu
25
25
 
26
26
  ## 🛠️ CORE PROTOCOLS (The "How")
27
27
 
28
+ > **These are protocols you follow, not modules you call.** `SwarmController`, `PersonaFactory`
29
+ > and `WaveExecutor` are role names in the specs under `.mindforge/engine/`, not importable code —
30
+ > there is no file by any of those names. Every step below is something you do by reasoning and by
31
+ > using your own tools. Where a real executable exists, it is named with its path.
32
+
28
33
  ### 1. Swarm Dynamic Orchestration (V4)
29
34
  **IF** task complexity/impact is high **OR** cross-disciplinary logic is required:
30
- 1. Invoke `SwarmController` and activate `mindforge-swarm-execution`.
35
+ 1. Adopt the swarm-orchestration protocol described in `.mindforge/engine/`.
31
36
  2. Spawn task-specific ephemeral specialist cluster (AIEngineering, Security, etc.).
32
- 3. Inject knowledge patches via `PersonaFactory` (Context7).
33
- 4. Execute parallel mesh waves via `WaveExecutor` guided by `mindforge-parallel-mesh_extended`.
37
+ 3. Load the relevant persona brief from `.mindforge/personas/` before each specialist acts.
38
+ 4. Execute parallel mesh waves, consolidating dependent work before independent work.
34
39
  5. Consolidate mesh findings into a single `SWARM-SUMMARY`.
35
40
 
36
41
  ### 2. The Sharded Memory Loop (SRD)
37
42
  **IF** context ≥ 70% **OR** starting a new task:
38
- 1. Initialize `shard-controller.js`.
39
- 2. Rotate context per the Tri-Tier strategy (Hot/Warm/Cold).
40
- 3. Inject only sharded relevant data into the active buffer.
43
+ 1. Rotate context per the Tri-Tier strategy (Hot/Warm/Cold) yourself — this is an advisory
44
+ discipline, not an automated step.
45
+ 2. Inject only sharded relevant data into the active buffer.
46
+ 3. Re-read the current phase's plan rather than carrying stale detail forward.
41
47
 
42
48
  ### 3. The Adversarial Decision Loop (ADS)
43
49
  **BEFORE** committing any architectural change:
44
- 1. Spawn Red-Team/Blue-Team debate contexts.
45
- 2. Run `soul-engine.js` on the proposed diff.
46
- 3. **STOP** if SOUL Score < `[MIN_SOUL_SCORE]` from MINDFORGE.md.
50
+ 1. Spawn Red-Team/Blue-Team debate contexts and argue the change against itself.
51
+ 2. Score the proposal on impact, leverage, reversibility, effort, risk and cost.
52
+ 3. **STOP** if the resulting SOUL Score < `[MIN_SOUL_SCORE]` from MINDFORGE.md.
53
+
54
+ ADS is a reasoning protocol you run, not a command. Do not look for a script: measured, the two
55
+ scripts this section used to name (soul-engine.js and shard-controller.js) do not exist
56
+ anywhere in the package. The nearest real implementation, `runADSSynthesis()` in
57
+ `bin/review/ads-engine.js`, is a library with a single internal caller, exposes no CLI, and takes
58
+ `{phaseNum, goal, context, sessionId}` rather than a diff, so it cannot be invoked here either.
47
59
 
48
60
  ### 4. Standard Extended Protocols (Quality Gates)
49
61
  **MANDATORY**: For specific workflows, activate the corresponding `_extended` protocol:
@@ -78,18 +90,26 @@ Prioritize based on `[REACTIVE_MODE]` in MINDFORGE.md. These are the **Quality g
78
90
  - [ ] **AgRevOps Check**: Verify ROI trends and Security Health Score via `/api/revops`.
79
91
  - [ ] **PLAN-FIRST RULE**: Never code without a verified XML plan.
80
92
  - [ ] **Verify First**: Never task-complete without successful `<verify>` output.
81
- - [ ] **Audit Always**: Write a JSONL entry for every significant session event. All entries must be Merkle-linked.
93
+ - [ ] **Audit Always**: Write a JSONL entry for every significant session event. The result is a hash-chained append-only audit log (SHA-256 back-links): each entry sets `previous_hash` to the prior entry's `_hash`.
82
94
 
83
95
  ---
84
96
 
85
97
  ## ⚡ COMMAND SUITE
86
98
 
99
+ Every entry below has a backing command file, checked by `tests/protocol-claims.test.js`. Two that
100
+ did not (the brainstorming and history entries) are gone: neither existed in
101
+ `.claude/commands/mindforge/` or `.agent/mindforge/` (both hold exactly 221 files, so this was not
102
+ a mirror gap), and neither had a near-match to correct to. Temporal history is reachable, just not
103
+ as a slash command, so it is named as what it actually is.
104
+
87
105
  - `/mindforge:next` — Primary auto-discovery.
88
106
  - `/mindforge:auto` — Reactive engine start.
89
- - `/mindforge:brainstorming` — Creative & architectural exploration.
90
- - `/mindforge:history` — Temporal Hub access.
107
+ - `/mindforge:plan-phase` — Plan the next phase before writing code.
108
+ - `/mindforge:verify-phase` — Verify the phase against its plan.
91
109
  - `/mindforge:status` — Project health & sharding state.
92
110
  - `/mindforge:audit` — Day 4 governance access.
111
+ - `mindforge temporal <status|cleanup|inject>` — reasoning-history access (a CLI command, not a
112
+ slash command).
93
113
 
94
114
  ---
95
115
 
@@ -109,7 +129,11 @@ Adopt the Principal AI persona. Be instruction-dense, unambiguous, and architect
109
129
 
110
130
  **Source of Truth Hierarchy**:
111
131
 
112
- 1. SOUL.md (Sovereign Identity — Behavioral OS)
132
+ 1. SOUL.md (Sovereign Identity — Behavioral OS). **Not shipped in the package**, and generated
133
+ locally rather than installed: `bin/memory/identity-synthesizer.js` creates and evolves it. If
134
+ your project has no SOUL.md, this entry is vacant and authority passes to MINDFORGE.md — do not
135
+ infer its contents. The prompt-defense baseline it carries is reproduced verbatim at the top of
136
+ this file, so that part reaches you either way.
113
137
  2. MINDFORGE.md (Parameter Registry)
114
138
  3. .agent/CLAUDE.md (Protocols)
115
139
  4. `.mindforge/` (Framework Binary Logic)
@@ -1,11 +1,11 @@
1
1
  ---
2
- description: "@mindforge browse <url | action>"
2
+ description: "/mindforge:browse <url | action>"
3
3
  ---
4
4
 
5
5
  # /mindforge:browse
6
6
 
7
7
  ## Usage
8
- `@mindforge browse <url | action>`
8
+ `/mindforge:browse <url | action>`
9
9
 
10
10
  ## Description
11
11
  Controls the persistent MindForge browser daemon.
@@ -61,7 +61,7 @@ Remove old checkpoints, keeping the last 5.
61
61
 
62
62
  ## AUDIT linkage
63
63
 
64
- Each create/verify optionally writes a Merkle-linked AUDIT.jsonl entry:
64
+ Each create/verify optionally writes a hash-chained AUDIT.jsonl entry:
65
65
 
66
66
  ```json
67
67
  { "event": "checkpoint_created", "name": "core-done", "sha": "abc1234", "tests_pass_rate": 1.0, "coverage": 0.0 }
@@ -31,7 +31,7 @@ $ARGUMENTS
31
31
  - Identify divergence (models disagree — flag for user)
32
32
  - Identify novel insights (unique points from one model)
33
33
  7. **Present results** with clear attribution (which model said what).
34
- 8. Log consultation in token-ledger.jsonl (model, tokens, cost per call).
34
+ 8. Log consultation in token-usage.jsonl (model, tokens, cost per call).
35
35
  9. Report total cost of this consultation.
36
36
  10. Remind: "External opinions are advisory — user sovereignty applies."
37
37
  </process>
@@ -19,7 +19,7 @@ $ARGUMENTS
19
19
 
20
20
  <process>
21
21
  1. Parse flags: --window (time period, default: current session), --by-model, --by-task, --phase.
22
- 2. Read `.mindforge/metrics/token-ledger.jsonl` for the specified window.
22
+ 2. Read `.mindforge/metrics/token-usage.jsonl` for the specified window.
23
23
  3. **Compute totals:**
24
24
  - Total tokens (input, output, cached)
25
25
  - Total estimated cost (USD)
@@ -31,7 +31,7 @@ LLM layer judges *whether it matters here* and proposes the highest-leverage fix
31
31
 
32
32
  ## Step 3 — Report + AUDIT entry
33
33
 
34
- Summarize the scorecard, then write a Merkle-linked AUDIT.jsonl entry:
34
+ Summarize the scorecard, then write a hash-chained AUDIT.jsonl entry:
35
35
 
36
36
  ```json
37
37
  {
@@ -34,7 +34,7 @@ with `$ARGUMENTS` as the request and `operation = add-feature`. The engine will:
34
34
  3. TDD each task via `mindforge-tdd_extended` (new failing tests → green), then
35
35
  `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
36
36
  if a security trigger is touched).
37
- 4. Commit as conventional `feat(...)` commits, each writing a Merkle-linked
37
+ 4. Commit as conventional `feat(...)` commits, each writing a hash-chained
38
38
  AUDIT.jsonl entry. → **GATE 2** (confirm before commit).
39
39
 
40
40
  Honor both gates — do not write implementation before Gate 1, do not commit
@@ -42,7 +42,7 @@ with `$ARGUMENTS` as the doc path and `operation = build-mvp` (default floor:
42
42
  > the orch-pipeline skill.
43
43
  4. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
44
44
  on any security-trigger slice), then commit the scaffold and each slice as
45
- separate conventional `feat(...)` commits, each writing a Merkle-linked
45
+ separate conventional `feat(...)` commits, each writing a hash-chained
46
46
  AUDIT.jsonl entry. → **GATE 2**.
47
47
 
48
48
  If `$ARGUMENTS` is empty, ask the user for the path to the design/spec doc.
@@ -36,7 +36,7 @@ with `$ARGUMENTS` as the request and `operation = change-feature`. The engine wi
36
36
  first is what makes this a tweak, not a fix.)
37
37
  4. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
38
38
  on a security trigger), then commit as conventional `feat(...)` / `refactor(...)`
39
- + Merkle-linked AUDIT.jsonl entry. → **GATE 2**.
39
+ + hash-chained AUDIT.jsonl entry. → **GATE 2**.
40
40
 
41
41
  Use this only when the feature **works** but should behave differently — not for
42
42
  bugs (`/mindforge:orch-fix-defect`) or net-new capability
@@ -33,7 +33,7 @@ with `$ARGUMENTS` as the request and `operation = fix-defect`. The engine will:
33
33
  this a fix, not a tweak.)
34
34
  3. `/mindforge:review` (+ the `quick.md` security auto-trigger / `security-reviewer`
35
35
  if the defect sits in a sensitive path).
36
- 4. Commit as a conventional `fix(...)` commit + Merkle-linked AUDIT.jsonl entry.
36
+ 4. Commit as a conventional `fix(...)` commit + hash-chained AUDIT.jsonl entry.
37
37
  → **GATE 2** (confirm before commit).
38
38
 
39
39
  Use this only when behavior is **broken/wrong** — not for intentional changes
@@ -35,7 +35,7 @@ with `$ARGUMENTS` as the request and `operation = refine-code`. The engine will:
35
35
  — the existing suite proves behavior is unchanged). Dead-code/dup sweeps
36
36
  delegate to `/mindforge:de-slop`.
37
37
  4. `/mindforge:review`, then commit as `refactor(...)` (the diff must be
38
- behavior-neutral) + Merkle-linked AUDIT.jsonl entry. → **GATE 2**.
38
+ behavior-neutral) + hash-chained AUDIT.jsonl entry. → **GATE 2**.
39
39
 
40
40
  Use this only when behavior must **not** change. If behavior should change at
41
41
  all, use `/mindforge:orch-change-feature` or `/mindforge:orch-fix-defect`.
@@ -1,11 +1,11 @@
1
1
  ---
2
- description: "@mindforge qa [--phase N] [--auto]"
2
+ description: "/mindforge:qa [--phase N] [--auto]"
3
3
  ---
4
4
 
5
5
  # /mindforge:qa
6
6
 
7
7
  ## Usage
8
- `@mindforge qa [--phase N] [--auto]`
8
+ `/mindforge:qa [--phase N] [--auto]`
9
9
 
10
10
  ## Description
11
11
  Runs systematic visual QA on UI surfaces changed in the current phase.
@@ -1,33 +1,146 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "MindForge Project Configuration Schema",
4
- "description": "JSON Schema for MINDFORGE.md key-value settings",
4
+ "description": "JSON Schema for MINDFORGE.md bracketed parameter assignments ([KEY] = value)",
5
5
  "type": "object",
6
+ "required": [
7
+ "VERSION",
8
+ "REACTIVE_MODE",
9
+ "PLANNER",
10
+ "EXECUTOR",
11
+ "MIN_SOUL_SCORE"
12
+ ],
13
+ "recommended": [
14
+ "COST_WARN_USD",
15
+ "COST_HARD_LIMIT_USD",
16
+ "BLOCK_ON_SECURITY"
17
+ ],
6
18
  "properties": {
19
+ "NAME": { "type": "string", "description": "Project display name" },
20
+ "VERSION": {
21
+ "type": "string",
22
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
23
+ "description": "MindForge version this registry targets (must equal package.json version)"
24
+ },
25
+ "STABLE": { "type": "boolean", "description": "Registry is a released/stable configuration" },
26
+ "MODE": { "type": "string", "description": "Operating mode label (free-form)" },
27
+ "REQUIRED_CORE_VERSION": {
28
+ "type": "string",
29
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
30
+ "description": "Minimum MindForge core version required by this project"
31
+ },
32
+ "SOVEREIGN_IDENTITY": {
33
+ "type": "boolean",
34
+ "nonOverridable": true,
35
+ "description": "NON-OVERRIDABLE: identity verification is always required"
36
+ },
37
+ "SRE_LAYER_ENABLED": { "type": "boolean", "description": "Enable the SRE persona layer" },
38
+ "SWARM_ORCHESTRATION": { "type": "boolean", "description": "Enable dynamic swarm orchestration" },
39
+ "AUTO_SWARM_THRESHOLD": {
40
+ "type": "number", "minimum": 0, "maximum": 10,
41
+ "description": "Difficulty score above which a swarm is auto-spawned"
42
+ },
43
+ "CONTEXT7_DEPTH": {
44
+ "type": "enum", "values": ["MINIMAL", "STANDARD", "EXTENDED"],
45
+ "description": "Depth of Context7 knowledge injection"
46
+ },
47
+ "DYNAMISM_LEVEL": {
48
+ "type": "number", "minimum": 1, "maximum": 5,
49
+ "description": "How aggressively the engine reshapes its own plan (1=static, 5=fully dynamic)"
50
+ },
51
+ "REACTIVE_MODE": { "type": "boolean", "description": "Enable the reactive (auto-discovery) engine" },
52
+ "CONTEXT_SHARDING": { "type": "boolean", "description": "Enable the sharded memory loop" },
53
+ "ADS_LOOP_ENFORCED": { "type": "boolean", "description": "Enforce the adversarial decision loop before architectural change" },
54
+ "TEMPORAL_VISION": { "type": "boolean", "description": "Enable temporal hindsight / steering" },
55
+ "RAG_2_AUTO_SHADOW": { "type": "boolean", "description": "Run RAG-2 retrieval in shadow mode" },
56
+ "ENABLE_ART_TRACING": { "type": "boolean", "description": "Enable agent reasoning trace (ART) capture" },
57
+ "ENABLE_ZTAI": {
58
+ "type": "boolean",
59
+ "nonOverridable": true,
60
+ "description": "NON-OVERRIDABLE: zero-trust agent identity cannot be bypassed"
61
+ },
62
+ "ZTAI_KEY_TYPE": { "type": "string", "description": "Declared ZTAI key algorithm label" },
63
+ "NEXUS_TRACE_RETENTION_DAYS": {
64
+ "type": "number", "minimum": 1, "maximum": 365,
65
+ "description": "Days of NexusTracer trace retention"
66
+ },
67
+ "CADIA_CORE": { "type": "boolean", "description": "Enable the CADIA core layer" },
68
+ "PQAS_ENFORCED": {
69
+ "type": "boolean",
70
+ "description": "Post-quantum attestation enforcement (SIMULATED/inactive by default — see bin/governance/quantum-crypto.js)"
71
+ },
72
+ "PROACTIVE_HOMING": { "type": "boolean", "description": "Enable proactive homing / next-task discovery" },
73
+ "PLANNER": { "type": "string", "description": "Model id for the planning persona (canonical: PLANNER_MODEL)" },
74
+ "EXECUTOR": { "type": "string", "description": "Model id for execution agents (canonical: EXECUTOR_MODEL)" },
75
+ "REVIEWER": { "type": "string", "description": "Model id for the code reviewer (canonical: REVIEWER_MODEL)" },
76
+ "VERIFIER": { "type": "string", "description": "Model id for the verification persona (canonical: VERIFIER_MODEL)" },
77
+ "SECURITY": { "type": "string", "description": "Model id for security review (canonical: SECURITY_MODEL)" },
78
+ "DEBUG": { "type": "string", "description": "Model id for the debug specialist (canonical: DEBUG_MODEL)" },
79
+ "RESEARCH": { "type": "string", "description": "Model id for the research agent (canonical: RESEARCH_MODEL)" },
80
+ "QA": { "type": "string", "description": "Model id for the QA engineer (canonical: QA_MODEL)" },
81
+ "QUICK": { "type": "string", "description": "Model id for tier-1 budget-bias tasks (canonical: QUICK_MODEL)" },
82
+ "COST_WARN_USD": {
83
+ "type": "number", "minimum": 0, "maximum": 10000,
84
+ "description": "Daily spend at which a cost warning is emitted"
85
+ },
86
+ "COST_HARD_LIMIT_USD": {
87
+ "type": "number", "minimum": 0, "maximum": 10000,
88
+ "description": "Daily hard cost limit in USD. ENFORCED as of 11.9.3 (COST-02): bin/models/cost-tracker.js preflight() throws COST_LIMIT_REACHED once today's ledger spend plus the call estimate reaches this value, and bin/models/model-client.js re-throws it. 0 disables the cap, and so does omitting the key (it is `recommended`, not `required`) — an upgrade never rewrites an existing MINDFORGE.md. A present-but-unparseable value throws COST_LIMIT_MISCONFIGURED rather than silently running uncapped."
89
+ },
90
+ "ADS_DEBATE_ROUNDS": {
91
+ "type": "number", "minimum": 1, "maximum": 10,
92
+ "description": "Red-team/blue-team debate rounds per architectural decision"
93
+ },
94
+ "MIN_SOUL_SCORE": {
95
+ "type": "number", "minimum": 0, "maximum": 10,
96
+ "nonOverridable": true,
97
+ "description": "NON-OVERRIDABLE: minimum SOUL score required for architectural changes"
98
+ },
99
+ "REQUIRE_ADR": { "type": "boolean", "description": "Require an ADR for architectural decisions" },
100
+ "BLOCK_ON_SECURITY": {
101
+ "type": "boolean",
102
+ "nonOverridable": true,
103
+ "description": "NON-OVERRIDABLE: security gate enforcement cannot be disabled"
104
+ },
105
+ "BROWSER_PORT": {
106
+ "type": "number", "minimum": 1024, "maximum": 65535,
107
+ "description": "Port for the browser/QA harness"
108
+ },
109
+ "DASHBOARD_PORT": {
110
+ "type": "number", "minimum": 1024, "maximum": 65535,
111
+ "description": "Port for the MindForge dashboard"
112
+ },
113
+ "API_URL": { "type": "string", "description": "Base URL of the project API under development" },
114
+ "SHARD_RETAIN_DAYS": {
115
+ "type": "number", "minimum": 1, "maximum": 365,
116
+ "description": "Days to retain context shards"
117
+ },
118
+ "FORBIDDEN": { "type": "string", "description": "Multi-line block of project prohibitions injected into every agent prompt" },
119
+ "INSTRUCTIONS": { "type": "string", "description": "Multi-line block of project instructions injected into every agent prompt" },
7
120
  "MINDFORGE_VERSION_REQUIRED": {
8
121
  "type": "string",
9
122
  "pattern": "^\\d+\\.\\d+\\.\\d+$",
10
123
  "description": "Minimum MindForge version required for this config"
11
124
  },
12
125
  "PLANNER_MODEL": {
13
- "type": "enum",
14
- "values": ["claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5", "inherit"],
15
- "description": "Claude model to use for the planning agent"
126
+ "type": "string",
127
+ "deprecated": true,
128
+ "description": "DEPRECATED long form of [PLANNER]. Model id for the planning agent (free-form: model ids churn faster than this schema)"
16
129
  },
17
130
  "EXECUTOR_MODEL": {
18
- "type": "enum",
19
- "values": ["claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5", "inherit"],
20
- "description": "Claude model to use for execution agents"
131
+ "type": "string",
132
+ "deprecated": true,
133
+ "description": "DEPRECATED long form of [EXECUTOR]. Model id for execution agents"
21
134
  },
22
135
  "REVIEWER_MODEL": {
23
- "type": "enum",
24
- "values": ["claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5", "inherit"],
25
- "description": "Claude model to use for the code reviewer"
136
+ "type": "string",
137
+ "deprecated": true,
138
+ "description": "DEPRECATED long form of [REVIEWER]. Model id for the code reviewer"
26
139
  },
27
140
  "SECURITY_MODEL": {
28
- "type": "enum",
29
- "values": ["claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5", "inherit"],
30
- "description": "Claude model to use for security review (recommend Opus for thoroughness)"
141
+ "type": "string",
142
+ "deprecated": true,
143
+ "description": "DEPRECATED long form of [SECURITY]. Model id for security review"
31
144
  },
32
145
  "TIER1_AUTO_APPROVE": {
33
146
  "type": "boolean",
@@ -1,11 +1,11 @@
1
1
  {
2
- "version": "11.9.1",
2
+ "version": "11.9.3",
3
3
  "environment": "development",
4
4
  "governance": {
5
5
  "drift_threshold": 0.75,
6
6
  "critical_drift_threshold": 0.5,
7
7
  "res_threshold": 0.8,
8
- "active_did": "did:mindforge:ea8ace55-c2f0-46f2-af28-4d5a8ee3293a"
8
+ "active_did": ""
9
9
  },
10
10
  "revops": {
11
11
  "market_registry": {
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "mesh": {
73
73
  "_node_id_note": "Set node_id to a unique value per node in multi-node deployments. auto = hostname-derived.",
74
- "node_id": "beta-node",
74
+ "node_id": "auto",
75
75
  "peers": []
76
76
  },
77
77
  "ase": {
@@ -125,7 +125,7 @@
125
125
  "project_weekly_warn_usd": 50,
126
126
  "project_weekly_hard_limit_usd": 200
127
127
  },
128
- "ledger_path": ".mindforge/metrics/token-ledger.jsonl"
128
+ "ledger_path": ".mindforge/metrics/token-usage.jsonl"
129
129
  },
130
130
  "proactive_suggestions": {
131
131
  "enabled": true,
@@ -46,8 +46,8 @@ Typical GitHub Action setup:
46
46
  ```yaml
47
47
  steps:
48
48
  - uses: actions/checkout@v4
49
- - name: Run MindForge Auto
50
- run: npx mindforge auto --phase 3 --headless
49
+ - name: Run MindForge headless
50
+ run: npx mindforge headless --phase 3
51
51
  env:
52
52
  MINDFORGE_TOKEN: ${{ secrets.MINDFORGE_TOKEN }}
53
53
  AUTO_PUSH_ON_WAVE_COMPLETE: true
@@ -41,7 +41,7 @@ These always override the matrix:
41
41
  3. Map score to tier via decision matrix
42
42
  4. Apply override rules
43
43
  5. Check budget: if remaining budget < estimated cost, downgrade one tier with WARNING
44
- 6. Log routing decision to token-ledger.jsonl
44
+ 6. Log routing decision to token-usage.jsonl
45
45
  7. Return selected model ID
46
46
 
47
47
  ## Budget Guard
@@ -5,43 +5,40 @@ Append-only ledger recording all token usage for analytics, budgeting, and optim
5
5
 
6
6
  ## Storage
7
7
 
8
- - Location: `.mindforge/metrics/token-ledger.jsonl`
8
+ - Location: `.mindforge/metrics/token-usage.jsonl` (canonical shape: `bin/models/usage-record.js`)
9
9
  - Format: JSON Lines (one entry per model interaction)
10
10
  - Rotation: Archive entries older than 30 days to `.mindforge/metrics/archive/`
11
11
  - Retention: Archives kept for 90 days, then deleted
12
12
 
13
13
  ## Entry Format
14
14
 
15
- Each line in the ledger is a complete JSON object:
15
+ Each line in the ledger is a complete JSON object. The authoritative shape is
16
+ `bin/models/usage-record.js`; this is what `bin/models/cost-tracker.js`
17
+ actually appends today (all five providers in `bin/models/*-provider.js` emit it):
16
18
 
17
19
  ```json
18
20
  {
19
- "id": "txn-[uuid]",
20
- "timestamp": "2026-05-25T10:30:00Z",
21
- "session_id": "session-abc123",
22
- "task_id": "task-def456",
23
- "phase": "execute",
24
21
  "model": "claude-sonnet-4-6",
25
- "tier": "standard",
26
- "routing_reason": "difficulty_score_5_multi_file",
27
- "tokens": {
28
- "input": 12500,
29
- "output": 3200,
30
- "cached_input": 8000,
31
- "total": 15700
32
- },
22
+ "input_tokens": 12500,
23
+ "output_tokens": 3200,
24
+ "cache_read_input_tokens": 8000,
25
+ "cache_creation_input_tokens": 0,
33
26
  "cost_usd": 0.085,
34
- "budget_remaining": {
35
- "session": 4.915,
36
- "project_weekly": 49.915
37
- },
38
- "task_type": "implementation",
39
- "files_touched": 3,
40
- "skills_loaded": ["code-quality", "testing-standards"],
41
- "outcome": "success"
27
+ "task_name": "Plan 3-04",
28
+ "session_id": "session-abc123",
29
+ "phase": 3,
30
+ "date": "2026-05-25",
31
+ "timestamp": "2026-05-25T10:30:00.000Z"
42
32
  }
43
33
  ```
44
34
 
35
+ `cost_usd` is the ONLY cost field. `total_cost_usd` belongs to cross-review
36
+ reports (`bin/review/cross-review-engine.js`) and must never appear here.
37
+
38
+ Not yet emitted (aspirational — do not read these): `id`, `task_id`, `tier`,
39
+ `routing_reason`, `budget_remaining`, `task_type`, `files_touched`,
40
+ `skills_loaded`, `outcome`.
41
+
45
42
  ## Reporting Queries
46
43
 
47
44
  The `/mindforge:cost-report` command reads this ledger to produce:
@@ -71,7 +68,7 @@ debugging | $0.85 | 32,000 | 8
71
68
 
72
69
  ## Integration
73
70
 
74
- - Written to by the budget-enforcer after every model interaction
71
+ - Written to by `bin/models/cost-tracker.js` `record()` after every model interaction (called from `bin/models/model-client.js:77`)
75
72
  - Read by `/mindforge:cost-report` command
76
73
  - Summarized weekly into `.mindforge/metrics/weekly-cost-summary.json`
77
74
  - Referenced by AgRevOps dashboard for ROI tracking
@@ -10,7 +10,7 @@ Temporal Vision enables high-fidelity "Time-Travel Debugging" by snapshotting th
10
10
  - `task_completed`
11
11
  - `hindsight_injected`
12
12
  2. **Persistence**: Snapshots are stored in `.planning/history/[audit_id]/`.
13
- 3. **Retention**: The system retains snapshots for the current milestone. Completed milestones should be archived or purged using `/mindforge:temporal --cleanup`.
13
+ 3. **Retention**: The system retains snapshots for the current milestone. Completed milestones should be archived or purged using `mindforge temporal cleanup`.
14
14
 
15
15
  ## Hindsight Injection Protocol
16
16
  Hindsight Injection is a powerful tool and must be used according to these safety rules:
@@ -37,4 +37,4 @@ Hindsight Injection is a powerful tool and must be used according to these safet
37
37
  ## Common Operations
38
38
  - `GET /api/temporal/history`: View the timeline.
39
39
  - `POST /api/temporal/inject`: Perform hindsight repair.
40
- - `/mindforge:temporal --status`: Check history size and snapshot count.
40
+ - `mindforge temporal status`: Check history size and snapshot count.