Skip to content

refactor(review): rename byte-size, digest, and conformance-registry modules for the roles they play - #737

Merged
benvinegar merged 7 commits into
mainfrom
claude/review-cleanup-renames
Aug 14, 2026
Merged

refactor(review): rename byte-size, digest, and conformance-registry modules for the roles they play#737
benvinegar merged 7 commits into
mainfrom
claude/review-cleanup-renames

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Second cleanup PR from the post-merge Opus review (follows #736): naming fixes only, no logic changes.

Renames

  • core/review/noteBounds.tsnoteSize.ts, reviewNoteWithinBoundsreviewNoteWithinSizeLimit. The module measures serialized bytes, but CLAUDE.md reserves "bounds" for a concrete visible extent and the codebase honors that spatially everywhere (rowBounds, hunkBounds, selectedNoteBounds, VerticalBounds) — this was the one vocabulary break, sitting greppably next to the spatial note-card concept in the same feature area. MAX_REVIEW_NOTE_BYTES and reviewNoteByteLength were already unambiguous and keep their names. The conformance fixture file follows (ReviewNoteSizeFixture, REVIEW_NOTE_SIZE_FIXTURES, fixture field withinSizeLimit).
  • app/review/digest.tssrc/lib/reviewDigest.ts. Its header claimed "the producer's hashing implementation", but the daemon imports it too — the location made the broker carry an import edge into the app tier for three lines of Node hashing. src/lib/ is the existing home for tier-neutral primitives; the header now says what it is: the Node implementation of the shared ReviewDigestFn, injected by whichever tier owns bytes.
  • MAX_REVIEW_RESOURCE_CACHE_BYTESMAX_REVIEW_PRODUCER_RESOURCE_BYTES. It and MAX_REVIEW_DAEMON_CACHE_BYTES are identical 64 MB budgets in two tiers; only the daemon's named its tier, so a contributor tuning "the cache" had a coin-flip.
  • REVIEW_CONFORMANCE_CONSUMERS/FIXTURESREVIEW_GEOMETRY_CONSUMERS/FIXTURES (file fixtures.tsgeometryFixtures.ts), with the geometry-specific types following (ReviewGeometryConsumer etc.). Four peer registries exist — geometry, navigation, ordering, wire — and three were named for what they cover while the first wore the harness's generic name, so a future consumer would join the wrong registry. Genuinely shared harness vocabulary (ConformanceGap, ConformanceLineAddress, ConformanceSelection) keeps its prefix.
  • app/review/publication.ts header gains one cross-reference: the addressing/ordering vocabulary lives in core/review/generationOrder.ts (matching its existing pointer at core/review/document.ts).

Doc references in docs/browser-review-seam-audit.md were updated only where they'd now be wrong as instructions; historical narrative is untouched. No gate path-lists referenced the renamed files.

Gates

bun run typecheck clean; conformance + core + app + session suites 725 pass / 0 fail after rebasing onto main (post-#736 squash); bun run lint 0/0; bun run format clean. Full bun test on the pre-rebase branch matched its baseline (one PTY flake, passes in isolation; the two pre-existing @axe-core/playwright website errors). Empty changeset (maintenance).


Generated by Claude Code

claude added 6 commits August 14, 2026 17:29
`noteBounds.ts` measures a note's serialized *bytes*, but CLAUDE.md reserves
"bounds" for one concrete visible extent, and the codebase honors that
spatially everywhere else (`rowBounds`, `hunkBounds`, `selectedNoteBounds` in
DiffPane, `VerticalBounds`). This was the one vocabulary break, and it collided
greppably with the spatial note-card concept in the same feature area.

Rename the module to `noteSize.ts` and `reviewNoteWithinBounds` to
`reviewNoteWithinSizeLimit`; `MAX_REVIEW_NOTE_BYTES` and `reviewNoteByteLength`
were already unambiguous and stay put. The conformance fixture file and its
exports follow, along with the audit doc's references to the current code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
`src/app/review/digest.ts` called itself "the producer's hashing
implementation", but the daemon (`src/session/broker/state.ts`) imports it too,
which dragged a broker -> app-tier import edge across the codebase for three
lines of Node hashing. `src/lib/` already holds tier-neutral primitives
(`sourceText.ts`, `osPath.ts`, `terminalText.ts`), so the digest belongs there
and its header now says what it is rather than who owns it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
`MAX_REVIEW_RESOURCE_CACHE_BYTES` and `MAX_REVIEW_DAEMON_CACHE_BYTES` are
identical 64 MB budgets living in two tiers, and only the daemon's said which
tier it belonged to — so the producer's read like the resource budget rather
than one of two. Rename it to `MAX_REVIEW_PRODUCER_RESOURCE_BYTES` so the pair
is greppable and each name states its own side.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
`test/review-conformance/` runs four peer registries — geometry, navigation,
ordering, wire — and three are named for the question they answer. The first
wore the harness's generic name (`REVIEW_CONFORMANCE_CONSUMERS`,
`REVIEW_CONFORMANCE_FIXTURES`, `fixtures.ts`), so a future consumer would read
it as "the" registry and join the wrong one. The doc comments already call them
the geometry consumers; the code now says so too, types included
(`ReviewGeometryConsumer`/`Fixture`/`Projection`). The `Conformance*` shapes
stay as they are — they are shared harness vocabulary, not registry names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
The header already sends a reader to `core/review/document.ts` for the document
it publishes, but said nothing about where a generation's address and ordering
rules live — so `generationOrder.ts` was reachable only by grep. One sentence,
following the existing pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
Rename-only maintenance with no user-visible behavior change, so it should not
appear in release notes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018L6h5GBz6RAxRXbgUS4mx4
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hunk-web Ignored Ignored Preview Aug 14, 2026 7:46pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR consistently renames review modules, limits, fixtures, registries, and related documentation to clarify their roles without changing behavior.

  • Renames note byte-size APIs and their conformance fixtures.
  • Moves the shared Node review-digest implementation from the app tier into src/lib.
  • Clarifies producer resource-budget and geometry-registry names.
  • Updates all affected imports, tests, comments, and documentation references.

Confidence Score: 5/5

The PR appears safe to merge because the renames and module relocation are complete and preserve existing behavior.

Repository-wide references, registry memberships, configuration coverage, and the relocated digest implementation remain consistent, with no concrete changed-code failure identified.

Important Files Changed

Filename Overview
src/core/review/noteSize.ts Renames the note-size module and predicate without changing byte measurement or limit behavior.
src/lib/reviewDigest.ts Relocates the unchanged Node SHA-256 implementation to a tier-neutral internal utility path used by Node-side callers.
src/app/review/resourceStore.ts Renames the producer cache-budget constant and updates its default use without changing the 64 MB value.
src/session/broker/state.ts Updates the broker's digest import to the relocated implementation with no behavioral change.
src/session/reviewProtocol.ts Updates note-size terminology while preserving the existing transportability check.
test/review-conformance/geometryFixtures.ts Renames the geometry fixture module and types while preserving all fixture data and registry membership.
test/review-conformance/conformance.test.ts Updates conformance imports and registry names consistently across geometry and note-size checks.

Reviews (1): Last reviewed commit: "chore: add an empty changeset for the re..." | Re-trigger Greptile

…eader autopsies (#739)

Co-authored-by: Claude <noreply@anthropic.com>
@benvinegar
benvinegar merged commit c43f0b8 into main Aug 14, 2026
12 checks passed
benvinegar pushed a commit that referenced this pull request Aug 14, 2026
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
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.

2 participants