Verification

Literature toolkit: how the 235-paper workbook is built and what its checks catch

Scope: Literature toolkit commit (last commit that changed code)

The commit adds a literature pipeline: seed references, database search, a rule-checked Excel workbook, and a Zotero push. The 8 unit tests pass, the real workbook passes its own check, and the check caught all 4 errors I injected into a copy. Card rules have no real data yet, and 65 searches need a re-run.

Flow diagram from seed PDFs and searches, through checks, to the workbook and Zotero.
Seed references and searched papers pass separate database checks, join in the workbook, and pass the rule check before Zotero. — Figure sourcer17

What the commit adds

the change that adds the literature toolkit, 74 triaged seeds and 161 searched papers changes 339 files (128,735 lines added, 42 removed). Most of that is stored search answers and generated data. The code is a small set of Python scripts.

The the toolkit README that lists the folder layout, rules and commands says the design has four stages: S1 Value, S2 Method, S3 Improvement and S4 Robustness.

The commit touches 339 files.

339 files changed, 128735 insertions(+), 42 deletions(-)

List non-raw files in the commit and read the toolkit READMEr2

The tests cover 8 behaviors of the tool.

Outline the workbook tool and its testsr3

How a paper gets into the workbook

A paper comes from one of two sources. Seed references come from two PDFs. New papers come from database searches. Each source has a check against the database answer before the data reaches the workbook.

Script docstrings give the purpose of each stage.

Check that every candidate in candidates_S*.json matches a record in a raw tool

Read script docstrings so the pipeline diagram labels are accurater11

How import-json finds the row to update

import-json is an upsert: it updates a matching row or adds a new one. It tries three keys in a fixed order. It only writes fields that are not empty, and it never deletes a row. This lets an agent run the same import twice without duplicates.

The unit test for upsert adds 2 records, then imports 3 and reports 1 added and 2 updated.

Match by seed id, citekey, then DOI; update on a hit, else add.
A record tries three keys in order. A hit updates a row. No hit adds a row. — Figure sourcer19

The code skips empty values, so an update cannot erase a field.

if v == "":

Read the check rules and the import logicr4

The upsert test output shows 1 added and 2 updated.

import: 1 added, 2 updated (3 records)

Run the toolkit's unit testsr5

What the check enforces

lit_tool.py check prints each problem as SHEET!ROW: message and exits 1 if any exist. The main rules protect against uncited or invented papers.

One rule in the source: verified rows need an identifier.

E("Papers", r, "verified requires identifier")

Read the check rules and the import logicr4

What I ran

I ran three checks. Each one uses stored data; none needs the network.

  1. The unit tests. They create temporary workbooks, so they do not touch the real one.
  2. check on the real workbook. It passes with 235 papers and 0 cards.
  3. check on a corrupted copy in /tmp. I set a bad read level, a duplicate citekey, a verified row with no identifier and stage S9. The check reported all four, as 6 messages.

The real workbook is unchanged: git status shows no change under literature/.

All 8 tests pass. The summary is on stderr, where unittest writes it.

Ran 8 tests in 0.481s

Rerun the unit tests and capture the test list and summaryr7

The real workbook passes.

OK: 235 papers, 0 cards, no errors (lit_toolkit.xlsx)

Run the workbook check and count the Papers rowsr6

The corrupted copy fails with exit 1 and flags each injected error.

Papers!6: stage token 'S9' not in S1-S4

Check report counts and show check catching four injected errorsr9

Do the reported numbers match the workbook?

The the breadth search report with the stage-by-level table says 161 new papers and 45 at read level 1 to 3. I counted them in the workbook export. Both match. The stage-by-level table also matches for all four stages.

Stacked bars of new papers per stage by read level.
Most new papers are read level 0 (logged only). S2 has the most papers at level 3. Data are from the workbook export made here. — Figure sourcer18

161 new rows, 74 seed rows, 45 new papers at level 1 or higher.

N with level>=1 45

Check report counts and show check catching four injected errorsr9

The S2 row matches the report table.

S2 {'0': 32, '1': 8, '2': 5, '3': 4} total 49

Reconcile the to-pull count and the stage-by-level table with the reportr10

The invented-reference check finds nothing.

literature/search/candidates_S1.json: 42 records, 0 problems

Run the invented-reference check and count zero-hit searchesr12

Known gaps in the search

OpenAlex hit its free daily limit part way through. Searches after that returned 0 hits, which are false empties. The rerun script lists 65 queries to re-run after midnight UTC. Of the 332 logged queries, 119 had zero hits, so some zeros are real and some are not.

The re-run is a dry run by default. I did not apply it.

The dry run lists the queries to repeat.

65 queries to re-run

The breadth report states the same limit.

65 OpenAlex queries returned a false 0.

Count false-empty OpenAlex queries and the merged candidate totalr13

Checks

Material limits

Changed files
References
Scope and commits

Literature toolkit commit (last commit that changed code) · committed content

Head commit
3f58563b650d99d490bbb5e57dd7728e8a2972b7

Scope resolutionr1

Exact command log · 21 records

Working tree before the walkthrough (taken by the tool, not the agent) — exit 0r0

Stdout

 M .DS_Store
 M backlog/.DS_Store
 M notebooks/zo25/01_angular_momentum_basics.ipynb

Exact command

git status --porcelain --untracked-files=all -- . ':(exclude).walkthrough'

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:07.663Z
Duration (ms)
47
Execution status
exit 0
Snapshot
before
Recorded tree snapshot
{
  ".DS_Store": "3b476349a09022f6240027c0dbc9a899684f927a37bc0fa6264510287a141f91",
  "backlog/.DS_Store": "2606164498ffde2ebfb61f5f046c8023cf022462ef960db660289637caf2d2bc",
  "notebooks/zo25/01_angular_momentum_basics.ipynb": "8f045d7f7cf02a26e8f5a2c5283a722f17e64cc2ed1df95d4c647598767bd460",
  ".pi/": "directory",
  ".pytest_cache/": "directory",
  "Literature Review/": "directory",
  "Reaction Wheel/": "directory",
  "__pycache__/": "directory",
  "backlog/": "directory",
  "deliverables/": "directory",
  "literature/": "directory",
  "notebooks/": "directory",
  "outputs/": "directory",
  "tests/": "directory",
  "walkthrough/": "directory"
}
Show the commit scope and check the figure tools — exit 0r1

Stdout

3f58563b650d99d490bbb5e57dd7728e8a2972b7 2026-10-28
ZO-30.1-30.5: literature toolkit (Zotero + workbook), 74 verified seeds triaged, pull list and first-week queue, breadth search for S1-S4 (161 new papers, 332 logged queries)

 .gitignore                                         |   10 +
 ...w-toolkit-design-and-four-stage-reading-path.md |   31 +-
 ...erature-review-session-handoff-how-to-resume.md |   40 +-
 ...bTeX-and-the-four-stage-collection-structure.md |   38 +-
 ...ema-and-create-the-empty-literature-workbook.md |   33 +-
 ...e-Dingley-paper-and-the-users-SmallSat-paper.md |   32 +-
 ...ed-papers-into-stages-topics-and-read-levels.md |   36 +-
 ...ith-citation-snowballing-and-logged-searches.md |   24 +-
 literature/.gitkeep                                |    0
 literature/README.md                               |   45 +
 literature/library.bib                             | 1114 ++++
 literature/lit_toolkit.xlsx                        |  Bin 0 -> 186588 bytes
 literature/pull_list.md                            |   56 +
 literature/search/breadth_report.md                |  104 +
 literature/search/candidates_S1.json               |  974 +++
 literature/search/candidates_S2.json               | 1140 ++++
 literature/search/candidates_S3.json               | 1076 ++++
 literature/search/candidates_S4.json               | 1016 +++
 literature/search/existing_papers.json             |  520 ++
 literature/search/merge_candidates.py              |  126 +
 literature/search/merged_candidates.json           | 4510 ++++++++++++++
 literature/search/raw/S1/ax1.json                  |  114 +
 literature/search/raw/S1/ax10.json                 |   66 +
 literature/search/raw/S1/ax11.json                 |   66 +
 literature/search/raw/S1/ax2.json                  |   82 +
 literature/search/raw/S1/ax3.json                  |   34 +
 literature/search/raw/S1/ax4.json                  |   50 +
 literature/search/raw/S1/ax5.json                  |  242 +
 literature/search/raw/S1/ax6.json                  |  162 +
 literature/search/raw/S1/ax7.json                  |    1 +
 literature/search/raw/S1/ax8.json                  |  162 +
 literature/search/raw/S1/ax9.json                  |   66 +
 literature/search/raw/S1/cby_cja.json              |  802 +++
 literature/search/raw/S1/cby_dlr.json              |  362 ++
 literature/search/raw/S1/cby_leitner.json          |  802 +++
 literature/search/raw/S1/cby_liu.json              |  802 +++
 literature/search/raw/S1/cby_schenk.json           |  802 +++
 literature/search/raw/S1/cby_sur22.json            |  802 +++
 literature/search/raw/S1/nt1.json                  |    1 +
 literature/search/raw/S1/nt10.json                 |    1 +
 literature/search/raw/S1/nt10b.json                |  272 +
 literature/search/raw/S1/nt11.json                 |    1 +
 literature/search/raw/S1/nt11b.json                |  362 ++
 literature/search/raw/S1/nt12.json                 |   92 +
 literature/search/raw/S1/nt12b.json                |    1 +
 literature/search/raw/S1/nt13.json                 |    1 +
 literature/search/raw/S1/nt14.json                 |  272 +
 literature/search/raw/S1/nt15.json                 |   20 +
 literature/search/raw/S1/nt16.json                 |    1 +
 literature/search/raw/S1/nt16b.json                |  272 +
 literature/search/raw/S1/nt17.json                 |    1 +
 literature/search/raw/S1/nt17b.json                |    1 +
 literature/search/raw/S1/nt18.json                 |  272 +
 literature/search/raw/S1/nt19.json                 |  272 +
 literature/search/raw/S1/nt1b.json                 |  362 ++
 literature/search/raw/S1/nt2.json                  |   20 +
 literature/search/raw/S1/nt20.json                 |  272 +

 M .DS_Store
 M backlog/.DS_Store
 M notebooks/zo25/01_angular_momentum_basics.ipynb
