Skip to content

chore(fixture): enrich fixtures/minimal to exercise every codemap surface#55

Merged
SutuSebastian merged 4 commits intomainfrom
chore/enrich-fixture
May 3, 2026
Merged

chore(fixture): enrich fixtures/minimal to exercise every codemap surface#55
SutuSebastian merged 4 commits intomainfrom
chore/enrich-fixture

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

@SutuSebastian SutuSebastian commented May 3, 2026

Summary

Enriches the fixture from a minimal smoke target into a full per-surface demo. Foundation for the upcoming coverage ingestion plan (next agent-loop unlock — needs realistic data to exercise against).

Before → After

Metric Before After
files 11 18
symbols 9 33
calls 5 27
markers 3 (TODO/FIXME) 6 (TODO/FIXME/HACK/NOTE)
visibility tags 1 (@internal) 4 (@internal/@beta/@alpha/@private)
@deprecated 1 3 (SARIF/annotations show 3 rows)
components 1 2 (both call usePermissions — fan-in)
cycles 0 1 (cache.ts ↔ store.ts)
project recipes 0 1 (shop-symbols)
CODEOWNERS absent 4 owners (--group-by owner works)

See fixtures/minimal/README.md for the per-surface coverage table.

Smoke

```text
$ CODEMAP_ROOT=$(pwd)/fixtures/minimal bun src/index.ts query --recipe deprecated-symbols --format annotations
::notice file=src/api/client.ts,line=39::legacyClient (function)
::notice file=src/utils/date.ts,line=5::now (function)
::notice file=src/utils/format.ts,line=5::epochMs (function)

$ bun src/index.ts impact run --json --summary | jq '.summary'
{ "nodes": 13, "max_depth_reached": 3, "by_kind": {"symbol": 13}, "terminated_by": "depth" }

$ bun src/index.ts impact get --depth 5 --direction down --json | jq '.summary'
{ "nodes": 5, "max_depth_reached": 2, "terminated_by": "exhausted" } # cycle stops walk
```

Known limitations (filed for follow-up)

  • Project-recipe lookup runs at parse time — `bun src/index.ts query --recipe shop-symbols` is rejected as "unknown" because the parser checks the registry before bootstrap initialises `getProjectRoot()`. The recipe file shape is valid (frontmatter actions, project-local discovery path); the loader just needs to defer validation to the runner.
  • `XXX` is not a recognised marker kind — codemap's `MARKER_RE` covers `TODO|FIXME|HACK|NOTE` only. Trivial extension if we want.

Both surfaced by the fixture, unrelated to it. Worth separate issues.

Drive-by

  • `lint-staged.config.js`: filter out fixture paths before lint — oxlint exits 1 when every staged file matches an `ignorePatterns` entry, so all-fixture commits would otherwise fail.

Test plan

  • CodeRabbit reviews the new code (mostly trivial demo TS), the new `CODEOWNERS` shape, the project-recipe SQL.
  • All 714 tests still pass.

Summary by CodeRabbit

  • New Features

    • Enhanced shop UI components with permission-based conditional rendering
    • Added caching and storage system for data management
    • Introduced new utility functions for date/time and value formatting
  • Documentation

    • Expanded coverage documentation with comprehensive feature tables
  • Chores

    • Updated linting configuration to exclude test fixtures from staged checks
    • Added configuration files for code ownership and analysis recipes

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 3, 2026

⚠️ No Changeset found

Latest commit: f770638

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@SutuSebastian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 25 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2c0046b1-52ee-44b6-a175-7b970aa57995

📥 Commits

Reviewing files that changed from the base of the PR and between e7e078d and f770638.

📒 Files selected for processing (16)
  • fixtures/golden/minimal/barrel-files.json
  • fixtures/golden/minimal/calls-consumer.json
  • fixtures/golden/minimal/components-no-false-positives.json
  • fixtures/golden/minimal/dependencies-from-consumer.json
  • fixtures/golden/minimal/deprecated-symbols.json
  • fixtures/golden/minimal/exports-client.json
  • fixtures/golden/minimal/files-count.json
  • fixtures/golden/minimal/files-hashes.json
  • fixtures/golden/minimal/index-summary.json
  • fixtures/golden/minimal/markers-all-kinds.json
  • fixtures/golden/minimal/markers-notes-todo.json
  • fixtures/golden/minimal/visibility-tags.json
  • fixtures/minimal/.codemap/recipes/shop-symbols.sql
  • fixtures/minimal/README.md
  • fixtures/minimal/src/lib/cache.ts
  • package.json
📝 Walkthrough

Walkthrough

The PR expands the minimal fixture to comprehensively exercise codemap surfaces by adding shop components, library modules with call cycles, utility functions, Codemap recipes, CODEOWNERS metadata, and updating documentation and tooling configuration.

Changes

Minimal Fixture Comprehensive Expansion

