Skip to content

fix(procedures): traverse symlinked store dirs (find -H) - #36

Merged
drewdrewthis merged 1 commit into
mainfrom
fix/titw-store-symlink-traversal
Aug 9, 2026
Merged

fix(procedures): traverse symlinked store dirs (find -H)#36
drewdrewthis merged 1 commit into
mainfrom
fix/titw-store-symlink-traversal

Conversation

@drewdrewthis

@drewdrewthis drewdrewthis commented Aug 9, 2026

Copy link
Copy Markdown
Owner

What

query-records.sh scans each store with find "$d". When a store dir is a symlink — which is exactly how the titw claude-target projection ($TITW_HOME/targets/claude/active) is bridged into the corpus root at titw/ — a bare find treats the symlink as a file and silently finds nothing. One flag fixes it: find -H follows symlinks given as command-line arguments (POSIX; verified on BSD and GNU find).

Measured on macOS 25.5.0:

find link:    0
find link/:   1
find -H link: 1

Why now

procedures 0.3.0 shipped the titw vendor store, but a live titw install && titw sync projects outside ~/.claude and needs the symlink bridge — without this fix the store lists in --list-stores yet returns zero records.

Test

New bats regression test: a record under a symlinked titw/ store must be found by keyword (fails on bare find, passes with -H). Full suite green locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Query results now include records located within store directories reached through symlinks.
    • Existing Markdown, index, and archived-path filtering remains unchanged.
  • Tests

    • Added regression coverage for scanning symlinked store projections.

The titw claude-target projection lives under $TITW_HOME and is bridged
into the corpus root as a symlink at titw/. A bare find treats the
symlinked store as a file and silently scans nothing; -H follows
command-line symlink arguments on both BSD and GNU find. Regression
test added (measured on macOS: find link = 0 files, find -H link = 1).
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

query-records now scans store directories reached through symlinks. A regression test verifies that records under a symlinked titw projection are returned.

Changes

Query-records symlink support

Layer / File(s) Summary
Symlink-aware corpus scan
plugins/procedures/scripts/query-records.sh, plugins/procedures/hooks/tests/query-records.bats
The corpus scan uses find -H. The regression test verifies results from a symlinked titw store path.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling traversal of symlinked store directories with find -H.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/titw-store-symlink-traversal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/procedures/scripts/query-records.sh`:
- Line 177: Mark both vendored divergence sites with literal PLUGIN ADAPTATION
comments: annotate the find -H change in
plugins/procedures/scripts/query-records.sh at lines 177-177, and annotate the
added symlink traversal regression test in
plugins/procedures/hooks/tests/query-records.bats at lines 751-751.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4d81d6b1-7b72-4c6d-9c91-4e4682312b7a

📥 Commits

Reviewing files that changed from the base of the PR and between 690b38c and afccda8.

📒 Files selected for processing (2)
  • plugins/procedures/hooks/tests/query-records.bats
  • plugins/procedures/scripts/query-records.sh

Comment thread plugins/procedures/scripts/query-records.sh
@drewdrewthis
drewdrewthis merged commit f421166 into main Aug 9, 2026
3 checks passed
@drewdrewthis
drewdrewthis deleted the fix/titw-store-symlink-traversal branch August 9, 2026 13:09
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