Skip to content

ci: ratchet one-function-per-file to max_lines = 12 - #1051

Merged
thekevinscott merged 1 commit into
mainfrom
claude/1042-f-ofpf12
Sep 5, 2026
Merged

thekevinscott merged 1 commit into
mainfrom
claude/1042-f-ofpf12

Conversation

@thekevinbot

Copy link
Copy Markdown
Collaborator

Final step of the one-function-per-file ratchet opened in #1042. Every split that step needed has landed (#1045 distcheck, #1046 checks-B1, #1047 python, #1048 the 16 -> 15 config step, #1049 ts, #1050 checks-B2), so this PR is the ceiling drop and nothing else.

Fixes #1042

The change

Five max_lines values, 15 -> 12. No code changes.

File Table Before After
testing-conventions.toml [python] 15 12
testing-conventions.toml [typescript] 15 12
packages/python/testing-conventions.toml [python] 15 12
packages/ts/testing-conventions.toml [typescript] 15 12
internals/checks/testing-conventions.toml [python] 15 12

plugins/dirsql-plugin-embeddings/testing-conventions.toml stays at 10 -- it was already ahead of the campaign and raising it to 12 would loosen the rule for that package.

Why 12 and not 10

#1042 proposed the ladder down to 10; the campaign stops at 12. That is a decision, not an abandonment -- 12 is Kevin's explicit call, and it matches the issue's own recommendation.

Per #1042's analysis, the remaining four moves to reach 10 are the gate rearranging cohesive modules rather than finding real problems:

  • packages/ts/src/resolve-config-extensions.ts -- resolveConfigsExtensionSpecs, 11 lines
  • packages/python/dirsql/resolve_config_extensions.py -- _resolve_entries, 12 lines
  • internals/checks/src/checks/artifact_completeness/gate.py -- run, 11 lines
  • packages/ts/src/resolve-extension.ts -- resolveExtensionPath, 10 lines

Each is a marginal private helper or a run orchestrator flagged only because a slightly longer sibling sits above it in the file. Parent issue #1020 (ratchet toward the default of 1) stays open and carries the remaining distance.

Verification

testing-conventions@0.0.111 pinned explicitly (a bare npx testing-conventions resolves engine-aware and can silently pick an older release, #1018). Every scan root CI runs this gate on, at the value set here:

Scan root Language Config read Exit
internals/checks/src python internals/checks/testing-conventions.toml (12) 0
packages/python/dirsql python packages/python/testing-conventions.toml (12) 0
packages/ts/src typescript packages/ts/testing-conventions.toml (12) 0
internals/distcheck/src python root testing-conventions.toml (12; passes no config:) 0
plugins/dirsql-plugin-embeddings/src python plugins/dirsql-plugin-embeddings/testing-conventions.toml (10) 0

Zero violations, zero exemptions -- the exemption count for this gate stays at zero. Harness sanity-checked by re-running internals/checks/src at max_lines = 8, which correctly reports 5 violations.

just preflight (derives the (source, gate) pairs from the CI workflows) finishes preflight: 0 failing pair(s), 3 skipped -- the three skips are the packaging pairs, which need a built artifact. The three e2e-verify pairs that run locally (packages/ts, internals/checks, plugins/dirsql-plugin-embeddings) all pass with no receipt in the diff, which is the gate agreeing that none is owed.

Red / green

Not applicable. This is a config tightening with no behavior change and no new functionality -- there is nothing to assert red. Per AGENTS.md, red/green governs adding or changing behavior; the gate's own CI run is the proof, and every affected root was verified clean locally before push.

Obligations

Re-confirmed against the repo, not assumed:

  • Changelog fragment: not required. internals/checks/src/checks/changelog_gate/decide.py sets _ROOTS = ("packages", "plugins"), so the root and internals/checks files are outside the gate entirely. For the two package files that are inside it, _is_exempt waives <pkg>/testing-conventions.toml by exact match (re.fullmatch(rf"{p}/testing-conventions\.toml", path)) -- gate config that ships in no published artifact.
  • E2E attestation: not required. No lane's e2e scope is touched. The python lane walks packages/python/dirsql plus [e2e] extra_scope = ["packages/rust/src", "packages/python/src"]; the ts lane packages/ts/src plus ["packages/rust/src", "packages/ts/napi"]; internals/checks its own internals/checks/src. A package-root testing-conventions.toml is in none of them, and internals/distcheck declares no e2e-verify gate at all.
  • Migration fragment: not required. No public API change, no removed deprecation, no runtime behavior change. The only behavior change is which diffs a CI gate rejects.
  • PARITY.md: no change. No SDK API surface is added, removed, or renamed; no drift introduced and none restored.

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package (or: skip-changelog trailer on a commit with reason) -- not required: both package files are _is_exempt matches (see Obligations)
  • Migration fragment added under <root>/<pkg>/migrations.d/ (or: not required -- additive/bugfix only) -- not required

E2E Verification

N/A - CI gate config only, no source change in any scoped lane.

  • Ran e2e suites locally for every affected SDK: N/A
  • Python SDK e2e: N/A
  • TypeScript SDK e2e: N/A
  • Rust core e2e (if applicable): N/A
  • packages/python/e2e-attestations/<branch>.json receipt written if packages/python changed (just e2e-attest-python) -- not owed: no scoped source change
  • packages/ts/e2e-attestations/<branch>.json receipt written if packages/ts changed (just e2e-attest-ts) -- not owed: no scoped source change
  • Command(s) run: npx -y testing-conventions@0.0.111 unit one-function-per-file across all five scan roots; just preflight
  • Result summary: all five roots exit 0; preflight green

Drops the five opted-in configs still at 15 to 12, the target Kevin chose
for #1042 in place of the issue's original 10. Every split needed to be
green at 12 landed first (#1045, #1046, #1047, #1049, #1050), so this is
the ceiling drop alone -- no code changes.

The plugin config stays at 10; it was already ahead of the campaign and
raising it would loosen the rule there.

Verified with testing-conventions@0.0.111 pinned: all five scan roots
report zero violations at the values set here, and `just preflight` is
green with the three packaging pairs skipped.

skip-changelog: gate config only -- changelog_gate._is_exempt waives a
package-root testing-conventions.toml by exact match, and the root and
internals/checks files sit outside its _ROOTS entirely.
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.

ci: ratchet one-function-per-file from max_lines = 16 to 10

2 participants