Skip to content

feat(schema): substrate tiers 1–6 (SCHEMA 34)#107

Merged
SutuSebastian merged 23 commits into
mainfrom
feat/substrate-tiers-1-6
May 20, 2026
Merged

feat(schema): substrate tiers 1–6 (SCHEMA 34)#107
SutuSebastian merged 23 commits into
mainfrom
feat/substrate-tiers-1-6

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

@SutuSebastian SutuSebastian commented May 20, 2026

Expands the SQLite index substrate for tiers 1–6 of substrate-extraction.md. SCHEMA_VERSION 27 → 34 — rebuild on upgrade; coverage / query_baselines / recipe_recency preserved.

Summary

  • 7 schema bumps (28–34) — call/import precision, re-exported bindings, module-graph flags, dynamic imports, JSX, behavioral tables
  • 12 new or extended recipes with golden coverage
  • Insert-path perf — batched async_calls/try_catch, imports, jsx_attributes (~151→143 ms median on minimal fixture)
  • Minimal fixture enriched — every codemap surface; golden suite 52 → 71 scenarios
  • Docs/governance — rollout plan retired (delete + lift); glossary, architecture schema version, ship status aligned
  • Review + QA follow-ups — CodeRabbit extractor fixes; read-only CLI query enforcement; regression tests for extractors, migration, and fan-out-sample*

Changeset: minor (→ 0.8.0 on release).

Schema (27 → 34)

Version Change
28 calls.{args_count,is_method_call,is_constructor_call,is_optional_chain}; constructor vs call dedup key fix
29 symbols.{return_type,is_async,is_generator}
30 dynamic_imports table + extractor
31 files.{is_barrel,has_side_effects}
32 bindings.resolution_kind='re-exported'
33 Side-effect import_specifiers rows (kind='side-effect') + import_id FK
34 jsx_elements / jsx_attributes, async_calls, try_catch, decorators, jsdoc_tags

New extractors: extractors/jsx.ts, extractors/behavioral.ts, extractors/dynamic-imports.ts, extractors/module-side-effects.ts

Recipes

Recipe Notes
find-call-sites Extended — call-shape columns
find-async-functions New
find-dynamic-imports New
find-barrel-files New
find-side-effect-files New
find-side-effect-imports New
find-re-exported-bindings New
find-jsx-usages New
find-await-in-loop New
find-swallowed-errors New
find-decorator-usage New
find-throws-jsdoc New

Fixture & golden coverage

fixtures/minimal exercises tiers 1–6 end-to-end plus boundaries, FTS5, complexity, coverage, suppressions, test suites, and orphan exports. See fixtures/minimal/README.md.

+19 golden scenarios (71 total), including boundary-violations, fan-out-sample / fan-out-sample-json, try-catch-rethrow-heuristics, components-by-hooks, refactor-risk-ranking, and more.

Perf

Commit Change insert_ms median
7852ba2 Batch async_calls + try_catch 151→145
b9ebdb8 Batch imports in insertImportsWithSpecifiers 145→143
12b40c0 Batch jsx_attributes only 145→143

Post-review fixes

CodeRabbit (9fe9c11, 75a1a65)

  • catch_rethrows — skip nested function/class bodies in catch scan
  • parseJsDocTags — accept bare @returns / @throws / @tag lines
  • JSX fragments — column_end from openingFragment.end (was 239 on multi-line <></>)
  • Research appendix date → 2026-05-19; architecture.md schema version 34

QA remediation (694eb1f)

  • printQueryResultPRAGMA query_only = 1 (closes ad-hoc CLI DML/DDL gap)
  • Unit tests — behavioral.test.ts (catch_rethrows, bare JSDoc), jsx.test.ts (fragment bounds), index-engine.test.ts (read-only enforcement)
  • Migration test — v27 on-disk snapshot → schema 34 rebuild; user-data tables preserved (fixtures/db/schema-v27.sql)
  • Goldens — try-catch-rethrow-heuristics, fan-out-sample, fan-out-sample-json

CI (377de85, 4473ca4)

  • Scope unit tests to ./src (excludes fixtures/minimal/src it.only under CI=true)
  • Rebaseline perf for schema 34

CodeRabbit triage (9 actionable)

Verdict Items
✅ Applied (6) Post-review extractor fixes above
❌ Declined (3) experimentalDecorators README; JSDoc on internal persist helpers

