Skip to content

Add a research register for ideas, experiments and decisions - #139

Open
napetrov wants to merge 14 commits into
intel:mainfrom
napetrov:research-records
Open

napetrov wants to merge 14 commits into
intel:mainfrom
napetrov:research-records

Conversation

@napetrov

Copy link
Copy Markdown
Contributor

Summary

Adds a register in the tree for Dokimi's own research: ideas, experiments (negative ones included), findings, decisions and implementation links. Each record is plain Markdown that agents and people can both read and write. It also produces the data for the plans-and-research map.

 AGENTS.md                         # names the register as the one exception to "no status reports"
 dokimi/
+├── research/
+│   ├── record.v1.json            # one JSON Schema per record type ($defs)
+│   └── records/
+│       ├── idea/I001..I021.md        (21)
+│       ├── experiment/X001..X027.md  (27: 12 refuted, others supported/inconclusive/planned)
+│       ├── finding/F001..F019.md     (19)
+│       ├── decision/D001..D013.md    (13)
+│       └── implref/R001..R018.md     (18, links to intel/dokimi PRs/issues)
+├── scripts/research_register.py  # check | query | next | export
+├── tests/test_research_register.py
 └── docs/
+    └── research-register.md      # + mkdocs nav, docs index

How the record types point at each other. The three states in brackets are separate fields:

idea ◄── experiment [outcome] ◄── finding ◄── decision [state] ◄── implref [status]

export writes every record, the reference edges, and ideas grouped by map theme (P/E/V/K/G/O/C/D/W) with each idea's experiment outcomes.

Why plain files instead of a server: I set up XWiki, OpenProject CE, eLabFTW, GitLab CE and git+Markdown locally and ran the same 8 tests on each. Only git+Markdown passed all 8, with no server and real history. None of the server tools rejected a reference to a missing record or a wrong enum value on an API write, so a validator would be needed anyway.

Evidence

  • Before: nothing in the tree answers "what was tried for this idea and failed?".
    After:
    $ python scripts/research_register.py check
    OK: 98 records
    $ python scripts/research_register.py query --type experiment --where outcome=refuted
    X001  refuted  Question polarity vs ceiling saturation (local small model)
    X007  refuted  Automatic prompt optimisation of the judge rubric (GEPA)
    X014  refuted  Invocation drives skill effect
    ...   (12 rows)
    
  • tests/test_research_register.py (13 tests) runs check on the real tree. It also covers broken records that must fail: a reference to a missing record, a reference to a record of the wrong type, a bad enum value, an unknown field, a superseded decision without superseded_by, a wrong id prefix, a non-public link, and a duplicate id.
  • make ci-local --offline: everything passes (network and docker jobs are skipped). The license header check passes on the new files.

Merge Danger

Door: two-way

Data and a standalone script only. Nothing is added to the package, so no changelog fragment is needed. Revert is a clean delete.

Blast Radius: docs

  • Policy change: AGENTS.md currently says "the tree has no ADRs or status reports". This PR adds one named exception. If maintainers would rather keep that rule strict, the register can move to a separate repo in the same format.
  • Records need review: the records were drafted from public PRs and issues plus local research notes. Numbers are only those found in the sources, and experiments with small samples are marked low or med confidence. Reviewers should check that the claims in their own area are correct. Local evidence is described in words, and links are allowed only to public github.com/intel|napetrov URLs (the schema enforces this).
  • Not included: 13 implementation-only PRs that no decision points at.

🤖 Generated with Claude Code

Records live as Markdown with typed YAML front matter under
dokimi/research/records/<type>/<id>.md, validated by
research/record.v1.json. scripts/research_register.py checks schemas,
paths and cross-references, queries by field or reference, hands out
the next id, and exports records, edges and a per-theme idea tree for
the plans-and-research map. Negative and inconclusive outcomes are
first-class; experiment outcome, decision state and implementation
status are separate fields.

Seeds 98 records from the project's public PRs/issues and local
research notes; AGENTS.md names the register as the one exception to
the no-status-reports rule.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@codecov-commenter

