Skip to content

ci(ratchet): record core size per release and catch genre logic inside core - #385

Merged
airmang merged 1 commit into
mainfrom
ci/size-and-leak-ratchet
Oct 2, 2026
Merged

airmang merged 1 commit into
mainfrom
ci/size-and-leak-ratchet

Conversation

@airmang

@airmang airmang commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Closes #384.

What

  • Size history — docs/size-history.json, one entry per release: total lines, lines per subpackage, hwpx modules loaded by import hwpx, import ms (recorded, never gated). Seeded from tags:

    release lines import hwpx modules import ms
    5.0.1 36,244 70 58
    6.0.0 45,311 94 66
    6.6.0 72,464 114 79
    6.7.0 78,053 117 77

    scripts/size_ratchet.py prints the working tree against the last release per package; --record <version> appends an entry (new step 10 in docs/release-runbook.md). No per-PR line gate, so parallel PRs don't conflict on it.

  • Import breadth bound — tests/data/import_breadth.json (maxImportedModules: 117). Loading more modules fails with a hint (import lazily, or raise the bound in the same change and say why). Loading fewer passes with a warning to run --lower-bound.

  • Function-level layer guard — scripts/layer_leak_guard.py scans product modules for Hangul regex literals and the sections/blocks plan-schema keys. Today's 9 hits are in tests/data/layer_leak_allowlist.json with a reason each: format vocabulary (Hancom outline style names, a file-name sanitizer) or known leaks scheduled to move in 7.0. Two known leaks the scan cannot see (no Hangul in the pattern) are listed by name and must keep existing until they move. The failure message points to the placement test in docs/architecture/product-boundary.md.

Tests

  • tests/test_size_ratchet.py (5), tests/test_layer_leak_guard.py (14), including a synthetic new Hangul regex that must fail.
  • Checked on the real tree, then reverted: a 공고 제N호 regex added to doc_diff.py fails the guard; a bound of 116 fails the breadth test.
  • Full suite: 5676 passed, 19 skipped, 1 xfailed. ruff, mypy, pyright (0), census, hygiene, capabilities --verify, contract-docs sync pass.

No src/hwpx change.

🤖 Generated with Claude Code

…e core

Core doubled in two months with nothing making it visible, and the
path-based ownership ledger cannot see application logic inside a
core-owned file.

- scripts/size_ratchet.py + docs/size-history.json: per-release lines under
  src/hwpx, per top-level subpackage, the hwpx modules `import hwpx` loads
  in an isolated interpreter, and its import time. Seeded from v5.0.1,
  v6.0.0, v6.6.0 and v6.7.0 via git archive. Recorded during release prep
  (runbook step), not gated per pull request; the test only checks the file
  is well formed and not ahead of the pyproject version.
- tests/data/import_breadth.json: upper bound on the module count. More
  modules fails; fewer passes with a hint to tighten it.
- scripts/layer_leak_guard.py + tests/data/layer_leak_allowlist.json: AST
  scan for Hangul regex patterns and document-plan "sections"/"blocks"
  keys, every existing hit classified as format vocabulary or a known leak
  scheduled to move in 7.0; known leaks the scan cannot see are listed by
  name and must still exist.

docs/architecture/product-boundary.md explains both and how to update them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@airmang
airmang merged commit c14bf7a into main Oct 2, 2026
13 checks passed
@airmang
airmang deleted the ci/size-and-leak-ratchet branch October 2, 2026 16:35
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.

Make core growth visible: per-release size history, import-breadth bound, function-level layer guard

1 participant