Skip to content

feat(penpal): add ANCHORS as a first-class source type#457

Merged
loganj merged 1 commit intomainfrom
add-anchors-first-class-source
Mar 25, 2026
Merged

feat(penpal): add ANCHORS as a first-class source type#457
loganj merged 1 commit intomainfrom
add-anchors-first-class-source

Conversation

@loganj
Copy link
Copy Markdown
Collaborator

@loganj loganj commented Mar 24, 2026

Summary

Adds ANCHORS as a first-class source type alongside RPI and RP1:

  • Projects with an ANCHORS.md marker at root are auto-detected; all ANCHORS documents (PRODUCT.md, ERD.md, TESTING.md, DEPENDENCIES.md) are discovered recursively across nested modules
  • SourceType gains AutoDetectFile (file-based detection) and SkipDirs (skips node_modules, .git, etc. during tree scan) — generic infrastructure reusable by future source types
  • Files are grouped by module directory with canonical ordering (ANCHORS → PRODUCT → ERD → TESTING → DEPENDENCIES), and only included when a sibling ANCHORS.md marker exists
  • Watcher updated to trigger source rescans on ANCHORS.md creation/removal

Also bundles several accumulated fixes:

  • Penpal release: arm64-only builds; tag format changed to 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 artifact
  • Staged run-actions: New projectRunActionsStore tracks run-action phase (building vs. running) per project; project list and sidebar show a SineWave animation during the running phase; fixed listenToRunPhaseChanged to unwrap event payload correctly

Testing

New unit tests cover ANCHORS file classification and module grouping (TestClassifyAnchorsFile, TestGroupAnchorsPaths), including ordering, nested modules, and the rule that files without a sibling ANCHORS.md are excluded.

🤖 Generated with Claude Code

@loganj loganj added the ai-outer-loop Managed by outer-loop label Mar 24, 2026
@loganj
Copy link
Copy Markdown
Collaborator Author

loganj commented Mar 24, 2026

@codex review

Comment posted automatically by outer-loop

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@loganj loganj force-pushed the add-anchors-first-class-source branch from 6056084 to f95a30d Compare March 25, 2026 00:18
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>
@loganj loganj force-pushed the add-anchors-first-class-source branch from f95a30d to 5a50e96 Compare March 25, 2026 12:54
@loganj loganj marked this pull request as ready for review March 25, 2026 13:15
@loganj loganj merged commit 395c5f6 into main Mar 25, 2026
4 checks passed
@loganj loganj deleted the add-anchors-first-class-source branch March 25, 2026 13:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +225 to +226
case "PRODUCT.md":
return "product"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-outer-loop Managed by outer-loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant