feat(cli): add VBA rule-table stats#175
Merged
Merged
Conversation
…#168) Option A from the issue: build the tooling instead of marking VBA_RULE_TABLES as @internal. The new subcommand lists every declarative rule the VBA extractor dispatches with concern, id, plain-English description, serialized pattern, per-concern count, and the cross-concern total. --json prints a machine-readable envelope; the default mode is a human-readable listing. Important: the output reports STATIC rule counts (size of each classifier's RULES array), not per-rule runtime emission counts. vba-extractor.ts does not track per-rule emission counts at the orchestrator level today (the only instrumentation is vba-timing.ts per-stage wall-clock timings and VbaClassifier.count per-classifier totals). Anything resembling 'rule X fired N times' would be invented; keep it absent until real instrumentation exists. The unit test pins that boundary explicitly. Files: - src/cli/stats-vba-rules.ts (new) — pure buildStatsVbaRules() over VBA_RULE_TABLES; serializes single RegExp as .source string and RegExp[] alternatives as string[] preserving order. - src/bin/codegraph.ts — new 'stats' parent + 'vba-rules' subcommand with --json, following the existing 'status' command pattern. - __tests__/stats-vba-rules.test.ts (new) — 13 tests covering the unit shape, JSON envelope contract, CLI integration end-to-end against the built binary, and a regression guard that no fabricated emission-count field sneaks in. - README.md — added the new command to the CLI reference. - CHANGELOG.md — friendly user-facing entry under [Unreleased] > New Features. Installer files left untouched per the issue's scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #168
Summary
TDD evidence
pm run build`n
Independent final review found no blocking or important findings.