Skip to content

feat(phase0.5): validate-extracted with surfaces[].phase0 and v2 exit codes - #10

Merged
mikeylong merged 1 commit into
mainfrom
feat/phase0.5-validate-extracted-v2
Feb 5, 2026
Merged

mikeylong merged 1 commit into
mainfrom
feat/phase0.5-validate-extracted-v2

Conversation

@mikeylong

Copy link
Copy Markdown
Collaborator

Goal

Phase 0.5: validate extracted reality against declared policy using surfaces[].phase0 (no x_* in policy). v2 exit codes and deterministic findings.

Changes

  • Schema: Optional surfaces[].phase0: authPosture, requiresShell, expectsAuthRoutes, expectsDesignSystem.
  • CLI: validate-extracted --contract <path> --extracted <path> [--surface <id>] [--format text|json] [--exit-codes v1|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. Sorted by surfaceId then code.
  • Tests and API.md / README updates.

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

… 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>
@mikeylong
mikeylong merged commit cfc9dd5 into main Feb 5, 2026
2 checks passed
@mikeylong
mikeylong deleted the feat/phase0.5-validate-extracted-v2 branch February 5, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant