Skip to content

refactor(real-history): repair lint and split build_real_corpus.py (Refs #890) - #893

Merged
alex-mextner merged 6 commits into
mainfrom
fix-859-lint
Oct 28, 2026
Merged

alex-mextner merged 6 commits into
mainfrom
fix-859-lint

Conversation

@alex-mextner

@alex-mextner alex-mextner commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Refs #890

Main fails the universal Rig lint after the real-history KPI gate landed (#827, merged as 366918f): 31 ruff-check errors, one ruff-format file, and two handwritten files over the 1200-line warning limit. This PR is one atomic repair of all three, so main needs one release instead of two.

What changed

  • Ruff repair of the four real-history Python files: the same commit as the lint-only PR fix(lint): repair ruff findings in scripts/real-history (Refs #891) #892, cherry-picked unchanged (follow-up ticket Repair ruff findings in scripts/real-history from the intent engine PR #891). It is not duplicated work: if that PR lands first, this one rebases onto it.
  • scripts/real-history/build_real_corpus.py (1461 lines) is split into corpus_sources.py (inputs and rows), corpus_turns.py (entities, profile, turns), corpus_gates.py (output gates) and the CLI entry build_real_corpus.py. The entry name and arguments are unchanged.
  • src/services/intent/seed-calendar.ts (1347 lines) is split into seed-calendar-vocab.ts, seed-calendar-read.ts, seed-calendar-free.ts and the assembling seed-calendar.ts. The only importer, seed-catalog.ts, is unchanged.
  • One small defect fix found in review: OpenedDb now removes the unpacked temp copy when a corrupt .gz or a failed open stops it half-way (private chat data stayed in the system temp directory). A synthetic regression test covers it.

Behaviour proof (no corpus, no database, no benchmark touched)

  • Seed: the serialized calendarFamilies (12 families, names, field order, pattern hashes) has the same sha256 before and after: 20471407d4da23db97213ca7d8f53e5798beb719475d7b141cdfc0ee8021c836. No seed text, ID, link, version, model or KPI changed; no benchmark result file touched.
  • Python: the AST of all 109 top-level definitions is identical before and after, except _scan_record, which is now scan_record because gates and entry live in different modules (no other caller exists).
  • Synthetic end-to-end run of the split pipeline (scan, audit, build, verify on invented SQLite, gzip and log fixtures in a temp dir) gives the same canonical hash as the lint-only tree: 2a69f0f7158c2526220f3748e5f6edbae940d6ae50012d7dc88c84f058215b41. Input bytes unchanged, no residual temp files, same exit codes.

No lint suppression, config change or threshold change. uv.lock (1343 lines) stays a known warning.

@alex-mextner alex-mextner changed the title refactor: repair real-history lint and split the two oversized files (Refs #890) refactor(real-history): repair lint and split build_real_corpus.py (Refs #890) Oct 28, 2026
@alex-mextner
alex-mextner merged commit e05e318 into main Oct 28, 2026
12 checks passed
@alex-mextner
alex-mextner deleted the fix-859-lint branch October 28, 2026 22:50
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.

1 participant