Repository navigation
make bench-revision runs the four corrections-and-time harnesses on one generated corpus, with a question that needs two facts, one of them superseded - #2189
Merged
Conversation
…ne generated corpus, with a question that needs two facts bench/pi_llm.py, forget_switch_eval.py, fama_forgetting.py and supersession_audit.py shared no input and no entry point, and none asked a question that needs two facts. They now read one corpus, the generated episodes of pi_llm.py, and one make target runs them. pi_llm.py: - --kinds adds current_2hop (the module of "the project owned by team X", which needs the ownership fact and the latest update) and asof and asof_2hop (the same two questions as of the day of a middle update, sent with as_of). The default kind, current, sends the same requests. - score_answer holds the scoring and adds has_later: a value written after the as-of time. - --repeats, --gate, --gate-band, --gate-min-delta and --credit come from bench/_gate.py. The gate pairs the one-fact question with the two-fact question of the same episode, depth and time, and resamples episodes. - --out writes JSONL: a header, then one line per namespace and question with every repeat's answer and label and the reply fields that show the second hop and the supersession filter. - --audit-out runs supersession_audit.audit on the run's namespaces before they are erased. --dry runs two scripted readers and contacts no server. supersession_audit.py: audit() holds the run, --namespace repeats, and both rates are null when no pair was labelled. fama_forgetting.py: --org, and --episodes N for cases built from the corpus under module_status. forget_switch_eval.py: Case.existing, and --corpus-episodes N. make bench-revision runs models_used and the four harnesses into one directory. make bench-revision-dry is the pi_llm.py leg with --dry. No measurement is part of this change. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit df182d6. Configure here.
…first write, and --repeats below 1 is refused The supersession audit runs after the asks, on namespaces the run erases when it ends. A run with --audit-out that has no OPENAI_API_KEY for the audit's judge, or whose ClickHouse does not answer, exits 2 before it contacts the server. Without the key the audit labelled only byte-identical pairs and its record still named the judge. supersession_audit.connect() returns the server's ClickHouse client and connects it once; pi_llm.py calls it before the run and audit() reads through the same connection. The audit call leaves the window to the audit's default of 7 days. A window of one day dropped the keys of the first depths from a run that lasted longer than a day. --repeats below 1 is an argument error. It raised IndexError in _item after the episode's writes were sent. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
make bench-revisionrunspi_llm.py,forget_switch_eval.py,fama_forgetting.pyand the supersession audit on one generated corpus.pi_llm.py --kindsadds a question that needs two facts, one of them superseded, and both questions as of an earlier day;make bench-revision-drychecks the scorer, the gate and the artifact writer with no server.Why
The coverage page keeps "Corrections and time" at Harness only until four harnesses are published on one shared public corpus. They shared no input and no entry point:
pi_llm.pygenerated its own episodes and wrote no file,forget_switch_eval.pyandfama_forgetting.pyran inline cases, andsupersession_audit.pyread one namespace somebody else had written. None of them asked a question whose answer needs two facts, so nothing measured whether a correction still reaches an answer that arrives through a second fact.This change gives the four one corpus and one command. No measurement is part of the change: it builds the instrument, and the coverage row stays Harness only.
Design in brief.
pi_llm.py(one coined project whose module is updateddepthtimes) plus one ownership fact per episode: a coined team owns the project, dated the day before the first update, so a read as of any update's day sees it. Committed code rebuilds the corpus, so it is public with no download and any item count._ENTITIES,_valandupdate_textkeep their output, because the acceptance bench's floors are measured on them.--kindsselects from four, all asked on the one ingest:current(the project's module today),current_2hop(the module of "the project owned by team X", which never names the project),asofandasof_2hop(the same two about the day of a middle update, sent withas_ofat the last second of that day; depth 2 and up). The superseded fact is the second hop, project to module; the ownership fact is static. Each question records the writes its answer needs (gold_facts) and the update that replaced an earlier value (superseding_write, null at depth 1, the control where nothing was superseded).score_answermatches the coined value tokens, so one scorer serves every kind and no judge is called.has_lateris new: a value written after the as-of time. An item keeps the majority of its repeats'clean_correctlabels, so an abstention is a wrong answer.--gatepairs the one-fact question (arm A) with the two-fact question of the same episode, depth and time (arm B) throughbench/_gate.py, resampling whole episodes because one coined project serves every depth. The target passes--gate-min-delta -4: the default null band used as a non-inferiority margin. 100 episodes at depths 1, 2, 5 and 10 give 700 pairs in 100 clusters; with one pair in five differing between the arms the interval's half-width is about 3.1 points, inside the 4.0 band (test_the_planned_run_is_wide_enoughholds this against the target's own flags).--outwrites JSONL: a header (the flags, the server's instrument from/v1/health, the gate), then one line per namespace and question with every repeat's full answer and label and the reply'ssource,memory_keys,superseded_dropped,stale_sentences_masked,entity_followedanddecomposed_parts, which show whether the second hop and the supersession filter ran.--audit-outcallssupersession_audit.auditon the namespaces the run minted, inside the block that erases them, so the erasure also follows a failed run. The audit follows the asks and reads versions the run then erases, so a run with--audit-outchecksOPENAI_API_KEY(the audit's judge) and the ClickHouse connection before its first request and exits 2 without either. The audit reads over its own default window of 7 days.maketarget and not a runner module: the legs share only the corpus and the output directory.Alternatives and their cost.
bench/conflict_resolver_scenario.pyis committed and has ground truth, but it holds six changing attributes, so one question is 16.7 points, and its relations are not single-valued, so the interval check cannot use it. A downloaded conversational set costs a long extraction per item and has no as-of question. A new hand-written fixture needs hundreds of authored items to reach the same interval. The cost of the generated corpus is templated sentences and one attribute; phrasing variety stays with the 45 hand-written cases offorget_switch_eval.py.Scope and risk
bench/, theMakefile,bench/README.md, four pages underdocs/benchmarks/and the tests. No server code, op, setting, table or migration.bench/acceptance/memory_app.py,mutation_sequence.py,fact_consolidation.py,docs/benchmarks/results.mdand the coverage row's status.bench-, registered as a bench namespace and erased by exact name when the run ends, fails or is interrupted. The target never passes--keep-namespaces. The audit reads only the namespaces its run minted, bound as one array parameter, with noFINAL.--creditis passed. With more than one repeat an ask also sendsllm_cache: falseandprecedents: false, so a repeat is a new answer and not the first one's bytes.EPISODES=5) shows which path the updates took:pairsin the audit record, orsuperseded_droppedin the answer rows.--outrecord or calls the harness functions below.Compatibility, rollout and rollback
pi_llm.py:--kinds(defaultcurrent, which sends the same requests and writes no ownership fact),--repeats(below 1 is an argument error),--gate,--gate-band,--gate-min-delta,--judge-calibration(the shared gate arguments),--out,--audit-out(needsOPENAI_API_KEYand the server's.env),--dry.supersession_audit.py:--namespacerepeats.fama_forgetting.py:--org(defaultdev),--episodes N(default 0: the two inline cases).forget_switch_eval.py:--corpus-episodes N(default 0).bench-revision(EPISODES=100,DEPTHS=1,2,5,10,REPEATS=3,ORG=dev,OUT=/tmp/loom_revision_<unix ts>) andbench-revision-dry.bench/:supersession_audit.py --outwritesnamespaces(a list) where it wrotenamespace, andfalse_supersession_rateandomission_ratearenullwhen no pair was labelled, where they were0.0.--max-false-ratedoes not fail on a null rate.pi_llm.py --creditis the shared gate flag, with the same meaning. A run against a server reads/v1/healthfirst and exits 2 when it does not answer 200.run_episodetakes apostcallable and returns one row per question, and a row'shas_latestis nowhas_gold.fama_forgetting.run_casetakesorg./tmpand are not committed.Tests
Ran, all on this branch:
ruff format --checkandruff checkon the eight changed Python files: clean.make typecheck:mypy-gate: 0 error(s);Success: no issues found in 71 source files.pytest tests/unit/test_bench_pi_llm.py bench/test_supersession_audit.py bench/test_temporal_assertions.py bench/test_forget_switch_eval.py tests/unit/test_acceptance_benches.py tests/unit/test_bench_gate.py tests/unit/test_bench_gate_help_renders.py tests/unit/test_bench_namespaces.py -n 2: 81 passed.pytest bench -q -n 2: 256 passed.pytest tests/unit/test_package_contracts.py tests/unit/test_op_transport_contract.py tests/unit/test_tunable_constants.py tests/unit/test_store_names_refused.py tests/unit/test_degraded_unnoted.py tests/unit/test_public_copy.py tests/unit/test_doc_links.py tests/unit/test_agent_instructions.py tests/analyzer -n 2: 601 passed, 12 skipped.pytest tests/unit/test_format_hygiene.py tests/unit/test_stock_env_matches_docs.py tests/unit/test_docs_reference.py -n 2: 23 passed.pi_llm.py --token t --audit-out FILEwithOPENAI_API_KEYunset, and again with the key set andLOOM_CH_PORTon a closed port: each prints one line that names what is missing and exits 2 before any request.pi_llm.py --repeats 0: an argument error, exit 2.python scripts/gates/function_length_gate.py: 52 functions over 50 statements, the baseline.npx prettier@3.9.9 --checkon the five changed Markdown files: clean.make bench-revision-dryat the defaults: 1,400 question rows; the reader that answers the gold is 100% clean on every depth and kind, the reader that answers another value of the episode is 0% clean;gate: n=700 clusters=100,VERDICT PASS; exit 0.make -n bench-revisionprints the four legs;--helpof the four harnesses renders.What the new tests fail on:
test_every_two_fact_question_names_its_gold_facts_the_superseding_write_and_the_as_of_time: a two-fact question without the ownership fact, a superseding write that is no update of the episode, anas_ofoutside the gold update's interval, an as-of question at depth 1.test_a_two_fact_question_never_names_the_entity_and_no_token_hides_in_another: a two-fact text that names the project, or a value token inside another value, a name or a question.test_the_default_kind_sends_the_requests_it_sent_before: an ownership write, anas_ofor a changed update text under--kinds current.test_score_answer_on_recorded_answers: gold beside an earlier value read as clean, a later value read as correct for an as-of question, an answer with no value not read as an abstention.test_gate_pairs_one_fact_with_two_fact_inside_an_episode: a pair across episodes, depths or times, an errored item left in the pair, all-stale two-fact answers not readingfailat--gate-min-delta -4.test_the_planned_run_is_wide_enough: a change of kinds, depths or episodes in the target that leaves fewer pairs than the band needs.test_dry_run_passes_and_writes_the_artifact_shape: a duplicate--credit, a missing header or row field, a scorer that calls every answer clean.test_a_run_with_no_repeat_is_refused_when_its_flags_are_read:--repeats 0or a negative value accepted.test_audit_out_is_refused_before_the_first_request_without_its_judge_key_or_clickhouse: a run with--audit-outthat sends a request withoutOPENAI_API_KEYor with a ClickHouse that refuses the connection, or a run without--audit-outthat asks for either.test_audit_out_reads_the_runs_namespaces_over_the_audits_own_window(a mock server and a recording ClickHouse client): a connect after the first request or a second connect, an audit read that is not between the last ask and the erasure, a namespace of the run missing from the bound list, a window narrower than the audit's default.test_rates_are_null_without_a_labelled_pair,test_fetch_binds_every_namespace: a rate of 0.0 with no pair; a namespace interpolated into the statement or dropped from it.test_corpus_cases_sit_inside_and_after_their_interval: a generated case read outside its interval, or a relation that is not single-valued, which would never close the interval.test_a_corpus_case_scores_the_new_value_and_an_over_retirement: the new value read as a missing write, another stored key's retirement not read as an over-retirement,scorereading the shared rows for a case with its own.Not run, and no measurement is part of this change:
make bench-revision EPISODES=5, thenmake bench-revision. Both need a server with real providers,LOOM_BASE_URL, an org-adminLOOM_API_KEYfor the erasure, the server's.envat the repository root andOPENAI_API_KEYfor the audit's judge. At the defaults the run writes 400 namespaces with 2,200memory.set_from_messagescalls, sends 4,200memory.askcalls, makes 435 extraction calls inforget_switch_eval.pyand at most 1,400 judge calls in the audit.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the harness changes, the tests, the make targets and the docs. Checked by running the commands above, by reading the full diff against the four harnesses on
main, and by confirming thatbench/acceptance/memory_app.py, the one caller ofpi_llmoutside this change, uses only_valand_ENTITIES, which are unchanged.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.main; no merged migration is edited. None added.frontend/changed. Not changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code