Skip to content

Make the gate pass: measure child processes and split complex functions - #18

Merged
0xjgv merged 1 commit into
mainfrom
ub-gate-green
Nov 21, 2026
Merged

0xjgv merged 1 commit into
mainfrom
ub-gate-green

Conversation

@0xjgv

@0xjgv 0xjgv commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Why

make gate fails on main and on #17. It fails on the hook and init code, which the tests exercise only in child processes. The gate's coverage run never measured those processes, so that code scored 2–10% covered with 94 uncovered mutation sites. Five functions also fail on complexity alone, since CRAP never drops below cyclomatic complexity.

Stacked on #17 (ub-ratchet-guard); merge that first.

What

  • Coverage of child processes. make gate runs coverage with patch = ["subprocess"] and combines the data before writing LCOV. The settings live in scripts/gate-coverage.toml, not pyproject.toml, because plain ub crap does not combine parallel data. Coverage is pinned to 7.17.4.
  • Mutation in child processes. The tests no longer resolve the package path. Mutation workers link unmutated files to the original tree, so a resolved path made the child ub import the original code and every mutant survive. That first produced 93 false survivors.
  • Complexity. install_git, install_agent, initialize, terminate_check, and managed_block are split into named steps under CRAP 10. Behavior is unchanged.
  • Tests. New in-process tests kill the newly covered mutants:
    • hook usage errors
    • non-executable .ub/check
    • symlinked hook
    • stray marker
    • env shebang
    • handler timeout
    • malformed Stop group
    • marker validation
    • --max-workers bounds
    • write_file mode repair

Verification

  • make test: 161 tests pass.
  • make gate locally:
    • CRAP: 0 of 121 functions ≥ 10
    • Duplication: 0 pairs ≥ 0.8
    • Mutation: 529 killed, 0 survived, 0 uncovered
    • All ub-mode quality gates passed, in 15.5 minutes.
  • CI runtime is unmeasured until this PR's run. The job timeout is 30 minutes.

The hook and init tests run ub in child processes, which the gate's
coverage run did not measure, so that code scored as uncovered. make
gate now runs coverage with subprocess measurement and combines the
data (scripts/gate-coverage.toml, coverage 7.17.4).

The tests no longer resolve the package path: mutation workers link
unmutated files to the original tree, so a resolved path made the
child processes import the original code and every mutant survive.

install_git, install_agent, initialize, terminate_check, and
managed_block are split below CRAP 10, and the newly covered mutants
are killed by in-process tests.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T20:43:17.234540Z 01c8f33 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.

Base automatically changed from ub-ratchet-guard to main November 21, 2026 21:01
@0xjgv
0xjgv merged commit 7e92f2c into main Nov 21, 2026
2 checks passed
@0xjgv
0xjgv deleted the ub-gate-green branch November 21, 2026 21:01
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.

1 participant