Skip to content

Commit a108cbe

Browse files
spec: V18, generated canon formality replay hardening
Promotes ENGI to V18 after V17's operator-facing demonstration closure by making generated/formal proof exhaustiveness the canonical acceptance surface. V18 adds generated proof matrices over the runtime proof corpus: - proof-member semantic matrix: 45 members x 8 scenarios x 2 branch modes = 720 cells - theorem-evidence matrix: 57 theorems x 8 scenarios x 2 branch modes = 912 cells - state-machine matrix: repeated-run, reset-after-run, mixed-deposit, and no-survivor groups = 200 cells - total V18 generated source/integration matrix surface: 1832 cells, all passing, no accepted exclusions This release extends the canonical _PROVEN_ generator so V18 proof appendices include generated matrix summaries, matrix pass/fail totals, state-machine group counts, and aggregate matrix proof status. `ENGI_SPEC_V18_PROVEN.md` is generated from proof-source commit `c675116` using the established V16/V17 proof-source commit convention, and `ENGI_SPEC.txt` now points to `V18`. Implementation closes the source parity gaps surfaced by the V18 matrix work: - adds `v18-matrices.js` matrix builders and closure assertions - wires V18 generated matrices into `_PROVEN_ rendering - adds targeted matrix package scripts and tests - records generated matrix coverage in runtime test coverage reporting - replaces hand-maintained workflow proof-family catalog expectations with catalog truth derived from `collectCanonicalProvenRuns(...)` and `buildCanonicalProvenData(...)` - closes the `.engi/eval-manifest.json` witness digest gap for inference-synthesis replay evidence - aligns authorization sensitive-flow theorem replay ids with the combined proof-family replay catalog - labels internal projections explicitly while preserving raw internal artifact visibility - stabilizes deterministic parsed-completion timestamps so generated V18 `_PROVEN_ output is byte-stable under check mode The V18 docs, notes, and parity matrix now describe the completed generated proof closure posture, the `704` artifact digest count, the closed `1832` generated cell surface, and the generated-only appendix contract. Verification: - `npm run typecheck` - `npm run test:proof-member-matrix` - `npm run test:theorem-evidence-matrix` - `npm run test:state-machine` - `node scripts/generate-engi-proven.mjs --version V18 --commit c675116 --output ENGI_SPEC_V18_PROVEN.md --check --allow-dirty` - `git diff --check` - `npm test` passes 115 / 115
1 parent c675116 commit a108cbe

7 files changed

Lines changed: 2463 additions & 15 deletions

File tree

ENGI_SPEC.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
V17
1+
V18

ENGI_SPEC_V18.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
- Companion parity ledger: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_SYSTEM_PARITY_MATRIX.md`
88
- Prior canonical anchor: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17.md`
99
- Prior generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17_PROVEN.md`
10-
- Current canonical/latest target: `V17`
11-
- Last fully realized canonical target preserved in source: `V17`
12-
- V18 state: source-side generated matrix implementation complete in draft; canonical promotion and `ENGI_SPEC_V18_PROVEN.md` regeneration remain pending
10+
- Current generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_PROVEN.md`
11+
- Current canonical/latest target: `V18`
12+
- Last fully realized canonical target preserved in source: `V18`
13+
- V18 state: source-side generated matrix implementation complete; `ENGI_SPEC.txt` points to `V18`; `ENGI_SPEC_V18_PROVEN.md` is generated from proof-source commit `c675116`
1314
- Current realization basis for this pass: `engi-demo`
1415

1516
## Version executive summary

ENGI_SPEC_V18_NOTES.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
- Draft parity ledger: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_SYSTEM_PARITY_MATRIX.md`
88
- Prior canonical anchor: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17.md`
99
- Prior generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17_PROVEN.md`
10-
- Current canonical/latest target: `V17`
11-
- V18 state: source implementation complete for generated proof-member, theorem-evidence, and state-machine matrices; canonical promotion and `ENGI_SPEC_V18_PROVEN.md` regeneration remain pending
10+
- Current generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_PROVEN.md`
11+
- Current canonical/latest target: `V18`
12+
- V18 state: source implementation complete for generated proof-member, theorem-evidence, and state-machine matrices; `ENGI_SPEC_V18_PROVEN.md` is generated from proof-source commit `c675116`
1213

1314
## Why V18 starts from generated matrices
1415

@@ -45,6 +46,8 @@ Those facts define the starting V18 arithmetic:
4546
- `8 x 2 x 4 = 64` mixed-deposit cells,
4647
- `8 x 2 x 4 = 64` no-survivor cells.
4748

