refactor(review): delete dead wire helpers and hoist duplicated ones into core - #736
Conversation
The browser-review rebuild left four unreached paths behind: an identity function over the action type, an alias for `reviewNoteWithinBounds`, a lenient digest normalizer that contradicts the module's case-sensitive policy, and two empty exclusion lists whose only caller subtracted nothing. Each one is a second name for something core already answers, so the next reader has to work out which of the two is authoritative. The exclusion points survive as comments where a real exclusion would go, and the gate assertions that would catch one keep their tripwires without depending on the deleted machinery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
… into core Eight small facts were stated twice across the review tiers: the resource failure shape and its constructor, which ceiling a resource kind is held to, the plain-record guard, the "file does not exist" rejection and its wording, UTF-8 byte measurement, an index clamp, and the gap-id format. Each copy is a place the two can drift, and the audit's own findings are about exactly that kind of drift going unnoticed. Core now owns one of each and both tiers import it. The producer's resource-too-large messages keep their existing wording, including the path-bearing one a reviewer sees when a source is too large to expand. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
The parser hardcoded a 15-digit sequence while the formatter accepts any non-negative safe integer, so a producer that passed 10^15 would publish generations nothing could read back — and a generation that fails to parse is treated as stale, which would strand every attached surface. Building the parser's pattern from the prefix and producer-id rule the formatter writes by removes the twin that let them disagree; the safe-integer check stays the real gate on the value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
The digest-pattern gate covered the wire and the shared model but not `src/app`, which is the tier that computes the digests the other two compare — the one place an inline pattern would do the most damage. There is no live violation, so widening the scan only closes the hole before someone falls into it. Adds the maintenance-only changeset for this cleanup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis maintenance PR removes unused review-wire helpers and consolidates duplicated validation, resource, geometry, and failure-shape utilities into core modules. It also fixes generation parsing across the full non-negative safe-integer range and strengthens review vocabulary and digest-pattern tests.
Confidence Score: 5/5The PR appears safe to merge; no actionable regression or blocking failure was identified. The surviving helpers preserve their prior runtime contracts, the generation-parser change aligns parsing with formatting, and the investigated cross-module and wire-shape concerns are contradicted by the repository’s dependency and producer-result structures. Important Files Changed
Reviews (1): Last reviewed commit: "test(review): scan the producer tier for..." | Re-trigger Greptile |
The dedup and rename PRs (#736, #737) landed while this branch was in review: the digest implementation moved to src/lib/reviewDigest, the broker's resource ceiling became core's reviewResourceCeiling, and the geometry conformance registry took its dimension name. Point the phase-4 modules at the new homes instead of re-declaring the old ones. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
First of the cleanup PRs from the post-merge Opus review of the browser-review rebuild: dead code and duplicate helpers. No behavior changes and no renames of surviving symbols (renames are the next PR); net −58 lines.
Dead code (verified zero consumers on main and the phase-4 branch)
toHunkReviewAction— an exported identity function whose only reference in the repo was its own declaration, with a doc comment claiming a conformance check that doesn't exist.isTransportableReviewNote— a pure rename ofreviewNoteWithinBounds; the conformance wire adapter now points at the real function.normalizeReviewDigest— unconsumed, and contradicted the case-sensitive digest policy every wire path actually enforces.WIRE_UNREACHABLE_REVIEW_INTENT_TYPES+deriveReviewActionTypes,SEMANTIC_COMMANDS_WITHOUT_REVIEW_EFFECT) are inlined; the tripwire assertions that would catch a future exclusion stay.Duplicate helpers hoisted to one owner
{ ok: false, code, message }resource-failure shape +failure()constructor existed verbatim in bothresourceAssembly.tsandresourceStore.ts— now one shape incore/review/resources.tsbeside the error-code union it's parameterized by. The no-opfromProducerFailurefield-copy inreviewCommands.tsis gone (the producer failure already structurally satisfies the wire type).reviewResourceCeiling(kind)in core, called from both, so the two tiers cannot drift.requireFilewas duplicated acrossintents.tsandreviewCommands.tsincluding its user-visible message string; the session copy dies and the pre-checks go through the module's existingReviewIntentPlanningError → fail()conversion. Wire codes and message text unchanged.utf8ByteLength(STML parser had the last straggler copy),clamp(declared twice insidecore/review/), the gap-id format (contentManifest.tshand-wrote whatreviewGapIdowns), and the plain-record guard (nowasRecordinvalidation.tsbesidehasExactKeys) are each down to one implementation.One real (if unreachable) bug
parseReviewGenerationhardcoded\d{1,15}while its own formatter accepts any non-negative safe integer — so sequences above 10¹⁵ format to strings the parser rejects, whichclassifyReviewPublicationwould then classify asstaleand silently drop. The parser regex is now built from the module's own grammar constants with the existingNumber.isSafeIntegercheck as the real gate, and a round-trip test pins999999999999999,10¹⁵, andNumber.MAX_SAFE_INTEGER.Gate hardening
src/app/— where the one real hashing implementation lives (no live violation; the hole is just closed).Gates
bun run typecheckclean;bun testover scripts + conformance + core + app/review + session + stml: 1295 pass / 0 fail;bun run lint0/0 across 698 files;bun run format:checkclean. Rebased onto current main (post #733/#727/#728) with gates re-run. Empty changeset (maintenance).Generated by Claude Code