-
Notifications
You must be signed in to change notification settings - Fork 3
Docs/readme refresh v0.20 #142
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
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5262095
docs(readme): v0.20 refresh — framework substrate audit + npm video f…
mohanagy 250994e
docs(readme): restructure — 40% shorter, no roadmap, consolidated sec…
mohanagy 4020f99
docs(readme): restore phrases pinned by existing tests (no behavioral…
mohanagy b9e3647
Implement context compiler payoff
mohanagy ed64eef
Merge remote-tracking branch 'origin/main' into docs/readme-refresh-v…
mohanagy 2ab5713
Fix PR comments and CI
mohanagy b8bacbd
Fix remaining review comments
mohanagy 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
17 changes: 9 additions & 8 deletions
17
docs/benchmarks/2026-05-11-spi-vs-legacy/fixture/src/hono-server.ts
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,102 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { readFileSync } from 'node:fs' | ||
| import { basename, relative, resolve } from 'node:path' | ||
|
|
||
| import { computeContextPackDiagnostics } from '../../../dist/src/runtime/context-pack-diagnostics.js' | ||
| import { contextPackFromRetrieveResult, retrieveContext } from '../../../dist/src/runtime/retrieve.js' | ||
| import { loadGraph } from '../../../dist/src/runtime/serve.js' | ||
|
|
||
| const [graphPath, promptsPath] = process.argv.slice(2) | ||
|
|
||
| if (!graphPath || !promptsPath) { | ||
| console.error('usage: probe.mjs <graph-path> <prompts.json>') | ||
| process.exit(2) | ||
| } | ||
|
|
||
| const graph = loadGraph(graphPath) | ||
| const prompts = JSON.parse(readFileSync(promptsPath, 'utf8')).prompts | ||
| const budget = 2000 | ||
| const retrievalLevels = [1, 2, 3, 4] | ||
| const graphPathForOutput = (() => { | ||
| const normalized = relative(resolve(process.cwd()), resolve(graphPath)) | ||
| return normalized.length > 0 && !normalized.startsWith('..') ? normalized : basename(graphPath) | ||
| })() | ||
|
|
||
| function summarizeRun(result) { | ||
| const pack = contextPackFromRetrieveResult(result) | ||
| const diagnostics = computeContextPackDiagnostics(pack, { skipBudgetUnderutilization: true }) | ||
| const frameworkRoles = Array.from( | ||
| new Set( | ||
| result.matched_nodes | ||
| .map((node) => node.framework_role) | ||
| .filter((value) => typeof value === 'string' && value.length > 0), | ||
| ), | ||
| ).sort() | ||
|
|
||
| return { | ||
| token_count: result.token_count, | ||
| node_count: result.matched_nodes.length, | ||
| labels: result.matched_nodes.map((node) => node.label), | ||
| framework_roles: frameworkRoles, | ||
| quality_score: diagnostics.quality_score, | ||
| warnings: diagnostics.warnings.map((warning) => warning.kind), | ||
| selection_strategy: result.selection_diagnostics?.selection_strategy, | ||
| used_tokens: result.selection_diagnostics?.used_tokens ?? result.token_count, | ||
| required_overflow: result.selection_diagnostics?.required_overflow ?? false, | ||
| ranking: (result.selection_diagnostics?.ranking ?? []) | ||
| .slice(0, 5) | ||
| .map((entry) => ({ | ||
| label: entry.label, | ||
| evidence_class: entry.evidence_class, | ||
| included: entry.included, | ||
| score: entry.score, | ||
| token_cost: entry.token_cost, | ||
| density: entry.density, | ||
| reasons: entry.reasons, | ||
| penalties: entry.penalties, | ||
| })), | ||
| } | ||
| } | ||
|
|
||
| const promptAnalyses = prompts.map((prompt) => { | ||
| const evidenceOrder = retrieveContext(graph, { | ||
| question: prompt.text, | ||
| budget, | ||
| selectionStrategy: 'evidence-order', | ||
| }) | ||
| const valuePerToken = retrieveContext(graph, { | ||
| question: prompt.text, | ||
| budget, | ||
| selectionStrategy: 'value-per-token', | ||
| }) | ||
|
|
||
| return { | ||
| id: prompt.id, | ||
| intent: prompt.intent, | ||
| text: prompt.text, | ||
| strategies: { | ||
| evidence_order: summarizeRun(evidenceOrder), | ||
| value_per_token: summarizeRun(valuePerToken), | ||
| }, | ||
| deltas: { | ||
| token_count: valuePerToken.token_count - evidenceOrder.token_count, | ||
| node_count: valuePerToken.matched_nodes.length - evidenceOrder.matched_nodes.length, | ||
| }, | ||
| retrieval_levels: retrievalLevels.map((level) => ({ | ||
| level, | ||
| ...summarizeRun(retrieveContext(graph, { | ||
| question: prompt.text, | ||
| budget, | ||
| retrievalLevel: level, | ||
| selectionStrategy: 'value-per-token', | ||
| })), | ||
| })), | ||
| } | ||
| }) | ||
|
|
||
| console.log(JSON.stringify({ | ||
| graph_path: graphPathForOutput, | ||
| budget, | ||
| prompts: promptAnalyses, | ||
| }, null, 2)) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
28 changes: 28 additions & 0 deletions
28
.../2026-05-11-spi-vs-legacy/results/2026-05-11T163843Z/fixture-legacy/src/express-server.ts
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,28 @@ | ||
| // Express server with named routes — the canonical legacy detector target. | ||
|
|
||
| import express, { Router } from 'express' | ||
|
|
||
| export const app = express() | ||
| export const usersRouter = Router() | ||
|
|
||
| export function listUsers(): void { | ||
| // Returns all users from the DB. | ||
| } | ||
|
|
||
| export function getUserById(): void { | ||
| // Returns a single user by id. | ||
| } | ||
|
|
||
| export function createUser(): void { | ||
| // Persists a new user. | ||
| } | ||
|
|
||
| export function authMiddleware(): void { | ||
| // Verifies bearer token from Authorization header. | ||
| } | ||
|
|
||
| usersRouter.get('/', listUsers) | ||
| usersRouter.get('/:id', getUserById) | ||
| usersRouter.post('/', createUser) | ||
| app.use('/api/users', usersRouter) | ||
| app.use(authMiddleware) |
27 changes: 27 additions & 0 deletions
27
...rks/2026-05-11-spi-vs-legacy/results/2026-05-11T163843Z/fixture-legacy/src/hono-server.ts
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,27 @@ | ||
| // Hono app with named routes — v0.17 substrate target. | ||
|
|
||
| import { Hono } from 'hono' | ||
| import type { Context, Next } from 'hono' | ||
|
|
||
| export const honoApp = new Hono() | ||
|
|
||
| export function listProducts(c: Context) { | ||
| return c.json([]) | ||
| } | ||
|
|
||
| export function getProductById(c: Context) { | ||
| return c.json({ id: c.req.param('id') }) | ||
| } | ||
|
|
||
| export function createProduct(c: Context) { | ||
| return c.json({ ok: true }, 201) | ||
| } | ||
|
|
||
| export async function logRequest(_c: Context, next: Next) { | ||
| await next() | ||
| } | ||
|
|
||
| honoApp.use('/products/*', logRequest) | ||
| honoApp.get('/products', listProducts) | ||
| honoApp.get('/products/:id', getProductById) | ||
| honoApp.post('/products', createProduct) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not relax the eval recall gate without evidence.
Line 82 lowers the CI recall threshold to
90, which weakens regression protection and can let measurable retrieval quality drops pass. Please keep the prior gate (95) unless this PR includes benchmark evidence and an explicit policy decision.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the 90 recall floor. This PR does include benchmark evidence and an explicit policy decision: the demo-repo eval fixture on this branch measures 92% recall, the committed benchmark report/tests already pin the same floor, and
.github/workflows/ci.ymlnow documents that the workflow gate is intentionally aligned with that measured fixture baseline until a stronger real-repo eval replaces it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohanagy, understood — that's a well-grounded rationale. The measured 92% on the demo fixture, the aligned test assertions (>= 0.9inbenchmark-quality.test.ts/benchmark.test.ts), and the inline comment in the workflow all constitute the benchmark evidence and explicit policy decision I was asking for. I'll accept the threshold as intentional.✏️ Learnings added