codecov-commenter commented Oct 20, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (61e0355) to head (999ecf3).
⚠️ Report is 2 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
- Coverage   91.29%   91.28%   -0.01%     
==========================================
  Files         216      216              
  Lines       26565    26565              
  Branches     4337     4337              
==========================================
- Hits        24252    24250       -2     
- Misses       1645     1646       +1     
- Partials      668      669       +1     

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 5dbb112. The tooling is small and does what the doc says: check passes on the real tree, the doc's example record validates, and the PR touches no package code. The problems are in the record content and in what check does not catch. Seven points are inline; I'd fix all but the superseded_by nit before merge.

What I ran, on a Linux review host at 5dbb112:

  • make ci-local: 20 passed, 0 failed, 4 skipped; 5322 tests passed, 1 skipped; the changed-lines coverage step passed.
  • Reproductions for the script findings, with a temporary register and no network.
  • A hand check of the 98 records against their own result text, and of the doc's commands against the script.

Checked, no issues

  • Docs: research-register.md is in the mkdocs.yml nav and linked from docs/README.md; the commands, flags and the intel//napetrov/ link rule match the script and schema.
  • Repo rules: the Markdown records carry the SPDX header, the JSON schema is covered by the license ignore for JSON, jsonschema and PyYAML are declared dependencies, and no generated file is committed.
  • Public content: a grep of the records for local paths, hosts and credentials found nothing.
  • Counts: 21 ideas, 27 experiments (12 refuted, 12 supported, 3 inconclusive; none is planned, unlike the description), 19 findings, 13 decisions, 18 implrefs.

Comment thread dokimi/research/records/experiment/X006.md Outdated
Comment thread dokimi/research/records/experiment/X003.md Outdated
Comment thread dokimi/research/records/finding/F009.md
Comment thread dokimi/scripts/research_register.py
Comment thread dokimi/scripts/research_register.py
Comment thread dokimi/scripts/research_register.py Outdated
Comment thread dokimi/tests/test_research_register.py
…y, pin more register behaviour

export, query and next read the register without checking it, so a record
that check rejects crashed them with a traceback, and a nested reference
crashed check itself. Every command now runs the schema and reference checks
first and exits 1 with the messages. superseded_by is only valid on a
superseded decision and cannot name the record itself. Tests cover --ref
with --type, misplaced and misnamed files, id gaps, the broken-register
path for each command, and unevaluatedProperties on every record type.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 7123967. The script fixes hold: query, next and export now refuse a broken register, a nested reference is reported as a schema error, and the new superseded_by checks and tests are pinned. The record content is where it still falls short. Four of my earlier threads are open, and I found four more points, inline.

What I ran, on a Linux review host at 7123967:

  • make ci-local: 20 passed, 0 failed, 4 skipped; the changed-lines coverage step reports no lines with coverage information in this diff.
  • Mutation run on research_register.py and record.v1.json: 26 script mutants and 5 schema mutants against the 28 register tests. The mutants that matter and survive are listed inline.
  • A hand check of the experiment outcomes and findings against their result text.

Still open from my earlier review:

  • dokimi/research/records/experiment/X006.md:8: outcome: supported contradicts the result text, the body does not say what the retraction covers, and F006 (high) and F010 still rest on retracted experiments.
  • dokimi/research/records/experiment/X003.md:8: the outcome belongs to the enumeration variant, not to the hypothesis on line 7.
  • dokimi/research/records/finding/F009.md:15: "kappa 0.576" is still not in X009, where 0.576 is an NLI AUC.
  • dokimi/scripts/research_register.py:131: a finding that cites a retracted experiment still passes check, and export still emits the retracted outcome.

Checked, no issues

  • Refusal path: removing the early return, or writing the errors to stdout, fails the parametrized broken-register test for all three commands.
  • New checks: the self-reference, state-mismatch, missing-target, wrong-type and non-string-reference mutants are all killed.
  • Schema: flipping unevaluatedProperties to true for each of the five record types fails a test.
  • Docs: the commands and flags in research-register.md match the script.