49+
The V18 generated appendix reports `artifactDigestCount=704` because V18 closes the `.engi/eval-manifest.json` digest gap for each of the 16 canonical proof runs.
50+
4851
V18 must treat those as named matrices, not as vague "more tests."
4952

5053
## Important distinction from V17
@@ -137,7 +140,7 @@ The accepted source-side path is:
137140
6. Add matrix test entrypoints and package scripts only after the generated builders are stable.
138141
7. Add matrix summaries to `testCoverageReport`.
139142
8. Extend `renderCanonicalProvenMarkdown(...)` for V18 matrix summaries.
140-
9. Generate `ENGI_SPEC_V18_PROVEN.md` only at canonical promotion.
143+
9. Generate `ENGI_SPEC_V18_PROVEN.md` only at canonical promotion, from the proof-source commit convention used by V16/V17.
141144

142145
## Final source implementation answers
143146

@@ -167,4 +170,5 @@ The source-side V18 implementation work is complete when:
167170
- `test:state-machine` executes `200` passing cells,
168171
- full `npm test` remains green,
169172
- no V18 document implies canonical promotion before `_PROVEN_` regeneration,
170-
- and `ENGI_SPEC.txt` remains on `V17` until the canonical V18 commit.
173+
- `ENGI_SPEC.txt` points to `V18`,
174+
- and `ENGI_SPEC_V18_PROVEN.md` check mode passes against the recorded proof-source commit.

ENGI_SPEC_V18_PROVEN.md

Lines changed: 2363 additions & 0 deletions
Large diffs are not rendered by default.

ENGI_SPEC_V18_SYSTEM_PARITY_MATRIX.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
- Prior canonical anchor: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17.md`
99
- Prior parity ledger: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17_SYSTEM_PARITY_MATRIX.md`
1010
- Prior generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V17_PROVEN.md`
11-
- Current canonical/latest target: `V17`
12-
- Last fully realized canonical target preserved in source: `V17`
13-
- V18 state: source-side matrix generators and tests implemented in draft; canonical promotion and `ENGI_SPEC_V18_PROVEN.md` regeneration remain pending
11+
- Current generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_PROVEN.md`
12+
- Current canonical/latest target: `V18`
13+
- Last fully realized canonical target preserved in source: `V18`
14+
- V18 state: source-side matrix generators and tests implemented; `ENGI_SPEC_V18_PROVEN.md` is generated from proof-source commit `c675116`
1415
- Primary implementation surface to audit for this pass: `engi-demo`
1516

1617
## Purpose
@@ -57,7 +58,7 @@ This matrix is grounded in:
5758

5859
| Area | Current source truth | V18 implementation expectation | Closure signal | Judgment |
5960
|---|---|---|---|---|
60-
| Root canon posture | `ENGI_SPEC.txt` points to `V17`; V17 canonical commit and V17 `_PROVEN_` are present | V18 must remain draft until matrix implementation and V18 `_PROVEN_` regeneration are complete | V18 docs state V17 as current canon and do not advance the pointer prematurely | closed for draft posture |
61+
| Root canon posture | `ENGI_SPEC.txt` points to `V18`; V17 canonical commit and V17 `_PROVEN_` remain present as prior canon | V18 promotion prep must advance the pointer only after matrix implementation and V18 `_PROVEN_` regeneration are complete | V18 docs state V18 as current target and record the generated appendix | closed |
6162
| V17 proof appendix input | `ENGI_SPEC_V17_PROVEN.md` records 16 runs, 9 families, 45 members, 57 theorems, and 688 artifact digests | V18 must use this as the arithmetic and audit seed for generated matrix work | V18 spec/notes/matrix cite those counts and derive required matrix sizes from them | closed for draft posture |
6263
| Proven generator structural checks | `buildCanonicalProvenData(...)` validates family catalog stability, member/theorem presence, replay catalog agreement, witness paths, required artifacts, metadata, and digest presence | V18 must extend beyond structural checks into generated semantic/evidence matrices | `buildV18Matrices(...)` consumes normalized proven data and adds proof-member/theorem/state summaries for V18 `_PROVEN_` rendering | closed |
6364
| Hand-maintained proof catalog expectations | `workflow.integration.test.js` formerly contained a literal proof-family/member/theorem expectation table | V18 must replace or subordinate this with generated/imported catalog truth to reduce drift | Workflow integration derives expected proof-family catalog from `collectCanonicalProvenRuns(...)` and `buildCanonicalProvenData(...)` | closed |
@@ -71,8 +72,8 @@ This matrix is grounded in:
7172
| Browser matrix | V17 E2E covers all `8 x 2 x 4 = 64` operator cells | V18 must keep browser coverage stable and avoid expanding it into proof-member/theorem cross-products | Browser tests remain green; new generated matrices live below the browser unless UI-specific gaps appear | accepted boundary |
7273
| Matrix artifact emission | Branch artifacts remain per-run; V18 matrices are generated from canonical proven data plus state-machine fixtures | V18 must emit or otherwise generate structured matrix JSON consumable by `_PROVEN_` | `buildV18Matrices(...)` returns JSON-compatible generated outputs for proof-member, theorem-evidence, and state-machine matrices; canonical files remain promotion-time outputs if written | closed |
7374
| Runtime coverage report | V17 `testCoverageReport` names unit/integration/e2e and major V17 validations | V18 must add generated matrix coverage honestly without inflating browser claims | Runtime report names generated proof-member, theorem-evidence, and state-machine matrices with cell counts totaling `1832` | closed |
74-
| `_PROVEN_` rendering | V17 `_PROVEN_` renders aggregate verdict, proof-family inventory, member summaries, theorem summaries, replay steps, run matrix, and run details | V18 `_PROVEN_` must add generated matrix summaries and accepted exclusions | Renderer includes V18 matrix totals, failed-cell tables, state-machine group counts, and aggregate matrix proof status | closed for generator; canonical file pending promotion |
75-
| Verification commands | V17 canonical verification used typecheck, full tests, generator write, generator check, and diff hygiene | V18 must preserve that stack and add targeted matrix scripts when implemented | Typecheck, targeted matrix tests, workflow integration, and full `npm test` pass; V18 generator write/check remains canonical-promotion-only | closed for source implementation |
75+
| `_PROVEN_` rendering | V17 `_PROVEN_` renders aggregate verdict, proof-family inventory, member summaries, theorem summaries, replay steps, run matrix, and run details | V18 `_PROVEN_` must add generated matrix summaries and accepted exclusions | `ENGI_SPEC_V18_PROVEN.md` includes V18 matrix totals, failed-cell tables, state-machine group counts, and aggregate matrix proof status | closed |
76+
| Verification commands | V17 canonical verification used typecheck, full tests, generator write, generator check, and diff hygiene | V18 must preserve that stack and add targeted matrix scripts when implemented | Typecheck, targeted matrix tests, workflow integration, full `npm test`, generator write, and generator check pass | closed |
7677

7778
---
7879

@@ -195,4 +196,4 @@ The V18 pass is complete when:
195196
6. runtime coverage reporting includes V18 matrix counts,
196197
7. `_PROVEN_` rendering includes V18 matrix summaries,
197198
8. full verification is green,
198-
9. and `ENGI_SPEC_V18_PROVEN.md` is generated only as part of canonical V18 promotion.
199+
9. and `ENGI_SPEC_V18_PROVEN.md` is generated as part of canonical V18 promotion prep.

