Skip to content

Audit remediation: 4 code fixes + doc corrections#23

Merged
LeahArmstrong merged 11 commits intomainfrom
audit-remediation
Mar 4, 2026
Merged

Audit remediation: 4 code fixes + doc corrections#23
LeahArmstrong merged 11 commits intomainfrom
audit-remediation

Conversation

@LeahArmstrong
Copy link
Owner

Summary

Addresses 4 functionality gaps and 10+ documentation inaccuracies found during a host-app audit.

Code fixes:

  • schema_sha now supports db/structure.sql (for apps using schema_format: :sql)
  • ViewComponent extractor filters framework-internal components with no file_path and no source
  • Engine extractor tags engines as :framework or :application based on root path
  • graph_analysis.json includes generated_at and graph_sha for staleness detection

Rake cleanup:

  • self_analyze and retrieve tasks hidden from rails -T (internal debugging tools)

Documentation:

  • Fixed tool counts (28 index / 33 console) and tier counts (8/10/12/3)
  • Fixed unit_typetype in Getting Started guide
  • Removed non-existent snapshot_metadata.rb from tree
  • Added missing migrations (004, 005) and subsystems (cache/, cost_model/, notion/, mcp/renderers/, flow_precomputer.rb, filename_utils.rb) to tree
  • Added Docker usage examples, codebase-index-mcp-start docs, install generator section, expanded task list, CI caching step, Notion link, Ruby API boot note
  • Synced CLAUDE.md architecture tree to match

Test plan

  • Full suite: 3252 examples, 0 failures, 2 pending
  • Rubocop: 350 files inspected, 0 offenses
  • Host app validation: run extraction in compose-dev/admin and verify schema_sha populated, no null-file_path view components, engine_source metadata present, graph_analysis.json has timestamps

Leah Armstrong added 11 commits February 28, 2026 17:39
Apps using `schema_format: :sql` have `db/structure.sql` instead of
`db/schema.rb`. Try schema.rb first, fall back to structure.sql.
Skip ViewComponent descendants that have no resolvable file_path and
empty source_code — these are framework internals (e.g., Lookbook base
classes) that produce noise in extraction output.
Add engine_source metadata (:framework or :application) based on
whether the engine root lives outside Rails.root (gem path) or under it.
Include generated_at timestamp and graph_sha (digest of
dependency_graph.json) so consumers can verify whether the analysis
is in sync with the current graph.
Remove desc from self_analyze and retrieve tasks so they don't appear
in the public task listing. They remain callable but are developer-only
debugging tools.
- Fix tool counts: Index Server 28, Console Server 33
- Fix tier counts: 8/10/12/3
- Fix unit_type -> type in Getting Started guide
- Remove non-existent snapshot_metadata.rb from tree
- Add missing migrations (004, 005) to tree
- Add missing subsystems to tree: cache/, cost_model/, notion/, mcp/renderers/,
  flow_precomputer.rb, filename_utils.rb
- Add Docker usage examples
- Document codebase-index-mcp-start wrapper in Claude Code setup
- Add install generator + initializer to Installation section
- Document embed, embed_incremental, flow, console, notion_sync tasks
- Add Notion integration link
- Add CI caching step to incremental example
- Add Rails boot requirement note to Ruby API section
Update tool counts (28/33), add missing subsystems (cache/,
cost_model/, filename_utils.rb), add mcp-start executable.
Extract stub_rails_root_and_logger helper to reduce complexity of
stub_rails_respond_to.
…, correct tool counts

Engine framework_engine? now checks for /vendor/ and /bundler/gems/ in
the path instead of only comparing against Rails.root — fixes all 17
engines being tagged as "application" when vendor/bundle is under
Rails.root in Docker.

View component filter simplified to skip any component with no
resolvable file_path, instead of requiring both nil file_path and empty
source_code. Catches framework-internal components (Lookbook etc.)
regardless of source_code state.

Tool counts corrected to match actual source: Index Server 27 (not 28),
Console Server 31 (not 33), tier breakdown 9/9/10/3. Added notion_sync
to MCP_SERVERS.md tool catalog.
New docs/DOCKER_SETUP.md covers the split architecture (Index Server
on host, extraction in container), volume mount requirements, path
translation, both Console Server modes, and troubleshooting. Updated
README, GETTING_STARTED, MCP_SERVERS, docs index, and CLAUDE.md with
Docker callouts and cross-references.
Create 10 new user-question-oriented docs to improve Context7 benchmark
score: FAQ, Troubleshooting, Why CodebaseIndex, Architecture, Extractor
Reference, MCP Tool Cookbook, and 3 Context7 skills. Add context7.json
to control indexing scope and eliminate ~1.2MB of noise from internal
docs.

Streamline README from 620 to 325 lines — add Quick Start section and
Documentation table, replace verbose extractor/subsystem sections with
summaries linking to dedicated docs.

Fix MCP tool counts across CLAUDE.md (28→27 index, 33→31 console) to
match actual source. Fix TROUBLESHOOTING.md incorrectly claiming
config.extractors controls which extractors run (it controls retrieval
scope; all 34 extractors always run).
@LeahArmstrong LeahArmstrong merged commit c468815 into main Mar 4, 2026
5 checks passed
@LeahArmstrong LeahArmstrong deleted the audit-remediation branch March 4, 2026 18:12
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