Not in this PR

  • files.is_entry / reachabilityc9-plugin-layer.md
  • Tiers 7–13 — CSS rich, project meta, ORM, …

Migration

No in-place DDL. Schema mismatch triggers rebuild; user-data tables survive via dropAll() exclusions. Re-run codemap --full after upgrade. v27→34 path covered by db.test.ts + frozen fixtures/db/schema-v27.sql.

Test plan

  • bun run check
  • bun run test:golden71 scenarios
  • bun test ./src
  • Self --full + validate --json[]
  • CodeRabbit review triaged (6 applied / 3 declined)
  • CI on latest push (694eb1f)
  • Reviewer: spot-check a recipe (CODEMAP_ROOT=fixtures/minimal bun run dev --full)

Summary by CodeRabbit

  • New Features
    • Richer indexable info: async/generator/return-type detection, JSX element/attribute extraction, dynamic imports, call-site shape, decorators, JSDoc throws, try/catch and side‑effect flags, barrel file detection, and re-export resolution.
  • Documentation
    • Architecture, glossary, plans, recipes and roadmap updated to cover new queries and substrates.
  • Tests
    • Expanded golden fixtures and tests exercising JSX, dynamic imports, behavioral rules, and new queries.
  • Migration
    • Index format bumped (schema v34); reindex required to regen the on-disk index.

Codemap-validated baseline and tracer-bullet execution order for tiers 1–6
remainder, explicitly excluding C.9 / files.is_entry.
Record args_count, method/constructor/optional-chain flags on call edges;
extend find-call-sites recipe and golden fixture. First tracer bullet from
the tiers 1–6 rollout plan.
Structured function shape on symbols (return_type, is_async, is_generator)
with find-async-functions recipe; minimal fixture prefetch export for golden.
Record import() sites with specifier kind, async-fn context, and literal
resolution; ship find-dynamic-imports recipe + minimal fixture golden.
Post-pass barrel detection from exports/symbols; parse-time module side-
effect tracking; find-barrel-files and find-side-effect-files recipes.
Mark bindings that reach their symbol through a re-export chain; ship
find-re-exported-bindings recipe + golden fixture.
Emit kind='side-effect' for bare imports; link specifiers to parent
imports.id at insert time. Recipe + golden on fixtures/minimal polyfill.
Add jsx_elements/jsx_attributes extractors with parent linking,
async_calls/try_catch/decorators/jsdoc_tags behavioral extractors,
five flagship recipes + golden fixtures on fixtures/minimal.
Update ship status in substrate-extraction.md and close the rollout
plan baseline (SCHEMA 34, all scoped slices landed, C.9 excluded).
SCHEMA 27→34; documents new substrate tables, recipes, and C.9 exclusion.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 3fd7c93

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/codemap Minor

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8d754b9-77d1-43cb-83e2-c4b6fa55a07d

📥 Commits

Reviewing files that changed from the base of the PR and between 694eb1f and 3fd7c93.

📒 Files selected for processing (1)
  • src/application/index-engine.test.ts

📝 Walkthrough

Walkthrough

Schema upgraded to 34 with new tables/columns; new extractors for JSX, behavioral data, dynamic imports, and call-shape flags; parser/adapters extended; indexing persists new substrates and barrel/side-effect flags; fixtures, goldens, tests, and recipes updated; docs and changeset added.

Changes

Substrate tiers 1–6 extraction and indexing