figkit: environment ok

Exact command

git show --stat --format='%H %ad%n%s' --date=short 3f58563 | head -60; echo; git status --short | head; "$WALKTHROUGH_FIGKIT/scripts/check-env.sh" 2>&1 | tail -8

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:07.663Z
Duration (ms)
144
Execution status
exit 0
List non-raw files in the commit and read the toolkit README — exit 1r2

Stdout

 ...ences-from-the-Dingley-paper-and-the-users-SmallSat-paper.md |   32 +-
 ...Triage-the-seed-papers-into-stages-topics-and-read-levels.md |   36 +-
 ...four-stages-with-citation-snowballing-and-logged-searches.md |   24 +-
 literature/.gitkeep                                             |    0
 literature/README.md                                            |   45 +
 literature/library.bib                                          | 1114 +++++
 literature/lit_toolkit.xlsx                                     |  Bin 0 -> 186588 bytes
 literature/pull_list.md                                         |   56 +
 literature/search/breadth_report.md                             |  104 +
 literature/search/candidates_S1.json                            |  974 ++++
 literature/search/candidates_S2.json                            | 1140 +++++
 literature/search/candidates_S3.json                            | 1076 +++++
 literature/search/candidates_S4.json                            | 1016 +++++
 literature/search/existing_papers.json                          |  520 +++
 literature/search/merge_candidates.py                           |  126 +
 literature/search/merged_candidates.json                        | 4510 ++++++++++++++++++
 literature/search/report_S1.md                                  |   67 +
 literature/search/report_S2.md                                  |   69 +
 literature/search/report_S3.md                                  |   61 +
 literature/search/report_S4.md                                  |   69 +
 literature/search/rerun_false_empty.py                          |   35 +
 literature/search/search_log.jsonl                              |  332 ++
 literature/search/search_log_rows.json                          | 2990 ++++++++++++
 literature/search/verify_candidates.py                          |   28 +
 literature/search/vocab.json                                    |    1 +
 literature/search/zo305_graph.json                              |   70 +
 literature/seeds/build_records.py                               |  132 +
 literature/seeds/clean_refs.py                                  |    8 +
 literature/seeds/dingley_refs_raw.txt                           |   47 +
 literature/seeds/finalize.py                                    |   47 +
 literature/seeds/harvest.py                                     |  143 +
 literature/seeds/kuhl_refs_raw.txt                              |   27 +
 literature/seeds/parse_ctx.py                                   |   55 +
 literature/seeds/parse_fields.py                                |   27 +
 literature/seeds/parsed_ctx.json                                |  520 +++
 literature/seeds/recs_stage1.json                               | 2074 +++++++++
 literature/seeds/run_verify.log                                 |   55 +
 literature/seeds/run_verify.py                                  |   42 +
 literature/seeds/seed_refs.json                                 | 2074 +++++++++
 literature/seeds/seed_report.md                                 |   94 +
 literature/seeds/split_refs.py                                  |   39 +
 literature/seeds/triage.json                                    |  594 +++
 literature/seeds/triage_report.md                               |   87 +
 literature/seeds/verify_raw.json                                | 6570 +++++++++++++++++++++++++++
 literature/seeds/zotero_map.json                                |  111 +
 literature/tools/lit_search.py                                  |  307 ++
 literature/tools/lit_tool.py                                    |  618 +++
 literature/tools/test_lit_tool.py                               |  101 +
 literature/tools/zotero_push.py                                 |  209 +
 339 files changed, 128735 insertions(+), 42 deletions(-)

 339 files changed, 128735 insertions(+), 42 deletions(-)
# literature/ - literature-review toolkit

Design: `backlog/docs/doc-14`. Four stages: S1 Value, S2 Method, S3 Improvement,
S4 Robustness. The join key between Zotero and the spreadsheet is the
Better BibTeX citekey.

## Folder layout
- `lit_toolkit.xlsx` - the spreadsheet: About, Papers, Map, Architecture
  comparison, Reading queue, Cards, Lookup index, Feedback log, Search log,
  Vocabularies. Start with the About sheet (every column explained).
- `library.bib` - Better BibTeX auto-export of the Zotero library. Do not edit.
- `seeds/` - harvested seed data (references from the two seed PDFs).
- `tools/` - `lit_tool.py` (the tool) and `test_lit_tool.py` (its tests).
- PDFs are never committed (`literature/**/*.pdf` is git-ignored). Zotero keeps
  the PDFs in `~/Zotero/storage`.

## Rules (short)
- Every paper has a DOI, arXiv id, NTRS id, ISBN, or stable URL, unless
  `verify_status` says `web-only` or `not-found`. Never cite from memory.
- Every takeaway on a card has a page number.
- Agents add and update rows. They never delete rows.
- The user approves reading-queue and pull-list choices.

## Commands (run from the repo root)
Check the workbook. It prints each problem as `SHEET!ROW: message` and exits 1
if there are any; otherwise it prints one OK line:

    python3 literature/tools/lit_tool.py check [--xlsx PATH]

Add or update Papers rows from a JSON list (field names = Papers columns).
It matches on seed_id, then citekey, then DOI. It only fills fields that are
non-empty in the JSON and never deletes rows:

    python3 literature/tools/lit_tool.py import-json PATH [--xlsx PATH]

Dump the Papers sheet to JSON:

    python3 literature/tools/lit_tool.py export-json PATH [--xlsx PATH]

`init` creates an empty workbook and refuses to overwrite an existing one
unless you add `--force`:

    python3 literature/tools/lit_tool.py init [--force]

Tests: `python3 -m unittest literature/tools/test_lit_tool.py -v`
literature:
library.bib
lit_toolkit.xlsx
pull_list.md
README.md
search
seeds
tools

Exact command