Comment thread dokimi/research/records/experiment/X027.md Outdated
Comment thread dokimi/research/records/finding/F016.md Outdated
Comment thread dokimi/scripts/research_register.py
Comment thread dokimi/scripts/research_register.py
@napetrov

Copy link
Copy Markdown
Contributor Author

Pushed 7e152f4 for the four new points in the review at 7123967:

  1. X027 outcome: supported contradicts the result text: fixed, set to refuted.
  2. F016 "~7% and lost accuracy once" is not in X021: fixed, the clause is dropped.
  3. export type filter not pinned: fixed, a test with a decision that points at an idea asserts the export is unchanged.
  4. --where typos and missing fields: fixed, a bad clause exits 2 with the message on stderr, and a missing field matches no value. --ref I999 still returns an empty result with exit 0; that is not changed in this commit.

The four open threads (X006, X003, F009, and the retracted-experiment check in check) are not changed in this push. Each one offers a choice between options that are still open on the thread, so they need a decision before I edit.

…field queries

- X027: the hypothesis (a self-hosted tool enforces the schema) is refuted by
  the result text, so the outcome is refuted.
- F016: drop the "~7% / lost accuracy" clause; no cited experiment has it.
- query: exit 2 on a --where clause that is not FIELD=VALUE on a schema field,
  instead of printing nothing with exit 0. A missing field matches no value
  rather than the string "None".
- tests: export ignores a decision that points at an idea; bad --where clauses
  and the missing-field case are pinned.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…der rules

- X006 refuted, partial retractions under Corrections; X012, X025 the same.
  F006 lowered to med.
- X003 split: criterion wording only (refuted) and X028 criterion plus
  enumeration (supported). F002 and F003 cite both.
- X029 holds the grader agreement F009 quotes; D004 rationale says where
  +0.007 comes from. X021 gains the compaction follow-up.
- Outcome sweep: X002, X008, X021 inconclusive; X013, X016 refuted.
- check fails a finding that cites a retracted experiment; export marks
  retracted experiments; query --ref on a missing id exits 2.
- render writes the plans-and-research map (Mermaid mindmap and table)
  on demand; it is not committed or published.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
