fix(status): count nested rule files recursively - #437
Merged
Conversation
`teamai status` was calling `listFiles()` for the rules directory, which only scans direct children. Rules organized in subdirectories (e.g. `rules/common/*.md`) were silently reported as zero. Switch to `listFilesRecursive()` to match the counting logic already used in `RulesHandler`. Add a regression test that places a rule under `rules/common/` and asserts `rules: 1` in the status output.
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.
Summary
teamai statuscalledlistFiles()for the rules directory, which only scans direct children. Rules organized in subdirectories (e.g.rules/common/*.md) were silently counted as zero. Switch tolistFilesRecursive()to match the logic already used inRulesHandler. Fixes #436.Type of Change
Test Plan
npx tsc --noEmitpassesnpx vitest runpassesAdded regression test in
src/__tests__/status-list.test.ts: createsrules/common/example.mdin a temp repo, callsstatus(), and assertsthe output contains
rules: 1.Related Issues
Fixes #436
Notes for Reviewers
One-line change in
src/status.ts. The recursive helperlistFilesRecursivewas already imported and used throughout
RulesHandler— this PR simplyapplies the same function to the status count.