mindforge-cc 10.7.0 → 11.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 (50) hide show
  1. package/.mindforge/MINDFORGE-V2-SCHEMA.json +43 -10
  2. package/.mindforge/config.json +6 -1
  3. package/CHANGELOG.md +64 -0
  4. package/MINDFORGE.md +3 -3
  5. package/README.md +49 -4
  6. package/RELEASENOTES.md +80 -0
  7. package/SECURITY.md +20 -8
  8. package/bin/autonomous/audit-writer.js +13 -0
  9. package/bin/autonomous/auto-runner.js +74 -16
  10. package/bin/autonomous/context-refactorer.js +26 -11
  11. package/bin/autonomous/state-manager.js +62 -6
  12. package/bin/autonomous/stuck-monitor.js +46 -7
  13. package/bin/autonomous/wave-executor.js +66 -25
  14. package/bin/dashboard/api-router.js +43 -0
  15. package/bin/dashboard/metrics-aggregator.js +28 -1
  16. package/bin/dashboard/server.js +67 -4
  17. package/bin/dashboard/sse-bridge.js +4 -4
  18. package/bin/engine/feedback-loop.js +8 -0
  19. package/bin/engine/intelligence-interlock.js +32 -15
  20. package/bin/engine/logic-drift-detector.js +2 -1
  21. package/bin/engine/nexus-tracer.js +3 -2
  22. package/bin/engine/remediation-engine.js +155 -32
  23. package/bin/engine/self-corrective-synthesizer.js +84 -10
  24. package/bin/engine/sre-manager.js +12 -4
  25. package/bin/engine/temporal-hub.js +131 -34
  26. package/bin/governance/approve.js +41 -5
  27. package/bin/governance/impact-analyzer.js +28 -0
  28. package/bin/governance/policy-engine.js +10 -3
  29. package/bin/governance/quantum-crypto.js +32 -19
  30. package/bin/governance/rbac-manager.js +74 -2
  31. package/bin/governance/ztai-manager.js +49 -7
  32. package/bin/hindsight-injector.js +3 -3
  33. package/bin/memory/eis-client.js +71 -34
  34. package/bin/memory/embedding-engine.js +61 -0
  35. package/bin/memory/knowledge-graph.js +58 -5
  36. package/bin/memory/knowledge-indexer.js +53 -6
  37. package/bin/memory/knowledge-store.js +22 -0
  38. package/bin/migrations/10.7.0-to-11.0.0.js +110 -0
  39. package/bin/migrations/schema-versions.js +13 -0
  40. package/bin/models/anthropic-provider.js +45 -0
  41. package/bin/models/cloud-broker.js +68 -20
  42. package/bin/models/gemini-provider.js +51 -0
  43. package/bin/models/model-client.js +20 -0
  44. package/bin/models/model-router.js +28 -8
  45. package/bin/models/openai-provider.js +44 -0
  46. package/bin/utils/file-io.js +63 -1
  47. package/bin/utils/index.js +58 -0
  48. package/docs/getting-started.md +1 -1
  49. package/docs/user-guide.md +2 -2
  50. package/package.json +2 -2
@@ -1,14 +1,51 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "MindForge v2 Autonomous Engine Schema",
4
- "description": "Schema for HANDOFF.json and auto-state.json in v2.0.0-alpha.1",
4
+ "description": "Schema for HANDOFF.json and auto-state.json in v2.0.0-alpha.1+",
5
5
  "type": "object",
6
6
  "properties": {
7
- "schema_version": { "type": "string", "const": "2.0.0" },
7
+ "schema_version": { "type": "string" },
8
+ "schema_type": { "type": "string", "enum": ["HANDOFF", "AUTO_STATE"] },
8
9
  "auto_mode_active": { "type": "boolean" },
9
- "phase": { "type": "integer" },
10
- "wave_current": { "type": "integer" },
11
- "tasks_completed": { "type": "integer" },
10
+ "phase": { "oneOf": [{ "type": "integer" }, { "type": "string" }] },
11
+ "wave_current": { "type": "integer", "minimum": 0 },
12
+ "tasks_completed": { "type": "integer", "minimum": 0 },
13
+ "status": {
14
+ "type": "string",
15
+ "enum": ["idle", "running", "paused", "completed", "escalated", "timeout"]
16
+ },
17
+ "handoffs": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "id": { "type": "string" },
23
+ "name": { "type": "string" },
24
+ "plan": { "type": "string" },
25
+ "depends_on": {
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ },
29
+ "wave": { "type": "integer", "minimum": 0 }
30
+ },
31
+ "required": ["id", "name"]
32
+ }
33
+ },
34
+ "timestamps": {
35
+ "type": "object",
36
+ "properties": {
37
+ "started_at": { "type": "string", "format": "date-time" },
38
+ "updated_at": { "type": "string", "format": "date-time" }
39
+ }
40
+ },
41
+ "next_task": { "type": "string" },
42
+ "context_refs": { "type": "array", "items": { "type": "string" } },
43
+ "blockers": { "type": "array", "items": { "type": "string" } },
44
+ "decisions_needed": { "type": "array", "items": { "type": "string" } },
45
+ "recent_commits": { "type": "array", "items": { "type": "string" } },
46
+ "recent_files": { "type": "array", "items": { "type": "string" } },
47
+ "current_context": { "type": "string" },
48
+ "last_updated": { "type": "string", "format": "date-time" },
12
49
  "PLANNER_MODEL": { "type": "string" },
