SPB Git

spb/wp45_uqo

Public
7.4 KB · 55 lines markdown
1# PROGRESS — WP45 / JoF-25023Verified milestones only. Times are America/Toronto unless marked UTC. Code versions refer to `git rev-parse --short HEAD`.45## Amendments (decisions taken by the executor, to be ratified by the author)67| ID | Date | Decision | Rationale |8|---|---|---|---|9| A-001 | 2026-11-03 | API budget envelope fixed at **90 USD** (initially 60, raised before the annotation run once the per-document cost was measured at ≈0.09 USD on Opus 5.5) (config/models.yaml `budget_usd_cap`) for annotation + pilot experiments, `claude-sonnet-5-5`, key from `~/Desktop/Cluster/secrets/wp42/.env` | Mandate forbids spending without authorization; the author's standing practice on WP26/WP29/WP42/WP44 is an executor-fixed envelope logged as an amendment. Every call is logged in `data/annotations/api_ledger.jsonl`. |10| A-002 | 2026-11-03 | Corpus scope = the 4 volumes present in the folder (72–75, 2017–2020), 277 documents, not the « ~250 of 2018–2020 » of the mandate | The folder contains 2017 (downloaded on request the same day); all pre-ChatGPT; year is a stratification variable. |11| A-003 | 2026-11-03 | Global install of the Claude Code commands/skill/agents under `~/.claude/` (prefix `jof-`) | Explicit user request « accessible à toutes les sessions Claude Code ». |1213## Phase 0 — Host audit (2026-11-03 17:30)14- macOS 27.0 (Darwin 27.0.0), Apple Silicon laptop; Claude Code **2.1.317**; Python 3.14 system, 3.11/3.12 via uv 0.11.7; PyMuPDF 1.27 available; `pdftotext` (poppler) present; GROBID not installed, Docker daemon not running → **PyMuPDF chosen** (local, no server); LaTeX: TeX Live (latexmk/pdflatex/biber).15- Global `~/.claude/commands` already holds `cluster-*` commands (untouched). `~/.claude/settings.json` has an auto-approve PreToolUse hook (not modified).16- Corpus folder `~/Desktop/Journal-of-Finance-2018-2020`: 277 PDF + `index.csv` + `_outils/` (download scripts). Original PDFs are never written to.1718## Phase 1 — Corpus inventory (2026-11-03 17:36) ✅19- `jof250 corpus audit` → `data/manifests/{corpus_manifest.parquet,corpus_manifest.csv,corpus_audit.md,corpus_v1_frozen.json,crossref_cache.json,inventory_ledger.jsonl}`.20- Files scanned 278; **277 included at first** (2017: 63, 2018: 65, 2019: 74, 2020: 75); excluded 1 (`index.csv`, non-PDF) — **revised to 276 in Phase 2** after the AFA 2021 preliminary program (labelled ARTICLES in the Wiley TOC) was excluded (2020: 74; 11 735 pages); 0 SHA-256 duplicates; 0 DOI duplicates.21- Types: 268 articles (incl. presidential addresses), 8 replications/corrigenda, 1 retracted article (Rampini–Viswanathan–Vuillemey 2020, kept and flagged).22- **Crossref verification: 277/277** records status 200, container « The Journal of Finance », title similarity ≥ 85 (public API, polite pool).23- Pages: 11 775 total, median 43 per document; 230.6 MB.24- Fixes during the phase: ligature « fi » (U+FB01) in PDF text broke DOI regex → NFKC normalization; presidential address opens with a portrait page → validity checks the first three pages.2526## Open blockers27- Human inter-rater audit of annotations and blind human evaluation (Phase 7) require qualified human reviewers: **not available in this session** → protocols and sheets prepared, results reported as model-judge only (see LIMITATIONS.md).2829## Phase 2 — Structured extraction (2026-11-03 18:00) ✅30- `jof250 corpus parse` (parser `pymupdf-jof-heuristics-1.3`): 276/276 documents parsed, 0 failures, mean confidence 0.951; 3 documents < 0.8 (all corrigenda/notes, expected).31- Medians over the corpus: 43 pages, 10 965 body words, 5 numbered sections, 8 tables, 3 figures, 10 numbered equations, 38 footnotes, 52 references, 101-word abstract.32- Parser QA (`scripts/02_parser_qa.py`, 26-document stratified sample vs `pdftotext` regex): sections exact 85% (26/26 after adjudication of appendix sub-headings), tables within ±1 96%, figures exact 92%, references within 10% 92%, abstract presence 100%; parsed title vs Crossref title ≥ 90 similarity for 98.9% of all 276 documents. Equation counts are approximate (reference regex is noisy). Not a human gold standard (see LIMITATIONS.md).33- Fixes along the way: odd/even page margins for hanging-indent references; rotated (landscape) tables; figure captions whose first span only is bold; figure-internal text excluded from footnotes; DOI lines excluded from references; the AFA preliminary program (labelled ARTICLES in the TOC) excluded from the corpus (276 included).3435## Phase 3 — Ontology annotation (started 2026-11-03 17:55)36- Schema v1.0 (`src/jof250/rhetoric.py`), prompt `document_annotation` v1.0, model claude-opus-5-5 effort medium; the API grammar for structured outputs rejected the full schema ("compiled grammar too large") → JSON requested in the prompt + strict local JSON-schema validation; invalid annotations are re-run.37- Pilot on 2 documents: ≈ 7.9k input / 2.3k output tokens, 0.08–0.10 USD per document.38- Full run (2026-11-03 17:55→18:30, 4 workers): 276/276 documents annotated; first pass 228 schema-valid, 48 invalid (extra `*_note` keys, mis-nested objects, 7 non-JSON). Deterministic, auditable **repair** (drop unknown keys / hoist mis-nested keys, recorded in `repairs`) fixed 38; an uncached retry with the validation errors echoed fixed the remaining 10 → **276/276 valid**. Cost 22.09 USD (≈ 0.08 USD/doc).39- Model–rule agreement (train, n = 221): section-role agreement median 1.00; roadmap LLM vs regex agree on most documents; see `numbers.tex` macros `\roleAgreementMedian`, `\roadmapAgree`, `\contribAgree`.4041## Phase 4 — Profiles (2026-11-03 18:35) ✅42- `jof250 profiles build` on the train split (221 docs): 8 profiles (`profiles/*.yaml`): corpus_all 221, empirical_all 173, empirical_asset_pricing 58, household_behavioral 32, theoretical_finance 32, corporate_finance 28, intermediation/banking 21, financial_econometrics 8 (too small; falls back to empirical_all in the engine). Medians/IQR/bootstrap CIs; figures `fig_structure_distributions`, `fig_abstract_moves`, `fig_contribution_position`, `fig_moves_robustness`.43- Known measurement limit: table standard-error conventions are mostly "unclear" to the annotator because table notes are capped at 350 chars per table in the payload (rights policy) — reported as such.4445## Phase 5 — Retrieval + engine (2026-11-03 18:00–18:40) ✅46- Index: 9 642 units over 276 docs (all annotated), MiniLM-L6 (384-d, local) + BM25; held-out split excluded from retrieval by default; ≤ 2 units per document; provenance on every hit.47- Engine demo (real): `experiments/outputs/demo/wp41_intro_upgrade_E.tex` (+ report, diff, audit; 2 calls, 0.37 USD, 108 s) and `wp29_referee.md` (0.19 USD). Manuscripts untouched.4849## Phase 6 — Claude Code integration (2026-11-03 18:05) ✅50- Project scope: 10 commands, 7 agents, 1 skill (`.claude/`). User scope installed on explicit request (A-003); registration verified: the `jof250` skill and `/jof-*` commands appear in the running Claude Code session.51- Separate-project test: `/jof-audit` run headlessly in `/tmp/sample-paper` → `experiments/outputs/demo/separate_project_test.md`.5253## Phase 7 — Preregistration frozen (commit 87c73cd) and benchmark launched (2026-11-03 18:40)54- `experiments/preregistration.md`; fixtures from held-out docs jof_12439 (corporate/intermediation) and jof_12777 (credit spreads / asset pricing) + WP29 (out-of-domain); plan: 199 runs (A–E ×27, 4 ablations ×16), 27 judge sets (+25% second pass); estimated 46 USD.55
Files · 62a9da723bfa8125e943fa9f6b4bc31044d26d0e
Menu

Theme