ENGI_SPEC_V19_NOTES.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# ENGI Spec V19 Notes
2+
3+
## Status
4+
5+
- Scope: draft recommendations for the next specification after V18 generated proof closure
6+
- Prior canonical target: `V18`
7+
- Prior generated proof appendix: `/Users/garrettmaring/Developer/ENGI/ENGI_SPEC_V18_PROVEN.md`
8+
- Current V19 state: notes only; no V19 canonical pointer, spec file, parity matrix, or source implementation yet
9+
10+
## Recommended V19 center
11+
12+
V19 should focus on canonical replay determinism and promotion hardening.
13+
14+
V18 proved that ENGI can generate and execute proof-member, theorem-evidence, and state-machine matrices from runtime proof truth.
15+
It also exposed the next sharper requirement: once more proof surfaces become digested, latent nondeterminism becomes canonical debt.
16+
The `.engi/eval-manifest.json` digest instability from volatile parsed-completion timestamps is the representative V19 lesson.
17+
18+
The V19 question should be:
19+
20+
Can ENGI prove that the same source, same canonical inputs, and same proof-source commit always regenerate the same canonical appendix and matrix artifacts?
21+
22+
## Primary specification potentialities
23+
24+
1. Deterministic canonical replay
25+
V19 should require every canonical proof run to be hermetic and replay-stable.
26+
Digested proof artifacts must not include wall-clock timestamps, process-order drift, random ids, filesystem-order drift, locale drift, environment drift, or unstated runtime inputs.
27+
28+
2. Canonical promotion command
29+
V19 should specify one promotion workflow that advances `ENGI_SPEC.txt`, regenerates `ENGI_SPEC_VN_PROVEN.md`, runs typecheck, targeted matrix tests, full tests, generator check mode, and diff hygiene, and emits the canonical commit message body.
30+
This removes manual sequencing as a canonical risk.
31+
32+
3. Generated matrix artifact materialization
33+
V18 generates matrix data and renders summaries into `_PROVEN_`.
34+
V19 should decide whether the full generated matrix artifacts are written as canonical structured JSON, so all cells are inspectable without reverse-engineering markdown.
35+
36+
4. Negative proof mutation matrices
37+
V19 should add generated fail-closed tests that mutate proof inputs and require deterministic rejection.
38+
Initial mutation classes should include missing digest, corrupted replay step, dropped theorem verdict, mutated member payload, changed projection policy, missing witness path, and changed matrix axis.
39+
40+
5. Source-level projection security matrix
41+
V17 proved projection behavior through browser operator coverage.
42+
V19 can add source-level projection-policy assertions across scenario, branch mode, and principal to prove policy visibility directly below the UI.
43+
44+
6. Canonical diff and contract-change ledger
45+
V19 should generate a version-to-version delta covering proof families, member ids, theorem ids, replay steps, witness artifacts, digest counts, matrix counts, and accepted boundary changes.
46+
The goal is to make contractual changes explicit before a canonical bump.
47+
48+
7. Deferred UX quality canon
49+
Visual regression, accessibility, and performance budgets remain valid future canon.
50+
They should not displace deterministic replay unless V19 is intentionally scoped as a production-quality UX release.
51+
52+
## Recommended V19 acceptance decisions
53+
54+
- Accept reproducible canon as V19's center.
55+
- Do not introduce new proof families unless determinism or mutation testing reveals a missing category.
56+
- Treat V18's `1832` generated matrix cells as the closed positive-proof baseline.
57+
- Treat V19 mutation matrices as negative-proof coverage, not as additions to the V18 positive matrix count.
58+
- Keep `_PROVEN_` generated-only and require check mode to be stable immediately after generation.
59+
- Preserve the V16/V17/V18 proof-source commit convention unless V19 explicitly replaces it with self-referential canonical commit generation.
60+
61+
## First implementation path
62+
63+
1. Inventory all volatile fields in canonical proof artifacts.
64+
2. Add a deterministic replay test that runs `_PROVEN_` generation twice and requires byte-identical output.
65+
3. Add a proof-artifact volatility scanner for timestamps, random-looking ids, unsorted collections, and environment-derived values.
66+
4. Add a promotion command or script that executes the canonical bump sequence.
67+
5. Add negative mutation matrix builders after replay determinism is green.
68+
6. Decide whether full matrix JSON artifacts become committed canonical outputs or generated side artifacts.
69+
7. Only then consider source-level projection-security matrices or UX quality gates.
70+
71+
## V19 success condition
72+
73+
V19 is complete when canonical promotion is reproducible, generated proof output is byte-stable, mutation coverage proves fail-closed behavior, and contractual deltas are generated rather than inferred from manual review.

engi-demo/src/canonical/need-measurement.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,30 +849,36 @@ export function createNeedMeasurementRuntime({
849849
}))}`
850850
};
851851
});
852+
const deterministicParsedAt = '2026-04-09T00:00:00.000Z';
852853
const parsedCompletionEnvelopes = [
853854
buildParsedCompletionEnvelope({
854855
promptSurface: requirePromptSurface(promptSurfaces, 'need-measurement.task.v2'),
855856
parsedPayload: { task },
857+
parsedAt: deterministicParsedAt,
856858
evidenceRefs
857859
}),
858860
buildParsedCompletionEnvelope({
859861
promptSurface: requirePromptSurface(promptSurfaces, 'need-measurement.failure-modes.v2'),
860862
parsedPayload: { failureModes },
863+
parsedAt: deterministicParsedAt,
861864
evidenceRefs
862865
}),
863866
buildParsedCompletionEnvelope({
864867
promptSurface: requirePromptSurface(promptSurfaces, 'need-measurement.constraints.v2'),
865868
parsedPayload: { constraints },
869+
parsedAt: deterministicParsedAt,
866870
evidenceRefs
867871
}),
868872
buildParsedCompletionEnvelope({
869873
promptSurface: requirePromptSurface(promptSurfaces, 'need-measurement.target-artifact-kinds.v2'),
870874
parsedPayload: { targetArtifactKinds },
875+
parsedAt: deterministicParsedAt,
871876
evidenceRefs
872877
}),
873878
buildParsedCompletionEnvelope({
874879
promptSurface: requirePromptSurface(promptSurfaces, 'need-measurement.closure-criteria.v2'),
875880
parsedPayload: { closureCriteria },
881+
parsedAt: deterministicParsedAt,
876882
evidenceRefs
877883
})
878884
];

0 commit comments

Comments
 (0)