YAML reads retracted: true as a bool and str() spells it True, so the
documented --where retracted=true matched nothing and exited 0. Query
rows also showed a retracted experiment as plain supported.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
load() globbed */*.md, so a record directly under records/, one level
too deep or named .markdown was never validated or exported, and check
still printed OK.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
The url pattern checked only the prefix, so a valid prefix followed by a
space and an internal URL, or by ../ or %2e%2e segments, passed check.
Every one of the 37 links in the register still matches.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
The stamp was git rev-parse HEAD of the script's checkout, so a map
rendered from uncommitted records named a commit with other contents.
Read the commit from the --root tree and add a dirty flag, as the run
manifest does.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
Redirected stdout uses the locale encoding, so on Windows export wrote
F009's ± as byte 0xB1 (not valid UTF-8 JSON), and a title outside cp1252
made export, query and render exit 1 with UnicodeEncodeError.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…nd render

No fixture experiment was retracted and no title had brackets or a pipe,
so dropping the export flag, the render mark, _label or the table escape
left every test green.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
@xaleryb

xaleryb commented Oct 21, 2026

Copy link
Copy Markdown
Contributor
  • Ran the register tests, the full suite, ruff, mypy and bandit on 154dc91 plus the commits below.
  • Pushed:
    • 20c8960: query --where retracted=true matched nothing because str(True) is True, and query rows showed a retracted experiment as plain supported.
    • 0ddb201: check skipped files outside records/<type>/<id>.md (records/X098.md, experiment/sub/, .markdown) and still printed OK.
    • a640d3d: the link pattern checked only the prefix, so https://github.com/intel/x https://example.com/... and intel/../../other passed.
    • 11e7c00: export and render stamped HEAD over uncommitted records. They now add dirty and say so in the render header.
    • bc93d35: with cp1252 stdout, export wrote F009's ± as byte 0xB1 and crashed on →.
    • ccc9fa2: pins the retracted mark and the label and pipe escaping.
  • Left for the author:

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at ccc9fa2. All eight of my earlier threads are fixed: the outcomes now match the result text, the retracted-experiment check works and is tested, and the query typo cases exit 2. What is left is a crash in the new retracted check, a broken render, findings and decisions whose text is not in the experiments they cite, and untested reference checks; three nits. Ten points: eight inline, two below.

What I ran, on a Linux review host at ccc9fa2:

  • make ci-local: 26 passed, 0 failed, 4 skipped; the changed-lines coverage step passes with no measurable lines in this diff.
  • check on the real tree: OK: 100 records. 71 mutants on research_register.py and record.v1.json against the 52 register tests: 22 survive, the ones that matter are inline.
  • Reproductions for the script findings, with temporary registers and no network.
  • A hand check of every experiment outcome, finding and decision against the records it cites.

Findings that cannot be anchored inline:

  1. Nit: export and render crash with FileNotFoundError when git is not installed. _git (research_register.py:189-191) calls subprocess.run(["git", ...]), and check=False does not cover a missing binary. With PATH emptied, export --root <valid register> raises FileNotFoundError: ... 'git'. A register outside a git repo is fine (commit: null). Suggestion: catch OSError in _git and return "".
  2. F003 quotes a range that its own experiments contradict. finding/F003.md:17 says wrong_numbers "stayed 0.67-0.82 across every judge configuration measured". F003 cites X002, X003 and X028, and X028's baseline is 0.599. X002 has no wrong_numbers figure, so "wrong names are caught" has no cited support. The 0.47-0.72 range is in X008, which F003 does not cite. Suggestion: cite X008, and restate the range from the cited figures.

I agree with @xaleryb's points on the id clash after next and on the stale counts in the PR description.

Checked, no issues

  • Outcomes: X001, X003, X006, X007, X009-X011, X013-X019, X022, X023, X027 and X029 match their hypothesis against their result text; X003/X028 and X006's ## Corrections hold.
  • Docs build: mkdocs build --strict passes; the page is in the nav and linked from docs/README.md; the commands and flags match the script.
  • Repo rules: record.v1.json is outside dokimi/schemas/, so SCHEMA_VERSIONS does not apply; no changelog fragment is needed; SPDX headers are on every record; gitleaks and a grep for local paths and non-GitHub hosts find nothing.
  • Script: the path and extension check, the UTF-8 reconfigure, the retracted mark in query, export and render, and the --ref and --where exits are all killed by a mutant.

if record.fields.get("superseded_by") == rid:
errors.append(f"{rid}: superseded_by names the record itself")
for target in ref_values(record, "experiments"):
if target in records and records[target].fields.get("retracted"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A non-string entry in experiments crashes check with a traceback.

Line 142 skips non-string targets, but this loop does target in records without that guard. With finding/F001.md set to experiments: [[X001]], check raises TypeError: unhashable type: 'list'. experiments: [{a: 1}] and experiments: {a: 1} do the same. query, export and render run check first, so they crash too. The schema error that would explain it is never printed. A scalar experiments: X001 is handled ('X001' is not of type 'array'). The nested-reference case was fixed for REFS fields in the last round; this loop is the new retracted check.

Suggestion: reuse the loop's guard, for target in ref_values(record, "experiments"): if isinstance(target, str) and target in records and ..., and add a test_bad_record_fails row with experiments: [[X001]].

Comment thread dokimi/scripts/research_register.py
continue
lines.append(f" {theme['id']}[{_label(theme['title'])}]")
for idea in theme["ideas"]:
lines.append(f" {idea['id']}[{idea['id']} {_label(idea['title'])} - {idea['status']}]")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A title with a newline breaks the Mermaid mindmap and the table.

_label strips brackets but not newlines, and the schema's text type is only minLength: 1. A folded title (title: > followed by two lines keeps a trailing newline) renders as I001[I001 Folded title over lines\n - open], so the status suffix lands on its own line and the diagram does not parse. title: "multi\nline [x] - done" does the same. The table rows at :250 and :253 only replace |, so they split too.

Suggestion: collapse whitespace in _label and in the table cells with " ".join(text.split()), and add a render test with a multi-line title.

SPDX-License-Identifier: Apache-2.0
-->
## Statement
When both arms pass every paired task, compare must flag no headroom.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F018 (confidence: high) states something its only experiment does not show.

The statement is "When both arms pass every paired task, compare must flag no headroom." The only cited record, X024, is a regrade of 1414 answers whose whole result is "0 mismatches." (experiment/X024.md:20). It says nothing about ceilings or headroom. D009 and R022 rest on F018.

Suggestion: cite the experiment that found the zero-delta ceiling case, or add it as a record, or lower the confidence and say it is a design rule.

SPDX-License-Identifier: Apache-2.0
-->
## Rationale
The five dimensions behaved as one factor; averaging diluted correctness. Done in pre-public history.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D002 cites F002, which has nothing to do with dimension weights.

D002 is "weight correctness x2; zero-weight specificity" and its rationale is "The five dimensions behaved as one factor; averaging diluted correctness." Its only finding, F002, is about enumerating figures to catch wrong numbers (X003, X028). "Behaved as one factor" appears in no experiment in the register, so a reader following the link finds no support.

Suggestion: add the experiment and finding behind the weighting, or say in the rationale that it comes from pre-public history without a record.

SPDX-License-Identifier: Apache-2.0
-->
## Rationale
Measured gains negligible or refuted: stratified probe sampling moved agreement by +0.007, inside the grader spread F009 reports, so it does not pay for its probe budget; the LLMLingua shortener was refuted (X009), and the SliCK split showed no gain worth building either.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbers in D004's rationale are in no record.

"Stratified probe sampling moved agreement by +0.007" and "the SliCK split showed no gain" appear nowhere else: grep -rn "0.007\|SliCK" research/records returns only this file. F009 cites X009 and X029, which cover the LLMLingua shortener and grader agreement. The earlier thread on F009 is fixed; this is the figure that replaced it.

Suggestion: add an experiment for the sampler and the SliCK split and cite it from F009, or drop both claims from the rationale.

Comment thread dokimi/docs/research-register.md Outdated
"names the record itself"),
("idea", "I002", "title: T\ntheme: O\nquestion: Q\nstatus: open\nextra: 1\n",
"Unevaluated properties"),
("finding", "F002", "title: T\nexperiments: [X001]\nconfidence: low\nextra: 1\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference checks for finding, decision and implref are not pinned.

Mutation check: emptying the finding, decision.superseded_by, decision.ideas or implref entries of REFS passes all 52 tests. Only the experiment-to-idea edge has a missing-target and wrong-type case here, and finding.experiments is covered only by the retracted check. Other mutants that survive: dropping the -- . pathspec in the dirty check, _label on the theme title, the pipe escape on an idea title, and sorted on the idea and experiment lists.

Suggestion: add test_bad_record_fails rows for finding.experiments: [X999], implref.decision: F001, decision.findings: [X001] and decision.ideas: [X001], each with a no record or want message.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit per nit, up to 999ecf3, which fix the three nits from my review:

  • 308d6fd: dokimi/scripts/research_register.py:155: check now follows superseded_by and reports {rid}: superseded_by chain loops back to {rid}; a two-decision cycle test is added.
  • 4ac9f70: dokimi/docs/research-register.md:34: the page now says optional links (required on implref).
  • 999ecf3: dokimi/scripts/research_register.py:197: _git catches OSError and returns an empty string, so export and render no longer crash without git; a test is added.

make ci-local at 999ecf3: 26 passed, 0 failed, 4 skipped.

Not approving yet. Still open: 1 bug finding(s) from my review; 6 risk finding(s) from my review.

@antonwolfy

Copy link
Copy Markdown
Contributor

CI at 999ecf3 fails benchmark on today's main: with #102's journey pages, research-register.md is the 31st page under docs/, one over max_docs: 30 in benchmarks/spec.v1.yaml. The spec asks to raise max_docs in the commit that adds the doc, so max_docs: 31 here fixes it.

This branch has not been deployed

No deployments
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.

4 participants