mindforge-cc 1.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.
Files changed (324) hide show
  1. package/.agent/CLAUDE.md +462 -0
  2. package/.agent/forge/help.md +7 -0
  3. package/.agent/forge/init-project.md +32 -0
  4. package/.agent/forge/plan-phase.md +30 -0
  5. package/.agent/mindforge/approve.md +18 -0
  6. package/.agent/mindforge/audit.md +30 -0
  7. package/.agent/mindforge/benchmark.md +33 -0
  8. package/.agent/mindforge/complete-milestone.md +18 -0
  9. package/.agent/mindforge/debug.md +126 -0
  10. package/.agent/mindforge/discuss-phase.md +138 -0
  11. package/.agent/mindforge/execute-phase.md +165 -0
  12. package/.agent/mindforge/health.md +21 -0
  13. package/.agent/mindforge/help.md +23 -0
  14. package/.agent/mindforge/init-org.md +131 -0
  15. package/.agent/mindforge/init-project.md +155 -0
  16. package/.agent/mindforge/install-skill.md +15 -0
  17. package/.agent/mindforge/map-codebase.md +298 -0
  18. package/.agent/mindforge/metrics.md +22 -0
  19. package/.agent/mindforge/migrate.md +40 -0
  20. package/.agent/mindforge/milestone.md +12 -0
  21. package/.agent/mindforge/next.md +105 -0
  22. package/.agent/mindforge/plan-phase.md +125 -0
  23. package/.agent/mindforge/plugins.md +40 -0
  24. package/.agent/mindforge/pr-review.md +41 -0
  25. package/.agent/mindforge/profile-team.md +23 -0
  26. package/.agent/mindforge/publish-skill.md +19 -0
  27. package/.agent/mindforge/quick.md +135 -0
  28. package/.agent/mindforge/release.md +10 -0
  29. package/.agent/mindforge/retrospective.md +26 -0
  30. package/.agent/mindforge/review.md +157 -0
  31. package/.agent/mindforge/security-scan.md +233 -0
  32. package/.agent/mindforge/ship.md +100 -0
  33. package/.agent/mindforge/skills.md +141 -0
  34. package/.agent/mindforge/status.md +104 -0
  35. package/.agent/mindforge/sync-confluence.md +11 -0
  36. package/.agent/mindforge/sync-jira.md +12 -0
  37. package/.agent/mindforge/tokens.md +8 -0
  38. package/.agent/mindforge/update.md +42 -0
  39. package/.agent/mindforge/verify-phase.md +62 -0
  40. package/.agent/mindforge/workspace.md +29 -0
  41. package/.claude/CLAUDE.md +462 -0
  42. package/.claude/commands/forge/help.md +7 -0
  43. package/.claude/commands/forge/init-project.md +32 -0
  44. package/.claude/commands/forge/plan-phase.md +30 -0
  45. package/.claude/commands/mindforge/approve.md +18 -0
  46. package/.claude/commands/mindforge/audit.md +30 -0
  47. package/.claude/commands/mindforge/benchmark.md +33 -0
  48. package/.claude/commands/mindforge/complete-milestone.md +18 -0
  49. package/.claude/commands/mindforge/debug.md +126 -0
  50. package/.claude/commands/mindforge/discuss-phase.md +138 -0
  51. package/.claude/commands/mindforge/execute-phase.md +165 -0
  52. package/.claude/commands/mindforge/health.md +21 -0
  53. package/.claude/commands/mindforge/help.md +23 -0
  54. package/.claude/commands/mindforge/init-org.md +131 -0
  55. package/.claude/commands/mindforge/init-project.md +155 -0
  56. package/.claude/commands/mindforge/install-skill.md +15 -0
  57. package/.claude/commands/mindforge/map-codebase.md +298 -0
  58. package/.claude/commands/mindforge/metrics.md +22 -0
  59. package/.claude/commands/mindforge/migrate.md +40 -0
  60. package/.claude/commands/mindforge/milestone.md +12 -0
  61. package/.claude/commands/mindforge/next.md +105 -0
  62. package/.claude/commands/mindforge/plan-phase.md +125 -0
  63. package/.claude/commands/mindforge/plugins.md +40 -0
  64. package/.claude/commands/mindforge/pr-review.md +41 -0
  65. package/.claude/commands/mindforge/profile-team.md +23 -0
  66. package/.claude/commands/mindforge/publish-skill.md +19 -0
  67. package/.claude/commands/mindforge/quick.md +135 -0
  68. package/.claude/commands/mindforge/release.md +10 -0
  69. package/.claude/commands/mindforge/retrospective.md +26 -0
  70. package/.claude/commands/mindforge/review.md +157 -0
  71. package/.claude/commands/mindforge/security-scan.md +233 -0
  72. package/.claude/commands/mindforge/ship.md +100 -0
  73. package/.claude/commands/mindforge/skills.md +141 -0
  74. package/.claude/commands/mindforge/status.md +104 -0
  75. package/.claude/commands/mindforge/sync-confluence.md +11 -0
  76. package/.claude/commands/mindforge/sync-jira.md +12 -0
  77. package/.claude/commands/mindforge/tokens.md +8 -0
  78. package/.claude/commands/mindforge/update.md +42 -0
  79. package/.claude/commands/mindforge/verify-phase.md +62 -0
  80. package/.claude/commands/mindforge/workspace.md +29 -0
  81. package/.forge/org/CONVENTIONS.md +0 -0
  82. package/.forge/org/ORG.md +0 -0
  83. package/.forge/org/SECURITY.md +0 -0
  84. package/.forge/org/TOOLS.md +0 -0
  85. package/.forge/personas/analyst.md +0 -0
  86. package/.forge/personas/architect.md +0 -0
  87. package/.forge/personas/debug-specialist.md +0 -0
  88. package/.forge/personas/developer.md +26 -0
  89. package/.forge/personas/qa-engineer.md +0 -0
  90. package/.forge/personas/release-manager.md +0 -0
  91. package/.forge/personas/security-reviewer.md +33 -0
  92. package/.forge/personas/tech-writer.md +0 -0
  93. package/.forge/skills/api-design/SKILL.md +0 -0
  94. package/.forge/skills/code-quality/SKILL.md +0 -0
  95. package/.forge/skills/documentation/SKILL.md +0 -0
  96. package/.forge/skills/security-review/SKILL.md +23 -0
  97. package/.forge/skills/testing-standards/SKILL.md +27 -0
  98. package/.github/workflows/mindforge-ci.yml +224 -0
  99. package/.gitlab-ci-mindforge.yml +18 -0
  100. package/.mindforge/MINDFORGE-SCHEMA.json +165 -0
  101. package/.mindforge/audit/AUDIT-SCHEMA.md +451 -0
  102. package/.mindforge/ci/ci-config-schema.md +21 -0
  103. package/.mindforge/ci/ci-mode.md +179 -0
  104. package/.mindforge/ci/github-actions-adapter.md +224 -0
  105. package/.mindforge/ci/gitlab-ci-adapter.md +31 -0
  106. package/.mindforge/ci/jenkins-adapter.md +44 -0
  107. package/.mindforge/distribution/registry-client.md +166 -0
  108. package/.mindforge/distribution/registry-schema.md +96 -0
  109. package/.mindforge/distribution/skill-publisher.md +44 -0
  110. package/.mindforge/distribution/skill-validator.md +74 -0
  111. package/.mindforge/engine/compaction-protocol.md +182 -0
  112. package/.mindforge/engine/context-injector.md +128 -0
  113. package/.mindforge/engine/dependency-parser.md +113 -0
  114. package/.mindforge/engine/skills/conflict-resolver.md +69 -0
  115. package/.mindforge/engine/skills/loader.md +184 -0
  116. package/.mindforge/engine/skills/registry.md +98 -0
  117. package/.mindforge/engine/skills/versioning.md +75 -0
  118. package/.mindforge/engine/verification-pipeline.md +111 -0
  119. package/.mindforge/engine/wave-executor.md +235 -0
  120. package/.mindforge/governance/GOVERNANCE-CONFIG.md +17 -0
  121. package/.mindforge/governance/approval-workflow.md +37 -0
  122. package/.mindforge/governance/change-classifier.md +63 -0
  123. package/.mindforge/governance/compliance-gates.md +31 -0
  124. package/.mindforge/integrations/confluence.md +27 -0
  125. package/.mindforge/integrations/connection-manager.md +163 -0
  126. package/.mindforge/integrations/github.md +25 -0
  127. package/.mindforge/integrations/gitlab.md +13 -0
  128. package/.mindforge/integrations/jira.md +102 -0
  129. package/.mindforge/integrations/slack.md +41 -0
  130. package/.mindforge/intelligence/antipattern-detector.md +75 -0
  131. package/.mindforge/intelligence/difficulty-scorer.md +55 -0
  132. package/.mindforge/intelligence/health-engine.md +208 -0
  133. package/.mindforge/intelligence/skill-gap-analyser.md +40 -0
  134. package/.mindforge/intelligence/smart-compaction.md +71 -0
  135. package/.mindforge/metrics/METRICS-SCHEMA.md +42 -0
  136. package/.mindforge/metrics/quality-tracker.md +32 -0
  137. package/.mindforge/monorepo/cross-package-planner.md +114 -0
  138. package/.mindforge/monorepo/dependency-graph-builder.md +32 -0
  139. package/.mindforge/monorepo/workspace-detector.md +129 -0
  140. package/.mindforge/org/CONVENTIONS.md +62 -0
  141. package/.mindforge/org/ORG.md +51 -0
  142. package/.mindforge/org/SECURITY.md +50 -0
  143. package/.mindforge/org/TOOLS.md +53 -0
  144. package/.mindforge/org/integrations/INTEGRATIONS-CONFIG.md +58 -0
  145. package/.mindforge/org/skills/MANIFEST.md +38 -0
  146. package/.mindforge/personas/analyst.md +52 -0
  147. package/.mindforge/personas/architect.md +75 -0
  148. package/.mindforge/personas/debug-specialist.md +52 -0
  149. package/.mindforge/personas/developer.md +85 -0
  150. package/.mindforge/personas/overrides/README.md +85 -0
  151. package/.mindforge/personas/qa-engineer.md +61 -0
  152. package/.mindforge/personas/release-manager.md +76 -0
  153. package/.mindforge/personas/security-reviewer.md +91 -0
  154. package/.mindforge/personas/tech-writer.md +51 -0
  155. package/.mindforge/plugins/PLUGINS-MANIFEST.md +23 -0
  156. package/.mindforge/plugins/plugin-loader.md +93 -0
  157. package/.mindforge/plugins/plugin-registry.md +44 -0
  158. package/.mindforge/plugins/plugin-schema.md +68 -0
  159. package/.mindforge/pr-review/ai-reviewer.md +266 -0
  160. package/.mindforge/pr-review/finding-formatter.md +46 -0
  161. package/.mindforge/pr-review/review-prompt-templates.md +44 -0
  162. package/.mindforge/production/compatibility-layer.md +39 -0
  163. package/.mindforge/production/migration-engine.md +52 -0
  164. package/.mindforge/production/production-checklist.md +165 -0
  165. package/.mindforge/production/token-optimiser.md +68 -0
  166. package/.mindforge/skills/accessibility/SKILL.md +106 -0
  167. package/.mindforge/skills/api-design/SKILL.md +98 -0
  168. package/.mindforge/skills/code-quality/SKILL.md +88 -0
  169. package/.mindforge/skills/data-privacy/SKILL.md +126 -0
  170. package/.mindforge/skills/database-patterns/SKILL.md +192 -0
  171. package/.mindforge/skills/documentation/SKILL.md +91 -0
  172. package/.mindforge/skills/incident-response/SKILL.md +180 -0
  173. package/.mindforge/skills/performance/SKILL.md +120 -0
  174. package/.mindforge/skills/security-review/SKILL.md +83 -0
  175. package/.mindforge/skills/testing-standards/SKILL.md +97 -0
  176. package/.mindforge/team/TEAM-PROFILE.md +42 -0
  177. package/.mindforge/team/multi-handoff.md +23 -0
  178. package/.mindforge/team/profiles/README.md +13 -0
  179. package/.mindforge/team/session-merger.md +18 -0
  180. package/.planning/ARCHITECTURE.md +0 -0
  181. package/.planning/AUDIT.jsonl +0 -0
  182. package/.planning/HANDOFF.json +28 -0
  183. package/.planning/PROJECT.md +33 -0
  184. package/.planning/RELEASE-CHECKLIST.md +68 -0
  185. package/.planning/REQUIREMENTS.md +0 -0
  186. package/.planning/ROADMAP.md +0 -0
  187. package/.planning/STATE.md +31 -0
  188. package/.planning/approvals/.gitkeep +1 -0
  189. package/.planning/archive/.gitkeep +1 -0
  190. package/.planning/audit-archive/.gitkeep +1 -0
  191. package/.planning/decisions/.gitkeep +0 -0
  192. package/.planning/decisions/ADR-001-handoff-tracking.md +41 -0
  193. package/.planning/decisions/ADR-002-markdown-commands.md +46 -0
  194. package/.planning/decisions/ADR-003-skills-trigger-model.md +37 -0
  195. package/.planning/decisions/ADR-004-wave-parallelism-model.md +45 -0
  196. package/.planning/decisions/ADR-005-append-only-audit-log.md +51 -0
  197. package/.planning/decisions/ADR-006-tiered-skills-system.md +22 -0
  198. package/.planning/decisions/ADR-007-trigger-keyword-model.md +22 -0
  199. package/.planning/decisions/ADR-008-just-in-time-skill-loading.md +29 -0
  200. package/.planning/decisions/ADR-009-enterprise-integration-retry-policy.md +8 -0
  201. package/.planning/decisions/ADR-010-governance-tier-escalation.md +8 -0
  202. package/.planning/decisions/ADR-011-multi-developer-handoff-contract.md +8 -0
  203. package/.planning/decisions/ADR-012-intelligence-feedback-loops.md +19 -0
  204. package/.planning/decisions/ADR-013-mindforge-md-constitution.md +16 -0
  205. package/.planning/decisions/ADR-014-metrics-as-signals-not-evaluation.md +15 -0
  206. package/.planning/decisions/ADR-015-npm-based-skill-registry.md +26 -0
  207. package/.planning/decisions/ADR-016-ci-exit-code-0-on-timeout.md +27 -0
  208. package/.planning/decisions/ADR-017-sdk-localhost-only.md +28 -0
  209. package/.planning/decisions/ADR-018-installer-self-install-detection.md +15 -0
  210. package/.planning/decisions/ADR-019-self-update-scope-preservation.md +14 -0
  211. package/.planning/decisions/ADR-020-v1.0.0-stable-interface-contract.md +23 -0
  212. package/.planning/jira-sync.json +9 -0
  213. package/.planning/milestones/.gitkeep +1 -0
  214. package/.planning/phases/day1/REVIEW-DAY1.md +50 -0
  215. package/.planning/phases/day1/SECURITY-REVIEW-DAY1.md +15 -0
  216. package/.planning/phases/day2/REVIEW-DAY2.md +521 -0
  217. package/.planning/phases/day3/REVIEW-DAY3.md +234 -0
  218. package/.planning/slack-threads.json +6 -0
  219. package/CHANGELOG.md +175 -0
  220. package/LICENSE +21 -0
  221. package/MINDFORGE.md +76 -0
  222. package/README.md +182 -0
  223. package/RELEASENOTES.md +41 -0
  224. package/SECURITY.md +4 -0
  225. package/bin/install.js +120 -0
  226. package/bin/installer-core.js +292 -0
  227. package/bin/migrations/0.1.0-to-0.5.0.js +37 -0
  228. package/bin/migrations/0.5.0-to-0.6.0.js +17 -0
  229. package/bin/migrations/0.6.0-to-1.0.0.js +100 -0
  230. package/bin/migrations/migrate.js +151 -0
  231. package/bin/migrations/schema-versions.js +64 -0
  232. package/bin/updater/changelog-fetcher.js +62 -0
  233. package/bin/updater/self-update.js +169 -0
  234. package/bin/updater/version-comparator.js +68 -0
  235. package/bin/validate-config.js +92 -0
  236. package/bin/wizard/config-generator.js +112 -0
  237. package/bin/wizard/environment-detector.js +76 -0
  238. package/bin/wizard/setup-wizard.js +237 -0
  239. package/docs/Context/Master-Context.md +701 -0
  240. package/docs/architecture/README.md +35 -0
  241. package/docs/architecture/decision-records-index.md +26 -0
  242. package/docs/ci-cd-integration.md +30 -0
  243. package/docs/ci-quickstart.md +78 -0
  244. package/docs/commands-reference.md +11 -0
  245. package/docs/contributing/CONTRIBUTING.md +38 -0
  246. package/docs/contributing/plugin-authoring.md +50 -0
  247. package/docs/contributing/skill-authoring.md +41 -0
  248. package/docs/enterprise-setup.md +25 -0
  249. package/docs/faq.md +38 -0
  250. package/docs/getting-started.md +36 -0
  251. package/docs/governance-guide.md +23 -0
  252. package/docs/mindforge-md-reference.md +53 -0
  253. package/docs/monorepo-guide.md +26 -0
  254. package/docs/persona-customisation.md +56 -0
  255. package/docs/quick-verify.md +33 -0
  256. package/docs/reference/audit-events.md +53 -0
  257. package/docs/reference/commands.md +82 -0
  258. package/docs/reference/config-reference.md +64 -0
  259. package/docs/reference/sdk-api.md +48 -0
  260. package/docs/reference/skills-api.md +57 -0
  261. package/docs/release-checklist-guide.md +37 -0
  262. package/docs/requirements.md +29 -0
  263. package/docs/sdk-reference.md +27 -0
  264. package/docs/security/SECURITY.md +42 -0
  265. package/docs/security/penetration-test-results.md +31 -0
  266. package/docs/security/threat-model.md +142 -0
  267. package/docs/skills-authoring-guide.md +119 -0
  268. package/docs/skills-publishing-guide.md +21 -0
  269. package/docs/team-setup-guide.md +21 -0
  270. package/docs/troubleshooting.md +119 -0
  271. package/docs/tutorial.md +195 -0
  272. package/docs/upgrade.md +44 -0
  273. package/docs/user-guide.md +131 -0
  274. package/docs/usp-features.md +214 -0
  275. package/eslint.config.mjs +31 -0
  276. package/examples/starter-project/.planning/AUDIT.jsonl +1 -0
  277. package/examples/starter-project/.planning/HANDOFF.json +23 -0
  278. package/examples/starter-project/.planning/PROJECT.md +27 -0
  279. package/examples/starter-project/.planning/STATE.md +10 -0
  280. package/examples/starter-project/MINDFORGE.md +40 -0
  281. package/examples/starter-project/README.md +14 -0
  282. package/implementation-roadmap/day-1-imp/DAY1-HARDEN.md +823 -0
  283. package/implementation-roadmap/day-1-imp/DAY1-IMPLEMENT.md +2459 -0
  284. package/implementation-roadmap/day-1-imp/DAY1-REVIEW.md +288 -0
  285. package/implementation-roadmap/day-2-imp/DAY2-HARDEN.md +954 -0
  286. package/implementation-roadmap/day-2-imp/DAY2-IMPLEMENT.md +2347 -0
  287. package/implementation-roadmap/day-2-imp/DAY2-REVIEW.md +422 -0
  288. package/implementation-roadmap/day-3-imp/DAY3-HARDEN.md +870 -0
  289. package/implementation-roadmap/day-3-imp/DAY3-IMPLEMENT.md +2798 -0
  290. package/implementation-roadmap/day-3-imp/DAY3-REVIEW.md +484 -0
  291. package/implementation-roadmap/day-4-imp/DAY4-HARDEN.md +1087 -0
  292. package/implementation-roadmap/day-4-imp/DAY4-IMPLEMENT.md +2874 -0
  293. package/implementation-roadmap/day-4-imp/DAY4-REVIEW.md +386 -0
  294. package/implementation-roadmap/day-5-imp/DAY5-HARDEN.md +1078 -0
  295. package/implementation-roadmap/day-5-imp/DAY5-IMPLEMENT.md +3151 -0
  296. package/implementation-roadmap/day-5-imp/DAY5-REVIEW.md +345 -0
  297. package/implementation-roadmap/day-6-imp/DAY6-COMPLETE.md +3919 -0
  298. package/implementation-roadmap/day-7-imp-prod/DAY7-PRODUCTION-FINAL.md +4513 -0
  299. package/package.json +31 -0
  300. package/sdk/README.md +69 -0
  301. package/sdk/eslint.config.mjs +34 -0
  302. package/sdk/package-lock.json +1507 -0
  303. package/sdk/package.json +30 -0
  304. package/sdk/src/client.ts +133 -0
  305. package/sdk/src/commands.ts +63 -0
  306. package/sdk/src/events.ts +166 -0
  307. package/sdk/src/index.ts +22 -0
  308. package/sdk/src/types.ts +87 -0
  309. package/sdk/tsconfig.json +13 -0
  310. package/tests/audit.test.js +206 -0
  311. package/tests/ci-mode.test.js +162 -0
  312. package/tests/compaction.test.js +161 -0
  313. package/tests/distribution.test.js +205 -0
  314. package/tests/e2e.test.js +618 -0
  315. package/tests/governance.test.js +130 -0
  316. package/tests/install.test.js +209 -0
  317. package/tests/integrations.test.js +128 -0
  318. package/tests/intelligence.test.js +117 -0
  319. package/tests/metrics.test.js +96 -0
  320. package/tests/migration.test.js +309 -0
  321. package/tests/production.test.js +416 -0
  322. package/tests/sdk.test.js +200 -0
  323. package/tests/skills-platform.test.js +403 -0
  324. package/tests/wave-engine.test.js +338 -0
