ci(ratchet): record core size per release and catch genre logic inside core - #385
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #384.
What
Size history —
docs/size-history.json, one entry per release: total lines, lines per subpackage, hwpx modules loaded byimport hwpx, import ms (recorded, never gated). Seeded from tags:import hwpxmodulesscripts/size_ratchet.pyprints the working tree against the last release per package;--record <version>appends an entry (new step 10 indocs/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.pyscans product modules for Hangul regex literals and thesections/blocksplan-schema keys. Today's 9 hits are intests/data/layer_leak_allowlist.jsonwith 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 indocs/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.공고 제N호regex added todoc_diff.pyfails the guard; a bound of 116 fails the breadth test.capabilities --verify, contract-docs sync pass.No
src/hwpxchange.🤖 Generated with Claude Code