[Spec 1210] codev doctor: detect protocol-file drift - #1223
Merged
Conversation
…ntradiction (codex)
…meration (codex review)
…ng; accurate staleness-only header (codex review)
…m); assert identical is info-only; explicit EOL precondition (codex/claude review)
…unded+offline-tolerant (codex review)
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.
Summary
Adds a Framework Drift report to
codev doctorthat surfaces a previously-silent failure class of the four-tier resolver (.codev/→codev/→ cache → skeleton):identical→ redundant, safe to remove (info-only);differs→ "customized or stale? — adjudicate" (warning, names the file, tier, resolved-winner, and skeleton package version).@cluesmith/codevversion vs npmlatest, reported explicitly (installed X; latest Y), best-effort, offline-tolerant, bounded (~2.5s).Report-only — no user file is ever modified. Quiet by default — the section prints only when a shadow exists or the skeleton is behind; no overrides + up-to-date/offline is a true no-op.
Closes #1210
Changes
packages/codev/src/lib/protocol-drift-audit.ts(auditProtocolDrift,hasFrameworkShadows,checkSkeletonStaleness,fetchLatestVersion, formatters). Mirrors thepr-gate-audit/framework-ref-auditprecedent; reuseslib/skeleton.tsresolver primitives so the audit and runtime resolution agree on "the skeleton". Raw-byte SHA-256 compare (EOL-only diffs →differs, conservatively). Scan set:protocols/,consult-types/,roles/;resources/excluded (user-evolved).packages/codev/src/commands/doctor.ts(quiet-by-default; stalenessbehindis a warning, up-to-date/offline is info; header subtitle adapts to shadow vs staleness-only). DocumentedCODEV_DOCTOR_FAKE_LATESTenv test-seam (inert in real use).Testing
protocol-drift-audit.test.ts): identical/differs/no-copy, both override tiers + resolved-winner,resources/excluded, EOL-only → differs, no-op gate, staleness behind/equal/offline/throws, real npm lookup bounded+offline-tolerant, no-mutation, scan-set integrity, formatters.doctor-drift.e2e.test.ts): differing shadow → adjudicate warning w/ version; identical shadow → info-only (no adjudicate line); no overrides → no section; no overrides + behind → staleness-only section.codev/overrides.Deferred (per spec — non-blocking)
DriftFinding.codev updatewiring (optional) → lib is structured for it.Spec
codev/specs/1210-codev-doctor-detect-protocol-f.md
Review
codev/reviews/1210-codev-doctor-detect-protocol-f.md