@aionis/substrate 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +81 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +222 -0
- package/dist/cli.js.map +1 -0
- package/dist/event-log.d.ts.map +1 -1
- package/dist/event-log.js +13 -2
- package/dist/event-log.js.map +1 -1
- package/dist/file-substrate.d.ts.map +1 -1
- package/dist/file-substrate.js +46 -2
- package/dist/file-substrate.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime-sidecar-check.d.ts +30 -0
- package/dist/runtime-sidecar-check.d.ts.map +1 -0
- package/dist/runtime-sidecar-check.js +101 -0
- package/dist/runtime-sidecar-check.js.map +1 -0
- package/dist/sqlite-substrate.d.ts.map +1 -1
- package/dist/sqlite-substrate.js +156 -21
- package/dist/sqlite-substrate.js.map +1 -1
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/ADAPTER_CONTRACT.md +23 -3
- package/docs/API_USAGE.md +25 -0
- package/docs/CLI.md +89 -0
- package/docs/RUNTIME_SIDECAR_STABILIZATION.md +96 -0
- package/docs/STORE_CONTRACT.md +18 -2
- package/docs/V0_2_ROADMAP.md +108 -0
- package/package.json +8 -2
package/docs/ADAPTER_CONTRACT.md
CHANGED
|
@@ -33,6 +33,7 @@ Examples:
|
|
|
33
33
|
- lifecycle transition for a missing memory node must fail without appending an event;
|
|
34
34
|
- relation with a missing source or target must fail without appending an event;
|
|
35
35
|
- feedback for a missing memory node must fail without appending an event.
|
|
36
|
+
- decision trace for a missing memory node must fail without appending an event.
|
|
36
37
|
|
|
37
38
|
The file adapter validates against a cloned state before appending to `events.jsonl`.
|
|
38
39
|
|
|
@@ -54,6 +55,8 @@ The current schema version is `1`.
|
|
|
54
55
|
|
|
55
56
|
The SQLite adapter must persist schema metadata in `substrate_metadata`, set SQLite `user_version`, and refuse to open a database whose schema version is newer than the runtime supports. Silent best-effort reads of future schemas are not allowed.
|
|
56
57
|
|
|
58
|
+
SQLite schema changes must go through the adapter migration registry. Applied migrations are recorded in `substrate_schema_migrations` with version, name, and timestamp. A migration ledger whose recorded name no longer matches the current registry is treated as corruption and the store is rejected.
|
|
59
|
+
|
|
57
60
|
The file adapter must write the schema version into `snapshot.json` and report the same version through `getStoreInfo`.
|
|
58
61
|
|
|
59
62
|
### 4. Scope Isolation
|
|
@@ -107,7 +110,19 @@ Search is not a vector index and not the full Runtime admission policy. It is a
|
|
|
107
110
|
|
|
108
111
|
This is intentional: exported context must leave a receipt. Callers that need a side-effect-free preview must use `previewContext` instead of weakening `compileContext`.
|
|
109
112
|
|
|
110
|
-
### 9.
|
|
113
|
+
### 9. Audit Read API Parity
|
|
114
|
+
|
|
115
|
+
Adapters must expose the same scoped audit reads:
|
|
116
|
+
|
|
117
|
+
- `listRelations(scope, memoryId?)`
|
|
118
|
+
- `listFeedback({ scope, memoryId? })`
|
|
119
|
+
- `listDecisions(scope)`
|
|
120
|
+
|
|
121
|
+
These APIs must be side-effect-free. They must not append decision events, lifecycle transitions, relation writes, feedback writes, or checkpoints.
|
|
122
|
+
|
|
123
|
+
When `memoryId` is supplied to `listRelations`, adapters must return relations where that memory is either the source or target. When `memoryId` is supplied to `listFeedback`, adapters must return feedback attached to that memory only.
|
|
124
|
+
|
|
125
|
+
### 10. Backup and Restore Integrity
|
|
111
126
|
|
|
112
127
|
Backup export must operate over the append-only event log, not only over derived read-model tables or snapshots.
|
|
113
128
|
|
|
@@ -116,7 +131,7 @@ Restore must verify:
|
|
|
116
131
|
- supported backup and schema version;
|
|
117
132
|
- contiguous event sequence;
|
|
118
133
|
- duplicate event ids;
|
|
119
|
-
- event reference integrity;
|
|
134
|
+
- event reference integrity, including decision trace memory ids;
|
|
120
135
|
- header event counts;
|
|
121
136
|
- SHA-256 checksum.
|
|
122
137
|
|
|
@@ -129,6 +144,7 @@ The test suite currently checks:
|
|
|
129
144
|
- failed lifecycle transition does not corrupt the file event log;
|
|
130
145
|
- failed relation writes do not persist corrupt events or partial rows;
|
|
131
146
|
- failed feedback writes do not persist corrupt events or partial rows;
|
|
147
|
+
- failed decision writes do not persist corrupt events or partial rows;
|
|
132
148
|
- file and SQLite adapters compile identical buckets for the same evidence;
|
|
133
149
|
- superseded memory is blocked from direct use;
|
|
134
150
|
- archived evidence becomes a rehydrate hook;
|
|
@@ -136,10 +152,14 @@ The test suite currently checks:
|
|
|
136
152
|
- file snapshots can be rebuilt from append-only events;
|
|
137
153
|
- concurrent writes are serialized with contiguous event sequences;
|
|
138
154
|
- store schema version is reported by both adapters;
|
|
139
|
-
- SQLite schema metadata
|
|
155
|
+
- SQLite schema metadata and migration ledger are persisted, backfilled for legacy v1 stores, and future unsupported schemas are rejected;
|
|
140
156
|
- event-log backups verify checksums and restore to file and SQLite stores;
|
|
157
|
+
- event-log backups reject checksum-valid decision traces that reference missing memory nodes;
|
|
141
158
|
- checkpoint compaction preserves governed state and restarts future event sequences after the checkpoint;
|
|
159
|
+
- compacted checkpoints reject corrupt decision references on reopen;
|
|
160
|
+
- relation, feedback, and decision writes remain atomic after checkpoint compaction;
|
|
142
161
|
- file and SQLite adapters return identical read-only search results for the same scoped query;
|
|
162
|
+
- file and SQLite adapters return identical scoped audit reads without mutating event logs;
|
|
143
163
|
- Runtime snapshot import opens source SQLite read-only.
|
|
144
164
|
|
|
145
165
|
## Non-Goals
|
package/docs/API_USAGE.md
CHANGED
|
@@ -177,6 +177,31 @@ The compiled context has four surfaces:
|
|
|
177
177
|
|
|
178
178
|
`compileContext` records a `memory.decision.recorded` event. It is intentionally auditable, not a pure read.
|
|
179
179
|
|
|
180
|
+
## Read Audit Records
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
const relations = await store.listRelations("repo-a", "route-current");
|
|
184
|
+
const feedback = await store.listFeedback({
|
|
185
|
+
scope: "repo-a",
|
|
186
|
+
memoryId: "route-current",
|
|
187
|
+
});
|
|
188
|
+
const decisions = await store.listDecisions("repo-a");
|
|
189
|
+
|
|
190
|
+
console.log(relations.map((relation) => relation.kind));
|
|
191
|
+
console.log(feedback.map((item) => item.outcome));
|
|
192
|
+
console.log(decisions.at(-1)?.decisions);
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Audit reads are scoped and side-effect-free:
|
|
196
|
+
|
|
197
|
+
- `listRelations(scope)` returns all relations in a scope.
|
|
198
|
+
- `listRelations(scope, memoryId)` returns relations where the memory is either source or target.
|
|
199
|
+
- `listFeedback({ scope })` returns feedback in a scope.
|
|
200
|
+
- `listFeedback({ scope, memoryId })` returns feedback attached to one memory.
|
|
201
|
+
- `listDecisions(scope)` returns recorded decision receipts for the scope.
|
|
202
|
+
|
|
203
|
+
These APIs read evidence and receipts. They do not append events, compile prompt surfaces, or decide whether memory can influence the next Agent turn.
|
|
204
|
+
|
|
180
205
|
## Compact the Event Log
|
|
181
206
|
|
|
182
207
|
```ts
|
package/docs/CLI.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLI
|
|
2
|
+
|
|
3
|
+
`@aionis/substrate` publishes a small CLI for validation and sidecar integration work.
|
|
4
|
+
|
|
5
|
+
It is intentionally narrow:
|
|
6
|
+
|
|
7
|
+
- it runs read-only checks over existing Runtime evidence;
|
|
8
|
+
- it writes reports to local files;
|
|
9
|
+
- it does not start Aionis Runtime unless you explicitly use the separate repository script `check:runtime-dual-write`;
|
|
10
|
+
- it does not mutate Runtime source code or replace Runtime storage.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Run without installing permanently:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @aionis/substrate --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install into a project:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @aionis/substrate
|
|
24
|
+
npx aionis-substrate --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The CLI requires Node 24+.
|
|
28
|
+
|
|
29
|
+
## Sidecar Check
|
|
30
|
+
|
|
31
|
+
Use `sidecar` when you already have Runtime Lite SQLite evidence and want to check whether Substrate can mirror the governed context surface from outside the Runtime boundary.
|
|
32
|
+
|
|
33
|
+
Snapshot parity:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx aionis-substrate sidecar \
|
|
37
|
+
--source /path/to/aionis-runtime-lite.sqlite \
|
|
38
|
+
--scope repo-a \
|
|
39
|
+
--reference /path/to/runtime-guide-or-measure.json \
|
|
40
|
+
--output reports/runtime-sidecar/summary.json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Reference corpus parity:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx aionis-substrate sidecar \
|
|
47
|
+
--source-root /path/to/runtime-sqlite-root \
|
|
48
|
+
--reference-root /path/to/runtime-reference-root \
|
|
49
|
+
--max-source-files all \
|
|
50
|
+
--max-scopes all \
|
|
51
|
+
--max-scopes-per-file 100 \
|
|
52
|
+
--max-references all
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Combined report:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx aionis-substrate sidecar \
|
|
59
|
+
--source /path/to/aionis-runtime-lite.sqlite \
|
|
60
|
+
--scope repo-a \
|
|
61
|
+
--reference /path/to/runtime-guide-or-measure.json \
|
|
62
|
+
--source-root /path/to/runtime-sqlite-root \
|
|
63
|
+
--reference-root /path/to/runtime-reference-root \
|
|
64
|
+
--output reports/runtime-sidecar/summary.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The report contract is `aionis_runtime_sidecar_check_report_v1`.
|
|
68
|
+
|
|
69
|
+
## What Passing Means
|
|
70
|
+
|
|
71
|
+
Passing snapshot parity means one Runtime SQLite scope can be imported into an isolated Substrate store and compiled into matching governed buckets.
|
|
72
|
+
|
|
73
|
+
Passing reference corpus parity means exported Runtime guide/measure JSON is traceable to real Runtime memory ids in the same source corpus.
|
|
74
|
+
|
|
75
|
+
Passing these checks does not mean Substrate has become the full Runtime policy engine. Runtime still owns richer product policy; Substrate owns durable evidence, lifecycle state, relations, feedback, and the minimum governed context contract.
|
|
76
|
+
|
|
77
|
+
## Common Failures
|
|
78
|
+
|
|
79
|
+
`no_matched_reference`
|
|
80
|
+
|
|
81
|
+
The reference files were scanned, but none of their memory ids overlap the discovered Runtime SQLite scopes. Point `--reference-root` at guide/measure outputs produced from the same Runtime data as `--source-root`.
|
|
82
|
+
|
|
83
|
+
`snapshot_parity failed`
|
|
84
|
+
|
|
85
|
+
The imported Substrate buckets do not match the supplied Runtime guide/measure surface. Inspect the generated `summary.json` before changing code; the mismatch may be a scope, reference, or fixture problem.
|
|
86
|
+
|
|
87
|
+
`ExperimentalWarning: SQLite is an experimental feature`
|
|
88
|
+
|
|
89
|
+
Node 24 currently marks `node:sqlite` as experimental. This is expected for the current embedded SQLite adapter.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Runtime Sidecar Stabilization
|
|
2
|
+
|
|
3
|
+
This page defines the Substrate sidecar validation path for Aionis Runtime.
|
|
4
|
+
|
|
5
|
+
The sidecar path is intentionally external:
|
|
6
|
+
|
|
7
|
+
- it does not mutate `AionisRuntime-focused` source code;
|
|
8
|
+
- it does not replace Runtime Lite SQLite, Zvec, AIFS, or product storage;
|
|
9
|
+
- it does not install a production dual-write adapter;
|
|
10
|
+
- it only proves that Substrate can mirror, import, and inspect Runtime evidence from outside the Runtime boundary.
|
|
11
|
+
|
|
12
|
+
## Sidecar Gates
|
|
13
|
+
|
|
14
|
+
### Gate 1: Read-Only Snapshot Parity
|
|
15
|
+
|
|
16
|
+
Import one Runtime Lite SQLite snapshot into an isolated Substrate store and compile context for one scope.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm run check:runtime-sidecar -- \
|
|
20
|
+
--source /path/to/aionis-runtime-lite.sqlite \
|
|
21
|
+
--scope repo-a \
|
|
22
|
+
--reference /path/to/runtime-guide-or-measure.json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Without `--reference`, this is an import smoke: Runtime SQLite is opened read-only and Substrate writes to an isolated target.
|
|
26
|
+
|
|
27
|
+
With `--reference`, the command compares the four governed buckets:
|
|
28
|
+
|
|
29
|
+
- `use_now`
|
|
30
|
+
- `inspect_before_use`
|
|
31
|
+
- `do_not_use`
|
|
32
|
+
- `rehydrate`
|
|
33
|
+
|
|
34
|
+
### Gate 2: Same-Source Reference Corpus
|
|
35
|
+
|
|
36
|
+
Scan Runtime SQLite files and Runtime guide/measure JSON references, then count only references that share concrete memory ids with a discovered Runtime scope.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm run check:runtime-sidecar -- \
|
|
40
|
+
--source-root /path/to/runtime-sqlite-root \
|
|
41
|
+
--reference-root /path/to/runtime-reference-root \
|
|
42
|
+
--max-source-files all \
|
|
43
|
+
--max-scopes all \
|
|
44
|
+
--max-scopes-per-file 100 \
|
|
45
|
+
--max-references all
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This gate rejects demo-only evidence: a reference JSON must overlap real Runtime memory ids to count.
|
|
49
|
+
|
|
50
|
+
### Gate 3: Real Runtime Dual-Write Sidecar
|
|
51
|
+
|
|
52
|
+
This stage starts focused Runtime with isolated Lite SQLite files, calls the public Runtime SDK loop, mirrors the observed memory ids and outcomes into a separate Substrate SQLite store, and compares Runtime guide surfaces against Substrate compiled context.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run check:runtime-dual-write -- \
|
|
56
|
+
--runtime-root /Volumes/ziel/AionisRuntime-focused \
|
|
57
|
+
--generated-count 8 \
|
|
58
|
+
--chain-probe-count 4 \
|
|
59
|
+
--concurrency 4
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This command remains separate from `check:runtime-sidecar` because it starts a Runtime process. It must be explicit.
|
|
63
|
+
|
|
64
|
+
## Combined Read-Only Report
|
|
65
|
+
|
|
66
|
+
`check:runtime-sidecar` can run Gate 1 and Gate 2 in one report:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run check:runtime-sidecar -- \
|
|
70
|
+
--source /path/to/aionis-runtime-lite.sqlite \
|
|
71
|
+
--scope repo-a \
|
|
72
|
+
--reference /path/to/runtime-guide-or-measure.json \
|
|
73
|
+
--source-root /path/to/runtime-sqlite-root \
|
|
74
|
+
--reference-root /path/to/runtime-reference-root \
|
|
75
|
+
--output reports/runtime-sidecar-manual/summary.json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The report contract is `aionis_runtime_sidecar_check_report_v1`.
|
|
79
|
+
|
|
80
|
+
It records:
|
|
81
|
+
|
|
82
|
+
- requested stages;
|
|
83
|
+
- pass/fail summary per stage;
|
|
84
|
+
- snapshot import coverage and parity;
|
|
85
|
+
- reference corpus matched/unmatched counts;
|
|
86
|
+
- notes confirming that Runtime source and Runtime storage were not replaced.
|
|
87
|
+
|
|
88
|
+
## Interpretation
|
|
89
|
+
|
|
90
|
+
Passing Gate 1 means Substrate can represent one Runtime SQLite scope as governed substrate state.
|
|
91
|
+
|
|
92
|
+
Passing Gate 2 means exported Runtime references are traceable to real Runtime SQLite memory ids, not only documentation examples.
|
|
93
|
+
|
|
94
|
+
Passing Gate 3 means an external host can mirror a small real Runtime execution loop into Substrate and preserve the same admission surface after reopen.
|
|
95
|
+
|
|
96
|
+
None of these gates mean Substrate has become the full Aionis Runtime policy engine. Runtime owns richer product policy; Substrate owns the durable evidence and minimum governed context contract.
|
package/docs/STORE_CONTRACT.md
CHANGED
|
@@ -40,6 +40,8 @@ Adapters must expose schema metadata through `getStoreInfo`:
|
|
|
40
40
|
|
|
41
41
|
The SQLite adapter persists schema metadata in `substrate_metadata` and mirrors the same version into SQLite `user_version`. Opening a store with a newer unsupported schema must fail before any mutation occurs.
|
|
42
42
|
|
|
43
|
+
SQLite schema changes are applied through an explicit adapter migration registry. Applied migrations are recorded in `substrate_schema_migrations`. The registry must stay contiguous and end at the current substrate schema version, and a tampered migration name must cause open to fail.
|
|
44
|
+
|
|
43
45
|
The file adapter writes the same schema version into `snapshot.json`. The append-only event log remains the durable evidence source; the snapshot schema is the derived read-model format.
|
|
44
46
|
|
|
45
47
|
### Backup Boundary
|
|
@@ -48,6 +50,8 @@ Backups export the append-only event log plus schema metadata and a SHA-256 chec
|
|
|
48
50
|
|
|
49
51
|
Restore must verify the backup before writing a target store. Restored stores preserve original event ids and sequence numbers, then rebuild derived read models.
|
|
50
52
|
|
|
53
|
+
Backup verification must replay event reference integrity, including lifecycle targets, relation endpoints, feedback memory ids, and decision-trace memory ids.
|
|
54
|
+
|
|
51
55
|
Payload files referenced by `payloadRef` are not embedded in the Substrate backup. They remain external artifacts and need their own retention policy.
|
|
52
56
|
|
|
53
57
|
### Checkpoint Compaction
|
|
@@ -156,12 +160,22 @@ Every compiled context must include a decision trace:
|
|
|
156
160
|
- which reason code caused the decision
|
|
157
161
|
- which relation caused the decision when applicable
|
|
158
162
|
|
|
163
|
+
Every decision entry must reference a memory node that exists in the same scope as the trace. Decision traces are receipts over known substrate evidence; they cannot introduce orphan memory ids.
|
|
164
|
+
|
|
159
165
|
The trace is for audit/debug/measure. It must not mutate admission by itself.
|
|
160
166
|
|
|
161
167
|
`previewContext` is the side-effect-free admission preview. It returns the same bucket and reason-code shape as `compileContext`, but it must not append events or insert decision rows.
|
|
162
168
|
|
|
163
169
|
`compileContext` is intentionally not a pure read. It records `memory.decision.recorded` so every exported context has an auditable receipt. Tools that need a side-effect-free view must use `previewContext` instead of treating `compileContext` as read-only.
|
|
164
170
|
|
|
171
|
+
Decision and evidence records must also be inspectable without creating new events:
|
|
172
|
+
|
|
173
|
+
- `listRelations(scope, memoryId?)`
|
|
174
|
+
- `listFeedback({ scope, memoryId? })`
|
|
175
|
+
- `listDecisions(scope)`
|
|
176
|
+
|
|
177
|
+
These read APIs are for audit, debug, and measure surfaces. They do not compile context and do not mutate lifecycle, relation, feedback, decision, or checkpoint state.
|
|
178
|
+
|
|
165
179
|
## Adapter Requirements
|
|
166
180
|
|
|
167
181
|
Every adapter must satisfy the same observable contract:
|
|
@@ -172,8 +186,10 @@ Every adapter must satisfy the same observable contract:
|
|
|
172
186
|
4. Compile the same admission buckets from the same node/relation state.
|
|
173
187
|
5. Return the same scoped search results from the same node state.
|
|
174
188
|
6. Record decision traces as events.
|
|
175
|
-
7.
|
|
176
|
-
8.
|
|
189
|
+
7. Return the same scoped audit reads from the same relation, feedback, and decision state.
|
|
190
|
+
8. Reopen cleanly and recover the same read model.
|
|
191
|
+
9. Reject corrupt lifecycle, relation, feedback, decision, and checkpoint references before persisting invalid events.
|
|
192
|
+
10. If compaction is supported, compact only through a validated checkpoint event.
|
|
177
193
|
|
|
178
194
|
Current adapters:
|
|
179
195
|
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Aionis Substrate v0.2 Roadmap
|
|
2
|
+
|
|
3
|
+
This roadmap freezes the intended scope for the next Substrate release.
|
|
4
|
+
|
|
5
|
+
Substrate remains an independent storage-contract layer. It is not the full Aionis Runtime policy engine, not a vector database, and not an Agent framework.
|
|
6
|
+
|
|
7
|
+
## v0.2 Principles
|
|
8
|
+
|
|
9
|
+
- Keep append-only evidence as the source of truth.
|
|
10
|
+
- Keep lifecycle, relation, feedback, and decision receipts inspectable.
|
|
11
|
+
- Preserve file and SQLite adapter parity for every public API.
|
|
12
|
+
- Add product hardening only where it improves durability, auditability, or Runtime sidecar integration.
|
|
13
|
+
- Do not encode task-specific benchmark fixtures or one-off Runtime policies in Substrate.
|
|
14
|
+
|
|
15
|
+
## Included
|
|
16
|
+
|
|
17
|
+
### 1. Migration Scaffold
|
|
18
|
+
|
|
19
|
+
Add a small schema-migration boundary for future SQLite changes:
|
|
20
|
+
|
|
21
|
+
- explicit migration registry;
|
|
22
|
+
- current schema guard remains strict;
|
|
23
|
+
- migration tests for already-created stores;
|
|
24
|
+
- no best-effort reads of unsupported future schemas.
|
|
25
|
+
|
|
26
|
+
Initial implementation status: SQLite now has a registry-backed v1 migration ledger. Future schema changes should add migrations through that registry instead of editing open-time schema creation ad hoc.
|
|
27
|
+
|
|
28
|
+
### 2. Read API Hardening
|
|
29
|
+
|
|
30
|
+
Expose scoped audit reads that do not mutate the event log:
|
|
31
|
+
|
|
32
|
+
- `listRelations(scope, memoryId?)`
|
|
33
|
+
- `listFeedback({ scope, memoryId? })`
|
|
34
|
+
- `listDecisions(scope)`
|
|
35
|
+
|
|
36
|
+
These APIs are for audit/debug/measure surfaces and adapter parity checks. They do not replace `compileContext`, and they do not make admission decisions.
|
|
37
|
+
|
|
38
|
+
### 3. Durability Negative Tests
|
|
39
|
+
|
|
40
|
+
Extend failure-mode coverage:
|
|
41
|
+
|
|
42
|
+
- corrupt event references;
|
|
43
|
+
- interrupted writes;
|
|
44
|
+
- relation and feedback edge cases after compaction;
|
|
45
|
+
- checkpoint reopen after mixed read/write traffic.
|
|
46
|
+
|
|
47
|
+
Initial implementation status: decision trace references are validated like relation and feedback references. File and SQLite adapters reject missing decision targets before persisting events or rows; backup verification rejects checksum-valid orphan decision receipts; checkpoint reopen rejects corrupt decision references; post-checkpoint invalid relation, feedback, and decision writes stay atomic.
|
|
48
|
+
|
|
49
|
+
### 4. Runtime Sidecar Stabilization
|
|
50
|
+
|
|
51
|
+
Keep Runtime experiments isolated:
|
|
52
|
+
|
|
53
|
+
- read-only Runtime snapshot import remains separate from Runtime source;
|
|
54
|
+
- dual-write sidecar continues to write into a separate Substrate store;
|
|
55
|
+
- no replacement of Aionis Runtime storage in v0.2.
|
|
56
|
+
|
|
57
|
+
Initial implementation status: `check:runtime-sidecar` now combines read-only Runtime snapshot parity and same-source reference corpus parity into a single report contract. Real Runtime dual-write remains an explicit separate gate through `check:runtime-dual-write` because it starts focused Runtime.
|
|
58
|
+
|
|
59
|
+
### 5. Product CLI and Docs
|
|
60
|
+
|
|
61
|
+
Make the substrate boundary easier to consume without widening policy scope:
|
|
62
|
+
|
|
63
|
+
- publish a package CLI entrypoint for read-only sidecar checks;
|
|
64
|
+
- document install, minimal API usage, and sidecar reports separately;
|
|
65
|
+
- keep repository-only Runtime process experiments explicit and separate.
|
|
66
|
+
|
|
67
|
+
Initial implementation status: the package exposes `aionis-substrate sidecar` for read-only snapshot/reference checks. It does not start Runtime, mutate Runtime storage, or implement Runtime admission policy.
|
|
68
|
+
|
|
69
|
+
## Excluded
|
|
70
|
+
|
|
71
|
+
- Vector search, ANN, embeddings, or semantic recall.
|
|
72
|
+
- Full Aionis Runtime admission policy.
|
|
73
|
+
- LLM-as-judge or model-generated lifecycle policy.
|
|
74
|
+
- Agent orchestration or external Agent harnesses.
|
|
75
|
+
- SaaS tenancy, auth, billing, or cloud service behavior.
|
|
76
|
+
- Replacing `AionisRuntime-focused` storage.
|
|
77
|
+
|
|
78
|
+
## Release Gates
|
|
79
|
+
|
|
80
|
+
Before v0.2 can be tagged:
|
|
81
|
+
|
|
82
|
+
- `npm run typecheck`
|
|
83
|
+
- `npm test`
|
|
84
|
+
- `npm run bench:contract`
|
|
85
|
+
- `npm run check:release`
|
|
86
|
+
- `npm run check:scale -- --nodes 10000 --scopes 10 --relations 2000 --feedback 1000`
|
|
87
|
+
- adapter parity tests for every new public API;
|
|
88
|
+
- package install smoke from tarball;
|
|
89
|
+
- published registry smoke after release.
|
|
90
|
+
|
|
91
|
+
## v0.1 Baseline
|
|
92
|
+
|
|
93
|
+
v0.1 already provides:
|
|
94
|
+
|
|
95
|
+
- file and SQLite adapters;
|
|
96
|
+
- append-only event log;
|
|
97
|
+
- governed context buckets;
|
|
98
|
+
- decision receipts;
|
|
99
|
+
- read-only context preview;
|
|
100
|
+
- backup and restore;
|
|
101
|
+
- checkpoint compaction;
|
|
102
|
+
- deterministic scoped search;
|
|
103
|
+
- Runtime snapshot import;
|
|
104
|
+
- external admission parity;
|
|
105
|
+
- isolated Runtime dual-write sidecar experiments;
|
|
106
|
+
- npm package and registry smoke checks.
|
|
107
|
+
|
|
108
|
+
v0.2 should harden this substrate boundary instead of broadening the product surface.
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aionis/substrate",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Durable governed memory substrate for Aionis execution state.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"aionis-substrate": "dist/cli.js"
|
|
10
|
+
},
|
|
8
11
|
"exports": {
|
|
9
12
|
".": {
|
|
10
13
|
"types": "./dist/index.d.ts",
|
|
@@ -30,11 +33,14 @@
|
|
|
30
33
|
"check:runtime-snapshot": "node scripts/runtime-snapshot-parity.ts",
|
|
31
34
|
"check:runtime-corpus": "node scripts/runtime-snapshot-corpus.ts",
|
|
32
35
|
"check:runtime-reference-corpus": "node scripts/runtime-reference-corpus.ts",
|
|
36
|
+
"check:runtime-sidecar": "node scripts/runtime-sidecar-check.ts",
|
|
33
37
|
"make:runtime-product-reference": "node scripts/runtime-product-reference-fixture.ts",
|
|
34
38
|
"check:external-admission-parity": "node scripts/external-admission-parity.ts",
|
|
35
39
|
"check:runtime-dual-write": "node scripts/runtime-dual-write-experiment.ts",
|
|
36
40
|
"check:pack": "npm run build && node scripts/verify-package.ts",
|
|
37
41
|
"check:install-smoke": "npm run build && node scripts/install-smoke.ts",
|
|
42
|
+
"check:registry-install": "node scripts/registry-install-smoke.ts",
|
|
43
|
+
"check:published-runtime-smoke": "node scripts/published-runtime-smoke.ts",
|
|
38
44
|
"check:scale": "node scripts/scale-test.ts",
|
|
39
45
|
"example:basic": "npm run build && node examples/basic/index.mjs",
|
|
40
46
|
"check:release": "npm run typecheck && npm test && npm run bench:contract && npm run example:basic && npm run check:pack && npm run check:install-smoke"
|