Skip to content

chore: canonical-key TODO sweep (candidates script + verified batch) #145

Closed

Description

@Jammy2211

Overview

Wiki source and seed pages still carry **Canonical BibTeX key:** TODO markers (388 sections at 965d45f, up from the 345 counted in #24 now that seed/ is walked). Many already have a matching entry in bibliography/pyautomemory.bib. This task adds a read-only matching script that ranks candidates, then fills a first batch of sections whose match was verified against the public paper record. Uncertain matches stay TODO.

Plan

  • Add scripts/canonical_key_candidates.py. It finds every TODO section, matches it against the canonical bib by DOI, then arXiv id, then first-author + year ranked by title overlap with the heading tag, and prints a candidates report. It never writes keys.
  • Add unit tests for the script.
  • Pick the unambiguous candidates in the cti and lensing wikis: one entry for that author+year, a title that fits the heading tag, and a DOI or arXiv id on the entry.
  • Check each one against the public record (DOI/arXiv id → title, first author, year). Fill only the key and the Reference: line. Supports/Use when claims stay TODO because claim support is a separate reading task.
  • Run make validate and make test. List the residual sections in the PR, along with the reason each one stays TODO (duplicate bib entries, title mismatch, no identifier).

Tier: notify — merge mode: auto-merge on green (in-turn wait, then /prm close-out). Batch contract overrides: this run ends at PR-open and the human merges via /prm.

Detailed implementation plan

Affected Repositories

  • PyAutoMemory (primary)

Branch Survey

Repository Current Branch Dirty?
./PyAutoMemory main clean

Suggested branch: feature/canonical-key-todo-sweep

Implementation Steps

  1. scripts/canonical_key_candidates.py: reuses SOURCE_SECTION / source_directories from validate_literature_citations.py. It parses bib entries (key, first-author surname folded to ASCII, year, title, doi, arXiv) and outputs a Markdown or --json report.
  2. tests/test_canonical_key_candidates.py: covers parsing, author folding, DOI-exact ranking, author+year ranking and confidence labels.
  3. Fill the verified sections: **Canonical BibTeX key:** \Key`andReference: <title>; doi:|arXiv:; `.
  4. Validate with make validate and python -m pytest tests -q.

Key Files

  • scripts/canonical_key_candidates.py: new candidates report
  • wiki/{cti,lensing}/sources/*.md: filled sections
  • bibliography/pyautomemory.bib: unchanged unless a verified entry is missing

Original Prompt

Click to expand starting prompt

Type: maintenance · Target: PyAutoMemory · Autonomy: safe · Consequence: notify

345 source-page sections across the wikis still carry "Canonical BibTeX key: TODO — no unique match found in bibliography/pyautomemory.bib" markers (count from the 2026-07-16 structure-cleanup audit, PyAutoMemory#24)…

Task: pair a matching script with a human verification loop to burn down the TODO count.

  • Script: for each TODO section, extract the section heading (Author Year — tag) and any partial reference text; match against bibliography/pyautomemory.bib by author+year key stem, DOI, arXiv ID, then normalized title. Emit a ranked candidates report (section -> candidate keys + confidence), never auto-writing keys.
  • Human loop: verify each proposed match against the public paper record before filling the section (per bibliography/README.md: never fabricate; uncertain stays TODO). Where no canonical entry exists, add verified metadata first.
  • Batch by wiki (cti and galaxies have the densest TODO clusters); run make validate after each batch.
  • Success: TODO count meaningfully down with zero fabricated keys; report the residual genuinely-unidentifiable sections.

Context: PyAutoMemory#24 design-note follow-up #1. The 856 canonical entries not yet cited by any wiki page are explicitly OUT of scope.

Full prompt: PyAutoMind active/canonical_key_todo_sweep.md.

Activity

  1. Jammy2211 commented on Nov 8, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    Merged in #146 (merge commit 855eead).

    • TODO count: Canonical BibTeX key: TODO went from 388 to 77. 290 sections are filled with a canonical key checked against the public record, and 21 placeholder sections were removed because they were not papers.
    • New script: scripts/canonical_key_candidates.py is a read-only report of ranked candidates, covered by 9 tests.
    • Bib cleanup:
      • 61 duplicate entries removed.
      • 2 mis-keyed entries renamed: Do2014, Sanghvi2014.
      • 6 corrupted entries repaired.
      • 28 new entries added, each with a DOI or arXiv id.
      • 3 entries that had no identifier now have one.
    • Residual 77: these are ambiguous, not found on the public record, or held. The list is in the PR body, and python -m scripts.canonical_key_candidates regenerates it.

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions