Skip to content

ci: ratchet one-function-per-file to max_lines = 15 - #1048

Merged
thekevinscott merged 1 commit into
mainfrom
claude/tackle-1042-ofpf15
Sep 5, 2026
Merged

thekevinscott merged 1 commit into
mainfrom
claude/tackle-1042-ofpf15

Conversation

@thekevinbot

Copy link
Copy Markdown
Collaborator

Part of #1042 (parent tracker #1020).

PR A of the sequence in #1042: ratchet the one-function-per-file gate from max_lines = 16 toward 10. This step is config-only and costs zero code changes.

What changed

Config Before After
testing-conventions.toml [python] 16 15
testing-conventions.toml [typescript] 16 15
packages/python/testing-conventions.toml 16 15
packages/ts/testing-conventions.toml 16 15
internals/checks/testing-conventions.toml 16 15
plugins/dirsql-plugin-embeddings/testing-conventions.toml 24 10

Six lines across five files. No source file moves, no function is split, no function is golfed under the limit.

Why 15 is free

The enumeration in #1042 (against main at fb432f7, testing-conventions@0.0.111 pinned) swept the whole ladder: every scan root is already clean at 15, and the first violations appear at 14. So 16 -> 15 is a strict tightening that costs nothing.

Why the plugin goes to 10, not 15

plugins/dirsql-plugin-embeddings was left at 24 by the earlier 16 step (#1040) because it belonged to neither that PR's lane. It is already clean at 10 -- its largest shared-file function is build_search_sql at 8 lines -- so there is no reason to leave it looser than it needs to be.

Verified rather than assumed. At max_lines = 10 the gate exits 0; at max_lines = 1 the same root reports 6 violations with the largest at 8 lines, confirming the gate is actually inspecting the tree and not silently no-opping.

Verification

Per-root, at the values this PR sets, with the tool version pinned explicitly (a bare npx testing-conventions resolves engine-aware and can silently pick an older release, #1018):

npx -y testing-conventions@0.0.111 unit one-function-per-file --language <lang> --config <config> <source>
Scan root Language Config read max_lines Exit
internals/checks/src python internals/checks/testing-conventions.toml 15 0
packages/python/dirsql python packages/python/testing-conventions.toml 15 0
packages/ts/src typescript packages/ts/testing-conventions.toml 15 0
internals/distcheck/src python root testing-conventions.toml (passes no config:) 15 0
plugins/dirsql-plugin-embeddings/src python plugins/dirsql-plugin-embeddings/testing-conventions.toml 10 0

Then the full just preflight, which derives the (source, gate) pairs from the CI workflows rather than restating them:

preflight: gate matrix from 6 workflow files
50 pairs run
preflight: 0 failing pair(s), 3 skipped

The three skips are the packaging pairs (python-sdk, rust, typescript-sdk), which need a built artifact CI builds from the manifest. @latest resolved to 0.0.111 in that run, matching the pin above.

Exemptions

None added. This gate's exemption count is deliberately zero and stays there.

Red/green

Does not apply. This is a config tightening with no behavior change and no new functionality -- nothing to write a failing test against. The verification above is the proof, and it is a set of gate exit codes rather than a test suite.

Changelog / Migrations

  • Changelog fragment: none owed, re-confirmed against the gate rather than assumed. internals/checks/src/checks/changelog_gate/decide.py sets _ROOTS = ("packages", "plugins"), so the root testing-conventions.toml and internals/checks/testing-conventions.toml are outside the gate entirely. For the three files that are under those roots, _is_exempt waives a package-root testing-conventions.toml by name (re.fullmatch(rf"{p}/testing-conventions\.toml", path)) -- which is the only kind of file this PR touches there.
  • Migration fragment: not required. No public API changes, no symbol removed, no runtime behavior change. The only thing that changes is the threshold a CI gate compares against.

PARITY.md

No change. No SDK public API is touched -- this PR edits only gate configuration, in no src/ tree.

E2E Verification

N/A - CI gate configuration only, no source change.

  • Ran e2e suites locally for every affected SDK -- N/A, no SDK source affected
  • Python SDK e2e: N/A
  • TypeScript SDK e2e: N/A
  • Rust core e2e (if applicable): N/A
  • packages/python/e2e-attestations/<branch>.json receipt: not owed
  • packages/ts/e2e-attestations/<branch>.json receipt: not owed
  • Command(s) run: git diff --name-only fb432f7..HEAD against each lane's e2e scope
  • Result summary: the diff touches no scoped source in any lane -- not packages/python/dirsql, packages/python/src, packages/ts/src, packages/ts/napi, packages/rust/src, internals/checks/src, nor plugins/dirsql-plugin-embeddings/src. Every lane's e2e-verify pair ran green under just preflight, which is the gate itself agreeing that no receipt is owed.

Config-only step under #1042 (parent tracker #1020). The enumeration on
main at fb432f7, with testing-conventions@0.0.111 pinned, showed every
scan root already clean at 15 -- the first violations appear at 14, so
16 -> 15 costs no file splits.

The embeddings plugin goes to 10 rather than 15: it was left at 24 by
the earlier 16 step because it belonged to neither lane, and its largest
shared-file function is 8 lines. Verified clean at 10 against the gate.

No exemptions added; none golfed under the limit. The exemption count
for this rule stays zero.
@thekevinscott
thekevinscott merged commit 6999d28 into main Sep 5, 2026
85 checks passed
@thekevinscott
thekevinscott deleted the claude/tackle-1042-ofpf15 branch September 5, 2026 00:51
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