substrate-ai 0.20.67 → 0.20.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.20.67",
3
+ "version": "0.20.68",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -98,6 +98,28 @@ Use this exact format for each item:
98
98
  - The transport annotation `(queue: ...)` or `(api: ...)` or `(from story X-Y)` is optional but recommended when applicable
99
99
  - **The `## Interface Contracts` section is optional** — omit it entirely if the story has no cross-story schema dependencies
100
100
 
101
+ ## Using Canonical Substrate Helpers
102
+
103
+ **When ACs reference reading/writing substrate runtime state (pipeline runs, manifest data, story status, findings), the rendered story MUST cite the canonical helper module by import path. Do NOT invent parallel formats.**
104
+
105
+ Three May-2026 dispatches (69-1, 71-1, 73-1) invented `.substrate/runs/manifest.json` (does NOT exist in production) and required hot-fixes. Trigger: AC text mentions "run manifest" or "latest run" without canonical citation.
106
+
107
+ **Run-discovery canonical chain** (highest-recurrence trap):
108
+
109
+ 1. Explicit `--run-id` arg if provided
110
+ 2. `readCurrentRunId(dbRoot)` from `src/cli/commands/manifest-read.js`
111
+ 3. `getLatestRun(adapter)` Dolt fallback from `packages/core/src/persistence/queries/decisions.js`
112
+
113
+ Then `resolveRunManifest(dbRoot, runId)` materializes the per-run manifest at `.substrate/runs/<run-id>.json` (one file per run, NOT an aggregate).
114
+
115
+ **Other canonical helpers** by AC mention:
116
+ - manifest data / per-story state → `RunManifest` + `patchStoryState` (`@substrate-ai/sdlc/run-model/run-manifest.js`)
117
+ - Dolt persistence → `DoltClient`, `createDatabaseAdapter`, `initSchema` (`src/modules/state/index.js`, `src/persistence/adapter.js`)
118
+ - Findings / learning → `Finding` + `appendFinding(adapter, finding)` (`packages/sdlc/src/learning/types.js`, `packages/core/src/persistence/queries/decisions.js`)
119
+ - working-tree changes / git diff for story → `detectAutoCommit`, `detectWorkingTreeChanges` (`src/cli/commands/reconcile-from-disk.js`)
120
+
121
+ **Rule**: When an AC requires reading state, cite the canonical helper in AC text or "Files involved". Example: write "discover the latest run via `getLatestRun(adapter)` from `packages/core/src/persistence/queries/decisions.js`" — not just "discover the latest run". Forces dev-story to import the helper instead of synthesizing one.
122
+
101
123
  ## Runtime Verification Guidance
102
124
 
103
125
  **If the Story Definition already contains a `## Runtime Probes` section, transfer it verbatim** — including every probe entry, YAML fenced block, and surrounding prose — into the rendered story artifact. Do not independently re-evaluate whether the story is runtime-dependent; the epic author already decided when they authored probes in the source. Adding, removing, renaming, or reshaping a source-declared probe silently subverts the author's runtime contract.