Revert "feat: add 4 scorer kinds (retrieval, demotion, procedure, dedup) + dashboard surface + dedup React install" - #43
Open
rahuldindor411-glitch wants to merge 1 commit into
Conversation
…up) + da…" This reverts commit 185e443.
Author
|
Rekha dindor |
Author
|
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.
Reverts #40## Intent
AgentProbe's existing memory evaluation routes everything through an
LLM-judge over a transcript. That is the right shape for conversational
behaviors, but it cannot answer the question the AutoGPT dream system
needs answered: given a query, did the right memories come back in
the right order. This PR adds the missing scorer kind and the
scenarios that exercise it.
It ships:
and NDCG@k (with
log2(rank + 1)discount), pinned by 25 known-answerunit tests.
retrieval:block on scenario YAML —golden, optionalforbidden,k,match, per-metricweight,pass_threshold,and a
source(eitherraw_exchange_keyfor inline adapterpayloads or
fixturefor offline runs).forces a scenario fail when any forbidden item lands in the top-k,
and surfaces a
RetrievalScoreonScenarioRunResult.retrieval_scorespersistence table mirroringjudge_dimension_scoreson both SQLite (v8 → v9) and Postgres(v4 → v5), with recorders, getters, and Drizzle schema entries.
retrieval_rows+ a pretty JSON blobalongside the existing judge dimension rows.
data/retrieval-memory.yaml+ fixturesunder
data/fixtures/retrieval/) that exercise forget-on-request,warm-context relevance, stale-fact demotion, scope filtering, and
bounded cascading expiry.
Behavior changes
retrieval:block. Without one, behavioris unchanged: the judge is still the only signal, the overall pass
is whatever the judge said.
retrieval:block present, the runner scores the retrievedlist (resolved from
last_reply.rawExchange[<key>]or a JSON fixture)and the overall scenario
passedbecomesjudge.passed && retrieval.passed.A forbidden-item hit in the top-k forces
retrieval.passed = falseregardless of the weighted aggregate.
POSTGRES_TARGET_VERSION 4 → 5. Both backends ship the new
retrieval_scorestable in their baseline DDL and add a forward-onlymigration step that
create table if not existss it on upgrade.retrievalScores: Array<...>on eachscenario record. The field is optional on the
ScenarioRecordtypeso existing tools that don't read it stay typecheck-clean.
How it's wired
src/domains/evaluation/ranking.tsis pure TypeScript withno I/O and 100% function coverage from
src/domains/evaluation/ranking.test.ts. The four metric primitivesare individually exported (and individually tested against
known-answer cases like NDCG@3 of
[1, 0, 1]and MRR of[0, 0, 1]),and a top-level
scoreRankingaggregator threads them together witha weighted average, forbidden-hit detection, and a pass threshold.
src/domains/evaluation/retrieval-scorer.tsconsumesthe parsed YAML config plus a
RetrievalSourceContext(
scenariosPath,lastAdapterReply) and resolves the actualretrieved list. It accepts strings,
{label}/{text}/{name}/{id}object payloads, or a JSON file path. Missing sources record a
source: "missing"score instead of crashing the suite.src/domains/validation/load-suite.tsvalidates theretrieval:block strictly — non-empty golden, valid match policy,threshold ∈ [0,1], known metric weight keys, non-negative weights.
runScenarioinsrc/domains/evaluation/run-suite.tsscores retrieval after the judge phase, records it via a new
recordRetrievalResultrecorder hook, and ANDs the two pass flagsinto the final scenario result.
create table if not exists retrieval_scoresin the baseline DDL,a forward migration step, an
ensureRetrievalScoresTablehelper forthe legacy SQLite in-recorder migrator, recorder methods, and a
getRunjoin. The Drizzle inventory test pins the table count.prepareScenarioViewemitsretrieval_rows,one row per metric with pretty value/percent labels, and a
retrieval_scores_prettyJSON blob. Templates that already existsee no change until they reference the new keys.
Scope rails
rawExchangedata the adapter already returns; no
EndpointAdaptershape change.Scenarios that need offline scoring use the
fixturesource.in the report-prepared view, but the React dashboard is not
updated. Flagged as a follow-up below.
live in their own
data/retrieval-memory.yamlpack alongside theexisting
data/multi-session-memory.yaml. The forget-on-requestscenario is a ranking-scored sibling of the existing judge-only
mem-negative-forget-on-request.Risk
additive and the migration is
create table if not exists, so theforward path is safe. Rollback to prior schema would require
dropping the table.
retrieval:block but no fixture and no adapterpayload will score
source: "missing"and fail. This is intentional— silently passing a "we got nothing" run would mask real regressions
— but it does mean integrating this against an adapter that doesn't
populate
rawExchange.retrievedrequires that adapter to be updatedor the scenarios to use the
fixturesource.RetrievalScoreis ANDed with the judge for the final pass flag.A scenario that previously passed via judge alone and now adds a
retrieval block that fails will see its overall pass flip. That is
the intended UX — both signals must be green — but it's a behavior
change worth calling out.
Out of scope (deferred)
prepared for the renderer; React surfaces are not updated. The
retrieval_rows array is structured the same way as dimension_rows
so a UI addition should be a small follow-up.
return
rawExchange.retrievedpayloads is left as adapter work anddoesn't belong in this scorer-shaped PR. The scenarios ship with
fixtures so the scorer math is exercised against curated graph
snapshots in the meantime.
bias_mitigation.multiple_judgesconfig remains unimplemented (preexisting); not in scope here.
into the new format. Out of scope; the brief calls for ≥5 new
scenarios and that's what shipped.
Validation
bun test: 250 pass / 7 fail. The 7 failures are allpre-existing dashboard React tests
(
useDashboard,RunDetailViewSSE,StartRunView,CompareView)that fail identically on
origin/mainat the parent commit. Theyare not touched by this PR.
bun run lint: clean.bunx tsc --noEmit(root): clean.bun run docs:validate: clean (new scenario added toplatform.md,current-state.md,e2e-checklist.md; generated docs refreshed).exercised by
tests/unit/db.test.tsandtests/unit/persistence/migrations.test.ts. Postgres migrationexercised by
tests/unit/persistence/migrations.test.tsagainst apre-v5 baseline.
rubric, and points at a fixture file that exists relative to the
YAML. Pinned by
tests/unit/retrieval-memory.test.ts.Checklist
bun run lintclean.bunx tsc --noEmit(root) clean.bun run docs:validateclean.bun testshows no new failures vs.origin/main.docs/product-specs/platform.md+current-state.md+e2e-checklist.md).Commits
feat(evaluation): add ranking metrics primitives— pure math module + 25 unit testsfeat(evaluation): add retrieval scorer kind and YAML schema— typed config, scorer module, loader, schema validationfeat(evaluation): wire retrieval scorer into runScenario— runner integration + two runner-level testsfeat(persistence): persist retrieval scores in sqlite and postgres— table, migrations, recorders, gettersfeat(reporting): expose retrieval metrics in run reports— prepared view fields + biome touch-upsfeat(data): add five ranking-scored memory scenarios— YAML pack + fixtures + pack-level testsdocs(specs): document ranking-scored retrieval scenarios— platform spec entry + generated docs refresh