git show --stat=100 --format= 3f58563 | grep -v 'search/raw/' | tail -50; echo; git show --stat=100 --format= 3f58563 | tail -1; cat literature/README.md; ls literature literature/*.py 2>/dev/null

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:09.635Z
Duration (ms)
111
Execution status
exit 1
Outline the workbook tool and its tests — exit 0r3

Stdout

20:DEFAULT_XLSX = Path(__file__).resolve().parent.parent / "lit_toolkit.xlsx"
22:PAPERS_COLS = [
29:ARCH_COLS = ["architecture", "measure", "value", "unit", "citekey", "page", "note"]
30:QUEUE_COLS = ["rank", "citekey", "title", "stage", "read_level", "parts_to_read",
32:CARDS_COLS = (["citekey", "stage", "topic", "why_it_matters", "read_level", "parts_to_read"]
36:LOOKUP_COLS = ["question", "answer_short", "citekey", "page", "card_row"]
37:FEEDBACK_COLS = ["date", "citekey", "useful", "why", "action_taken"]
38:SEARCH_COLS = ["date", "source", "query_or_seed", "filters", "hits", "kept", "notes"]
39:VOCAB_COLS = ["stage", "read_level", "status", "verify_status", "id_type", "item_type",
42:VOCAB = {
66:VOCAB_MAX_ROW = 60       # validation / Map ranges look this far down the vocab columns
67:DATA_MAX_ROW = 5000      # validation / COUNTIFS ranges look this far down data sheets
68:MAP_ROWS = 40
70:SHEET_ORDER = ["About", "Papers", "Map", "Architecture comparison", "Reading queue",
72:DATA_SHEETS = {
77:WRAP_COLS = {"title", "authors", "verify_evidence", "raw_reference", "cite_context",
83:WIDTHS = {
93:STAGE_RE = re.compile(r"^S[1-4]$")
98:PAPER_DOC = {
126:COLUMN_DOC = {
192:SHEET_DOC = {
204:HEADER_BLOCK = [
215:def vocab_range(name):
220:def style_header(ws, ncols):
229:def make_data_sheet(wb, name, cols):
239:def add_list_validation(ws, cols, header, vocab_name=None, inline=None):
248:def build_about(ws):
297:def build_map(ws):
323:def build_vocab(ws):
333:def cmd_init(args):
372:def norm(v):
382:def read_sheet(wb, name):
394:def read_vocab(wb):
406:def is_level(v):
410:def cmd_check(args):
515:def coerce(field, v):
525:def last_data_row(ws):
532:def cmd_import(args):
591:def cmd_export(args):
600:def main(argv=None):
----
import json
import sys
import tempfile
import unittest
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent))
import lit_tool as lt  # noqa: E402
from openpyxl import load_workbook  # noqa: E402


def rec(**kw):
    base = dict(seed_id="D1", title="A paper", verify_status="verified", id_type="DOI",
                identifier="10.1/abc", verify_evidence="Crossref title match 1.0",
                stage="S1", topic="deployables", read_level=1, status="new")
    base.update(kw)
    return base


class T(unittest.TestCase):
    def setUp(self):
        self.tmp = tempfile.TemporaryDirectory()
        self.dir = Path(self.tmp.name)
        self.x = str(self.dir / "t.xlsx")
        self.assertEqual(lt.main(["init", "--xlsx", self.x]), 0)

    def tearDown(self):
        self.tmp.cleanup()

    def imp(self, recs):
        p = self.dir / "in.json"
        p.write_text(json.dumps(recs))
        self.assertEqual(lt.main(["import-json", "--xlsx", self.x, str(p)]), 0)

    def chk(self):
        return lt.main(["check", "--xlsx", self.x])

    def test_init(self):
        wb = load_workbook(self.x)
        self.assertEqual(wb.sheetnames, lt.SHEET_ORDER)
38:    def test_init(self):
46:    def test_import_upsert_and_export(self):
60:    def test_bad_read_level(self):
64:    def test_duplicate_citekey(self):
71:    def test_verified_without_identifier(self):
77:    def test_card_takeaway_without_page(self):
89:    def test_import_strips_control_chars(self):
93:    def test_card_unknown_citekey(self):

Exact command

cd literature/tools; grep -n "^def \|^class \|^[A-Z_]* = " lit_tool.py | head -70; echo ----; sed -n 1,40p test_lit_tool.py; grep -n "def test" test_lit_tool.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:13.018Z
Duration (ms)
19
Execution status
exit 0
Read the check rules and the import logic — exit 0r4

Stdout

def cmd_check(args):
    path = Path(args.xlsx)
    if not path.exists():
        print(f"no workbook at {path}", file=sys.stderr)
        return 1
    wb = load_workbook(path)
    errs = []
    E = lambda sheet, row, msg: errs.append(f"{sheet}!{row}: {msg}")
    missing = [s for s in SHEET_ORDER if s not in wb.sheetnames]
    for s in missing:
        E(s, 1, "sheet missing")
    if missing:
        print("\n".join(errs))
        return 1
    voc = read_vocab(wb)
    for name, cols in DATA_SHEETS.items():
        hdr = [norm(c.value) for c in wb[name][1]][:len(cols)]
        if hdr != cols:
            E(name, 1, f"header mismatch; expected {cols}")
    vset = {k: {str(x) for x in v} for k, v in voc.items()}

    # Papers
    _, papers = read_sheet(wb, "Papers")
    ck, sid, doi = {}, {}, {}
    for r, d in papers:
        if not d.get("seed_id") and not d.get("citekey"):
            E("Papers", r, "needs seed_id or citekey")
        for f in ("title", "verify_status", "id_type"):
            if d.get(f, "") == "":
                E("Papers", r, f"missing required field {f}")
        idt, ident, vs = d.get("id_type", ""), d.get("identifier", ""), d.get("verify_status", "")
        if idt and idt != "none" and not ident:
            E("Papers", r, f"id_type={idt} requires identifier")
        if vs == "verified":
            if idt not in ("DOI", "arXiv", "NTRS", "ISBN", "URL"):
                E("Papers", r, "verified requires id_type DOI/arXiv/NTRS/ISBN/URL")
            if not ident:
                E("Papers", r, "verified requires identifier")
            if not d.get("verify_evidence"):
                E("Papers", r, "verified requires verify_evidence")
        for f in ("read_level", "status", "verify_status", "id_type", "item_type", "pdf_in_zotero"):
            vname = "Y/N" if f == "pdf_in_zotero" else f
            val = d.get(f, "")
            if val != "" and str(val) not in vset.get(vname, set()):
                E("Papers", r, f"{f}={val!r} not in allowed values")
        if d.get("read_level", "") != "" and not is_level(d["read_level"]):
            E("Papers", r, f"read_level must be 0-3, got {d['read_level']!r}")
        if d.get("stage"):
            for tok in [t.strip() for t in str(d["stage"]).split(";") if t.strip()]:
                if not STAGE_RE.match(tok):
                    E("Papers", r, f"stage token {tok!r} not in S1-S4")
        if d.get("topic") and d["topic"] not in voc.get("topic", []):
            E("Papers", r, f"topic {d['topic']!r} not in Vocabularies")
        if d.get("citekey"):
            if d["citekey"] in ck:
                E("Papers", r, f"duplicate citekey {d['citekey']!r} (also row {ck[d['citekey']]})")
            else:
                ck[d["citekey"]] = r
        if d.get("seed_id"):
            if d["seed_id"] in sid:
                E("Papers", r, f"duplicate seed_id {d['seed_id']!r} (also row {sid[d['seed_id']]})")
            else:
                sid[d["seed_id"]] = r
        if idt == "DOI" and ident:
            k = str(ident).lower()
            if k in doi:
                E("Papers", r, f"duplicate DOI {ident!r} (also row {doi[k]})")
            else:
                doi[k] = r

    # Cards
    _, cards = read_sheet(wb, "Cards")
    for r, d in cards:
        if d.get("citekey") and d["citekey"] not in ck:
            E("Cards", r, f"citekey {d['citekey']!r} not in Papers")
        if not d.get("citekey"):
            E("Cards", r, "missing citekey")
        for i in range(1, 6):
            if d.get(f"takeaway_{i}") and d.get(f"page_{i}", "") == "":
                E("Cards", r, f"takeaway_{i} has no page_{i}")
        if d.get("read_level", "") != "" and not is_level(d["read_level"]):
            E("Cards", r, f"read_level must be 0-3, got {d['read_level']!r}")
        if d.get("quote_check") and d["quote_check"] not in ("pass", "fail"):
            E("Cards", r, "quote_check must be pass, fail, or blank")
    for sheet in ("Reading queue", "Lookup index", "Architecture comparison", "Feedback log"):
        _, rows = read_sheet(wb, sheet)
        for r, d in rows:
            if d.get("citekey") and d["citekey"] not in ck:
                E(sheet, r, f"citekey {d['citekey']!r} not in Papers")
            if sheet == "Reading queue":
                if d.get("read_level", "") != "" and not is_level(d["read_level"]):
                    E(sheet, r, f"read_level must be 0-3, got {d['read_level']!r}")
                if d.get("approved_by_user") and d["approved_by_user"] not in ("Y", "N"):
                    E(sheet, r, "approved_by_user must be Y or N")
            if sheet == "Feedback log" and d.get("useful") and d["useful"] not in ("Y", "N"):
                E(sheet, r, "useful must be Y or N")
    if errs:
        print("\n".join(errs))
        print(f"{len(errs)} error(s)", file=sys.stderr)
        return 1
    print(f"OK: {len(papers)} papers, {len(cards)} cards, no errors ({path.name})")
    return 0


# ---------------------------------------------------------------- import/export
def coerce(field, v):
def cmd_import(args):
    path = Path(args.xlsx)
    recs = json.loads(Path(args.json).read_text(encoding="utf-8"))
    if not isinstance(recs, list):
        print("JSON must be a list of records", file=sys.stderr)
        return 1
    wb = load_workbook(path)
    ws = wb["Papers"]
    col = {c: i + 1 for i, c in enumerate(PAPERS_COLS)}
    last = last_data_row(ws)
    idx_seed, idx_ck, idx_doi = {}, {}, {}

    def index_row(r):
        s = norm(ws.cell(row=r, column=col["seed_id"]).value)
        c = norm(ws.cell(row=r, column=col["citekey"]).value)
        if s:
            idx_seed[s] = r
        if c:
            idx_ck[c] = r
        if norm(ws.cell(row=r, column=col["id_type"]).value) == "DOI":
            i = norm(ws.cell(row=r, column=col["identifier"]).value)
            if i:
                idx_doi[str(i).lower()] = r

    for r in range(2, last + 1):
        index_row(r)
    added = updated = 0
    for rec in recs:
        unknown = set(rec) - set(PAPERS_COLS)
        if unknown:
            print(f"warning: ignoring unknown fields {sorted(unknown)}", file=sys.stderr)
        rec = {k: coerce(k, v) for k, v in rec.items() if k in col}
        row = None
        if rec.get("seed_id") and rec["seed_id"] in idx_seed:
            row = idx_seed[rec["seed_id"]]
        elif rec.get("citekey") and rec["citekey"] in idx_ck:
            row = idx_ck[rec["citekey"]]
        elif rec.get("id_type") == "DOI" and rec.get("identifier") and str(rec["identifier"]).lower() in idx_doi:
            row = idx_doi[str(rec["identifier"]).lower()]
        if row is None:
            last += 1
            row = last
            added += 1
        else:
            updated += 1
        for k, v in rec.items():
            if v == "":
                continue
            if isinstance(v, str):
                v = ILLEGAL_CHARACTERS_RE.sub(" ", v)
            cell = ws.cell(row=row, column=col[k], value=v)
            cell.alignment = Alignment(wrap_text=k in WRAP_COLS, vertical="top")
        index_row(row)
    ws.auto_filter.ref = f"A1:{get_column_letter(len(PAPERS_COLS))}{max(last, 2)}"
    wb.save(path)
    print(f"import: {added} added, {updated} updated ({len(recs)} records)")
    return 0


Exact command

cd literature/tools; sed -n 410,515p lit_tool.py; sed -n 532,590p lit_tool.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:16.587Z
Duration (ms)
9
Execution status
exit 0
Run the toolkit's unit tests — exit 0r5

Stdout

Papers!2: read_level=5 not in allowed values
Papers!2: read_level must be 0-3, got 5
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmp7_q0kvmc/t.xlsx
import: 1 added, 0 updated (1 records)
Cards!2: takeaway_1 has no page_1
OK: 1 papers, 1 cards, no errors (t.xlsx)
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpxyt9ybau/t.xlsx
Cards!2: citekey 'nope' not in Papers
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpzn8nl5y0/t.xlsx
import: 2 added, 0 updated (2 records)
Papers!3: duplicate citekey 'a1' (also row 2)
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpk2xzoi_n/t.xlsx
import: 1 added, 0 updated (1 records)
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmprmq_92bd/t.xlsx
import: 2 added, 0 updated (2 records)
import: 1 added, 2 updated (3 records)
export: 3 records -> /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmprmq_92bd/out.json
OK: 3 papers, 0 cards, no errors (t.xlsx)
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpavl_ynjt/t.xlsx
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpavl_ynjt/t.xlsx
OK: 0 papers, 0 cards, no errors (t.xlsx)
created /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpbblpengu/t.xlsx
import: 1 added, 0 updated (1 records)
Papers!2: id_type=URL requires identifier
Papers!2: verified requires identifier

Exact command

cd /Users/mikek/Zig_ORLO*; python3 -m unittest literature/tools/test_lit_tool.py -v 2>&1 | tail -25

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:16.596Z
Duration (ms)
658
Execution status
exit 0
Run the workbook check and count the Papers rows — exit 0r6

Stdout

OK: 235 papers, 0 cards, no errors (lit_toolkit.xlsx)
exit=0
rows 235
stage {'S1': 110, 'S1; S3': 3, 'S1; S2; S3': 2, 'S1; S2': 2, 'S2; S3': 14, 'S2': 31, 'S3': 30, 'S4': 37, 'S3; S4': 6}
read_level {'0': 167, '2': 19, '1': 45, '3': 4}
verify_status {'web-only': 20, 'verified': 205, 'not-found': 10}
status {'skip': 23, 'new': 144, 'to-pull': 66, 'queued': 2}
id_type {'URL': 24, 'DOI': 144, 'none': 22, 'NTRS': 35, 'arXiv': 8, 'ISBN': 2}

Exact command

cd /Users/mikek/Zig_ORLO*; python3 literature/tools/lit_tool.py check; echo "exit=$?"; python3 literature/tools/lit_tool.py export-json /tmp/papers_wt.json >/dev/null; python3 - <<'E'
import json,collections
p=json.load(open('/tmp/papers_wt.json'))
print('rows',len(p))
for k in ['stage','read_level','verify_status','status','id_type']:
    print(k,dict(collections.Counter(str(r.get(k)) for r in p)))
E

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:17.255Z
Duration (ms)
281
Execution status
exit 0
Rerun the unit tests and capture the test list and summary — exit 0r7

Stdout

exit=0
--- stderr (unittest writes here)
test_bad_read_level (literature.tools.test_lit_tool.T.test_bad_read_level) ... 2 error(s)
test_card_takeaway_without_page (literature.tools.test_lit_tool.T.test_card_takeaway_without_page) ... 1 error(s)
test_card_unknown_citekey (literature.tools.test_lit_tool.T.test_card_unknown_citekey) ... 1 error(s)
test_duplicate_citekey (literature.tools.test_lit_tool.T.test_duplicate_citekey) ... 1 error(s)
test_import_strips_control_chars (literature.tools.test_lit_tool.T.test_import_strips_control_chars) ... ok
test_import_upsert_and_export (literature.tools.test_lit_tool.T.test_import_upsert_and_export) ... ok
test_init (literature.tools.test_lit_tool.T.test_init) ... refusing to overwrite /var/folders/g_/z858_lzj63l9qh1p69jdr70w0000gn/T/tmpt3i4j8z3/t.xlsx (use --force)
test_verified_without_identifier (literature.tools.test_lit_tool.T.test_verified_without_identifier) ... 2 error(s)
Ran 8 tests in 0.481s
OK
      27 /tmp/ut_out.txt
      19 /tmp/ut_err.txt
      46 total

Exact command

cd /Users/mikek/Zig_ORLO*; python3 -m unittest literature/tools/test_lit_tool.py -v >/tmp/ut_out.txt 2>/tmp/ut_err.txt; echo "exit=$?"; echo "--- stderr (unittest writes here)"; grep -E "^test_|^Ran|^OK|FAIL|ERROR" /tmp/ut_err.txt; wc -l /tmp/ut_out.txt /tmp/ut_err.txt

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:24.094Z
Duration (ms)
609
Execution status
exit 0
Look at the seed triage, search report, search log and pull list — exit 0r8

Stdout

list 74
['seed_id', 'stage', 'topic', 'read_level', 'level_reason', 'status']
# ZO-30.5 breadth search: results for review (2026-10-28)

161 new papers found and checked against OpenAlex, NASA NTRS or arXiv. No paper is from memory; a script checked every record against the database answer (`literature/search/verify_candidates.py`).

- In the workbook `literature/lit_toolkit.xlsx`: Papers sheet rows N001-N161. Search log sheet: 332 queries.
- In Zotero: the 45 papers at level 1-3 are in `00 Inbox` and their stage collections, tagged `#L1`/`#L2`/`#L3` and `#to-pull`. Level 0 papers are only in the workbook.
- Per-stage details: `literature/search/report_S1.md` ... `report_S4.md`.

| Stage | Kept | L0 | L1 | L2 | L3 |
|---|---|---|---|---|---|
| S1 Value | 43 | 31 | 11 | 1 | 0 |
| S2 Method | 49 | 32 | 8 | 5 | 4 |
| S3 Improvement | 55 | 36 | 12 | 4 | 3 |
| S4 Robustness | 43 | 31 | 9 | 3 | 0 |

Papers that serve two stages are counted in both rows.

## Read first (one or two per stage)

**S1 Value**
- N001 L2: Review of in-space assembly technologies (2020). Defines S1: most-cited ISA review (228); classifies ISA, covers US/EU/JP/CA/CN programs, structure design, robots.  `DOI 10.1016/j.cja.2020.09.043`
- N003 L1: The Future of Space Astronomy will be Built: Results from the NASA-Chartered In-Space Assembled (2020). Defines S1: iSAT study results (NASA-chartered) on assembled vs monolithic telescopes.  `NTRS 20220001411`

**S2 Method**
- N045 L2: Equations of Motion of Free-Floating Spacecraft-Manipulator Systems: An Engineer's Tutorial (2018). Teacher: engineer tutorial that derives equations of motion of free-floating spacecraft-manipulator systems; notebook-friendly.  `DOI 10.3389/frobt.2018.00041`
- N043 L2: Robotic Manipulation and Capture in Space: A Survey (2021). Defines S2: 2021 survey of space manipulation dynamics, control and capture; authors include Papadopoulos.  `DOI 10.3389/frobt.2021.686723`

**S3 Improvement**
- N060 L3: Reaction null-space control of flexible structure mounted manipulator systems (1999). Method: defines the reaction null-space (RNS) idea; the maths to redo in a ZO-26 notebook.  `DOI 10.1109/70.817666`
- N063 L3: Zero reaction maneuver: flight validation with ETS-VII space robot and extension to kinematical (2002). Method: zero reaction maneuver (ZRM) with ETS-VII flight data and redundant-arm extension; notebook basis for ZO-26.  `DOI 10.1109/robot.2001.932590`
     332 search/search_log.jsonl
{"date": "2026-10-28", "source": "OpenAlex reviews", "query_or_seed": "in-space assembly spacecraft review", "filters": "type:review", "hits": 581, "out": "literature/search/raw/S1/sv1.json"}
{"date": "2026-10-28", "source": "OpenAlex reviews", "query_or_seed": "space robotics on-orbit servicing review", "filters": "type:review", "hits": 489, "out": "literature/search/raw/S2/q01.json"}
{"date": "2026-10-28", "source": "OpenAlex reviews", "query_or_seed": "on-orbit servicing assembly and manufacturing", "filters": "type:review", "hits": 463, "out": "literature/search/raw/S1/sv2.json"}
{"date": # Pull list: papers to get (ZO-30.4, approved 2026-10-28)

Approved by the user as drafted. Source of truth: `literature/lit_toolkit.xlsx` (Papers sheet, status `to-pull`). In Zotero: tag `#to-pull`.

23 papers: 7 need the MIT library, 13 are free online, 2 are web pages, 1 is not found. Bold = first-week reading queue (get these first).

After you get a PDF: drag it onto the Zotero item. Tell the agent; it sets status `queued`. Links checked 2026-10-28.

## A. Needs MIT library (publisher paywall or login)

| Seed | Title | First author, year | Level | Identifier | Link |
|---|---|---|---|---|---|
| K09 | **On-Orbit Upgrade and Repair: The Hubble Space Telescope Example** | Hastings 2006 | L2 | DOI 10.2514/1.15496 | https://doi.org/10.2514/1.15496 |
| K19 | **HOTDOCK: Design and Validation of a New Generation of Standard Robotic Interface** | Letier 2020 | L2 | URL https://elib.dlr.de/139963/1/IAC-20-D3.2B-001_1.0.0.pdf | https://elib.dlr.de/139963/1/IAC-20-D3.2B-001_1.0.0.pdf |
| D05 | Review of Large Spacecraft Deployable Membrane Antenna Structures | Liu 2017 | L2 | DOI 10.1007/s10033-017-0198-x | https://doi.org/10.1007/s10033-017-0198-x |
| D06 | Review of Inflatable Booms for Deployable Space Structures: Packing and Rigidiza | Schenk 2014 | L2 | DOI 10.2514/1.a32598 | https://doi.org/10.2514/1.a32598 |
| D30 | On-Orbit Performance Degradation of the International Space Station P6 Photovolt | Kerslake 2003 | L1 | DOI 10.2514/6.2003-5999 | https://doi.org/10.2514/6.2003-5999 |
| K01 | ISS Interface Mechanisms and their Heritage | Cook 2011 | L1 | DOI 10.2514/6.2011-7150 | https://doi.org/10.2514/6.2011-7150 |
| K17 | PULSAR: development of a mirror tile prototype for future large telescopes robot | Rouvinet 2020 | L1 | DOI 10.1117/12.2576237 | https://doi.org/10.1117/12.2576237 |

K19: the DLR eLib PDF needs a login (HTTP 401). Try the IAC 2020 proceedings through the MIT library.

## B. Free online - direct PDF where known

| Seed | Title | First author, year | Level | Identifier | Link |

Exact command

cd /Users/mikek/Zig_ORLO*/literature; python3 - <<'E'
import json,collections
t=json.load(open('seeds/triage.json'))
print(type(t).__name__, len(t))
x=t if isinstance(t,list) else list(t.values())
print(list(x[0].keys()) if isinstance(x[0],dict) else x[0])
E
sed -n 1,30p search/breadth_report.md; wc -l search/search_log.jsonl; head -c 600 search/search_log.jsonl; sed -n 1,25p pull_list.md

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:24.704Z
Duration (ms)
26
Execution status
exit 0
Check report counts and show check catching four injected errors — exit 0r9

