Skip to content

feat(procedures): query the titw vendor store; byte-safe scans - #33

Merged
drewdrewthis merged 5 commits into
mainfrom
feat/titw-vendor-store-locale-safe
Aug 9, 2026
Merged

feat(procedures): query the titw vendor store; byte-safe scans#33
drewdrewthis merged 5 commits into
mainfrom
feat/titw-vendor-store-locale-safe

Conversation

@drewdrewthis

@drewdrewthis drewdrewthis commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Two changes to the query surface, proven live in the titw dogfood run (2026-08-09):

titw vendor store (D23)

drewdrewthis/titw DECISIONS D23 (ratified 2026-08-09): titw-installed packages project into ~/.claude/titw/<pkg>/… and the plugin queries them as one extra store.

  • stores.sh: new VENDOR_STORES=(titw) array — queried, never linted/backfilled. Kept out of STORES so every existing consumer (lint-frontmatter, backfill, path guards) is untouched; vendored records are validated by titw check at publish time instead.
  • query-records.sh: ALL_STORES = STORES + VENDOR_STORES.
  • Scout Boundaries + how-do-i tooling note name the store; store-list-drift.bats binds VENDOR_STORES to both prose surfaces; functional test proves a vendored record is found by --keyword/--kind/--id.

Byte-safe scans

export LC_ALL=C in query-records.sh: one non-UTF-8 byte anywhere in the corpus makes BSD cut/grep abort with Illegal byte sequence under a UTF-8 locale — reproduced on macOS against the live corpus (--keyword queries returned nothing). Regression test writes an invalid byte into a fixture record and asserts the scan still succeeds under LC_ALL=en_US.UTF-8.

Evidence

  • bats hooks/tests: 160/160 ok (was 155; +5 new).
  • Live proof: codex published from the sweatshop as @drewdrewthis/orchard-codex@0.1.0, installed via titw on the mac, projected corpus queried through these scripts — 27 results for --keyword worktree from the projection vs 27 from the live codex (identical answers).
  • Mirrors orchard-codex upstream commit 5be2a738 (develop-local-mac) — no unmarked drift.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Record searches now include the titw/ vendor store, enabling discovery by keyword, type, and ID.
    • Searches can include additional configured record stores through QUERY_RECORDS_EXTRA_STORES.
  • Bug Fixes
    • Improved search reliability for records containing non-UTF-8 bytes under UTF-8 locales.
  • Documentation
    • Updated search guidance to describe vendor stores and expanded search coverage.
  • Tests
    • Added coverage for vendor-store discovery, extra stores, invalid encoding, and configuration consistency.

- stores.sh: VENDOR_STORES=(titw) — queried by query-records.sh, never linted/backfilled (D23 in drewdrewthis/titw: vendored records are validated by titw check at publish)
- query-records.sh: ALL_STORES includes vendor stores; export LC_ALL=C so one non-UTF-8 corpus byte no longer aborts BSD cut/grep under a UTF-8 locale (reproduced on macOS)
- scout Boundaries + how-do-i tooling note name the titw store; store-list-drift covers VENDOR_STORES; functional bats tests for vendor-store hits and locale byte-safety

Mirrors orchard-codex upstream commit 5be2a738 (develop-local-mac) — no unmarked drift.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@drewdrewthis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1b4eab8-7974-4a09-8619-89abb57d07a8

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5d537 and 9bed550.

📒 Files selected for processing (6)
  • plugins/procedures/agents/procedure-scout.md
  • plugins/procedures/hooks/tests/query-records.bats
  • plugins/procedures/hooks/tests/store-list-drift.bats
  • plugins/procedures/scripts/lib/stores.sh
  • plugins/procedures/scripts/query-records.sh
  • plugins/procedures/skills/how-do-i/SKILL.md
📝 Walkthrough

Walkthrough

The query system now searches the titw/ vendor store and configured extra stores. It uses the C locale for byte-safe scanning. Documentation and tests cover the expanded search scope and invalid UTF-8 records.

Changes

Vendor Store Query Support

Layer / File(s) Summary
Vendor store contract
plugins/procedures/scripts/lib/stores.sh, plugins/procedures/agents/procedure-scout.md, plugins/procedures/skills/how-do-i/SKILL.md
Defines titw and optional extra stores as query locations while keeping them separate from standard stores.
Query integration
plugins/procedures/scripts/query-records.sh
Uses LC_ALL=C and includes VENDOR_STORES in the query corpus.
Regression coverage
plugins/procedures/hooks/tests/query-records.bats, plugins/procedures/hooks/tests/store-list-drift.bats
Tests vendor-store searches, invalid UTF-8 handling, extra-store configuration, documentation consistency, and query wiring.