13
50
  "EXECUTOR_MODEL": { "type": "string" },
14
51
  "REVIEWER_MODEL": { "type": "string" },
@@ -21,10 +58,6 @@
21
58
  "MODEL_COST_HARD_LIMIT_USD": { "type": "number" },
22
59
  "MODEL_PREFER_CHEAP_BELOW_DIFFICULTY": { "type": "number" },
23
60
  "REQUIRE_CROSS_REVIEW": { "type": "boolean" },
24
- "status": {
25
- "type": "string",
26
- "enum": ["idle", "running", "paused", "completed", "escalated", "timeout"]
27
- },
28
61
  "governance": {
29
62
  "type": "object",
30
63
  "properties": {
@@ -43,5 +76,5 @@
43
76
  }
44
77
  }
45
78
  },
46
- "required": ["schema_version", "auto_mode_active", "status"]
79
+ "required": ["schema_version"]
47
80
  }
@@ -5,7 +5,7 @@
5
5
  "drift_threshold": 0.75,
6
6
  "critical_drift_threshold": 0.5,
7
7
  "res_threshold": 0.8,
8
- "active_did": "did:mindforge:5a537f83-69de-40ac-a613-e96d4a84a270"
8
+ "active_did": "did:mindforge:da5daf83-c478-490f-b528-bd907ad4eee3"
9
9
  },