Stdout

seed rows 74 N rows 161
N read_level {'0': 116, '1': 31, '2': 10, '3': 4}
N with level>=1 45
to-pull rows 66
verified without identifier 0
triage entries 74

=== corrupted copy ===
Papers!2: read_level=7 not in allowed values
Papers!2: read_level must be 0-3, got 7
Papers!4: duplicate citekey 'spacexStarshipsSecondFlight2023' (also row 3)
Papers!5: verified requires id_type DOI/arXiv/NTRS/ISBN/URL
Papers!5: verified requires identifier
Papers!6: stage token 'S9' not in S1-S4
exit=1

Stderr

6 error(s)

Exact command

cd /Users/mikek/Zig_ORLO*; python3 - <<'E'
import json,collections
p=json.load(open('/tmp/papers_wt.json'))
N=[r for r in p if str(r.get('seed_id','')).startswith('N')]
S=[r for r in p if not str(r.get('seed_id','')).startswith('N')]
print('seed rows',len(S),'N rows',len(N))
print('N read_level',dict(sorted(collections.Counter(str(r['read_level']) for r in N).items())))
print('N with level>=1',sum(1 for r in N if str(r['read_level']) in '123'))
print('to-pull rows',sum(1 for r in p if r['status']=='to-pull'))
print('verified without identifier',sum(1 for r in p if r['verify_status']=='verified' and not r.get('identifier')))
tri=json.load(open('literature/seeds/triage.json'))
print('triage entries',len(tri))
E
echo; echo "=== corrupted copy ==="
cp literature/lit_toolkit.xlsx /tmp/wt_bad.xlsx
python3 - <<'E'
from openpyxl import load_workbook
wb=load_workbook('/tmp/wt_bad.xlsx'); ws=wb['Papers']
hdr=[c.value for c in ws[1]]
ci={h:i+1 for i,h in enumerate(hdr)}
ws.cell(row=2,column=ci['read_level'],value=7)            # out of range
ws.cell(row=3,column=ci['citekey'],value=ws.cell(row=4,column=ci['citekey']).value)  # duplicate citekey
ws.cell(row=5,column=ci['verify_status'],value='verified'); ws.cell(row=5,column=ci['identifier'],value=None)
ws.cell(row=6,column=ci['stage'],value='S9')
wb.save('/tmp/wt_bad.xlsx')
E
python3 literature/tools/lit_tool.py check --xlsx /tmp/wt_bad.xlsx; echo "exit=$?"
git status --short literature | head -3

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:33.658Z
Duration (ms)
355
Execution status
exit 0
Reconcile the to-pull count and the stage-by-level table with the report — exit 0r10