Layer / File(s) Summary
Core Library & Call Graph
fixtures/minimal/src/lib/cache.ts, fixtures/minimal/src/lib/store.ts
New modules establish a 2-node call cycle (getreadinvalidatewrite) using in-memory Map storage to exercise cycle detection.
Utility Functions
fixtures/minimal/src/utils/date.ts, fixtures/minimal/src/utils/format.ts
Added time/format utilities: nanoseconds(), _hiResEpoch() (deprecated/beta variants), epochMs() (deprecated), and nowIso() to exercise visibility tags and deprecation markers.
Shop Component Expansion
fixtures/minimal/src/components/shop/ProductCard.tsx, fixtures/minimal/src/components/shop/ShopButton.tsx, fixtures/minimal/src/components/shop/ShopButton.default.ts, fixtures/minimal/src/components/shop/index.ts
Added new ProductCard with React hooks, updated ShopButton to use usePermissions(), created default-export fixture, and added barrel re-exports (including default-as-named re-export) to exercise component surfaces.
API Client Deepening
fixtures/minimal/src/api/client.ts
Expanded createClient with deeper call chain via new setupTransport, openSocket, and handshake functions; added Transport interface and deprecated legacyClient() to exercise call graph and deprecation.
Consumer Wiring
fixtures/minimal/src/consumer.ts
Updated run() to invoke cache get(), call utility epochMs(), and reference shop components to integrate new surfaces into the call graph.
Fixture Metadata & Indexing
fixtures/minimal/.codemap/recipes/shop-symbols.md, fixtures/minimal/.codemap/recipes/shop-symbols.sql, fixtures/minimal/CODEOWNERS
Added project-local Codemap recipe (MD definition + SQL query) targeting shop component surface and CODEOWNERS fixture to exercise recipe discovery and group-by-owner queries.
Tooling & Documentation
lint-staged.config.js, fixtures/minimal/README.md, fixtures/minimal/src/notes.md
Updated linter config to exclude fixtures directory, expanded README with detailed coverage table and usage examples (including --recipe invocation), and added fixture-specific marker annotations to exercise marker scanning.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

enhancement, documentation


🐰 A fixture grows so tall and wide,
With symbols, shops, and caches tied,
Cycles dance and recipes bloom,
Markers scattered through the room,
Codemap surfaces shine with pride!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'chore(fixture): enrich fixtures/minimal to exercise every codemap surface' directly and accurately summarizes the main objective of the changeset, which is to expand the minimal fixture to comprehensively cover all codemap analysis surfaces.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/enrich-fixture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 35 minutes and 25 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Replaces the lint-staged wrapper that filtered fixture paths (which
broke other CI tasks). The proper fix is at the lint script: oxlint
exits 1 when every staged file matches an `ignorePatterns` entry
(e.g. all-fixture commits) — `--no-error-on-unmatched-pattern` makes
it a no-op instead, mirroring what `format:check` already does for
`oxfmt`.

Also refreshes golden query fixtures to match the enriched
fixtures/minimal corpus.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@fixtures/minimal/.codemap/recipes/shop-symbols.sql`:
- Around line 4-8: The SQL recipe queries the symbols table but does not
restrict results to exported symbols; update the WHERE clause in the query that
selects from the symbols table (the SELECT name, file_path, line_start,
signature ... FROM symbols ... WHERE file_path LIKE 'src/components/shop/%' AND
kind = 'function') to include the exported filter by adding a predicate on the
is_exported column (is_exported = 1) so the result set matches the recipe
description of "every exported function under src/components/shop/". Ensure the
additional predicate is combined with the existing conditions (AND) and keep the
ORDER BY file_path, line_start intact.

In `@fixtures/minimal/README.md`:
- Around line 34-36: The `## Use` block shows the command
`CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun src/index.ts query --recipe
shop-symbols --json` without warning that `--recipe shop-symbols` is rejected at
runtime; add a short inline note immediately below that command explaining that
the `shop-symbols` recipe is currently unsupported/unknown (per the table/PR
notes) and will fail if used, so readers don’t run the command expecting it to
succeed. Reference the exact command string (`CODEMAP_ROOT=... bun src/index.ts
query --recipe shop-symbols --json`) in the note so it’s unambiguous.
- Line 13: Update the README table row so the documented cycle path matches the
actual code and the corrected comment in cache.ts: replace the incorrect 4-step
cycle `cache.get → store.read → cache.invalidate → store.write → cache.get` with
the real cycle `cache.invalidate → store.write → cache.invalidate`; ensure the
caller→callee chain (`run → createClient → setupTransport → openSocket →
handshake`) remains unchanged and that the README entry aligns with the cache.ts
header comment describing the cycle involving cache.invalidate and store.write.

In `@fixtures/minimal/src/components/shop/ProductCard.tsx`:
- Around line 11-19: Add a JSDoc block for the exported ProductCard function
(export function ProductCard(props: ProductCardProps)) documenting the function
purpose, the props parameter (shape via ProductCardProps), and the return value
(JSX.Element or React element), including any behavior such as conditional
rendering based on usePermissions(). Place the JSDoc immediately above the
ProductCard declaration and include tags like `@param` and `@returns` so the public
API is documented per guidelines.

In `@fixtures/minimal/src/components/shop/ShopButton.tsx`:
- Around line 7-14: The exported React component ShopButton lacks JSDoc; add a
JSDoc block above the exported function ShopButton that documents its purpose
(renders a "Buy" button), notes it uses usePermissions to control the disabled
state (disabled when perms.canEdit is false), lists that it accepts no props (or
describe any props if added later), and states the return type (JSX.Element).
Reference the ShopButton function and the usePermissions usage in the comment so
the public API is properly documented.

In `@fixtures/minimal/src/lib/cache.ts`:
- Around line 17-20: invalidate causes unbounded mutual recursion by calling
write(key, "") which in turn calls invalidate; remove the back-call from
invalidate so it only performs _data.delete(key) and does not call write; keep
the existing import relationship and the store.write → cache.invalidate
direction intact (so leave store.write unchanged) and ensure the function name
invalidate is the only change.
- Around line 1-3: Update the header comment to reflect the actual call graph:
change the documented path from "cache.get → store.read → cache.invalidate →
store.write → cache.get" to the real 2-node cycle "cache.invalidate ↔
store.write" and note the unidirectional "cache.get → store.read" edge; edit the
comment in fixtures/minimal/src/lib/cache.ts (where cache.get and
cache.invalidate are defined) and the matching line in README.md (line 13) so
they correctly describe that store.read only returns the backing value and
store.write and cache.invalidate form the two-node cycle.

In `@lint-staged.config.js`:
- Around line 28-44: The current lint-staged config leaves "bun run
format:check" as a plain string so lint-staged appends all filenames (including
fixtures) to it; change the export so the glob handler uses the existing
lintStaged function only, and update lintStaged to return both commands
(format:check and the lint command) for non-empty lintable arrays — locate the
lintStaged function and the export default object and replace the string entry
"*.{js,jsx,ts,tsx,mjs,mts,cjs,cts}": ["bun run format:check", lintStaged] with a
single reference to lintStaged (ensuring lintStaged returns an array like ["bun
run format:check", `bun run lint ...`] or ["true"] when nothing to run).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e4d31fe-0fce-480c-9b5a-578c01cfcd9b

📥 Commits

Reviewing files that changed from the base of the PR and between 1313fc2 and e7e078d.

📒 Files selected for processing (16)
  • fixtures/minimal/.codemap/recipes/shop-symbols.md
  • fixtures/minimal/.codemap/recipes/shop-symbols.sql
  • fixtures/minimal/CODEOWNERS
  • fixtures/minimal/README.md
  • fixtures/minimal/src/api/client.ts
  • fixtures/minimal/src/components/shop/ProductCard.tsx
  • fixtures/minimal/src/components/shop/ShopButton.default.ts
  • fixtures/minimal/src/components/shop/ShopButton.tsx
  • fixtures/minimal/src/components/shop/index.ts
  • fixtures/minimal/src/consumer.ts
  • fixtures/minimal/src/lib/cache.ts
  • fixtures/minimal/src/lib/store.ts
  • fixtures/minimal/src/notes.md
  • fixtures/minimal/src/utils/date.ts
  • fixtures/minimal/src/utils/format.ts
  • lint-staged.config.js

Comment thread fixtures/minimal/.codemap/recipes/shop-symbols.sql
Comment thread fixtures/minimal/README.md Outdated
Comment thread fixtures/minimal/README.md Outdated
Comment thread fixtures/minimal/src/components/shop/ProductCard.tsx
Comment thread fixtures/minimal/src/components/shop/ShopButton.tsx
Comment thread fixtures/minimal/src/lib/cache.ts Outdated
Comment thread fixtures/minimal/src/lib/cache.ts
Comment thread lint-staged.config.js Outdated
- shop-symbols.sql: add `is_exported = 1` so the recipe matches the
  `.md` description ("every exported function under src/components/shop/").
- cache.ts header + README cycle row: replace the bogus 4-step path
  (which referenced edges that don't exist in the code) with the
  actual 2-node static call cycle `cache.invalidate ↔ store.write`,
  plus the non-cyclic `cache.get → store.read` edge.
- cache.ts invalidate(): guard the `write(key, "")` re-entry behind
  an unreachable string check. The AST still records the
  `invalidate → write` call edge needed by the cycle fixture, but
  runtime execution no longer triggers infinite mutual recursion.
- README "Use" section: inline note that `--recipe shop-symbols` is
  currently rejected (matches the table caveat above), so a reader
  copying the command knows to expect the known limitation.
- Re-snapshot files-hashes.json against the post-format README.md so
  CI's golden-query regression matches the on-disk corpus.
- Trim the cache.ts header from a 7-line block to a 2-line cycle
  description + one-line guard explainer (concise-comments rule).
@SutuSebastian SutuSebastian merged commit 499f661 into main May 3, 2026
10 checks passed
@SutuSebastian SutuSebastian deleted the chore/enrich-fixture branch May 3, 2026 18:18
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.

1 participant