T2: Claude adapter capture-seam drop for .hypignore#207
Merged
philcunliffe merged 1 commit intoJun 30, 2026
Merged
Conversation
Wire the shared usage-policy resolver (LLP 0050 / src/core/usage-policy) into both Claude capture-seam drop-sites so an exchange whose resolved cwd is governed by an ancestor `.hypignore` is never written to the cache, for live capture and backfill alike (LLP 0049 R1/R2): - projector.js: createClaudeExchangeProjector holds one resolver per projector. Once the exchange cwd is resolved from the session-context record, an ignored cwd returns no rows BEFORE building any, so the ai-gateway source write guard persists nothing. Returning `undefined` is the projector's existing no-rows signal (a literal `[]` is an invalid projection that would log a spurious warning); the live LLM call already streamed, so it is untouched. - backfill.js: createClaudeBackfillProvider holds one resolver per run and skips ignored sessions before projecting/writing, keyed on the same cwd the row would carry (record cwd, else first transcript line). - Both drop-sites emit a structured usage_policy_drop event. - Resolver is injectable on both factories for hermetic tests. New test/plugins/claude-usage-policy-drop.test.js drives the real matcher (injected fs) through the gateway dispatcher and the backfill provider: ignored cwd => no rows / session skipped; clean cwd and no-cwd unaffected. @ref LLP 0050 [implements] @ref LLP 0049#requirements [constrained-by] Task-Id: T2 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c33dd29
into
integration/hypignore-usage-policy
6 checks passed
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.
Implements task T2 of hypignore-usage-policy.
Wires the shared usage-policy resolver (
src/core/usage-policy, LLP 0050) into both Claude capture-seam drop-sites so an exchange whose resolvedcwdis governed by an ancestor.hypignoreis never written to the cache, for live capture and backfill (LLP 0049 R1/R2):claude/src/projector.js:createClaudeExchangeProjectorholds one resolver per projector; once the exchangecwdis resolved it returns no rows before building any, so theai-gateway/src/source.jswrite guard persists nothing. Returnsundefined(this projector's existing no-rows signal) rather than a literal[]which is an invalid projection. Live LLM call untouched (already streamed).claude/src/backfill.js:createClaudeBackfillProviderholds one resolver per run and skips ignored sessions before projecting/writing, keyed on the samecwdthe row would carry.usage_policy_dropevent; resolver is injectable for hermetic tests.Tests:
test/plugins/claude-usage-policy-drop.test.js(ignored cwd => no rows / session skipped; clean and no-cwd unaffected).Checks:
npm run lint,npm run typecheck,npm run build:types,npm test(1503 pass / 1 skip) all green.@ref LLP 0050 [implements]Task-Id: T2