@@ -0,0 +1,451 @@
1
+ # MindForge Audit System — Schema Reference
2
+
3
+ ## Purpose
4
+ AUDIT.jsonl is an append-only, newline-delimited JSON log of every significant
5
+ MindForge agent action. It provides a complete, tamper-evident history of what
6
+ the agent did, when, and why.
7
+
8
+ ## File location
9
+ `.planning/AUDIT.jsonl`
10
+
11
+ ## Format
12
+ One JSON object per line. Never modify existing lines. Only append.
13
+
14
+ ```
15
+ {"id":"...","timestamp":"...","event":"...","phase":1,...}
16
+ {"id":"...","timestamp":"...","event":"...","phase":1,...}
17
+ ```
18
+
19
+ ## Archiving and rotation
20
+ When `.planning/AUDIT.jsonl` exceeds 10,000 lines, rotate it into
21
+ `.planning/audit-archive/` instead of truncating or rewriting history.
22
+
23
+ Recommended archive naming:
24
+ - `AUDIT-2026-03-20T14-32-10Z.jsonl`
25
+ - `AUDIT-phase-4-rotation-001.jsonl`
26
+
27
+ Rotation procedure:
28
+ 1. Validate the active log is valid JSONL
29
+ 2. Copy it into `.planning/audit-archive/`
30
+ 3. Replace the active log with a new empty `AUDIT.jsonl`
31
+ 4. Write an AUDIT entry or rotation manifest noting archive filename, line count,
32
+ and timestamp
33
+
34
+ ## Universal fields (present in every entry)
35
+
36
+ | Field | Type | Description |
37
+ |---|---|---|
38
+ | `id` | string | UUID v4. Unique per entry. |
39
+ | `timestamp` | string | ISO-8601 with timezone: `2026-03-20T14:32:10.000Z` |
40
+ | `event` | string | Event type (see Event Types below) |
41
+ | `agent` | string | Which agent wrote this: `mindforge-orchestrator`, `mindforge-subagent-[plan]`, `mindforge-security-reviewer`, etc. |
42
+ | `phase` | number/null | Phase number, or null if not in a phase |
43
+ | `session_id` | string | Identifies the current agent session (use a short random ID) |
44
+
45
+ ## Event types and their additional fields
46
+
47
+ ### `project_initialised`
48
+ ```json
49
+ {
50
+ "id": "uuid",
51
+ "timestamp": "ISO-8601",
52
+ "event": "project_initialised",
53
+ "agent": "mindforge-orchestrator",
54
+ "phase": null,
55
+ "session_id": "sess_abc",
56
+ "project_name": "my-saas-app",
57
+ "tech_stack": "Next.js + PostgreSQL",
58
+ "compliance": ["GDPR"]
59
+ }
60
+ ```
61
+
62
+ ### `phase_planned`
63
+ ```json
64
+ {
65
+ "id": "uuid",
66
+ "timestamp": "ISO-8601",
67
+ "event": "phase_planned",
68
+ "agent": "mindforge-orchestrator",
69
+ "phase": 1,
70
+ "session_id": "sess_abc",
71
+ "plan_count": 5,
72
+ "wave_count": 3,
73
+ "research_conducted": true
74
+ }
75
+ ```
76
+
77
+ ### `phase_execution_started`
78
+ ```json
79
+ {
80
+ "id": "uuid",
81
+ "timestamp": "ISO-8601",
82
+ "event": "phase_execution_started",
83
+ "agent": "mindforge-orchestrator",
84
+ "phase": 1,
85
+ "session_id": "sess_abc",
86
+ "plan_count": 5,
87
+ "wave_count": 3,
88
+ "dependency_graph_path": ".planning/phases/1/DEPENDENCY-GRAPH-1.md"
89
+ }
90
+ ```
91
+
92
+ ### `phase_execution_completed`
93
+ ```json
94
+ {
95
+ "id": "uuid",
96
+ "timestamp": "ISO-8601",
97
+ "event": "phase_execution_completed",
98
+ "agent": "mindforge-orchestrator",
99
+ "phase": 1,
100
+ "session_id": "sess_abc",
101
+ "tasks_completed": 5,
102
+ "tasks_failed": 0,
103
+ "verify_status": "pass",
104
+ "verification_path": ".planning/phases/1/VERIFICATION.md"
105
+ }
106
+ ```
107
+
108
+ ### `session_started`
109
+ ```json
110
+ {
111
+ "id": "uuid",
112
+ "timestamp": "ISO-8601",
113
+ "event": "session_started",
114
+ "agent": "mindforge-orchestrator",
115
+ "phase": null,
116
+ "session_id": "sess_abc",
117
+ "reason": "new_session"
118
+ }
119
+ ```
120
+
121
+ ### `quick_task_completed`
122
+ ```json
123
+ {
124
+ "id": "uuid",
125
+ "timestamp": "ISO-8601",
126
+ "event": "quick_task_completed",
127
+ "agent": "mindforge-orchestrator",
128
+ "phase": null,
129
+ "session_id": "sess_abc",
130
+ "quick_task_id": "003-fix-login",
131
+ "commit_sha": "abc1234",
132
+ "verify_result": "pass"
133
+ }
134
+ ```
135
+
136
+ ### `debug_completed`
137
+ ```json
138
+ {
139
+ "id": "uuid",
140
+ "timestamp": "ISO-8601",
141
+ "event": "debug_completed",
142
+ "agent": "mindforge-debug-specialist",
143
+ "phase": 2,
144
+ "plan": "03",
145
+ "session_id": "sess_abc",
146
+ "root_cause": "Null pointer in auth middleware",
147
+ "commit_sha": "def5678",
148
+ "tests_run": true
149
+ }
150
+ ```
151
+
152
+ ### `uat_started`
153
+ ```json
154
+ {
155
+ "id": "uuid",
156
+ "timestamp": "ISO-8601",
157
+ "event": "uat_started",
158
+ "agent": "mindforge-orchestrator",
159
+ "phase": 1,
160
+ "session_id": "sess_abc",
161
+ "owner": "product"
162
+ }
163
+ ```
164
+
165
+ ### `uat_completed`
166
+ ```json
167
+ {
168
+ "id": "uuid",
169
+ "timestamp": "ISO-8601",
170
+ "event": "uat_completed",
171
+ "agent": "mindforge-orchestrator",
172
+ "phase": 1,
173
+ "session_id": "sess_abc",
174
+ "result": "pass",
175
+ "notes": "Signed off by product"
176
+ }
177
+ ```
178
+
179
+ ### `ship_started`
180
+ ```json
181
+ {
182
+ "id": "uuid",
183
+ "timestamp": "ISO-8601",
184
+ "event": "ship_started",
185
+ "agent": "mindforge-release-manager",
186
+ "phase": 1,
187
+ "session_id": "sess_abc",
188
+ "version": "v0.1.0"
189
+ }
190
+ ```
191
+
192
+ ### `ship_completed`
193
+ ```json
194
+ {
195
+ "id": "uuid",
196
+ "timestamp": "ISO-8601",
197
+ "event": "ship_completed",
198
+ "agent": "mindforge-release-manager",
199
+ "phase": 1,
200
+ "session_id": "sess_abc",
201
+ "version": "v0.1.0",
202
+ "release_tag": "v0.1.0"
203
+ }
204
+ ```
205
+
206
+ ### `task_started`
207
+ ```json
208
+ {
209
+ "id": "uuid",
210
+ "timestamp": "ISO-8601",
211
+ "event": "task_started",
212
+ "agent": "mindforge-subagent-01",
213
+ "phase": 1,
214
+ "plan": "01",
215
+ "session_id": "sess_abc",
216
+ "task_name": "Create user authentication model",
217
+ "persona": "developer",
218
+ "skills_loaded": ["security-review"],
219
+ "files_in_scope": ["src/models/user.ts", "src/models/user.test.ts"]
220
+ }
221
+ ```
222
+
223
+ ### `task_completed`
224
+ ```json
225
+ {
226
+ "id": "uuid",
227
+ "timestamp": "ISO-8601",
228
+ "event": "task_completed",
229
+ "agent": "mindforge-subagent-01",
230
+ "phase": 1,
231
+ "plan": "01",
232
+ "session_id": "sess_abc",
233
+ "task_name": "Create user authentication model",
234
+ "commit_sha": "abc1234",
235
+ "verify_result": "pass",
236
+ "verify_output": "Tests: 8 passing (342ms)",
237
+ "files_changed": ["src/models/user.ts", "src/models/user.test.ts"],
238
+ "decisions_made": ["Used argon2id over bcrypt per SECURITY.md requirements"]
239
+ }
240
+ ```
241
+
242
+ ### `task_failed`
243
+ ```json
244
+ {
245
+ "id": "uuid",
246
+ "timestamp": "ISO-8601",
247
+ "event": "task_failed",
248
+ "agent": "mindforge-subagent-02",
249
+ "phase": 1,
250
+ "plan": "02",
251
+ "session_id": "sess_abc",
252
+ "task_name": "Create product model",
253
+ "failure_reason": "verify step failed: TypeError: Cannot read property 'id' of undefined",
254
+ "files_modified_at_failure": ["src/models/product.ts"],
255
+ "recovery_action": "debug_agent_spawned"
256
+ }
257
+ ```
258
+
259
+ ### `security_finding`
260
+ ```json
261
+ {
262
+ "id": "uuid",
263
+ "timestamp": "ISO-8601",
264
+ "event": "security_finding",
265
+ "agent": "mindforge-security-reviewer",
266
+ "phase": 1,
267
+ "plan": "03",
268
+ "session_id": "sess_abc",
269
+ "severity": "HIGH",
270
+ "owasp_category": "A03:Injection",
271
+ "finding": "Parameterised query missing in user search endpoint",
272
+ "file": "src/api/users/search.ts",
273
+ "line": 47,
274
+ "remediated": false,
275
+ "report_path": ".planning/phases/1/SECURITY-REVIEW-1.md"
276
+ }
277
+ ```
278
+
279
+ ### `integration_action`
280
+ ```json
281
+ {
282
+ "id": "uuid",
283
+ "timestamp": "ISO-8601",
284
+ "event": "integration_action",
285
+ "agent": "mindforge-orchestrator",
286
+ "phase": 2,
287
+ "session_id": "sess_abc",
288
+ "integration": "jira",
289
+ "action": "create_ticket",
290
+ "status": "success",
291
+ "external_id": "ENG-42",
292
+ "detail": "Created Epic for Phase 2",
293
+ "attempts": 1
294
+ }
295
+ ```
296
+
297
+ ### `integration_credential_expired`
298
+ ```json
299
+ {
300
+ "id": "uuid",
301
+ "timestamp": "ISO-8601",
302
+ "event": "integration_credential_expired",
303
+ "agent": "mindforge-orchestrator",
304
+ "phase": null,
305
+ "session_id": "sess_abc",
306
+ "integration": "jira",
307
+ "detail": "Health check returned 401"
308
+ }
309
+ ```
310
+
311
+ ### `change_classified`
312
+ ```json
313
+ {
314
+ "id": "uuid",
315
+ "timestamp": "ISO-8601",
316
+ "event": "change_classified",
317
+ "agent": "mindforge-orchestrator",
318
+ "phase": 4,
319
+ "session_id": "sess_abc",
320
+ "tier": 3,
321
+ "classification_reason": "code pattern: jwt.sign found in src/utils/helper.ts",
322
+ "signal_triggered": "code_content"
323
+ }
324
+ ```
325
+
326
+ ### `compliance_gate_failed`
327
+ ```json
328
+ {
329
+ "id": "uuid",
330
+ "timestamp": "ISO-8601",
331
+ "event": "compliance_gate_failed",
332
+ "agent": "mindforge-security-reviewer",
333
+ "phase": 4,
334
+ "session_id": "sess_abc",
335
+ "gate": "GDPR_retention",
336
+ "detail": "PII field added without retention policy"
337
+ }
338
+ ```
339
+
340
+ ### `quality_gate_failed`
341
+ ```json
342
+ {
343
+ "id": "uuid",
344
+ "timestamp": "ISO-8601",
345
+ "event": "quality_gate_failed",
346
+ "agent": "mindforge-orchestrator",
347
+ "phase": 1,
348
+ "session_id": "sess_abc",
349
+ "gate": "test_suite",
350
+ "detail": "4 tests failing after wave 2 completion",
351
+ "blocking": true,
352
+ "user_notified": true
353
+ }
354
+ ```
355
+
356
+ ### `context_compaction`
357
+ ```json
358
+ {
359
+ "id": "uuid",
360
+ "timestamp": "ISO-8601",
361
+ "event": "context_compaction",
362
+ "agent": "mindforge-orchestrator",
363
+ "phase": 1,
364
+ "plan": "03",
365
+ "session_id": "sess_abc",
366
+ "context_usage_pct": 72,
367
+ "session_summary": "Completed plans 01 and 02, started plan 03",
368
+ "handoff_written": true
369
+ }
370
+ ```
371
+
372
+ ### `phase_completed`
373
+ ```json
374
+ {
375
+ "id": "uuid",
376
+ "timestamp": "ISO-8601",
377
+ "event": "phase_completed",
378
+ "agent": "mindforge-orchestrator",
379
+ "phase": 1,
380
+ "session_id": "sess_abc",
381
+ "tasks_completed": 5,
382
+ "commits": ["abc1234", "def5678", "ghi9012", "jkl3456", "mno7890"],
383
+ "requirements_met": 8,
384
+ "requirements_total": 8,
385
+ "uat_signed_off": true,
386
+ "duration_estimate": "~51 minutes"
387
+ }
388
+ ```
389
+
390
+ ### `decision_recorded`
391
+ ```json
392
+ {
393
+ "id": "uuid",
394
+ "timestamp": "ISO-8601",
395
+ "event": "decision_recorded",
396
+ "agent": "mindforge-orchestrator",
397
+ "phase": 1,
398
+ "session_id": "sess_abc",
399
+ "decision_type": "architectural",
400
+ "description": "Chose argon2id over bcrypt for password hashing",
401
+ "rationale": "argon2id won PHC and is more memory-hard against GPU attacks",
402
+ "adr_path": ".planning/decisions/ADR-004-password-hashing.md"
403
+ }
404
+ ```
405
+
406
+ ## Audit query guide (for `/mindforge:status` command)
407
+
408
+ To read the audit log effectively:
409
+
410
+ ```bash
411
+ # All events for phase 1
412
+ grep '"phase":1' .planning/AUDIT.jsonl | python3 -m json.tool
413
+
414
+ # All security findings
415
+ grep '"event":"security_finding"' .planning/AUDIT.jsonl
416
+
417
+ # All task failures
418
+ grep '"event":"task_failed"' .planning/AUDIT.jsonl
419
+
420
+ # Today's activity
421
+ grep "$(date -u +%Y-%m-%d)" .planning/AUDIT.jsonl
422
+
423
+ # Count events by type
424
+ grep -o '"event":"[^"]*"' .planning/AUDIT.jsonl | sort | uniq -c | sort -rn
425
+ ```
426
+
427
+ ## Audit integrity rules
428
+
429
+ 1. **Never delete lines** from AUDIT.jsonl. It is append-only.
430
+ 2. **Never modify existing lines.** If an entry was wrong, write a correction entry.
431
+ 3. **Every correction entry** must reference the ID of the entry it corrects:
432
+ ```json
433
+ {"id":"new-uuid","event":"correction","corrects_id":"original-uuid","correction":"..."}
434
+ ```
435
+ 4. **Write an entry for every significant action** — not just successes.
436
+ Failures, blockers, and security findings are especially important.
437
+ 5. **AUDIT.jsonl is committed to git.** Do not write secrets into it.
438
+
439
+ ## Corruption recovery and archiving
440
+
441
+ If AUDIT.jsonl is corrupted (partial line from crash):
442
+ 1. Restore the last clean version from git history, OR
443
+ 2. Filter valid lines only:
444
+ ```bash
445
+ python3 -c "import sys,json;[print(l.strip()) for l in sys.stdin if l.strip() and json.loads(l)]" < .planning/AUDIT.jsonl > /tmp/AUDIT.clean.jsonl
446
+ mv /tmp/AUDIT.clean.jsonl .planning/AUDIT.jsonl
447
+ ```
448
+
449
+ If AUDIT.jsonl grows beyond 10,000 lines:
450
+ 1. Archive to `.planning/AUDIT-archive-YYYY.jsonl`
451
+ 2. Start a fresh `.planning/AUDIT.jsonl` with new entries
@@ -0,0 +1,21 @@
1
+ # MindForge CI Config Schema
2
+
3
+ ## Purpose
4
+ Document CI-related configuration keys supported in `MINDFORGE.md`.
5
+
6
+ ## Supported keys
7
+
8
+ | Key | Type | Default | Description |
9
+ |---|---|---|---|
10
+ | `CI_EXECUTE_PHASES` | string | `all` | Phases to run in CI (`all` or comma-separated list) |
11
+ | `CI_AUTO_APPROVE_TIER2` | boolean | `false` | Auto-approve Tier 2 changes in CI |
12
+ | `CI_BLOCK_ON_MEDIUM_SECURITY` | boolean | `false` | Block CI on MEDIUM security findings |
13
+ | `CI_SECURITY_SCAN` | boolean | `true` | Run security scan in CI |
14
+ | `CI_SKIP_UAT` | boolean | `true` | Skip human UAT in CI |
15
+ | `CI_MIN_COVERAGE_PCT` | number | `80` | Coverage threshold for CI |
16
+ | `CI_TIMEOUT_MINUTES` | number | `60` | Total CI timeout in minutes |
17
+ | `CI_OUTPUT_FORMAT` | enum | `github-annotations` | Output format: json, text, github-annotations |
18
+
19
+ ## Notes
20
+ - CI defaults are safety-first. Tier 2 is blocked unless explicitly auto-approved.
21
+ - Tier 3 is always blocked in CI regardless of configuration.
@@ -0,0 +1,179 @@
1
+ # MindForge CI Mode
2
+
3
+ ## Purpose
4
+ Enable MindForge to run in non-interactive CI/CD environments.
5
+ CI mode is fully automated — no user prompts, no interactive approvals,
6
+ no waiting for human input. All decisions are pre-configured.
7
+
8
+ ## Activating CI mode
9
+
10
+ CI mode activates automatically when:
11
+ 1. `CI=true` environment variable is set (standard in GitHub Actions, GitLab CI, Jenkins)
12
+ 2. `MINDFORGE_CI=true` is explicitly set
13
+ 3. `process.stdin.isTTY === false` (piped or non-interactive shell)
14
+
15
+ In CI mode:
16
+ - All interactive prompts are skipped — pre-configured answers are used
17
+ - Approval workflows use the CI approval policy (see below)
18
+ - Progress output is structured JSON (parseable by CI log processors)
19
+ - Exit codes communicate status (0 = success, 1 = failure)
20
+ - Slack/GitHub notifications are sent as configured (integrations still work)
21
+
22
+ ## CI mode configuration
23
+
24
+ Add to `MINDFORGE.md` for CI-specific settings:
25
+
26
+ ```
27
+ ## CI/CD configuration
28
+
29
+ # Which phases to execute in CI (comma-separated phase numbers, or "all")
30
+ CI_EXECUTE_PHASES=all
31
+
32
+ # Auto-approve Tier 2 changes in CI (default: false — safer)
33
+ CI_AUTO_APPROVE_TIER2=false
34
+
35
+ # Block CI on MEDIUM security findings (default: false)
36
+ CI_BLOCK_ON_MEDIUM_SECURITY=false
37
+
38
+ # Run full security scan in CI (default: true)
39
+ CI_SECURITY_SCAN=true
40
+
41
+ # Skip human UAT in CI — only run automated verification (default: true)
42
+ CI_SKIP_UAT=true
43
+
44
+ # Fail CI if test coverage drops below this threshold
45
+ CI_MIN_COVERAGE_PCT=80
46
+
47
+ # Timeout for entire CI run in minutes (default: 60)
48
+ CI_TIMEOUT_MINUTES=60
49
+
50
+ # Output format for CI logs: json | text | github-annotations
51
+ CI_OUTPUT_FORMAT=github-annotations
52
+ ```
53
+
54
+ ## CI approval policy
55
+
56
+ Tier 1: always auto-approved (same as interactive mode)
57
+ Tier 2: auto-approved IF `CI_AUTO_APPROVE_TIER2=true` in MINDFORGE.md
58
+ rejected (build fails) IF `CI_AUTO_APPROVE_TIER2=false`
59
+ Tier 3: ALWAYS fails the build in CI — Tier 3 changes require human review.
60
+
61
+ The CI build should never be the first time a Tier 3 change is seen.
62
+ Engineers should get Tier 3 changes approved BEFORE pushing to CI.
63
+
64
+ ## CI output format
65
+
66
+ ### JSON format (`CI_OUTPUT_FORMAT=json`)
67
+ ```json
68
+ {
69
+ "mindforge_version": "0.6.0",
70
+ "phase": 3,
71
+ "status": "running | success | failure | warning",
72
+ "timestamp": "ISO-8601",
73
+ "tasks_completed": 5,
74
+ "tasks_total": 8,
75
+ "current_task": "Plan 3-06: Implement auth middleware",
76
+ "gates": {
77
+ "secrets_clean": true,
78
+ "tests_passing": true,
79
+ "security_findings_critical": 0,
80
+ "security_findings_high": 0,
81
+ "coverage_pct": 84
82
+ },
83
+ "events": [
84
+ { "time": "ISO-8601", "type": "task_completed", "plan": "3-01", "commit": "abc1234" },
85
+ { "time": "ISO-8601", "type": "security_finding", "severity": "MEDIUM", "finding": "..." }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ### GitHub Annotations format (`CI_OUTPUT_FORMAT=github-annotations`)
91
+ ```
92
+ ::group::MindForge Phase 3 Execution
93
+ ::notice::Task 3-01 completed: Create auth middleware [abc1234]
94
+ ::notice::Task 3-02 completed: Add JWT validation [def5678]
95
+ ::warning file=src/auth/session.ts,line=47::Medium security finding: Verbose error message exposes stack trace
96
+ ::notice::Phase 3 complete: 8/8 tasks, all tests passing
97
+ ::endgroup::
98
+ ```
99
+
100
+ ### Error output
101
+ ```
102
+ ::error::MindForge CI failed: Task 3-06 verify step failed
103
+ ::error file=src/api/users.ts,line=89::TypeScript error: Type 'string' is not assignable to 'number'
104
+ ::error::Quality gate failed: test coverage 68% (minimum: 80%)
105
+ ```
106
+
107
+ ## CI environment requirements
108
+
109
+ ```bash
110
+ # Required environment variables for full CI functionality:
111
+ ANTHROPIC_API_KEY= # Claude API access (required for AI features)
112
+ GITHUB_TOKEN= # For PR creation and status checks
113
+ JIRA_API_TOKEN= # Optional — for Jira sync
114
+ SLACK_BOT_TOKEN= # Optional — for notifications
115
+ ```
116
+
117
+ ## CI timeout and exit codes
118
+
119
+ **Exit code policy:**
120
+ | Situation | Exit code | Meaning |
121
+ |---|---|---|
122
+ | All phases complete, gates passed | 0 | Success |
123
+ | Quality gate failed | 1 | Hard failure — fix required |
124
+ | Tier 2/3 governance block | 1 | Hard failure — approval required |
125
+ | CI timeout reached | 0 | Soft stop — work saved, resume next run |
126
+ | No MindForge project found | 1 | Configuration error |
127
+
128
+ **Important:** GitHub Actions (and most CI systems) treat ANY non-zero exit code
129
+ as failure. Exit code 2 does NOT mean "warning" in CI — it means failure.
130
+
131
+ **Timeout handling (exit 0 with state preservation):**
132
+ ```bash
133
+ # Set up timeout trap
134
+ CI_TIMEOUT_SECONDS=$((${CI_TIMEOUT_MINUTES:-60} * 60))
135
+ timeout_handler() {
136
+ echo "::warning::MindForge CI timeout reached after ${CI_TIMEOUT_MINUTES} minutes"
137
+ echo "::warning::Progress saved. Next CI run will resume from: $(cat .planning/HANDOFF.json | python3 -c 'import sys,json; print(json.load(sys.stdin).get("next_task","unknown"))')"
138
+
139
+ # Write resume info to GitHub Actions step summary
140
+ cat >> "${GITHUB_STEP_SUMMARY:-/dev/null}" << 'SUMMARY_EOF'
141
+ ## ⏱️ MindForge CI Timeout
142
+
143
+ CI timeout reached. Progress has been saved.
144
+
145
+ Next run will resume from:
146
+ $(cat .planning/HANDOFF.json | python3 -c 'import sys,json; d=json.load(sys.stdin); print(d.get("next_task","unknown"))')
147
+
148
+ Run the CI pipeline again to continue.
149
+ SUMMARY_EOF
150
+
151
+ # Commit HANDOFF.json so next run can resume
152
+ git add .planning/HANDOFF.json .planning/STATE.md
153
+ git commit -m "ci: save MindForge progress on timeout [skip ci]" || true
154
+ git push origin HEAD || true
155
+
156
+ exit 0 # Exit 0 — timeout is not a failure
157
+ }
158
+
159
+ trap 'timeout_handler' TERM
160
+ (sleep "${CI_TIMEOUT_SECONDS}"; kill -TERM $$) &
161
+ TIMEOUT_PID=$!
162
+ ```
163
+
164
+ ## CI timeout and resource management
165
+
166
+ ```
167
+ Default execution limits per CI run:
168
+ Maximum tasks per session: 25
169
+ Maximum parallel subagents: 5 (respect CI runner memory limits)
170
+ Task timeout: 10 minutes per task
171
+ Phase timeout: 45 minutes
172
+ Full CI timeout: 60 minutes
173
+
174
+ On timeout:
175
+ 1. Write current state to HANDOFF.json
176
+ 2. Exit with code 0 (soft stop)
177
+ 3. The next CI run resumes from HANDOFF.json
178
+ 4. Report: "CI timeout reached. Run will resume from: [next_task]"
179
+ ```