Skip to content

Scripts and data for the illustrative examples and benchmarks. - #224

Merged
giovannivolpe merged 19 commits into
developfrom
cm-reference-example
Dec 3, 2026
Merged

giovannivolpe merged 19 commits into
developfrom
cm-reference-example

Conversation

@cmanzo

@cmanzo cmanzo commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Reference example (reference_analysis/)

  • reference_example.py builds two literature projects (with and without the article), runs reference_check on the article and on a copy with eight planted miscitations, and asks suggest_reference for 15 statements; it recomputes the rule-based counts and writes JSON results with a grading worksheet.
  • make_planted.py writes the planted copy; reference_annotations.json holds the statements (grouped as tools, uses, results, background) and the planted changes.
  • Adds the six open-access cited works missing from literature_repo/papers.

Code example (code_analysis/)

  • 45 questions with reference functions, facts and core facts; the 16 reworded questions avoid being routed to other tools.
  • Scoring counts a class passage that contains a whole method for that method.
  • --questions selects questions by identifier (replaces --sets).
  • Examples run at the project types' default temperatures and record the routing model.

Timing (paper_numbers.py)

  • Reads the startup breakdown from logs/traces/project.json, where startup events are recorded since the project trace was introduced (operations_s was empty); also reports reading, extracting and chunking the sources.

Benchmarks (benchmarks/)

  • evaluate_retrieval returns a 95% bootstrap interval of NDCG@10 over the queries (ndcg_interval).
  • Notebooks 60 and 70 record Wilson intervals for their counts and a bootstrap interval for the mean citation coverage (fixed seed, so a run gives the same intervals).
  • The KíLín gold locations are updated to the current code; several pointed at moved functions.

giovannivolpe and others added 19 commits November 23, 2026 15:23
reference_example.py builds check, planted and suggestion projects from the committed article corpus, asks reference_check and suggest_reference at temperature 0 with every claim checked, and scores reference matching, citation detection, planted-miscitation verdicts and suggestion ranks
against reference_annotations.json. The suggestion project leaves out the article, so it cannot suggest itself.
The article, its planted copy and the cited works share one project for both reference checks; the cited works alone form the suggestion project, since suggest_reference cannot be told to leave out the article and its copy.
make_planted.py reads the article as KíLín reads the PDF, changes eight citation numbers (six to unrelated works, two to related ones), writes tiunn26braph2_planted.txt and records the changes in reference_annotations.json. A text copy keeps the sentences as KíLín reads them; editing the PDF split the edited lines into separate blocks.
prepare_code_project now sets temperature 0 and the download policy through configure_project instead of editing profile.ini, so the code example, its no-retrieval baseline and paper_numbers all generate deterministically. Both scripts record the temperature in their results.
Both examples now generate as a new project in the app does: the code example at the code type's temperature and the reference example at the literature type's. The scripts write that value into their sandbox workspaces and record it in the results. The reference example no longer overrides the temperature per question.
Add the callers that appeared since October (_answer_sentences, RAGSession._source_passages, reference_check's _choose_list and _second_look), narrow strip_thinking_callers to answering.py since strip_thinking now has 19 callers, and correct facts where the code changed. The evaluation questions keep their wording.
code_example.py, paper_numbers.py and reference_example.py take --router-model and save it in their sandbox projects, as choosing the intent model in the app's project settings does. Without the option the packaged default is saved. The results record the router model used.
Fifteen sentences in four groups: tools, uses and results (one work states each) and background (several works support each, all listed as acceptable). Papers with the same verdict and score now share a rank and are reported as a tie, and the summary counts each group separately.
Nine questions now start with "Explain", and four name the function they ask about. Each question marks its core facts (core_facts), which the grading worksheet labels.
All 45 questions now start with "Explain" and ask about the code. The development and evaluation sets are dropped, since the questions are examples rather than a held-out benchmark. A passage of a class whose lines contain a whole gold method now counts for that method.
Since startup events moved to logs/traces/project.json, paper_numbers recorded an empty operations_s. It now also reads the events of the session it just opened from the project trace, and includes reading, extracting and chunking the sources.
evaluate_retrieval returns a bootstrap interval of NDCG@10 over the queries, and the code-question notebooks record Wilson intervals for their counts and a bootstrap interval for the mean citation coverage. The bootstrap uses a fixed seed so that a run gives the same interval.
The code-question gold set was annotated on a previous source; since then several functions moved, so the locations pointed at unrelated lines. Every location now matches commit 6cb105d; A3 also cites the code project type's system prompt, which a code project uses.
Rounding could give an upper bound of 0.9999999999999999 for 42 of 42, which failed the test on CI. The bound is exactly 1 (or 0) in these cases, so set it directly.
@giovannivolpe
giovannivolpe changed the base branch from main to develop December 3, 2026 16:12
@giovannivolpe
giovannivolpe merged commit ba0224b into develop Dec 3, 2026
26 of 28 checks passed
@giovannivolpe
giovannivolpe deleted the cm-reference-example branch December 3, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants