fix(snippets): satisfy the parity guards the drift check tripped
CI & Build / Python lint (push) Successful in 3s
CI & Build / integration (push) Successful in 16s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / Python tests (push) Successful in 52s
CI & Build / Build & push image (push) Successful in 45s

Two CI failures, both the guards working as intended rather than defects
in them:

- The MCP tool-name manifest and the REST route/service parity lists are
  explicit, so a new capability has to be added to both surfaces or the
  test fails. verify_snippet / verify_snippet_route / record_verification
  added, plus an assertion that the `verification` filter reaches both
  callers — a verdict an agent records must be visible to the human
  looking at the same corpus, or the two surfaces disagree about what's
  rotten (rule #33).

- vue-tsc rejected two object-literal lookups keyed by the status union:
  `status` includes "ok" and "unverified", and an object literal has to
  enumerate every member even just to say "nothing to show for these".
  Typed as Record<string, string>, which is what the ?? "" fallback
  already assumed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UaYUaouG9jjhATyuxCKrQs
This commit is contained in:
2026-07-28 18:24:48 -04:00
parent 35f3f09d12
commit 84c5c0dc81
3 changed files with 25 additions and 12 deletions
+15 -9
View File
@@ -161,9 +161,15 @@ function driftBadge(s: SnippetListItem): string {
const v = s.verification;
if (!v) return "";
if (!v.current) return "unchecked since edit";
return { ok: "", missing: "path gone", moved: "symbol moved", changed: "code drifted" }[
v.status
] ?? "";
// Record<string, string>, not an object literal: `status` is a union that
// includes "ok" and "unverified", and a literal would have to enumerate every
// member just to say "nothing to show for these".
const labels: Record<string, string> = {
missing: "path gone",
moved: "symbol moved",
changed: "code drifted",
};
return labels[v.status] ?? "";
}
function driftTitle(s: SnippetListItem): string {
@@ -178,12 +184,12 @@ function driftTitle(s: SnippetListItem): string {
`code this record no longer holds. Re-verify it.`
);
}
const what =
{
missing: "the recorded path no longer exists",
moved: "the file is there but the symbol isn't in it",
changed: "the source no longer matches the recorded code",
}[v.status] ?? "";
const reasons: Record<string, string> = {
missing: "the recorded path no longer exists",
moved: "the file is there but the symbol isn't in it",
changed: "the source no longer matches the recorded code",
};
const what = reasons[v.status] ?? "";
return v.detail ? `${when}: ${what}. ${v.detail}` : `${when}: ${what}.`;
}