Layer / File(s) Summary
Schema and DB helpers
src/db.ts, src/application/types.ts, src/application/run-index.ts
Adds new tables/columns, indexes, and insert helpers; updates stats types and initialization.
AST extractors
src/extractors/*
Emits enriched calls, JSX elements/attributes, async/try-catch/decorators/JSDoc tags, dynamic imports, and module-side-effect signals; updates extractor types.
Parser/adapters/resolver
src/parser.ts, src/adapters/*, src/parsed-types.ts, src/resolver.ts
Registers new extractors; extends payloads; handles side-effect imports/specifiers with import_index; adds module resolution helper.
Indexing pipeline and persistence
src/application/*
Persists new substrates (dynamic_imports, async_calls, try_catch, decorators, jsdoc_tags, jsx_*); sets files.has_side_effects; uses insertImportsWithSpecifiers; computes is_barrel.
Minimal fixture source/config
fixtures/minimal/...
Adds TS/TSX sources exercising decorators, JSX, dynamic imports, side-effects, complexity fixtures, env, tests, and tsconfig experimentalDecorators.
Golden datasets and scenarios
fixtures/golden/...
Updates/adds goldens for barrels, calls, refs, JSX, behavioral findings, coverage, rankings, boundaries, scenarios, file metrics, and hashes.
Docs, changeset, and recipes
.changeset/*, docs/*, templates/recipes/*
Documents schema bump and tier shipping; adds recipes and SQL templates for new queries (dynamic imports, JSX usages, decorators, throws-jsdoc, side-effect imports, etc.).
Parser tests
src/parser.test.ts, src/extractors/*.test.ts, src/db.test.ts
Adds/extends tests for function-shape fields, dynamic imports, module-side-effects, call-site metadata, behavioral parsing, JSX extraction, and schema rebuild behavior.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Source as Source files
  participant Parser as Parser
  participant Extractors as JSX/Behavioral/Calls/Dynamic
  participant Resolver as resolveModuleSpecifier
  participant Index as IndexEngine
  participant DB as Codemap DB

  Source->>Parser: parse file
  Parser->>Extractors: visit AST nodes (JSX, calls, await/try, import())
  Extractors-->>Parser: elements/attrs, async_calls, try_catch, decorators, jsdocTags, calls, dynamicImports, hasSideEffects
  Parser->>Resolver: resolve literal dynamic import
  Resolver-->>Parser: resolved_path|null
  Parser-->>Index: ParsedFile payload (+imports/specifiers incl. side-effect)
  Index->>DB: insert files/symbols/calls/imports+specifiers
  Index->>DB: insert dynamic_imports, async_calls, try_catch, decorators, jsdoc_tags, jsx_*
  Index->>DB: update files.has_side_effects
  Index->>DB: persistFileBarrelFlags()
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested labels

enhancement, documentation

A rabbit taps the schema drum,
From twenty-seven to thirty-four we come.
JSX petals, async beats, imports that roam,
Barrels and side-effects find a home.
Goldens glitter, tests take flight — hippity-hop, codemap's bright! 🐇✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/substrate-tiers-1-6

Delete execution plan per docs-governance (shipped content lives in
substrate-extraction.md and architecture.md).
@SutuSebastian SutuSebastian changed the title feat: substrate tiers 1–6 (no C.9) feat(schema): substrate tiers 1–6 (SCHEMA 34) May 20, 2026
Rule 9 glossary entries and stale deferred text in substrate-extraction,
research synthesis, and roadmap; trim restating SymbolRow JSDoc per concise-comments.
insert_ms median 151→145ms (7-run self-index); fewer JS↔SQLite round-trips via batchInsert.
insert_ms median 145→143ms (10-run self-index); batchInsert + id > maxBefore
for import_id FK wiring preserves row order.
insert_ms median 145→143ms (10-run self-index); element inserts unchanged.
Add boundary config, tests, complexity/JSX/behavioral fixtures, and 16 golden
scenarios so bundled recipes and tiers 1–6 tables have non-empty CI coverage.
@SutuSebastian SutuSebastian marked this pull request as ready for review May 20, 2026 08:08
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: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/architecture.md (1)

190-190: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale schema version in architecture docs.

Line 190 still says schema version 27, but this PR documents and ships 34. Please update this to avoid migration/debugging confusion.

As per coding guidelines, "**/*.md: Documentation files must be kept up-to-date with code changes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture.md` at line 190, Update the documentation string "Current
schema version: **27**" in docs/architecture.md to reflect the shipped schema
version 34; search for the exact token "Current schema version" or the bolded
version number and replace **27** with **34** so the README matches the code/PR.
🧹 Nitpick comments (1)
templates/recipes/find-side-effect-imports.md (1)

1-10: ⚡ Quick win

Add recipe frontmatter metadata for consistency with the template set.

This is the only new recipe doc in this cohort without params/actions frontmatter, which makes behavior/documentation inconsistent with the other recipe templates.

Suggested patch
+---
+params: []
+actions:
+  - type: navigate-to-definition
+    description: "Each row is a side-effect-only import occurrence."
+---
+
 # find-side-effect-imports
 
 Side-effect-only import statements (`import "./mod"` with no bindings).

As per coding guidelines: "**/*.md: ... Use consistent terminology across all documentation" and "**/*.{json,yaml,yml,md}: Document all configuration options with examples".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/recipes/find-side-effect-imports.md` around lines 1 - 10, Add
standard frontmatter to the find-side-effect-imports recipe markdown by
inserting a YAML frontmatter block that documents the recipe's params and
actions (even if empty/default) so it matches other templates; include keys
"params" with descriptions/example values for any configurable query filters and
"actions" describing outputs (e.g., columns like import_id) and expected usage,
and ensure terminology matches the template set (use "params"/"actions" exact
key names and include a short description and example invocation).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/research/codemap-richer-index-synthesis-2026-05.md`:
- Around line 25-26: The appendix currently shows a "fact-checked 2026-05-18"
heading while the new bullets reference 2026-05-19; update the appendix heading
(the text node reading "fact-checked 2026-05-18") to "fact-checked 2026-05-19"
or add a short annotation under that heading clarifying that the substrate plan
bullets were updated on 2026-05-19 so the dates are consistent with the new
entries (refer to the lines mentioning "Substrate plan Tiers 1–6 (2026-05-19)"
and the 2026-05-19 ship claims).

In `@fixtures/minimal/tsconfig.json`:
- Line 7: Add a short documentation snippet showing the new
"experimentalDecorators": true tsconfig option in the minimal fixture README:
explain what experimentalDecorators does and include a minimal example showing a
TypeScript class decorator usage (a simple `@log` or `@sealed` decorator applied to
a class) plus the corresponding tsconfig JSON line "experimentalDecorators":
true so readers can copy the config and example; update the README for the
minimal fixture to include this example and a one-line note linking it to the
tsconfig change.

In `@src/application/behavioral-persist.ts`:
- Around line 4-8: Add concise JSDoc blocks for the two exported persistence
functions so they qualify as public API docs: place a JSDoc comment immediately
above export function insertDecorators(db: CodemapDatabase, filePath: string,
rows: ParsedDecorator[]): void and another above export function
insertJsdocTags(...) that states the lookup criteria (how filePath and any
identifying keys are matched), what rows represent (ParsedDecorator / JsdocTag
shapes), and the insertion behavior (whether it upserts, replaces, or appends
existing records and any side-effects). Mention the expected types
(CodemapDatabase, ParsedDecorator) and any important constraints (e.g., id/key
fields used for lookup) in each comment.

In `@src/application/jsx-persist.ts`:
- Around line 5-9: Add a concise JSDoc block above the exported function
persistJsxElementsAndAttributes describing its public contract: explain that it
persists ParsedJsxElement and ParsedJsxAttribute rows into the CodemapDatabase,
that element parent relationships must be mapped to existing database IDs
(describe parent mapping behavior: unmapped parents are handled/ignored or cause
skip), that attribute rows whose local element IDs are not found in the mapping
will be skipped, and list parameter meanings (db, elements, attributes) and side
effects/return type (void). Include brief notes about expected invariants (e.g.,
elements may reference parentId mappings) so callers know preconditions.

In `@src/extractors/behavioral.ts`:
- Around line 90-112: bodyHasThrow is traversing into nested function/class
bodies and can falsely detect a throw inside an inner function as a catch
rethrow; update bodyHasThrow to skip descending into nodes whose type is
FunctionDeclaration, FunctionExpression, ArrowFunctionExpression,
ClassDeclaration, or ClassExpression (and their bodies) when iterating keys, so
you only inspect the catch block's top-level statements and nested
non-function/class nodes; keep the existing stack-based traversal and checks for
ThrowStatement and Identifier but do not push function/class nodes or their
inner body objects onto the stack.
- Around line 173-193: The regexes for tag parsing (the `@returns`, `@throws` blocks
and the general /^@(\w+)\s+(.*)$/ at the end) currently require trailing
whitespace/text so bare tags like "`@returns`" or "`@deprecated`" are skipped;
update them to allow missing trailing text by making the trailing
space+description optional and allowing optional whitespace after the tag and
optional type: e.g. change /^`@returns`?\s+(?:\{([^}]*)\}\s+)?(.*)$/ to something
like /^`@returns`?\s*(?:\{([^}]*)\}\s*)?(.*)$/ and change the general
/^@(\w+)\s+(.*)$/ to /^@(\w+)(?:\s+(.*))?$/ so that the description can be
null/empty before pushing to out in the parsing logic in behavioral.ts.

In `@src/extractors/jsx.ts`:
- Around line 167-183: tokenEnd/column_end for JSXFragment may use
closingFragment.end (or node.end) which can be on a different line than
line_start, producing wrong column_end; when isFragment is true compute
tokenStart/tokenEnd from openingFragment/closingFragment bounds (use
openingFragment.start and closingFragment.end) relative to lineStartOffset so
column_start/column_end reflect fragment token positions, and ensure the
elements entry uses those fragment-based tokenStart/tokenEnd instead of falling
back to node.start/node.end; update the logic around tokenStart, tokenEnd and
the elements push (column_start/column_end) to use
openingFragment/closingFragment when isFragment is true.

---

Outside diff comments:
In `@docs/architecture.md`:
- Line 190: Update the documentation string "Current schema version: **27**" in
docs/architecture.md to reflect the shipped schema version 34; search for the
exact token "Current schema version" or the bolded version number and replace
**27** with **34** so the README matches the code/PR.

---

Nitpick comments:
In `@templates/recipes/find-side-effect-imports.md`:
- Around line 1-10: Add standard frontmatter to the find-side-effect-imports
recipe markdown by inserting a YAML frontmatter block that documents the
recipe's params and actions (even if empty/default) so it matches other
templates; include keys "params" with descriptions/example values for any
configurable query filters and "actions" describing outputs (e.g., columns like
import_id) and expected usage, and ensure terminology matches the template set
(use "params"/"actions" exact key names and include a short description and
example invocation).
🪄 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: 55621d6b-0ea0-435f-8f0f-65819fb45a85

📥 Commits

Reviewing files that changed from the base of the PR and between d95d2d1 and 93b2659.

📒 Files selected for processing (122)
  • .changeset/substrate-tiers-1-6.md
  • docs/architecture.md
  • docs/glossary.md
  • docs/plans/substrate-extraction.md
  • docs/research/codemap-richer-index-synthesis-2026-05.md
  • docs/roadmap.md
  • fixtures/golden/minimal/barrel-files.json
  • fixtures/golden/minimal/boundary-violations.json
  • fixtures/golden/minimal/calls-consumer.json
  • fixtures/golden/minimal/components-by-hooks.json
  • fixtures/golden/minimal/components-touching-deprecated.json
  • fixtures/golden/minimal/coverage-rows-after-ingest.json
  • fixtures/golden/minimal/deeply-nested-functions.json
  • fixtures/golden/minimal/dependencies-from-consumer.json
  • fixtures/golden/minimal/deprecated-symbols.json
  • fixtures/golden/minimal/enum-order-status.json
  • fixtures/golden/minimal/env-var-audit.json
  • fixtures/golden/minimal/fan-in.json
  • fixtures/golden/minimal/fan-out.json
  • fixtures/golden/minimal/files-by-coverage.json
  • fixtures/golden/minimal/files-count.json
  • fixtures/golden/minimal/files-hashes.json
  • fixtures/golden/minimal/files-largest.json
  • fixtures/golden/minimal/find-async-functions.json
  • fixtures/golden/minimal/find-await-in-loop.json
  • fixtures/golden/minimal/find-barrel-files.json
  • fixtures/golden/minimal/find-by-param-type.json
  • fixtures/golden/minimal/find-call-sites.json
  • fixtures/golden/minimal/find-decorator-usage.json
  • fixtures/golden/minimal/find-dynamic-imports.json
  • fixtures/golden/minimal/find-export-sites.json
  • fixtures/golden/minimal/find-import-sites.json
  • fixtures/golden/minimal/find-jsx-usages.json
  • fixtures/golden/minimal/find-leftover-console.json
  • fixtures/golden/minimal/find-re-exported-bindings.json
  • fixtures/golden/minimal/find-references.json
  • fixtures/golden/minimal/find-side-effect-files.json
  • fixtures/golden/minimal/find-side-effect-imports.json
  • fixtures/golden/minimal/find-skipped-tests.json
  • fixtures/golden/minimal/find-swallowed-errors.json
  • fixtures/golden/minimal/find-symbol-definitions.json
  • fixtures/golden/minimal/find-symbol-references.json
  • fixtures/golden/minimal/find-throws-jsdoc.json
  • fixtures/golden/minimal/find-write-sites.json
  • fixtures/golden/minimal/high-complexity-untested.json
  • fixtures/golden/minimal/index-summary.json
  • fixtures/golden/minimal/jsdoc-tags-createClient.json
  • fixtures/golden/minimal/jsx-attributes-product-card.json
  • fixtures/golden/minimal/large-functions.json
  • fixtures/golden/minimal/markers-all-kinds.json
  • fixtures/golden/minimal/markers-by-kind.json
  • fixtures/golden/minimal/refactor-risk-ranking.json
  • fixtures/golden/minimal/suppressions-orphan.json
  • fixtures/golden/minimal/tests-by-file.json
  • fixtures/golden/minimal/text-in-deprecated-functions.json
  • fixtures/golden/minimal/unimported-exports.json
  • fixtures/golden/minimal/untested-and-dead.json
  • fixtures/golden/minimal/visibility-tags.json
  • fixtures/golden/minimal/worst-covered-exports.json
  • fixtures/golden/scenarios.json
  • fixtures/minimal/.codemap/config.json
  • fixtures/minimal/README.md
  • fixtures/minimal/src/__tests__/smoke.test.ts
  • fixtures/minimal/src/api/client.ts
  • fixtures/minimal/src/api/decorated.ts
  • fixtures/minimal/src/components/shop/ApiBridge.tsx
  • fixtures/minimal/src/components/shop/ProductCard.tsx
  • fixtures/minimal/src/components/shop/ShopButton.tsx
  • fixtures/minimal/src/consumer.ts
  • fixtures/minimal/src/env.ts
  • fixtures/minimal/src/lib/cache.ts
  • fixtures/minimal/src/lib/complexity-fixture.ts
  • fixtures/minimal/src/orphan.ts
  • fixtures/minimal/src/polyfill.ts
  • fixtures/minimal/src/types/status.ts
  • fixtures/minimal/src/utils/format.ts
  • fixtures/minimal/tsconfig.json
  • src/adapters/builtin.ts
  • src/adapters/types.ts
  • src/application/behavioral-persist.ts
  • src/application/bindings-engine.ts
  • src/application/file-graph-flags.ts
  • src/application/index-engine.ts
  • src/application/jsx-persist.ts
  • src/application/run-index.ts
  • src/application/types.ts
  • src/db.ts
  • src/extractors/behavioral.ts
  • src/extractors/calls.ts
  • src/extractors/dynamic-imports.ts
  • src/extractors/jsx.ts
  • src/extractors/module-side-effects.ts
  • src/extractors/symbols.ts
  • src/extractors/type-stringify.ts
  • src/extractors/types.ts
  • src/parsed-types.ts
  • src/parser.test.ts
  • src/parser.ts
  • src/resolver.ts
  • templates/recipes/find-async-functions.md
  • templates/recipes/find-async-functions.sql
  • templates/recipes/find-await-in-loop.md
  • templates/recipes/find-await-in-loop.sql
  • templates/recipes/find-barrel-files.md
  • templates/recipes/find-barrel-files.sql
  • templates/recipes/find-call-sites.sql
  • templates/recipes/find-decorator-usage.md
  • templates/recipes/find-decorator-usage.sql
  • templates/recipes/find-dynamic-imports.md
  • templates/recipes/find-dynamic-imports.sql
  • templates/recipes/find-jsx-usages.md
  • templates/recipes/find-jsx-usages.sql
  • templates/recipes/find-re-exported-bindings.md
  • templates/recipes/find-re-exported-bindings.sql
  • templates/recipes/find-side-effect-files.md
  • templates/recipes/find-side-effect-files.sql
  • templates/recipes/find-side-effect-imports.md
  • templates/recipes/find-side-effect-imports.sql
  • templates/recipes/find-swallowed-errors.md
  • templates/recipes/find-swallowed-errors.sql
  • templates/recipes/find-throws-jsdoc.md
  • templates/recipes/find-throws-jsdoc.sql
💤 Files with no reviewable changes (1)
  • fixtures/golden/minimal/files-by-coverage.json

Comment thread docs/research/codemap-richer-index-synthesis-2026-05.md
Comment thread fixtures/minimal/tsconfig.json
Comment thread src/application/behavioral-persist.ts
Comment thread src/application/jsx-persist.ts
Comment thread src/extractors/behavioral.ts
Comment thread src/extractors/behavioral.ts Outdated
Comment thread src/extractors/jsx.ts
Routine package upgrades after substrate tiers 1–6 work.
Update research appendix date, skip nested scopes in catch_rethrows scan,
accept bare JSDoc tags, and use opening-fragment bounds for column_end.
Update stale schema 27→34 in architecture.md; add params/actions frontmatter
to find-side-effect-imports template for consistency with cohort.
Exclude fixtures/minimal smoke.test.ts (intentional it.only for index
coverage) from bun test. Update perf-baseline.json from CI ubuntu medians
after substrate tiers 1–6 insert-path growth.
Bun treats bare `src` as a glob and still runs fixtures/minimal/src
smoke.test.ts (it.only fails under CI=true).
Enforce PRAGMA query_only on printQueryResult, add extractor and migration
tests, catch_rethrows + fan-out-sample goldens, and document the CLI contract.
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/application/index-engine.test.ts`:
- Around line 36-46: Wrap each console spy setup in a try/finally so the spy is
always restored even if assertions fail: for the test that creates const log =
spyOn(console, "log").mockImplementation(() => {}), surround the assertion block
calling printQueryResult(...) and expect(...) with try { ... } finally {
log.mockRestore(); }, and apply the same change to the other tests that create a
log spy (the blocks around lines creating the spy for printQueryResult). This
ensures the spy on console.log is restored no matter what; reference the const
log spy and the printQueryResult calls to locate the tests to update.
🪄 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: bb94803c-7a66-4041-a9b6-b42d72dbeeb9