10
10
  "revops": {
11
11
  "market_registry": {
@@ -69,6 +69,11 @@
69
69
  "max_drift_threshold": 0.1,
70
70
  "auto_verify": false
71
71
  },
72
+ "wave_concurrency": 3,
73
+ "temporal": {
74
+ "max_snapshots": 50,
75
+ "max_age_days": 7
76
+ },
72
77
  "instincts": {
73
78
  "mode": "auto-capture",
74
79
  "max_active_per_project": 100,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ## [11.0.0] - 2026-05-28 — "Sovereign Stability"
4
+
5
+ ### Breaking Changes
6
+
7
+ - `verifyZKProof()` returns structured `{ verified, reason }` instead of throwing
8
+ - `signPQ()` returns `{ signature, simulated, algorithm }` object instead of raw string
9
+ - Wave task execution order within waves is no longer deterministic
10
+ - SDK bumped to 11.0.0 with new type exports
11
+ - Dashboard tokens now expire after 24 hours
12
+ - `TemporalHub.captureState()` and `rollbackTo()` are now async
13
+
14
+ ### Added
15
+
16
+ - LRUMap utility class for bounded caches with eviction callbacks
17
+ - Atomic JSON write primitives (write-to-temp, fsync, rename)
18
+ - AUDIT.jsonl log rotation with gzip archival (max 5000 lines)
19
+ - HANDOFF.json structural validation (fail-open)
20
+ - Temporal snapshot garbage collection (retain 50, expire > 7 days)
21
+ - BM25 scoring with document-length normalization
22
+ - Persistent index cache (mtime-based invalidation)
23
+ - Persistent adjacency index for knowledge graph
24
+ - Correction effectiveness tracking in self-corrective synthesizer
25
+ - Full remediation strategy implementations (CONTEXT_COMPRESSION, GOLDEN_TRACE_INJECTION, REASONING_RESTART)
26
+ - Graduated intelligence interlock (+1/+2/MAX tier) with cost-awareness
27
+ - 3-tier stuck detection (hash → length → truncated Levenshtein)
28
+ - Adaptive context window (10/20/30 based on velocity)
29
+ - Configurable external ZK verifier module path
30
+ - Ephemeral SRE enclave keys (crypto.randomBytes)
31
+ - Time-limited RBAC role elevation with auto-expiry
32
+ - Session-scoped ZTAI agent registry
33
+ - Dashboard rate limiting (100 req/min/IP) and token expiration (24h)
34
+ - /api/v1/token/refresh endpoint
35
+ - Optional GPG approval verification
36
+ - GET /api/v1/system observability endpoint (heap, uptime, audit stats)
37
+ - checkHeapHealth() with warning/critical thresholds
38
+ - Remediation effectiveness persistence
39
+ - Model router dynamic reload (mtime-based, 60s interval)
40
+ - P95 latency ring buffer for cloud broker
41
+ - EIS client with real fetch + 3-retry exponential backoff
42
+ - Semaphore-based parallel wave execution (max concurrency configurable)
43
+ - WebSocketEventStream with auto-reconnect
44
+ - SDK streamExecution() with AsyncIterable<StreamChunk>
45
+ - SDK batchExecute() with concurrent task execution
46
+ - SDK validateRuntimeConfig()
47
+ - Model streaming support (Anthropic, OpenAI, Gemini providers)
48
+ - Migration script (bin/migrations/10.7.0-to-11.0.0.js)
49
+
50
+ ### Changed
51
+
52
+ - sessionDriftHistory bounded to 500 entries via LRUMap
53
+ - entropyCache bounded to 1000 entries via LRUMap
54
+ - Cloud broker failure tracking uses 5-minute sliding window
55
+ - Self-corrective synthesizer window expanded from 10 → 50 events
56
+ - Context refactorer uses adaptive window instead of fixed 20
57
+
58
+ ### Fixed
59
+
60
+ - Memory leaks from unbounded Maps in long-running sessions
61
+ - Data corruption risk on process crash during state file writes
62
+ - Disk exhaustion from unbounded AUDIT.jsonl and snapshot growth
63
+ - Hardcoded SRE enclave private key (security issue)
64
+
65
+ ---
66
+
3
67
  ## [10.7.0] - 2026-05-27 — "Platform Sovereign"
4
68
 
5
69
  ### Added (v10.7.0)
package/MINDFORGE.md CHANGED
@@ -1,12 +1,12 @@
1
- # MINDFORGE.md — Parameter Registry (v10.7.0)
1
+ # MINDFORGE.md — Parameter Registry (v11.0.0)
2
2
 
3
3
  ## 1. IDENTITY & VERSIONING
4
4
 
5
5
  [NAME] = MindForge
6
- [VERSION] = 10.7.0-SOVEREIGN
6
+ [VERSION] = 11.0.0
7
7
  [STABLE] = true
8
8
  [MODE] = "Platform Sovereign"
9
- [REQUIRED_CORE_VERSION] = 10.7.0
9
+ [REQUIRED_CORE_VERSION] = 11.0.0
10
10
  [SOVEREIGN_IDENTITY] = true
11
11
  [SRE_LAYER_ENABLED] = true
12
12
 
package/README.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # MindForge
2
2
 
3
- **An agentic intelligence framework for Claude Code** — orchestrates multi-agent workflows with governance, memory, and autonomous execution. Install once, get structured AI-driven development with built-in quality gates.
3
+ **An agentic intelligence framework for Claude Code** — orchestrates multi-agent workflows with governance, memory, and autonomous execution. Production-hardened with true parallelism, streaming SDK, and zero-trust security. Install once, get structured AI-driven development with built-in quality gates.
4
4
 
5
5
  ---
6
6
 
7
- ## v10.0.3Council Awakens
7
+ ## v11.0.0Sovereign Stability
8
8
 
9
- MindForge v10.0.3 "Council Awakens" introduces the Council decision framework, Instinct Engine, Cost-Aware Routing, 6-phase Verification Loop, and Multi-LLM Consult. This release adds 10 skills (20 core total), 8 commands (71 total), 9 personas (117 total), 3 swarm templates (21 total), and 5 engine subsystems expanding MindForge's autonomous governance and multi-agent reasoning capabilities.
9
+ MindForge v11.0.0 "Sovereign Stability" is a production-hardening release focused on reliability, performance, and real-world deployment readiness. Key highlights:
10
+
11
+ - **Memory-safe operations** — LRU-bounded caches, atomic writes, log rotation, and snapshot garbage collection eliminate resource leaks in long-running sessions.
12
+ - **True wave parallelism** — Semaphore-based concurrent execution with configurable max concurrency replaces sequential task dispatch.
13
+ - **Streaming SDK** — WebSocket event streaming, `streamExecution()` with AsyncIterable, and `batchExecute()` for high-throughput integrations.
14
+ - **Hardened security** — Ephemeral enclave keys, session-scoped agent isolation, time-limited RBAC elevation, dashboard rate limiting, and structured ZK proof returns.
15
+ - **Production observability** — `/api/v1/system` health endpoint, P95 latency tracking, heap health monitoring, and real EIS client with retry logic.
16
+ - **Graduated intelligence** — Adaptive tier escalation (+1/+2/MAX) with cost-awareness, 3-tier stuck detection, and adaptive context windows.
17
+
18
+ This release ships 200+ skills, 400+ personas, 18 pillars, and 49 swarm templates across 12 engineering domains.
10
19
 
11
20
 
12
21
  ## Installation & Setup
@@ -45,6 +54,12 @@ npx mindforge-cc@latest --antigravity --local
45
54
 
46
55
  ---
47
56
 
57
+ - **Production Hardening (v11.0.0)** — LRU caches, atomic JSON writes, log rotation, HANDOFF validation, and temporal snapshot GC for crash-safe long-running sessions.
58
+ - **True Wave Parallelism (v11.0.0)** — Semaphore-based concurrent wave execution with configurable max concurrency replaces sequential dispatch.
59
+ - **Streaming SDK (v11.0.0)** — WebSocket event streaming, `streamExecution()` AsyncIterable, `batchExecute()`, model streaming across Anthropic/OpenAI/Gemini providers.
60
+ - **Graduated Intelligence (v11.0.0)** — Adaptive tier escalation (+1/+2/MAX) with cost-awareness, 3-tier stuck detection, and adaptive context windows (10/20/30).
61
+ - **Security Hardening (v11.0.0)** — Ephemeral enclave keys, session-scoped ZTAI, time-limited RBAC elevation, dashboard rate limiting (100 req/min/IP), token expiration.
62
+ - **Observability (v11.0.0)** — `/api/v1/system` health endpoint, P95 latency ring buffer, heap health monitoring, real EIS client with exponential backoff.
48
63
  - **Grounded Wave Execution (v9.0.0)** — AutoRunner reads HANDOFF.json wave groups, dispatches tasks with audit tracing, persists progress, and resumes on restart (Pillar XXIV).
49
64
  - **Model Topology Modernization (v9.0.0)** — All model references updated to the Claude 4.x family: claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5 (Pillar XXV).
50
65
  - **Unified Memory Architecture (v9.0.0)** — Knowledge and graph edges consolidated into SQLite (celestial.db) with FTS5 search. Four JSONL stores replaced by one queryable store (Pillar XXVI).
@@ -272,7 +287,7 @@ MindForge supports multiple interaction models to fit your engineering workflow:
272
287
  ```bash
273
288
  /mindforge:update
274
289
  /mindforge:update --apply
275
- /mindforge:migrate --from v0.6.0 --to v1.0.0
290
+ /mindforge:migrate --from v10.7.0 --to v11.0.0
276
291
  ```
277
292
 
278
293
  ---
@@ -320,6 +335,36 @@ See `.mindforge/production/token-optimiser.md`.
320
335
 
321
336
  ## 📜 Framework Evolution & Version History
322
337
 
338
+ <details>
339
+ <summary><b>v11.0.0 — Sovereign Stability (Production Hardening)</b></summary>
340
+
341
+ - **Phase 1: Foundation** — LRU-bounded caches, atomic JSON writes, AUDIT.jsonl log rotation, HANDOFF.json structural validation, temporal snapshot garbage collection.
342
+ - **Phase 2: Intelligence** — BM25 scoring with document-length normalization, full remediation strategy implementations, graduated intelligence interlock (+1/+2/MAX), 3-tier stuck detection, adaptive context windows.
343
+ - **Phase 3: Security** — Structured ZK proof returns, ephemeral SRE enclave keys, session-scoped ZTAI agent registry, time-limited RBAC elevation, dashboard rate limiting and token expiration, optional GPG approval verification.
344
+ - **Phase 4: Observability** — Async temporal I/O, `/api/v1/system` health endpoint, P95 latency ring buffer, heap health monitoring, EIS client de-stub with real fetch and retry logic.
345
+ - **Phase 5: SDK/Distributed** — Semaphore-based wave parallelism, WebSocket event streaming with auto-reconnect, `batchExecute()`, model streaming (Anthropic/OpenAI/Gemini), migration script from v10.7.0.
346
+ </details>
347
+
348
+ <details>
349
+ <summary><b>v10.x — The 200-Skills Expansion (Council → Platform Sovereign)</b></summary>
350
+
351
+ - **Council Awakens (v10.0.3)**: Council decision framework, Instinct Engine, Cost-Aware Routing, 6-phase Verification Loop, Multi-LLM Consult.
352
+ - **Skills Expansion (v10.0.4–v10.7.0)**: From 20 to 200+ core skills across 12 domains — AI/ML, data engineering, platform engineering, mobile, leadership, industry verticals, and more.
353
+ - **400+ Personas**: Comprehensive specialist coverage with domain-expert identity protocols.
354
+ - **49 Swarm Templates**: Task-aware parallel specialist clusters covering every engineering discipline.
355
+ </details>
356
+
357
+ <details>
358
+ <summary><b>v9.x — Grounded Execution & SQLite Persistence</b></summary>
359
+
360
+ - **Grounded Wave Execution (Pillar XXIV)**: AutoRunner reads HANDOFF.json wave groups with audit tracing and restart persistence.
361
+ - **Model Topology Modernization (Pillar XXV)**: Claude 4.x family (opus-4-7, sonnet-4-6, haiku-4-5).
362
+ - **Unified Memory Architecture (Pillar XXVI)**: SQLite (celestial.db) with FTS5 search replacing JSONL stores.
363
+ - **Schema Migration Engine (Pillar XXVII)**: Versioned migration tracking with transaction-wrapped imports.
364
+ - **Integration Test Chain (Pillar XXVIII)**: 27-assertion end-to-end pipeline validation.
365
+ </details>
366
+
367
+ <details>
323
368
  <summary><b>v8.1.x — Sovereign Identity (Pillar XIX)</b></summary>
324
369
 
325
370
  - **Pillar XIX: Sovereign Identity Synthesis**: Autonomous creation and evolution of `SOUL.md` from execution traces.
package/RELEASENOTES.md CHANGED
@@ -1,3 +1,83 @@
1
+ # Release Notes — v11.0.0 "Sovereign Stability"
2
+
3
+ **Release Date**: 2026-05-28
4
+ **Type**: Major (breaking changes)
5
+ **Upgrade Path**: Run `node bin/migrations/10.7.0-to-11.0.0.js`
6
+
7
+ ## Highlights
8
+
9
+ MindForge v11.0.0 is a production-hardening release that addresses systemic stability, intelligence, security, and SDK capabilities. It eliminates memory leaks, adds crash-safe writes, upgrades semantic search from TF-IDF to BM25, completes previously-stubbed subsystems, and introduces true parallel execution.
10
+
11
+ ## What's New
12
+
13
+ ### Foundation Hardening
14
+ - **Bounded caches** — LRUMap prevents unbounded memory growth in drift detector, entropy cache, and failure tracking
15
+ - **Atomic writes** — State files use write-to-temp → fsync → rename (crash-safe)
16
+ - **Log rotation** — AUDIT.jsonl auto-archives beyond 5000 lines with gzip compression
17
+ - **Schema validation** — HANDOFF.json validated on load (fail-open with warnings)
18
+ - **Snapshot GC** — Temporal history auto-cleaned (retain 50, expire > 7 days)
19
+
20
+ ### Intelligence Upgrades
21
+ - **BM25 scoring** — Document-length-normalized search replacing raw TF-IDF
22
+ - **Persistent caching** — Index and adjacency caches eliminate O(n) rebuilds
23
+ - **Complete remediation** — All three strategies fully implemented (no more stubs)
24
+ - **Adaptive systems** — Intelligence tier, context window, and stuck detection all auto-tune
25
+
26
+ ### Security Hardening
27
+ - **Ephemeral enclave keys** — No more hardcoded secrets in source
28
+ - **Structured crypto boundaries** — Simulated vs real clearly marked
29
+ - **Session isolation** — RBAC elevation with TTL, session-scoped identity
30
+ - **Dashboard security** — Token expiration, rate limiting, refresh endpoint
31
+
32
+ ### Observability
33
+ - **System metrics** — `/api/v1/system` with heap monitoring and alerts
34
+ - **P95 latency tracking** — Real measurements replace hardcoded values
35
+ - **Effectiveness tracking** — Remediations measured for closed-loop improvement
36
+ - **Dynamic config reload** — Model router refreshes on MINDFORGE.md changes
37
+
38
+ ### SDK & Distributed
39
+ - **True parallelism** — Wave tasks execute concurrently via semaphore
40
+ - **WebSocket streaming** — Real-time event delivery with auto-reconnect
41
+ - **Batch execution** — Execute multiple tasks with concurrency control
42
+ - **Model streaming** — Anthropic, OpenAI, and Gemini streaming support
43
+
44
+ ## Breaking Changes
45
+
46
+ | Change | Impact | Migration |
47
+ |--------|--------|-----------|
48
+ | `verifyZKProof()` returns structured result | Code catching throws will miss denials | Check `result.verified` instead |
49
+ | `signPQ()` returns object | Code using return value as string will break | Destructure `{ signature }` from result |
50
+ | Wave execution non-deterministic | Task order within waves no longer guaranteed | Do not rely on execution order |
51
+ | `captureState()`/`rollbackTo()` now async | Callers must await these methods | Add `await` at all call sites |
52
+ | Dashboard tokens expire after 24h | Long-lived tokens stop working | Use `/api/v1/auth/refresh` endpoint |
53
+ | SDK bumped to 11.0.0 | New exports, removed deprecated paths | Update `mindforge-sdk@11.0.0` |
54
+
55
+ See upgrade guide at `docs/upgrade.md` for full migration steps.
56
+
57
+ ## Migration
58
+
59
+ ```bash
60
+ node bin/migrations/10.7.0-to-11.0.0.js
61
+ ```
62
+
63
+ The migration script:
64
+ 1. Backs up `.mindforge/config.json`
65
+ 2. Adds new config sections (temporal, rate_limiting, session, wave_execution)
66
+ 3. Archives old AUDIT.jsonl entries if > 5000 lines
67
+ 4. Runs temporal snapshot GC
68
+ 5. Bumps schema versions
69
+
70
+ ---
71
+
72
+ ## Previous Releases
73
+
74
+ - [v10.0.3 — Council Awakens](https://github.com/sairam0424/MindForge/releases/tag/v10.0.3)
75
+ - [v10.0.1 — Bedrock Fortified](https://github.com/sairam0424/MindForge/releases/tag/v10.0.1)
76
+ - [v9.0.0 — Bedrock Meridian](https://github.com/sairam0424/MindForge/releases/tag/v9.0.0)
77
+
78
+ ---
79
+ ---
80
+
1
81
  # Release Notes — v10.0.3 "Council Awakens"
2
82
 
3
83
  **Release Date**: 2026-05-25
package/SECURITY.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  | Version | Status | Support Level |
6
6
  |---------|--------|---------------|
7
- | 10.x | **Current** | Full security and feature updates |
8
- | 9.x | Maintenance | Critical security patches only (until 2026-08-31) |
9
- | 8.x | End of Life | No further updates |
10
- | 7.x and below | End of Life | No further updates |
7
+ | 11.x | **Current** | Full security and feature updates |
8
+ | 10.x | Maintenance | Critical security patches only (until 2026-11-30) |
9
+ | 9.x | End of Life | No further updates |
10
+ | 8.x and below | End of Life | No further updates |
11
11
 
12
- We recommend all users upgrade to the latest 10.x release. Security patches for 9.x will be provided for critical vulnerabilities only, on a best-effort basis, until August 2026.
12
+ We recommend all users upgrade to the latest 11.x release. Security patches for 10.x will be provided for critical vulnerabilities only, on a best-effort basis, until November 2026.
13
13
 
14
14
  ---
15
15
 
@@ -44,18 +44,29 @@ We follow responsible disclosure practices. We will credit reporters in the rele
44
44
 
45
45
  ---
46
46
 
47
- ## Security Features (v10.0.1)
47
+ ## Security Features (v11.0.0)
48
48
 
49
49
  ### Authentication & Authorization
50
50
 
51
51
  - **Bearer token auth on dashboard** — All mutating endpoints (`/api/steering`, `/api/approve`, SSE control) require `Authorization: Bearer <token>`. Token is sourced from `MINDFORGE_DASHBOARD_TOKEN` environment variable.
52
+ - **Token expiration with refresh** — Dashboard tokens expire after 24 hours. Use `/api/v1/auth/refresh` to obtain a new token without re-authenticating.
53
+ - **Dashboard rate limiting** — 100 requests per minute per IP address. Exceeding the limit returns 429 with `Retry-After` header.
54
+ - **Session-scoped RBAC with TTL elevation** — Elevated permissions are session-scoped and auto-expire. No persistent privilege escalation.
52
55
  - **Browser daemon authentication** — The `/evaluate` endpoint requires auth before executing code in the Playwright context.
53
56
  - **ZTAI Trust Tiers** — 4-tier authorization model (Tier 0-3) controls which agents can perform which actions. Tier 3 (catastrophic-risk) operations require explicit human approval.
54
57
 
58
+ ### Cryptographic Security
59
+
60
+ - **Ephemeral enclave keys** — All crypto keys generated via `crypto.randomBytes()` at runtime. No hardcoded secrets in source.
61
+ - **Structured crypto boundaries** — Simulated (governance-enforcement) vs real (production-grade) cryptographic operations are clearly separated and labeled in code.
62
+ - **GPG approval verification** — Optional GPG signature verification on governance approvals for high-trust environments.
63
+ - **HMAC-signed temporal snapshots** — Temporal state captures are HMAC-signed to detect tampering during rollback operations.
64
+
55
65
  ### Audit & Integrity
56
66
 
57
67
  - **Merkle-chain audit log** — Every entry in `AUDIT.jsonl` includes a SHA-256 hash of the previous entry. Tampering with any historical entry breaks the chain, making modifications detectable.
58
68
  - **AuditWriter with buffered writes** — Atomic append operations prevent partial writes from corrupting the log.
69
+ - **Log rotation with archival** — AUDIT.jsonl auto-archives beyond 5000 lines with gzip compression, preventing unbounded disk growth.
59
70
  - **npm provenance** — Published packages include SLSA Build Level 2 attestation via `--provenance`, proving the package was built from the stated source commit in CI.
60
71
 
61
72
  ### Input Validation & Injection Prevention
@@ -67,7 +78,7 @@ We follow responsible disclosure practices. We will credit reporters in the rele
67
78
 
68
79
  ### Governance & Policy
69
80
 
70
- - **Fail-closed ZK verification** — `verifyZKProof()` throws on invalid or missing proofs. The system denies by default.
81
+ - **Structured ZK verification** — `verifyZKProof()` returns a structured result with `verified`, `reason`, and `timestamp` fields. The system denies by default when `verified` is false.
71
82
  - **Non-overridable parameters** — Security-critical MINDFORGE.md settings cannot be overridden by project-level or session-level configuration.
72
83
  - **CSP headers on dashboard** — Content Security Policy headers prevent XSS in the dashboard UI.
73
84
  - **Localhost-only binding** — The dashboard server binds to `127.0.0.1` only. It is not accessible from the network.
@@ -101,7 +112,8 @@ Before submitting code that touches security-sensitive paths:
101
112
 
102
113
  - **ZK-proofs are simulated** — The Dilithium-5 / ZK-proof layer uses cryptographic simulation, not hardware-backed TEEs. It provides logical governance enforcement, not hardware-grade isolation.
103
114
  - **Dashboard is localhost-only** — The dashboard is designed for local development. Do not expose it to the public internet, even behind a reverse proxy, without adding additional authentication.
104
- - **ZTAI keys are file-based** — Agent identity keys are stored on disk. In production deployments requiring hardware-bound keys, integrate with your organization's HSM or secure enclave.
115
+ - **ZTAI keys are ephemeral** — Agent identity keys are generated per-session via `crypto.randomBytes()`. In production deployments requiring persistent hardware-bound keys, integrate with your organization's HSM or secure enclave.
116
+ - **Rate limiting is per-process** — The 100 req/min limit is tracked in-memory. Restarting the dashboard resets counters. For distributed deployments, add an external rate limiter (e.g., nginx, Cloudflare).
105
117
 
106
118
  ---
107
119
 
@@ -6,11 +6,15 @@
6
6
  'use strict';
7
7
 
8
8
  const fs = require('fs');
9
+ const path = require('path');
9
10
  const crypto = require('crypto');
11
+ const { AuditRotator } = require('../utils/file-io');
10
12
 
11
13
  const FLUSH_INTERVAL_MS = 100;
12
14
  const FLUSH_THRESHOLD = 10;
13
15
 
16
+ const rotator = new AuditRotator({ maxLines: 5000 });
17
+
14
18
  /**
15
19
  * Creates a buffered async audit writer.
16
20
  * @param {string} auditPath — Path to the AUDIT.jsonl file
@@ -70,6 +74,15 @@ function createAuditWriter(auditPath) {
70
74
 
71
75
  const payload = toWrite.map(e => JSON.stringify(e)).join('\n') + '\n';
72
76
  await fs.promises.appendFile(auditPath, payload);
77
+
78
+ try {
79
+ if (rotator.shouldRotate(auditPath)) {
80
+ const archiveDir = path.join(path.dirname(auditPath), '..', '.planning', 'audit-archive');
81
+ rotator.rotate(auditPath, archiveDir);
82
+ }
83
+ } catch (err) {
84
+ process.stderr.write(`[audit-writer] rotation warning: ${err.message}\n`);
85
+ }
73
86
  }
74
87
 
75
88
  /**
@@ -21,7 +21,7 @@ const ContextRefactorer = require('./context-refactorer');
21
21
  // Extracted modules (lightweight, always needed)
22
22
  const { createAuditWriter } = require('./audit-writer');
23
23
  const { createStateManager } = require('./state-manager');
24
- const { createWaveExecutor } = require('./wave-executor');
24
+ const { createWaveExecutor, Semaphore } = require('./wave-executor');
25
25
 
26
26
  // ── Lazy-loaded heavy modules ────────────────────────────────────────────────
27
27
  // These are only required at the point of first use to reduce startup cost.
@@ -218,24 +218,44 @@ class AutoRunner {
218
218
  const wave = this.waves[this.currentWaveIndex];
219
219
  const waveNum = this.currentWaveIndex + 1;
220
220
  const pending = wave.tasks.filter(t => !this.completedTasks.has(t.id));
221
+ const maxConcurrency = this._getWaveConcurrency();
221
222
 
222
- console.log(`\n⚡ Wave ${waveNum}/${this.waves.length}: ${pending.length} tasks`);
223
+ console.log(`\n⚡ Wave ${waveNum}/${this.waves.length}: ${pending.length} tasks (concurrency: ${maxConcurrency})`);
223
224
  if (idcStatus.action === 'UPGRADE_MIR') console.log(` [IDC-ACTIVE] MIR Override: ${idcStatus.new_mir}`);
224
225
  this.writeAudit({ event: 'wave_started', phase: this.phase, wave: waveNum, task_count: pending.length });
225
226
 
226
- for (const task of pending) {
227
- const taskStart = Date.now();
228
- console.log(` → Task: ${task.name || task.id}`);
229
- try {
230
- this.writeAudit({ event: 'task_started', phase: this.phase, wave: waveNum, task_id: task.id, task_name: task.name || task.id });
231
- this.writeAudit({ event: 'task_completed', phase: this.phase, wave: waveNum, task_id: task.id, task_name: task.name || task.id, duration_ms: Date.now() - taskStart });
232
- this.completedTasks.add(task.id);
233
- } catch (err) {
234
- console.error(` Task failed: ${task.id} ${err.message}`);
235
- this.writeAudit({ event: 'task_failed', phase: this.phase, wave: waveNum, task_id: task.id, error: err.message, duration_ms: Date.now() - taskStart });
236
- const strategy = repairOperator.determineRepairStrategy({ planId: task.plan || task.id, phase: this.phase, attemptNumber: 1, errorOutput: err.message, isTier3Change: false, isOnCriticalPath: (task.depends_on || []).length > 0 });
237
- if (strategy === 'RETRY') { console.log(` Repair: retrying ${task.id}`); continue; }
238
- if (strategy === 'ESCALATE') { this.writeAudit({ event: 'auto_mode_escalated', reason: `Task ${task.id} unrecoverable` }); this.isPaused = true; return; }
227
+ const semaphore = new Semaphore(maxConcurrency);
228
+
229
+ const settled = await Promise.allSettled(
230
+ pending.map(async (task) => {
231
+ await semaphore.acquire();
232
+ const taskStart = Date.now();
233
+ console.log(` → Task: ${task.name || task.id}`);
234
+ try {
235
+ this.writeAudit({ event: 'task_started', phase: this.phase, wave: waveNum, task_id: task.id, task_name: task.name || task.id });
236
+ this.writeAudit({ event: 'task_completed', phase: this.phase, wave: waveNum, task_id: task.id, task_name: task.name || task.id, duration_ms: Date.now() - taskStart });
237
+ this.completedTasks.add(task.id);
238
+ return { taskId: task.id, status: 'fulfilled' };
239
+ } catch (err) {
240
+ console.error(` Task failed: ${task.id} — ${err.message}`);
241
+ this.writeAudit({ event: 'task_failed', phase: this.phase, wave: waveNum, task_id: task.id, error: err.message, duration_ms: Date.now() - taskStart });
242
+ throw { taskId: task.id, error: err, task };
243
+ } finally {
244
+ semaphore.release();
245
+ }
246
+ })
247
+ );
248
+
249
+ const failures = settled.filter(r => r.status === 'rejected');
250
+ if (failures.length > 0) {
251
+ for (const failure of failures) {
252
+ const { taskId, error, task } = failure.reason;
253
+ const strategy = repairOperator.determineRepairStrategy({ planId: task.plan || taskId, phase: this.phase, attemptNumber: 1, errorOutput: error.message, isTier3Change: false, isOnCriticalPath: (task.depends_on || []).length > 0 });
254
+ if (strategy === 'ESCALATE') {
255
+ this.writeAudit({ event: 'auto_mode_escalated', reason: `Task ${taskId} unrecoverable` });
256
+ this.isPaused = true;
257
+ return;
258
+ }
239
259
  }
240
260
  }
241
261
 
@@ -244,6 +264,19 @@ class AutoRunner {
244
264
  this.currentWaveIndex++;
245
265
  }
246
266
 
267
+ _getWaveConcurrency() {
268
+ try {
269
+ const configPath = path.join(process.cwd(), '.mindforge', 'config.json');
270
+ if (fs.existsSync(configPath)) {
271
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
272
+ if (typeof config.wave_concurrency === 'number' && config.wave_concurrency > 0) {
273
+ return config.wave_concurrency;
274
+ }
275
+ }
276
+ } catch (e) { /* Fall through to default */ }
277
+ return 3;
278
+ }
279
+
247
280
  /**
248
281
  * Build wave groups from HANDOFF handoffs array.
249
282
  * Kept as instance method for backward compatibility with tests.
@@ -316,6 +349,15 @@ class AutoRunner {
316
349
  if (captured.length + stability.length > 0) console.log(`🧠 Knowledge Graph: Captured ${captured.length + stability.length} insights.`);
317
350
  } catch (err) { console.error('⚠️ Knowledge Capture failed:', err.message); }
318
351
 
352
+ try {
353
+ _TemporalHub = lazyRequire(_TemporalHub, '../engine/temporal-hub');
354
+ const gcConfig = this._loadTemporalGcConfig();
355
+ const gcResult = await _TemporalHub.gc(gcConfig);
356
+ if (gcResult.deleted > 0) {
357
+ this.writeAudit({ event: 'temporal_gc_completed', deleted: gcResult.deleted, remaining: gcResult.remaining });
358
+ }
359
+ } catch (e) { /* GC failure is non-critical */ }
360
+
319
361
  this.writeAudit({ event: 'auto_mode_completed', timestamp: new Date().toISOString() });
320
362
  await this.auditWriter.close();
321
363
  }
@@ -334,7 +376,7 @@ class AutoRunner {
334
376
  const STATE_CHANGING_EVENTS = ['auto_mode_started', 'phase_planned', 'phase_execution_started', 'task_completed', 'hindsight_injected', 'auto_mode_completed'];
335
377
  if (STATE_CHANGING_EVENTS.includes(event.event)) {
336
378
  _TemporalHub = lazyRequire(_TemporalHub, '../engine/temporal-hub');
337
- _TemporalHub.captureState(event.id, { agent: event.agent || 'auto-runner', event: event.event, phase: this.phase });
379
+ _TemporalHub.captureState(event.id, { agent: event.agent || 'auto-runner', event: event.event, phase: this.phase }).catch(() => {});
338
380
  }
339
381
 
340
382
  const result = this.monitor.analyze(event);
@@ -444,6 +486,22 @@ class AutoRunner {
444
486
  const lines = buf.toString('utf8').trim().split('\n');
445
487
  return lines.slice(-count).map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
446
488
  }
489
+
490
+ _loadTemporalGcConfig() {
491
+ try {
492
+ const configPath = path.join(process.cwd(), '.mindforge', 'config.json');
493
+ if (fs.existsSync(configPath)) {
494
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
495
+ if (config.temporal) {
496
+ return {
497
+ maxSnapshots: config.temporal.max_snapshots || 50,
498
+ maxAgeDays: config.temporal.max_age_days || 7
499
+ };
500
+ }
501
+ }
502
+ } catch (e) { /* Fall through to defaults */ }
503
+ return { maxSnapshots: 50, maxAgeDays: 7 };
504
+ }
447
505
  }
448
506
 
449
507
  module.exports = AutoRunner;
@@ -14,18 +14,15 @@ class ContextRefactorer {
14
14
  this.history = [];
15
15
  }
16
16
 
17
- /**
18
- * Analyze the current context density.
19
- * Density = (Implementation Events) / (Total Events)
20
- */
21
17
  analyzeDensity(events) {
22
- this.history = events.slice(-this.windowSize);
23
-
24
- if (this.history.length < 5) return { density: 1.0, shouldRefactor: false };
18
+ const windowSize = this._getAdaptiveWindow(events);
19
+ this.history = events.slice(-windowSize);
25
20
 
26
- const implementationEvents = this.history.filter(h =>
27
- h.tool === 'run_command' ||
28
- h.tool === 'replace_file_content' ||
21
+ if (this.history.length < 5) return { density: 1.0, shouldRefactor: false, windowSize };
22
+
23
+ const implementationEvents = this.history.filter(h =>
24
+ h.tool === 'run_command' ||
25
+ h.tool === 'replace_file_content' ||
29
26
  h.tool === 'multi_replace_file_content' ||
30
27
  h.event === 'task_completed'
31
28
  );
@@ -35,10 +32,28 @@ class ContextRefactorer {
35
32
 
36
33
  return {
37
34
  density: parseFloat(density.toFixed(2)),
38
- shouldRefactor: density < this.threshold
35
+ shouldRefactor: density < this.threshold,
36
+ windowSize
39
37
  };
40
38
  }
41
39
 
40
+ _getAdaptiveWindow(events) {
41
+ const recent = events.slice(-10);
42
+ if (recent.length === 0) return 20;
43
+
44
+ const implEvents = recent.filter(e =>
45
+ e.event === 'run_command' ||
46
+ e.event?.includes('replace_file') ||
47
+ e.event === 'task_completed'
48
+ ).length;
49
+
50
+ const velocity = implEvents / recent.length;
51
+
52
+ if (velocity > 0.6) return 10;
53
+ if (velocity < 0.3) return 30;
54
+ return 20;
55
+ }
56
+
42
57
  /**
43
58
  * Generates a "Context Refactor" recommendation.
44
59
  */