Stdout

to-pull by seed/N: Counter({'N': 45, 'seed': 21})
to-pull by level: {'1': 43, '2': 19, '3': 4}
seed to-pull by level: {'1': 12, '2': 9}
S1 {'0': 31, '1': 11, '2': 1} total 43
S2 {'0': 32, '1': 8, '2': 5, '3': 4} total 49
S3 {'0': 36, '1': 12, '2': 4, '3': 3} total 55
S4 {'0': 31, '1': 9, '2': 3} total 43
5:23 papers: 7 need the MIT library, 13 are free online, 2 are web pages, 1 is not found. Bold = first-week reading queue (get these first).
9:## A. Needs MIT library (publisher paywall or login)
23:## B. Free online - direct PDF where known
43:## C. Web pages (already `queued`; read online)
50:## D. Not found in a database

Exact command

cd /Users/mikek/Zig_ORLO*; python3 - <<'E'
import json,collections
p=json.load(open('/tmp/papers_wt.json'))
tp=[r for r in p if r['status']=='to-pull']
print('to-pull by seed/N:', collections.Counter('N' if str(r['seed_id']).startswith('N') else 'seed' for r in tp))
print('to-pull by level:', dict(sorted(collections.Counter(str(r['read_level']) for r in tp).items())))
print('seed to-pull by level:', dict(sorted(collections.Counter(str(r['read_level']) for r in tp if not str(r['seed_id']).startswith('N')).items())))
N=[r for r in p if str(r['seed_id']).startswith('N')]
tab=collections.defaultdict(lambda: collections.Counter())
for r in N:
    for s in str(r['stage']).split(';'):
        tab[s.strip()][str(r['read_level'])]+=1
