-
Notifications
You must be signed in to change notification settings - Fork 0
feat(retrieval): add retrieval quality proofing workflow and archive change #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,217 @@ | ||
| { | ||
| "version": "1.0", | ||
| "datasetName": "retrieval-proofing-core", | ||
| "datasetVersion": "2026.03.01", | ||
| "cases": [ | ||
| { | ||
| "id": "repo-layout", | ||
| "title": "Find retrieval implementation location", | ||
| "query": "where is hybrid retrieval implemented", | ||
| "intent": "lookup", | ||
| "difficulty": "low", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1", "d2"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "src/context/retrieval/hybrid.ts", | ||
| "title": "Hybrid retrieval source", | ||
| "content": "The hybrid retrieval runner combines lexical search, vector similarity, and ranking metadata." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "src/context/retrieval/rerank.ts", | ||
| "title": "Rerank helpers", | ||
| "content": "hybridRerank computes weighted retrieval ordering and cosine similarity for vector retrieval." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "README.md", | ||
| "title": "Project overview", | ||
| "content": "General project overview and quick start commands for local development." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/cli/commands.ts", | ||
| "title": "CLI commands", | ||
| "content": "Registers chat, plan, index, and automations commands." | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": "quality-commands", | ||
| "title": "Identify quality gates", | ||
| "query": "what command runs lint typecheck and tests", | ||
| "intent": "lookup", | ||
| "difficulty": "medium", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "package.json", | ||
| "title": "Project scripts", | ||
| "content": "The checks script runs pnpm test, pnpm typecheck, pnpm lint, and pnpm build." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "README.md", | ||
| "title": "README quality commands", | ||
| "content": "The README includes lint, typecheck, test, and build as quality commands." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "src/automation/runner.ts", | ||
| "title": "Automation runner", | ||
| "content": "Executes configured prompts on cron schedules." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/db/client.ts", | ||
| "title": "Database client", | ||
| "content": "Initializes PGLite and exposes query and exec methods." | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": "provider-preflight", | ||
| "title": "Provider preflight requirements", | ||
| "query": "which env var is required for google provider preflight", | ||
| "intent": "lookup", | ||
| "difficulty": "medium", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1", "d2"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "src/cli/commands/chat.tsx", | ||
| "title": "Chat preflight", | ||
| "content": "Chat preflight checks provider env vars and prints setup instructions for google openai and anthropic." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "README.md", | ||
| "title": "Environment variable docs", | ||
| "content": "GOOGLE_GENERATIVE_AI_API_KEY is required when using the google provider." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "src/mcp/client.ts", | ||
| "title": "MCP client", | ||
| "content": "Starts and interacts with external MCP servers." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/context/indexer/full-index.ts", | ||
| "title": "Indexer", | ||
| "content": "Indexes repository files and writes chunks and embeddings." | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": "policy-approval", | ||
| "title": "Approval behavior", | ||
| "query": "which actions require approval in interactive mode", | ||
| "intent": "reasoning", | ||
| "difficulty": "high", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1", "d2"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "README.md", | ||
| "title": "Interactive approval docs", | ||
| "content": "Sensitive write and destructive tool actions require explicit approve, deny, or dismiss decisions in the TUI." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "src/policy/engine.ts", | ||
| "title": "Policy engine", | ||
| "content": "Policy engine classifies tool side effects and enforces approval decisions." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "src/context/retrieval/rerank.ts", | ||
| "title": "Rerank", | ||
| "content": "Reranks retrieval candidates with weighted score combination." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/db/migrate.ts", | ||
| "title": "Migrations", | ||
| "content": "Applies schema migrations at startup." | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": "automation-hooks", | ||
| "title": "Hook trigger behavior", | ||
| "query": "what hooks trigger tests or typecheck", | ||
| "intent": "lookup", | ||
| "difficulty": "low", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "AGENTS.md", | ||
| "title": "Hook definitions", | ||
| "content": "file-change runs pnpm test and git-head-change runs pnpm typecheck." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "README.md", | ||
| "title": "README automation", | ||
| "content": "Automations can run prompts but does not define hook command mapping." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "src/automation/scheduler.ts", | ||
| "title": "Scheduler", | ||
| "content": "Cron scheduler dispatches queued automation specs." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/agent/orchestrator.ts", | ||
| "title": "Orchestrator", | ||
| "content": "Runs gather reason act verify loops with validation retries." | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "id": "ci-workflow", | ||
| "title": "CI checks pipeline", | ||
| "query": "where is pr checks workflow defined", | ||
| "intent": "lookup", | ||
| "difficulty": "medium", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1", "d2"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": ".github/workflows/pr-checks.yml", | ||
| "title": "PR checks workflow", | ||
| "content": "Runs pnpm checks in CI on pull requests." | ||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "README.md", | ||
| "title": "Project quality commands", | ||
| "content": "The quality command list maps to CI checks execution." | ||
| }, | ||
| { | ||
| "id": "d3", | ||
| "path": "src/tools/registry.ts", | ||
| "title": "Tool registry", | ||
| "content": "Defines registered local tools and validation." | ||
| }, | ||
| { | ||
| "id": "d4", | ||
| "path": "src/db/client.ts", | ||
| "title": "Database client", | ||
| "content": "Provides thin wrapper around PGLite query execution." | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "version": "1.0", | ||
| "profiles": { | ||
| "smoke": { | ||
| "description": "Fast CI profile with a representative subset of benchmark cases", | ||
| "caseIds": ["repo-layout", "quality-commands", "provider-preflight"], | ||
| "thresholds": { | ||
| "hybridMinimums": { | ||
| "evidenceRelevance": 0.55, | ||
| "citationSupportCoverage": 0.75, | ||
| "compositeScore": 0.62, | ||
| "maxUnsupportedClaimPenalty": 0.45 | ||
| }, | ||
| "baselineDeltaFloors": { | ||
| "lexical": -0.03, | ||
| "vector": 0.02 | ||
| } | ||
| } | ||
| }, | ||
| "full": { | ||
| "description": "Full benchmark profile for deeper retrieval proofing", | ||
| "thresholds": { | ||
| "hybridMinimums": { | ||
| "evidenceRelevance": 0.5, | ||
| "citationSupportCoverage": 0.7, | ||
| "compositeScore": 0.58, | ||
| "maxUnsupportedClaimPenalty": 0.5 | ||
| }, | ||
| "baselineDeltaFloors": { | ||
| "lexical": -0.01, | ||
| "vector": 0.02 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Retrieval Proofing Benchmark Schema (v1.0) | ||
|
|
||
| This document defines the versioned fixture format used by retrieval proofing. | ||
|
|
||
| ## Fixture File | ||
|
|
||
| Path: `benchmarks/retrieval-proofing/benchmark.v1.json` | ||
|
|
||
| Top-level shape: | ||
|
|
||
| ```json | ||
| { | ||
| "version": "1.0", | ||
| "datasetName": "retrieval-proofing-core", | ||
| "datasetVersion": "2026.03.01", | ||
| "cases": [ | ||
| { | ||
| "id": "repo-layout", | ||
| "title": "Find retrieval implementation location", | ||
| "query": "where is hybrid retrieval implemented", | ||
| "intent": "lookup", | ||
| "difficulty": "low", | ||
| "topK": 3, | ||
| "expectedEvidenceDocIds": ["d1", "d2"], | ||
| "documents": [ | ||
| { | ||
| "id": "d1", | ||
| "path": "src/context/retrieval/hybrid.ts", | ||
| "title": "Hybrid retrieval source", | ||
| "content": "..." | ||
dubscode marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| { | ||
| "id": "d2", | ||
| "path": "src/context/retrieval/rerank.ts", | ||
| "title": "Rerank helpers", | ||
| "content": "..." | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## Field Semantics | ||
|
|
||
| - `version`: Fixture schema version. Must be `1.0` for this release. | ||
| - `datasetName`: Human-readable benchmark dataset name. | ||
| - `datasetVersion`: Version of benchmark content. Bump when case content or labels change. | ||
| - `cases`: Benchmark case list. | ||
| - `cases[].id`: Stable identifier used by profile filters and reports. | ||
| - `cases[].query`: Query string used by all retrieval strategies. | ||
| - `cases[].topK`: Number of retrieved documents considered for scoring. | ||
| - `cases[].documents`: Candidate evidence set for the case. | ||
| - `cases[].expectedEvidenceDocIds`: Canonical evidence documents used for deterministic scoring. | ||
|
|
||
| ## Profile File | ||
|
|
||
| Path: `benchmarks/retrieval-proofing/profiles.v1.json` | ||
|
|
||
| - `version`: Profile schema version (`1.0`). | ||
| - `profiles.<name>.caseIds`: Optional subset of case IDs for this profile. | ||
| - `profiles.<name>.thresholds.hybridMinimums`: Absolute floors for hybrid metrics. | ||
| - `profiles.<name>.thresholds.baselineDeltaFloors`: Minimum hybrid-vs-baseline composite deltas. | ||
|
|
||
| ## Versioning Rules | ||
|
|
||
| - Bump `datasetVersion` whenever benchmark content changes. | ||
| - Keep schema `version` at `1.0` unless the JSON structure changes. | ||
| - Prefer adding new cases over mutating existing case IDs to preserve comparability. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.