Skip to content

gate: a branch taken per operating system needs a test that injects one - #509

Open
EdbertChan wants to merge 1 commit into
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/refuse-quoted-cmd-string-passed-login-shell--acc7d623from
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/branch-taken-per-operating-system-needs-test--0ebec990
Open

gate: a branch taken per operating system needs a test that injects one#509
EdbertChan wants to merge 1 commit into
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/refuse-quoted-cmd-string-passed-login-shell--acc7d623from
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/branch-taken-per-operating-system-needs-test--0ebec990

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

This check helps maintainers trust that hook checks cover the paths their tools may take.

Checks passed on one computer but failed in Linux automation.

The check did not require a chosen operating system.

It now requires each check to supply that choice, so both paths are exercised.

Review Claim

Require operating-system branches to be tested with an explicit operating-system choice.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

Only test-coverage detection changes; runtime hooks and detectors keep their existing behavior.

Slice Rationale

This slice adds the missing coverage rule and its focused tests. It stays separate from runtime hook changes because none are included.

Non-goals

  • Do not change runtime hooks or detector behavior.
  • Do not change existing positive and negative coverage rules.
  • Do not change the operating system used by automation.

Test Plan

Test Plan
  • python3 -m unittest tests/test_check_hook_test_coverage.py
    ........
    ----------------------------------------------------------------------
    Ran 8 tests in 0.132s
    
    OK
    
  • Full repository test suite was not run.

The focused tests cover a missing platform injection, a supplied platform injection, and a detector without an operating-system branch. Backtested against the tests as first written: fires. Against the fixed ones: silent.

Depends-On: #508

Revert Plan

Revert Plan
  • Safe to revert? Yes.
  • Revert command: git revert <sha> or equivalent.
  • Post-revert steps: Re-run the focused test command and the PR body checker.
  • Data migration? No.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ

@EdbertChan

EdbertChan commented Sep 12, 2026

Copy link
Copy Markdown
Owner Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 hook: a script handed to the user is a claim that it runs #506
2 audit(token_audit): count "bogus" and "it didn't run" as the same class #507
3 hook: refuse a quoted command string passed through a login shell #508
4 gate: a branch taken per operating system needs a test that injects one #509 👈
5 audit(token_audit): one submission carrying two slash commands is one message #510
6 audit: use the transcript's own markers for what the human actually sent #511
7 README: list the handoff-needs-smoke-test and remote-payload-collapses hooks #535

@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5ede4904-9e80-419f-8b01-70487cd603c6)

A guard's screen-lock and idle probes returned early on anything but macOS.
The suite was green on a Mac and red on Linux CI with "unexpectedly None",
because the branch under test only ever ran on the author's machine.

The coverage gate now asks any detector that reads sys.platform for a test
that passes a platform in. Backtested against the tests as first written:
fires. Against the fixed ones: silent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ
Change-Id: I0ebec990b0153ad5e64e4725cbe045d4cd428ed4
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/refuse-quoted-cmd-string-passed-login-shell--acc7d623 branch from d76e1e5 to 7d7ef8b Compare September 13, 2026 05:55
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/branch-taken-per-operating-system-needs-test--0ebec990 branch from 1ec58f5 to c17c8d3 Compare September 13, 2026 05:55
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_80a80e17-fd28-4b60-9c0a-d5be721a00fc)

@EdbertChan

Copy link
Copy Markdown
Owner Author

Revision history

# Type Changes Reason Date
1 initial 1ec58f5 2026-09-13 05:55 UTC
2 rebase 1ec58f5 → c17c8d3 (rebase only) 2026-09-13 05:55 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant