Restores the eight-PDD purpose gate at the autonomous-loop boundary required by ADR-0000 (SF is a purpose-to-software compiler). The gate walks milestone vision -> slice.traces_vision_fragment -> task.purpose_trace before every dispatch and refuses to proceed when the purpose chain is broken at the vision root (degraded-vision). - New uok/purpose-coherence.js with a pure verdict function and a DB-backed adapter. Reads vision/trace columns directly via SQL so pre-P2/P3 schema migrations are tolerated. - Wired into auto/phases-pre-dispatch.js alongside resource-version- guard, pre-dispatch-health-gate, and planning-flow-gate. Fires on every pre-dispatch turn and emits to the existing trace JSONL. - Outcome ladder: fail (vision missing -> pause loop), warn (trace columns missing or NULL -> surface but allow dispatch so legacy DBs don't hard-break on day one), pass (full chain). - Tests in tests/uok-purpose-coherence.test.mjs cover the four contracted states plus the column-missing downgrade path on a pre-migration schema. Refs: ADR-0000. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| resources | ||
| tests | ||
| web | ||
| app-paths.ts | ||
| bundled-extension-paths.ts | ||
| bundled-resource-path.ts | ||
| claude-cli-check.ts | ||
| cli-key.ts | ||
| cli-logs.ts | ||
| cli-stats.ts | ||
| cli-status.ts | ||
| cli-web-branch.ts | ||
| cli.ts | ||
| env.ts | ||
| errors.ts | ||
| extension-discovery.ts | ||
| extension-registry.ts | ||
| headless-answers.ts | ||
| headless-context.ts | ||
| headless-events.ts | ||
| headless-feedback.ts | ||
| headless-import-backlog.ts | ||
| headless-mark-state.ts | ||
| headless-query.ts | ||
| headless-reflect.ts | ||
| headless-status.ts | ||
| headless-triage.ts | ||
| headless-types.ts | ||
| headless-ui.ts | ||
| headless-uok-status.ts | ||
| headless-usage.ts | ||
| headless.ts | ||
| help-text.ts | ||
| interactive-session-lock.ts | ||
| loader.ts | ||
| logger.ts | ||
| logo.ts | ||
| models-resolver.ts | ||
| onboarding.ts | ||
| pi-migration.ts | ||
| project-sessions.ts | ||
| provider-migrations.ts | ||
| remote-questions-config.ts | ||
| resource-loader.ts | ||
| rtk.ts | ||
| security-overrides.ts | ||
| startup-model-validation.ts | ||
| startup-timings.ts | ||
| tool-bootstrap.ts | ||
| traces.ts | ||
| update-check.ts | ||
| update-cmd.ts | ||
| web-mode.ts | ||
| welcome-screen.ts | ||
| wizard.ts | ||
| worktree-cli.ts | ||
| worktree-name-gen.ts | ||