Estimated code review effort: 2 (Simple) | ~10 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 summarizes the main changes: querying the titw vendor store and supporting byte-safe scans.
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 feat/titw-vendor-store-locale-safe

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: 2

🤖 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/agents/procedure-scout.md`:
- Around line 153-157: Replace the frozen store-path list in
plugins/procedures/agents/procedure-scout.md:153-157 with a reference to the
live query/store discovery mechanism. Update
plugins/procedures/skills/how-do-i/SKILL.md:24-27 to document the configured
query surface without duplicating store paths. Modify
plugins/procedures/hooks/tests/store-list-drift.bats:23-35 to verify the
discovery reference and retain only the mistakes.jsonl exception, removing
enumeration of STORES and VENDOR_STORES.

In `@plugins/procedures/hooks/tests/query-records.bats`:
- Around line 682-688: Add explicit status assertions after the --kind principle
and --id prin.vendored-sample invocations, matching the existing [ "$status" -eq
0 ] check for the keyword query, while preserving the current output assertions.
🪄 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: b7d1f769-a8af-4d1a-92e0-6d9dac0ca8b3

📥 Commits

Reviewing files that changed from the base of the PR and between e78bb61 and e14fa69.

📒 Files selected for processing (6)
  • plugins/procedures/agents/procedure-scout.md
  • plugins/procedures/hooks/tests/query-records.bats
  • plugins/procedures/hooks/tests/store-list-drift.bats
  • plugins/procedures/scripts/lib/stores.sh
  • plugins/procedures/scripts/query-records.sh
  • plugins/procedures/skills/how-do-i/SKILL.md

Comment thread plugins/procedures/agents/procedure-scout.md Outdated
Comment thread plugins/procedures/hooks/tests/query-records.bats
drewdrewthis and others added 2 commits August 9, 2026 12:29
…cation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…stores

Space-separated, root-relative store paths appended to the scan list.
Env on purpose: settings env maps stack by scope (user -> project ->
local), so a project can add a store with no plugin release. Extras are
queried, never linted, like vendor stores. Scout Boundaries + SKILL
tooling note document the knob; bats test proves a store is invisible
by default and scanned when named.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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: 2

🤖 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/lib/stores.sh`:
- Around line 34-43: Keep QUERY_RECORDS_EXTRA_STORES separate from the static
VENDOR_STORES array by introducing a dedicated extras array in the shown shell
block and appending parsed values there. Update query-records.sh’s ALL_STORES
construction to include the extras array, while leaving VENDOR_STORES unchanged
so store-list-drift.bats and its vendor documentation contract only inspect
managed vendor stores.
- Around line 39-42: Update the QUERY_RECORDS_EXTRA_STORES handling in stores.sh
to validate each entry before adding it to VENDOR_STORES: reject absolute paths,
normalize . and .. components, require the resolved path to remain under ROOT,
and preserve wildcard characters literally without shell glob expansion. Replace
the shellcheck directive with valid disable= syntax and ensure invalid entries
are rejected rather than appended.
🪄 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: 8ad84f5f-f005-487e-981c-9e92166b4adb

📥 Commits

Reviewing files that changed from the base of the PR and between e14fa69 and 4b5d537.

📒 Files selected for processing (4)
  • plugins/procedures/agents/procedure-scout.md
  • plugins/procedures/hooks/tests/query-records.bats
  • plugins/procedures/scripts/lib/stores.sh
  • plugins/procedures/skills/how-do-i/SKILL.md

Comment thread plugins/procedures/scripts/lib/stores.sh Outdated
Comment thread plugins/procedures/scripts/lib/stores.sh
drewdrewthis and others added 2 commits August 9, 2026 13:39
…om VENDOR_STORES

- extras no longer pollute VENDOR_STORES (which the drift test binds to
  the doc contract); query-records.sh composes STORES + VENDOR_STORES +
  EXTRA_STORES, empty-safe under set -u on bash 3.2
- entries validated: absolute paths, .., and glob characters rejected
  loudly on stderr; glob expansion disabled during the split
- valid shellcheck directive syntax; SC2034 silenced for arrays consumed
  by sourcing scripts
- bats: validation test (invalid entries dropped with notice, valid one
  still scanned)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d store list

Owner call (2026-08-09), reversing the earlier inlined-list convention:
agents scope searches to `query-records.sh --list-stores` output instead
of a hand-maintained enumeration in prose. Scout Boundaries and the
how-do-i tooling note now reference the mechanism; store-list-drift.bats
pins the discovery contract (flag lists STORES + VENDOR_STORES + env
extras; docs reference the flag) instead of patrolling prose copies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@drewdrewthis
drewdrewthis merged commit 1d23fe2 into main Aug 9, 2026
2 checks passed
@drewdrewthis
drewdrewthis deleted the feat/titw-vendor-store-locale-safe branch August 9, 2026 12:56
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