📥 Commits

Reviewing files that changed from the base of the PR and between 93b2659 and 694eb1f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • docs/architecture.md
  • docs/research/codemap-richer-index-synthesis-2026-05.md
  • fixtures/benchmark/perf-baseline.json
  • fixtures/db/schema-v27.sql
  • fixtures/golden/minimal/barrel-files.json
  • fixtures/golden/minimal/fan-out-sample-json.json
  • fixtures/golden/minimal/fan-out-sample.json
  • fixtures/golden/minimal/files-hashes.json
  • fixtures/golden/minimal/files-largest.json
  • fixtures/golden/minimal/index-summary.json
  • fixtures/golden/minimal/refactor-risk-ranking.json
  • fixtures/golden/minimal/try-catch-rethrow-heuristics.json
  • fixtures/golden/minimal/unimported-exports.json
  • fixtures/golden/minimal/untested-and-dead.json
  • fixtures/golden/minimal/worst-covered-exports.json
  • fixtures/golden/scenarios.json
  • fixtures/minimal/README.md
  • fixtures/minimal/src/lib/complexity-fixture.ts
  • package.json
  • src/application/index-engine.test.ts
  • src/application/index-engine.ts
  • src/db.test.ts
  • src/extractors/behavioral.test.ts
  • src/extractors/behavioral.ts
  • src/extractors/jsx.test.ts
  • src/extractors/jsx.ts
  • templates/recipes/find-side-effect-imports.md
✅ Files skipped from review due to trivial changes (10)
  • fixtures/benchmark/perf-baseline.json
  • fixtures/golden/minimal/refactor-risk-ranking.json
  • fixtures/golden/minimal/unimported-exports.json
  • fixtures/golden/minimal/try-catch-rethrow-heuristics.json
  • fixtures/golden/minimal/untested-and-dead.json
  • fixtures/golden/minimal/barrel-files.json
  • fixtures/minimal/README.md
  • fixtures/golden/minimal/files-largest.json
  • fixtures/golden/minimal/files-hashes.json
  • fixtures/golden/minimal/worst-covered-exports.json

Comment thread src/application/index-engine.test.ts
Prevents spy leakage when assertions fail mid-test (CodeRabbit PR #107).
@SutuSebastian SutuSebastian merged commit f24f8b6 into main May 20, 2026
11 of 12 checks passed
@SutuSebastian SutuSebastian deleted the feat/substrate-tiers-1-6 branch May 20, 2026 10:46
@github-actions github-actions Bot mentioned this pull request May 20, 2026
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