Repository navigation
feat(phase0.5): validate-extracted with surfaces[].phase0 and v2 exit codes - #10
Merged
Merged
Conversation
… codes - Schema: add optional surfaces[].phase0 (authPosture, requiresShell, expectsAuthRoutes, expectsDesignSystem) - CLI: validate-extracted reads phase0 only (no x_* in policy), --surface and --exit-codes v2 - v2 exit codes: 0 success, 10 E0 (load/parse), 30 E2 (mismatch) - Findings: phase0.authPosture.mismatch, phase0.authRoutes.missing, phase0.shell.mismatch, phase0.designSystem.missing - Deterministic output order (surfaceId, code). Tests and API/README docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Phase 0.5: validate extracted reality against declared policy using
surfaces[].phase0(no x_* in policy). v2 exit codes and deterministic findings.Changes
surfaces[].phase0:authPosture,requiresShell,expectsAuthRoutes,expectsDesignSystem.validate-extracted --contract <path> --extracted <path> [--surface <id>] [--format text|json] [--exit-codes v1|v2].phase0.authPosture.mismatch,phase0.authRoutes.missing,phase0.shell.mismatch,phase0.designSystem.missing. Sorted by surfaceId then code.Verification
```bash
pnpm test
```
Example commands (pass and fail with --exit-codes v2)
Pass (no phase0):
```bash
interfacectl validate-extracted --contract contracts/surfaces.web.contract.json --extracted contracts/generated/surfaces-web.extraction.json --exit-codes v2
No phase0 block => exit 0
```
Pass (phase0 matches extracted):
```bash
Contract has surfaces[].phase0 for surfaces-web; extracted has authAware true, hasShell true, auth routes, DS components
interfacectl validate-extracted --contract contract-phase0.json --extracted extracted-ok.json --exit-codes v2
exit 0
```
Fail (mismatch => exit 30):
```bash
interfacectl validate-extracted --contract contract-phase0.json --extracted extracted-shell-mismatch.json --exit-codes v2
phase0.shell.mismatch => exit 30
```
Invalid extracted file (exit 10):
```bash
interfacectl validate-extracted --contract contract.json --extracted nonexistent.json --exit-codes v2
exit 10
```
Made with Cursor