Conversation
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.
Why
Production verification after #247 exposed two gaps that CI did not model:
ai_transcript_pathis a SHA-256 locator andrawis empty, so historical skill backfill cannot reopen the original JSONL. Modern package-qualified command envelopes still survive in normalized usermessagecontent, but the backfill previously ignored that evidence.tool/sincefilters. On production,search_sessions(query="error", tool="claude", since=2026-09-11, limit=5)still exceeded the gateway timeout at ~59s.Fix
Forwarded Claude command recovery
<command-message>/<command-name>evidence directly from persisted normalized Claude user messages.metadata_json.event_kind == "user"before trusting forwarded command content.attributionSkill/attributionPluginevidence.source_unavailableaccounting when neither normalized command evidence nor the original source is recoverable.vibin:review-prcommand content.Scoped session search
ai_logs_ftswith provider scope (message,ai_tool).idx_logs_ai_timestamp_tool(timestamp, ai_tool) WHERE ai_tool IS NOT NULL.messageand, for safe provider identifiers,ai_tool.since, derive an exact-safe minimum rowid from the AI-only timestamp index and push that bound into FTS before common-term expansion.l.ai_tool = ?and timestamp filters as correctness guards.The rowid floor is derived from actual rows satisfying the event-time bound, not inferred from ingestion order, so late-arriving historical transcripts remain discoverable.
Production evidence before this PR
03ba04df.skill_eventssince 2026-09-01: 0.messagebut have scrubbed source/raw data.search_sessionscall: ~58.996s timeout.Validation
TDD:
inserted=0, source_unavailable=1, then passed after the recovery path.Targeted matrix:
skill_backfilltestssearch_ai_sessionstestsFull isolated gate:
Main library suite:
All integration/workflow suites also passed.
Deployment verification after merge
After hosted CI is green and this PR is merged:
claude_skill_commandevents become nonzero;search_sessionsquery and record before/after latency + result correctness;