for s in sorted(tab): print(s, dict(sorted(tab[s].items())), 'total', sum(tab[s].values()))
E
grep -n "^## \|^[0-9]* papers" literature/pull_list.md | head -12

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:39.852Z
Duration (ms)
35
Execution status
exit 0
Read script docstrings so the pipeline diagram labels are accurate — exit 0r11

Stdout

== seeds/harvest.py
ZO-30.3 harvest: verify seed references against Crossref / OpenAlex / NTRS / arXiv / Open Library.
Every API response is cached under cache/ (stdlib only; curl via subprocess).
== seeds/split_refs.py
(no docstring)
== seeds/parse_ctx.py
Step 1-3 of harvest: parse refs, find cite contexts. Output parsed.json
== seeds/build_records.py
Build seed_refs.json from verify_raw.json (+ a few targeted lookups). Every field comes from an API response or the PDF.
== seeds/run_verify.py
(no docstring)
== seeds/finalize.py
Post-process recs_stage1.json -> seed_refs.json, merge duplicates, self-check inputs.
== search/merge_candidates.py
ZO-30.5 merge: combine candidates_S1..S4.json, remove duplicates, give ids N001..,
and write merged_candidates.json (Papers columns) + search_log_rows.json (Search log rows).

Duplicates: same DOI/arXiv/NTRS id, or same normalized title (also against the seeds).
When two stages keep the same paper, 
== search/verify_candidates.py
Check that every candidate in candidates_S*.json matches a record in a raw tool
result file (same id_type+identifier and same title). Catches invented references.
== search/rerun_false_empty.py
Re-run OpenAlex queries that returned 0 on 2026-10-28 because of the OpenAlex
daily rate limit. Run after midnight UTC (or with an API key). It rebuilds each
command from search_log.jsonl and writes to the same raw file. Dry run by default.
    python3 literature/search/rerun_false_empty.py [--apply
== tools/lit_search.py
Repeatable literature searches for ZO-30.5 (stdlib only; curl via subprocess).

Every call is cached (literature/search/cache/) and logged as one JSON line in
literature/search/search_log.jsonl (date, source, query_or_seed, filters, hits).
Results are written as candidate records whose field names m
== tools/zotero_push.py
Push paper records to the Zotero web library (create only, never delete).

Usage:
  zotero_push.py push RECORDS.json [--apply]   # default is a dry run
  zotero_push.py citekeys RECORDS.json OUT.json  # read citekeys + zotero keys back
  zotero_push.py tags TRIAGE.json [--apply]  # merge #L/status t
5:  zotero_push.py push RECORDS.json [--apply]   # default is a dry run
7:  zotero_push.py tags TRIAGE.json [--apply]  # merge #L/status tags + stage collections (PATCH)
109:        print("dry run; add --apply to write")
196:          + ("" if apply else "; dry run, add --apply to write"))
203:        sys.exit(tags(a[1], "--apply" in a))
205:        sys.exit(push(a[1], "--apply" in a))
9:  lit_search.py openalex "QUERY" [--from-year Y] [--n 25] [--out F.json] [--stage S2]
10:  lit_search.py ntrs     "QUERY" [--n 25] [--out F.json] [--stage S2]
11:  lit_search.py arxiv    "QUERY" [--n 25] [--out F.json] [--stage S2]
12:  lit_search.py refs     DOI_OR_OPENALEX_ID [--n 200] [--out F.json] [--stage S2]   # backward snowball
13:  lit_search.py citedby  DOI_OR_OPENALEX_ID [--n 50]  [--out F.json] [--stage S2]   # forward snowball (most cited first)
14:  lit_search.py surveys  "QUERY" [--n 25] [--out F.json] [--stage S2]   # OpenAlex, type=review
17:QUERY for OpenAlex is full-text relevance search over title+abstract.
56:            sys.exit("ERROR: OpenAlex daily budget used up (resets at midnight UTC). "
seeds/build_records.py
seeds/finalize.py
seeds/harvest.py

Exact command

cd /Users/mikek/Zig_ORLO*/literature; for f in seeds/harvest.py seeds/split_refs.py seeds/parse_ctx.py seeds/build_records.py seeds/run_verify.py seeds/finalize.py search/merge_candidates.py search/verify_candidates.py search/rerun_false_empty.py tools/lit_search.py tools/zotero_push.py; do echo "== $f"; python3 - "$f" <<'E'
import ast,sys
t=ast.parse(open(sys.argv[1]).read()); d=ast.get_docstring(t)
print((d or '(no docstring)')[:300])
E
done; grep -n "dry\|--apply\|--live" tools/zotero_push.py | head -8; grep -n "openalex\|ntrs\|arxiv\|crossref" -i tools/lit_search.py | head -8; grep -n "crossref" -il seeds/*.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:48.106Z
Duration (ms)
225
Execution status
exit 0
Run the invented-reference check and count zero-hit searches — exit 0r12

Stdout

literature/search/candidates_S1.json: 42 records, 0 problems
literature/search/candidates_S2.json: 48 records, 0 problems
literature/search/candidates_S3.json: 45 records, 0 problems
literature/search/candidates_S4.json: 43 records, 0 problems
exit=0
---
queries 332
{'OpenAlex reviews': 13, 'OpenAlex': 153, 'NASA NTRS': 85, 'arXiv': 32, 'OpenAlex refs (backward)': 23, 'OpenAlex cited-by (forward)': 26}
zero-hit queries 119 Counter({'OpenAlex': 71, 'NASA NTRS': 36, 'arXiv': 6, 'OpenAlex reviews': 4, 'OpenAlex refs (backward)': 1, 'OpenAlex cited-by (forward)': 1})
   openalex reaction wheel momentum dumping spacecraft --out
   openalex reaction wheel sizing spacecraft attitude --out
   openalex variable inertia spacecraft attitude control --out
   openalex space robot walking manipulator --out
   openalex LLM planning --out

Exact command

cd /Users/mikek/Zig_ORLO*; python3 literature/search/verify_candidates.py 2>&1 | tail -8; echo "exit=$?"; echo ---; python3 - <<'E'
import json,collections
rows=[json.loads(l) for l in open('literature/search/search_log.jsonl')]
print('queries',len(rows))
c=collections.Counter(r['source'] for r in rows); print(dict(c))
z=[r for r in rows if r['hits']==0]
print('zero-hit queries',len(z), collections.Counter(r['source'] for r in z))
E
python3 literature/search/rerun_false_empty.py 2>&1 | tail -5

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:52.062Z
Duration (ms)
129
Execution status
exit 0
Count false-empty OpenAlex queries and the merged candidate total — exit 0r13

Stdout

65 queries to re-run
   openalex fault-tolerant multi-robot systems task reallocation failed robot --out
   openalex formation flying distributed aperture telescope versus monolithic space --out
   openalex robot team resilience failures survey --out
59
literature/search/breadth_report.md:30:- N063 L3: Zero reaction maneuver: flight validation with ETS-VII space robot and extension to kinematical (2002). Method: zero reaction maneuver (ZRM) with ETS-VII flight data and redundant-arm extension; notebook basis for ZO-26.  `DOI 10.1109/robot.2001.932590`
literature/search/breadth_report.md:43:- N063 (S2; S3): Zero reaction maneuver: flight validation with ETS-VII space robot and extension to kinematically re (2002). `DOI 10.1109/robot.2001.932590`
literature/search/breadth_report.md:64:| N063 | S2; S3 | 3 | 2002 | Zero reaction maneuver: flight validation with ETS-VII space robot and extension | DOI 10.1109/robot.2001.932590 | yoshidaZeroReactionManeuver2002 |
literature/search/breadth_report.md:97:- OpenAlex stopped answering part way through (free daily limit for this network). 65 OpenAlex queries returned a false 0. They are marked in the Search log sheet. Re-run after midnight UTC: `python3 literature/search/rerun_false_empty.py --apply`, then triage the new hits.
literature/search/breadth_report.md:102:- These gaps may mean the user's ZO-25/26/27 work is new. Check again after the re-run.
literature/search/report_S1.md:8:- Many of the 0-hit calls are not real misses. OpenAlex hit its free daily limit part-way (API said "Rate limit exceeded"). Calls after that returned 0 and were cached as empty. I repeated the key topics through NTRS and arXiv, which still worked.
literature/search/report_S1.md:9:- The parent fixed the tool (no error caching) but the OpenAlex daily budget stayed used up. NTRS/arXiv empties were re-run: NTRS 'large telescope assembly cost' and 'CIRAS' now give hits (2 L0 items added); the others are real zeros.
literature/search/report_S1.md:11:- These need a re-run after midnight UTC. Expect more in: degradation & failure rates, formation flying, SBSP, deployables, in-space manufacturing.
merged 161

Exact command

cd /Users/mikek/Zig_ORLO*; python3 literature/search/rerun_false_empty.py 2>&1 | head -4; python3 literature/search/rerun_false_empty.py 2>&1 | grep -c "^ *openalex"; grep -n "false empty\|rate limit\|zero\|0 hits\|re-run\|rerun" -i literature/search/breadth_report.md literature/search/report_S*.md | head -8; python3 -c "
import json
m=json.load(open('literature/search/merged_candidates.json')); print('merged',len(m))"

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:35:56.045Z
Duration (ms)
91
Execution status
exit 0
Draw the pipeline diagram from seed PDFs to Zotero — exit 0r14

Stdout

.walkthrough/figs/pipeline.svg: 0 findings

Exact command

mkdir -p .walkthrough/figs; cat > .walkthrough/figs/pipeline.py <<'E'
from svgfig import Figure
f = Figure()
w = 340
L, R = 40, 420
a = f.node(L, 20, ["Seed references", "harvest.py, split_refs.py", "74 refs from 2 PDFs"], cat=0, w=w)
b = f.node(R, 20, ["Breadth search", "lit_search.py", "332 logged queries"], cat=0, w=w)
c = f.node(L, 150, ["Verify against databases", "run_verify.py, finalize.py", "Crossref, OpenAlex, NTRS"], cat=1, w=w)
d = f.node(R, 150, ["Merge and check", "merge_candidates.py", "161 new rows, N001-N161"], cat=1, w=w)
e = f.node(L, 280, ["Triage", "triage.json", "stage, topic, read level"], cat=2, w=w)
g = f.node(R, 280, ["No invented papers", "verify_candidates.py", "match raw API answer"], cat=1, w=w)
h = f.node(230, 410, ["Workbook", "lit_tool.py import-json", "235 Papers rows"], cat=2, w=w)
i = f.node(230, 540, ["Rules", "lit_tool.py check", "exit 1 on any error"], cat=3, w=w)
j = f.node(230, 670, ["Zotero", "zotero_push.py", "dry run by default"], cat=0, w=w)
f.arrow(a.b, c.t)
f.arrow(b.b, d.t)
f.arrow(c.b, e.t)
f.arrow(d.b, g.t)
f.connector([e.b, (e.cx, 365), (h.cx-80, 365), (h.cx-80, h.t[1])], color="cat2")
f.connector([g.b, (g.cx, 365), (h.cx+80, 365), (h.cx+80, h.t[1])], color="cat2")
f.arrow(h.b, i.t)
f.arrow(i.b, j.t)
f.save(".walkthrough/figs/pipeline.svg")
E
"$WALKTHROUGH_FIGKIT/run.sh" .walkthrough/figs/pipeline.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:05.809Z
Duration (ms)
300
Execution status
exit 0

Figure artifacts

  • .walkthrough/figs/r14-pipeline.svg · 7160 bytes
    SHA-256: a9975dc4cb7d72fca52e0f20e19b02ee6aeefd14bd09b534fce1ba1ccc8b398a
    figkit lint: 0 findings
    Embedded as text outlines: .walkthrough/figs/r14-pipeline.outlined.svg · SHA-256 b493dcab3b486e0131b2c3d32ebc5535c6ea287e7024bff9de41cc3b6a864013

Requested artifact: .walkthrough/figs/pipeline.svg

Redraw the pipeline with the invented-paper check before the merge — exit 0r15

Stdout

6:b = f.node(R, 20, ["Breadth search", "lit_search.py", "332 logged queries"], cat=0, w=w)
8:d = f.node(R, 150, ["Merge and check", "merge_candidates.py", "161 new rows, N001-N161"], cat=1, w=w)
10:g = f.node(R, 280, ["No invented papers", "verify_candidates.py", "match raw API answer"], cat=1, w=w)
.walkthrough/figs/pipeline.svg: 0 findings

Stderr

sed: 1: ".walkthrough/figs/pipel ...": invalid command code .

Exact command

cd /Users/mikek/Zig_ORLO*; sed -i 's|d = f.node(R, 150, \["Merge and check", "merge_candidates.py", "161 new rows, N001-N161"\], cat=1, w=w)|d = f.node(R, 150, ["No invented papers", "verify_candidates.py", "match raw API answer"], cat=1, w=w)|; s|g = f.node(R, 280, \["No invented papers", "verify_candidates.py", "match raw API answer"\], cat=1, w=w)|g = f.node(R, 280, ["Merge, dedupe", "merge_candidates.py", "161 new rows, N001-N161"], cat=1, w=w)|' .walkthrough/figs/pipeline.py; grep -n "node(R" .walkthrough/figs/pipeline.py; "$WALKTHROUGH_FIGKIT/run.sh" .walkthrough/figs/pipeline.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:18.827Z
Duration (ms)
190
Execution status
exit 0

Figure artifacts

  • .walkthrough/figs/r15-pipeline.svg · 7160 bytes
    SHA-256: a9975dc4cb7d72fca52e0f20e19b02ee6aeefd14bd09b534fce1ba1ccc8b398a
    figkit lint: 0 findings
    Embedded as text outlines: .walkthrough/figs/r15-pipeline.outlined.svg · SHA-256 b493dcab3b486e0131b2c3d32ebc5535c6ea287e7024bff9de41cc3b6a864013

Requested artifact: .walkthrough/figs/pipeline.svg

Plot new papers per stage by read level from the workbook export — not run (report-only)r16

Not run: commands may write only under .walkthrough/figs/; the rest of .walkthrough/ belongs to the walkthrough tools.

Exact command

cd /Users/mikek/Zig_ORLO*; cat > .walkthrough/figs/levels.py <<'E'
import json, collections
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
p = json.load(open('/tmp/papers_wt.json'))
N = [r for r in p if str(r['seed_id']).startswith('N')]
stages = ['S1', 'S2', 'S3', 'S4']
names = ['S1 Value', 'S2 Method', 'S3 Improvement', 'S4 Robustness']
tab = {s: collections.Counter() for s in stages}
for r in N:
    for s in str(r['stage']).split(';'):
        tab[s.strip()][int(r['read_level'])] += 1
cols = {0: '#c9ced6', 1: '#8fb8de', 2: '#3b7bbf', 3: '#c0392b'}
fig, ax = plt.subplots(figsize=(8, 3.6), dpi=110)
bottom = [0]*4
for lv in range(4):
    vals = [tab[s][lv] for s in stages]
    ax.bar(names, vals, bottom=bottom, color=cols[lv], label=f'Level {lv}', edgecolor='white')
    for i, v in enumerate(vals):
        if v >= 3:
            ax.text(i, bottom[i]+v/2, str(v), ha='center', va='center', fontsize=8,
                    color='white' if lv >= 2 else '#222')
    bottom = [b+v for b, v in zip(bottom, vals)]
for i, b in enumerate(bottom):
    ax.text(i, b+1, str(b), ha='center', fontsize=9, fontweight='bold')
ax.set_ylabel('New papers kept (count)')
ax.set_ylim(0, 65)
ax.spines[['top', 'right']].set_visible(False)
ax.legend(title='Read level (0 = log only, 3 = read closely)', fontsize=8, title_fontsize=8, frameon=False, ncol=4, loc='upper center', bbox_to_anchor=(0.5, 1.2))
fig.tight_layout()
fig.savefig('.walkthrough/figs/levels.svg')
print({s: dict(sorted(tab[s].items())) for s in stages})
E
python3 .walkthrough_dummy 2>/dev/null; python3 .walkthrough/figs/levels.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:19.247Z
Execution status
not run (report-only)

Requested artifact: .walkthrough/figs/levels.svg

Redraw the pipeline with the invented-paper check before the merge — exit 0r17

Stdout

.walkthrough/figs/pipeline.svg: 0 findings

Exact command

cat > .walkthrough/figs/pipeline.py <<'E'
from svgfig import Figure
f = Figure()
w = 340
L, R = 40, 420
a = f.node(L, 20, ["Seed references", "harvest.py, split_refs.py", "74 refs from 2 PDFs"], cat=0, w=w)
b = f.node(R, 20, ["Breadth search", "lit_search.py", "332 logged queries"], cat=0, w=w)
c = f.node(L, 150, ["Verify against databases", "run_verify.py, finalize.py", "Crossref, OpenAlex, NTRS"], cat=1, w=w)
d = f.node(R, 150, ["No invented papers", "verify_candidates.py", "match raw API answer"], cat=1, w=w)
e = f.node(L, 280, ["Triage", "triage.json", "stage, topic, read level"], cat=2, w=w)
g = f.node(R, 280, ["Merge and dedupe", "merge_candidates.py", "161 new rows, N001-N161"], cat=1, w=w)
h = f.node(230, 410, ["Workbook", "lit_tool.py import-json", "235 Papers rows"], cat=2, w=w)
i = f.node(230, 540, ["Rules", "lit_tool.py check", "exit 1 on any error"], cat=3, w=w)
j = f.node(230, 670, ["Zotero", "zotero_push.py", "dry run by default"], cat=0, w=w)
f.arrow(a.b, c.t)
f.arrow(b.b, d.t)
f.arrow(c.b, e.t)
f.arrow(d.b, g.t)
f.connector([e.b, (e.cx, 365), (h.cx-80, 365), (h.cx-80, h.t[1])], color="cat2")
f.connector([g.b, (g.cx, 365), (h.cx+80, 365), (h.cx+80, h.t[1])], color="cat2")
f.arrow(h.b, i.t)
f.arrow(i.b, j.t)
f.save(".walkthrough/figs/pipeline.svg")
E
"$WALKTHROUGH_FIGKIT/run.sh" .walkthrough/figs/pipeline.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:29.305Z
Duration (ms)
188
Execution status
exit 0

Figure artifacts

  • .walkthrough/figs/r17-pipeline.svg · 7161 bytes
    SHA-256: c8903ba0e418956b169564c387a8f40c04d353f4fa94dd3d786b8dd9a6075747
    figkit lint: 0 findings
    Embedded as text outlines: .walkthrough/figs/r17-pipeline.outlined.svg · SHA-256 49501c2fb28216d5be869649dab16a737e7db45bb3b322693f8b5faad8b107f7

Requested artifact: .walkthrough/figs/pipeline.svg

Plot new papers per stage by read level from the workbook export — exit 0r18

Stdout

{'S1': {0: 31, 1: 11, 2: 1}, 'S2': {0: 32, 1: 8, 2: 5, 3: 4}, 'S3': {0: 36, 1: 12, 2: 4, 3: 3}, 'S4': {0: 31, 1: 9, 2: 3}}

Exact command

cat > .walkthrough/figs/levels.py <<'E'
import json, collections
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
p = json.load(open('/tmp/papers_wt.json'))
N = [r for r in p if str(r['seed_id']).startswith('N')]
stages = ['S1', 'S2', 'S3', 'S4']
names = ['S1 Value', 'S2 Method', 'S3 Improvement', 'S4 Robustness']
tab = {s: collections.Counter() for s in stages}
for r in N:
    for s in str(r['stage']).split(';'):
        tab[s.strip()][int(r['read_level'])] += 1
cols = {0: '#c9ced6', 1: '#8fb8de', 2: '#3b7bbf', 3: '#c0392b'}
fig, ax = plt.subplots(figsize=(8, 3.8), dpi=110)
bottom = [0]*4
for lv in range(4):
    vals = [tab[s][lv] for s in stages]
    ax.bar(names, vals, bottom=bottom, color=cols[lv], label=f'Level {lv}', edgecolor='white')
    for i, v in enumerate(vals):
        if v >= 3:
            ax.text(i, bottom[i]+v/2, str(v), ha='center', va='center', fontsize=8,
                    color='white' if lv >= 2 else '#222')
    bottom = [b+v for b, v in zip(bottom, vals)]
for i, b in enumerate(bottom):
    ax.text(i, b+1, str(b), ha='center', fontsize=9, fontweight='bold')
ax.set_ylabel('New papers kept (count)')
ax.set_ylim(0, 65)
ax.spines[['top', 'right']].set_visible(False)
ax.legend(title='Read level (0 = log only, 3 = read closely)', fontsize=8, title_fontsize=8, frameon=False, ncol=4, loc='upper center', bbox_to_anchor=(0.5, 1.25))
fig.tight_layout()
fig.savefig('.walkthrough/figs/levels.svg')
print({s: dict(sorted(tab[s].items())) for s in stages})
E
python3 .walkthrough/figs/levels.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:29.719Z
Duration (ms)
347
Execution status
exit 0

Figure artifacts

  • .walkthrough/figs/r18-levels.svg · 44335 bytes
    SHA-256: 25c2e62f0a32c529b2a5bd2658f6165bad557190c34362e3904b1ba5c073c9ff

Requested artifact: .walkthrough/figs/levels.svg

Draw how import-json matches a record to a row — exit 0r19

Stdout

.walkthrough/figs/upsert.svg: 0 findings

Exact command

cat > .walkthrough/figs/upsert.py <<'E'
from svgfig import Figure
f = Figure()
w = 300
rec = f.node(250, 20, ["One JSON record", "fields = Papers columns"], cat=0, w=w)
s1 = f.node(40, 140, ["1. Match seed_id", "idx_seed"], cat=1, w=w)
s2 = f.node(40, 250, ["2. Match citekey", "idx_ck"], cat=1, w=w)
s3 = f.node(40, 360, ["3. Match DOI", "id_type is DOI, lower case"], cat=1, w=w)
upd = f.node(460, 250, ["Update that row", "only non-empty fields", "never delete"], cat=2, w=w)
new = f.node(250, 490, ["Add a new row", "after the last data row"], cat=3, w=w)
f.arrow(rec.b, s1.t) if False else f.connector([rec.l, (s1.cx, rec.l[1]), (s1.cx, s1.t[1])], color="cat0")
f.arrow(s1.b, s2.t)
f.arrow(s2.b, s3.t)
f.tag(s1.cx+22, (s1.b[1]+s2.t[1])/2+4, "no")
f.tag(s2.cx+22, (s2.b[1]+s3.t[1])/2+4, "no")
f.connector([s1.r, (upd.cx, s1.r[1]), (upd.cx, upd.t[1])], color="cat2")
f.arrow(s2.r, upd.l)
f.connector([s3.r, (upd.cx, s3.r[1]), (upd.cx, upd.b[1])], color="cat2")
f.tag(s1.r[0]+40, s1.r[1]-10, "hit")
f.tag(s2.r[0]+40, s2.r[1]-10, "hit")
f.tag(s3.r[0]+40, s3.r[1]-10, "hit")
f.connector([s3.b, (s3.cx, 440), (new.cx, 440), (new.cx, new.t[1])], color="cat3")
f.tag(s3.cx+22, 425, "no")
f.save(".walkthrough/figs/upsert.svg")
E
"$WALKTHROUGH_FIGKIT/run.sh" .walkthrough/figs/upsert.py

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:36:37.562Z
Duration (ms)
196
Execution status
exit 0

Figure artifacts

  • .walkthrough/figs/r19-upsert.svg · 5774 bytes
    SHA-256: db2eb715325a93c81e14d0a00dba68dbb011e5befd15451c4202d5ee9bdcea48
    figkit lint: 0 findings
    Embedded as text outlines: .walkthrough/figs/r19-upsert.outlined.svg · SHA-256 8723f246977fbef10205e5079fda47a53518ea5f1b3df2e245e1079ea06195e5

Requested artifact: .walkthrough/figs/upsert.svg

Working tree when walkthrough_write was called (taken by the tool, not the agent) — exit 0r20

Stdout

 M .DS_Store
 M backlog/.DS_Store
 M notebooks/zo25/01_angular_momentum_basics.ipynb

Exact command

git status --porcelain --untracked-files=all -- . ':(exclude).walkthrough'

Technical metadata

Working directory
/Users/mikek/Zig_ORLO*
Started
2026-10-29T01:38:06.858Z
Duration (ms)
34
Execution status
exit 0
Snapshot
after
Recorded tree snapshot
{
  ".DS_Store": "21f33d16dbfbe2de36bb409f0a862df4f6776cf2b0d55c217da8f8e54e2d4517",
  "backlog/.DS_Store": "2606164498ffde2ebfb61f5f046c8023cf022462ef960db660289637caf2d2bc",
  "notebooks/zo25/01_angular_momentum_basics.ipynb": "8f045d7f7cf02a26e8f5a2c5283a722f17e64cc2ed1df95d4c647598767bd460",
  ".pi/": "directory",
  ".pytest_cache/": "directory",
  "Literature Review/": "directory",
  "Reaction Wheel/": "directory",
  "__pycache__/": "directory",
  "backlog/": "directory",
  "deliverables/": "directory",
  "literature/": "directory",
  "notebooks/": "directory",
  "outputs/": "directory",
  "tests/": "directory",
  "walkthrough/": "directory"
}
Report metadata
Repository
Zig_ORLO*
Branch
main
Commit
3f58563
Working tree
uncommitted changes
Recorded on
2026-10-29 01:38
Model
MIT-parley/bedrock/claude-sonnet-5-5
Budget
30 commands (this run), 10 min total (this run)
Working directory
/Users/mikek/Zig_ORLO*