Skip to content

build(sz): raise every core cap by 10 lines, and re-ratchet the baseline - #771

Merged
sv merged 1 commit into
mainfrom
claude/pr-issue-triage-swm02f
Sep 7, 2026
Merged

sv merged 1 commit into
mainfrom
claude/pr-issue-triage-swm02f

Conversation

@sv

@sv sv commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What

Raises each per-file core cap in sz-baseline.json by 10 lines, and regenerates the ratchet with sz.py --update-baseline. Only sz-baseline.json changes — no core code is touched, and nothing a caller of the service or the MCP wrapper sees changes.

core/app.py     1020 -> 1030      core/limit.py    183 ->  193
core/config.py    63 ->   73      core/store.py   1000 -> 1010
core/didkey.py    57 ->   67      core_total      3000 -> 3010

Why

main is currently red. Merging #156 (e7675dc) put core/didkey.py at 59 code lines against a cap of 57, so sz.py --check fails twice over — for growth past the ratchet, and for the cap itself:

core code-lines grew vs sz-baseline.json: core/didkey.py 57 -> 59 (cap 57)
core code-lines past cap: core/didkey.py 59 > cap 57

The alternative was shaving two lines back off #156, which is the wrong trade: the leading-zero fix reads well as written, and CONTRIBUTING is explicit that a low line count is a constraint rather than a score.

Headroom before this was 1, 0, -2, 0 and 8 lines across the five core files, which is the condition #656 reports — ordinary changes were failing as cap breaches rather than as ratchet growth, so the ceiling stopped being a decision anyone made deliberately. 10 lines each restores that without moving core_total far (694 lines of headroom remain).

Caps are policy and were edited by hand; the files block is measurement and comes from --update-baseline, which carries caps forward untouched. That regeneration also absorbs drift already on main from earlier merges: core/app.py comment lines, and core/store.py down 994 -> 992, which the ratchet permits since it only moves down.

This is the maintainer-side half of the sz-baseline.json rule in CONTRIBUTING, so it deliberately does not come from a fork.

Checks

  • uv run coverage run -m pytest tests -q && uv run coverage report — 750 passed, 1 skipped; 97.97% total
  • uv run ruff check . && uv run ruff format --check . and uv run ty check — all clean
  • Docs that would now be wrong are updated: none — no documented behaviour changes
  • New surface on a world-writable service: nothing new — this is a build-time policy file with no runtime effect

uv run sz.py --check and uv run sz.py --caps both exit 0 with this applied.

🤖 Generated with Claude Code

https://claude.ai/code/session_013sbowG1MTBENc8kd9tJknM


Generated by Claude Code

Merging #156 put `core/didkey.py` at 59 code lines against a cap of 57, so
`sz.py --check` fails on `main`: once for growth past the ratchet, and once
for the cap itself.

Rather than shave the two lines back off a fix that reads well as written,
this raises each policy ceiling by 10 and regenerates the ratchet from the
tree with `sz.py --update-baseline`. Four of the five core files had 0-1
lines of headroom before this, which is the condition #656 reports: ordinary
changes were failing as cap breaches rather than as ratchet growth, and the
cap stops being a decision anyone makes deliberately.

Caps are policy, so they move only by hand:

  core/app.py     1020 -> 1030      core/limit.py    183 ->  193
  core/config.py    63 ->   73      core/store.py   1000 -> 1010
  core/didkey.py    57 ->   67      core_total      3000 -> 3010

The `files` block is measurement, not policy: `--update-baseline` refreshes
it from the tree and carries the caps forward untouched. It also absorbs
drift already on `main` from earlier merges — `core/app.py` comment lines,
and `core/store.py` down 994 -> 992, which the ratchet allows since it only
moves down.

Nothing outside `sz-baseline.json` changes; no core code is touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013sbowG1MTBENc8kd9tJknM
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-07T03:49:49.175289Z 4b8901c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants