Skip to content

Commit 1ec7dee

Browse files
committed
feat(phase8): validate local runtime schema fragments
1 parent e08a673 commit 1ec7dee

6 files changed

Lines changed: 462 additions & 8 deletions

File tree

docs/plans/phase-8-schema-freeze-inventory.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ The repo advertises `cargo xtask wesley sync`, but `xtask/src/main.rs` does not
175175
implement it yet. Phase 8 needs a real, deterministic regeneration path before
176176
generated artifacts can be trusted.
177177

178+
For now, this branch keeps the runtime freeze loop Echo-local:
179+
180+
- the source of truth lives under `schemas/runtime/*.graphql`,
181+
- local validation happens via `pnpm schema:runtime:check`,
182+
- and Wesley sync stays deliberately deferred until the upstream Echo-facing
183+
schema/compiler contract stops moving.
184+
178185
### 3. Stale plan naming around scheduler results
179186

180187
The inventory resolves this now: Phase 8 should freeze `SchedulerStatus`,
@@ -233,3 +240,7 @@ This prep slice is complete when:
233240
- the first runtime schema artifact set is sketched concretely,
234241
- and the next implementation slice can start from a concrete schema authoring
235242
target instead of inference from Rust code.
243+
244+
That bar is now met. The next honest Phase 8 slice is Echo-local schema
245+
hardening and deferred-generation contract work, not premature Wesley
246+
integration.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"scripts": {
1010
"docs:dev": "vitepress dev docs",
1111
"docs:build": "vitepress build docs",
12-
"test:e2e": "playwright test"
12+
"test:e2e": "playwright test",
13+
"schema:runtime:check": "node scripts/validate-runtime-schema-fragments.mjs"
1314
},
1415
"devDependencies": {
1516
"@playwright/test": "^1.48.0",

schemas/runtime/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,46 @@ That means these files are allowed to exist before:
3333
- Wesley IR is vendored for the runtime freeze set,
3434
- or generated Rust replaces hand-written runtime mirrors.
3535

36+
## Validation
37+
38+
Run the local fragment validator before touching any generation plumbing:
39+
40+
```sh
41+
pnpm schema:runtime:check
42+
```
43+
44+
The validator does two narrow jobs:
45+
46+
- parse-check the SDL fragments via the repo's existing `prettier --check`
47+
toolchain path,
48+
- and verify that every referenced runtime type is defined somewhere inside the
49+
local `schemas/runtime/` fragment set.
50+
51+
This keeps Phase 8 moving without pretending Wesley is already stable enough to
52+
own the runtime freeze loop.
53+
54+
## Planned Output Contract
55+
56+
Generation is explicitly deferred, but the intended artifact boundary is:
57+
58+
- `schemas/runtime/*.graphql`
59+
Human-authored source fragments for Artifacts A-D.
60+
- `schemas/runtime/generated/runtime-schema.graphql`
61+
Planned normalized single-file runtime schema bundle.
62+
- `schemas/runtime/generated/runtime-ir.json`
63+
Planned vendored Wesley IR snapshot for the frozen runtime schema.
64+
- `schemas/runtime/generated/runtime-manifest.json`
65+
Planned vendored schema manifest/metadata for deterministic regeneration.
66+
67+
No generated Rust output path is frozen yet. That stays deferred until Wesley's
68+
Echo-facing contract stabilizes enough that wiring `cargo xtask wesley sync`
69+
will not thrash the Phase 8 freeze target.
70+
3671
## Notes
3772

3873
- These files are SDL **fragments**, not a standalone executable GraphQL API.
3974
- Comments here carry semantic constraints that current GraphQL type syntax
4075
cannot express directly, such as opaque-hash ids and logical-counter rules.
4176
- Generation plumbing (`cargo xtask wesley sync`) still does not exist for this
42-
runtime schema tree; Phase 8 is pinning source files before generation.
77+
runtime schema tree; Phase 8 is pinning and validating source files before
78+
generation.

0 commit comments

Comments
 (0)