feat(penpal): add ANCHORS as a first-class source type#457
Conversation
|
@codex review Comment posted automatically by outer-loop |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6056084780
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6056084 to
f95a30d
Compare
Add support for detecting and surfacing ANCHORS (anchorsmd) modules as a first-class source type alongside RPI and RP1. Projects with an ANCHORS.md marker file at the root are automatically detected, and all ANCHORS documents (PRODUCT.md, ERD.md, TESTING.md, DEPENDENCIES.md) are discovered recursively across nested modules. Key changes: - Add AutoDetectFile and SkipDirs fields to SourceType for file-based detection and efficient tree scanning from project root - Register "anchors" source type with teal badge, file classification, and module-aware grouping (files grouped by module directory with canonical ordering) - Update DetectSources to check for marker files in addition to dirs - Update watcher auto-detect to handle both file and directory creation - Skip .git/node_modules during ANCHORS tree walks for performance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f95a30d to
5a50e96
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a50e963f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "PRODUCT.md": | ||
| return "product" |
There was a problem hiding this comment.
Enforce ANCHORS marker before classifying module docs
classifyAnchorsFile classifies PRODUCT.md/ERD.md/etc. solely by basename, so any similarly named file anywhere under the project root is treated as an ANCHORS file once root detection enables the source. Both scanProjectSources and handleAPISearch include files whenever ClassifyFile returns non-empty, which means files like docs/PRODUCT.md (without a sibling docs/ANCHORS.md) get indexed and returned in search despite the module rule tested in TestGroupAnchorsPaths. This creates inconsistent behavior (hidden in grouped views but still indexed/searchable) and can skew file metadata/counts.
Useful? React with 👍 / 👎.
Summary
Adds ANCHORS as a first-class source type alongside RPI and RP1:
ANCHORS.mdmarker at root are auto-detected; all ANCHORS documents (PRODUCT.md,ERD.md,TESTING.md,DEPENDENCIES.md) are discovered recursively across nested modulesSourceTypegainsAutoDetectFile(file-based detection) andSkipDirs(skipsnode_modules,.git, etc. during tree scan) — generic infrastructure reusable by future source typesANCHORS.mdmarker existsANCHORS.mdcreation/removalAlso bundles several accumulated fixes:
penpal-*;just release <sha>reads version from Cargo.toml of the given commit; Homebrew bump uses a GitHub App token and passes a SHA256 for the artifactprojectRunActionsStoretracks run-action phase (building vs. running) per project; project list and sidebar show a SineWave animation during the running phase; fixedlistenToRunPhaseChangedto unwrap event payload correctlyTesting
New unit tests cover ANCHORS file classification and module grouping (
TestClassifyAnchorsFile,TestGroupAnchorsPaths), including ordering, nested modules, and the rule that files without a siblingANCHORS.mdare excluded.🤖 Generated with Claude Code