Skip to content

refactor(hooks): remove maintainer-internal live-probe gate from the shipped plugin (v4.4.32)#998

Merged
michael-wojcik merged 3 commits into
Synaptic-Labs-AI:mainfrom
michael-wojcik:remove/live-probe-gate
Jun 20, 2026
Merged

refactor(hooks): remove maintainer-internal live-probe gate from the shipped plugin (v4.4.32)#998
michael-wojcik merged 3 commits into
Synaptic-Labs-AI:mainfrom
michael-wojcik:remove/live-probe-gate

Conversation

@michael-wojcik

Copy link
Copy Markdown
Collaborator

Summary

Removes the maintainer-internal live_probe_gate from the shipped plugin and replaces its runtime-verification role with a non-mocked seam-integration-test requirement. Closes #997; supersedes #932 / #924 (the gate's efficacy fix + its codification, both closed) and the closed PR #996.

Why

A 25-hook audit (this session) found live_probe_gate.py is the only maintainer-internal hook that leaked into consumer runtime: it ships as a PreToolUse(Bash) hook — a subprocess on every Bash call in every consumer session — but only ever acts inside the PACT-plugin's own dev repo (it gates on the plugin's dev-repo marker); for any consumer it silently no-ops. Zero consumer value; dev-tooling baked into the product. The other 24 shipped hooks are genuinely consumer-facing.

What changed

Removed — gate runtime only (the consumer leak):

  • live_probe_gate.py + its hooks.json registration (surgical — the kept git_commit_check + merge_guard_pre Bash-block siblings are untouched)
  • test_live_probe_gate_dogfood.py, 924-locus-b-dogfood-probe.md, the 924/locus-b RUNBOOK_RUN_DATES rows (+ a one-line retirement tombstone)

Kept — the seam-verification discipline (NOT shipped as runtime; never leaked):

  • hook_infra_classifier.py (the SEAM_DEPENDENT_HOOKS SSOT) — minimal-touch (docstrings de-gated; classify_diff preserved because the meta-test exercises it)
  • live-probe-template.md + the 923 / 926 / 961 runbooks (other kept hooks depend on them)
  • the classifier's structure meta-test, renamed test_live_probe_gate_structure.pytest_hook_infra_classifier.py

Replaced the need — non-mocked seam-integration-test requirement:

  • A "non-mocked seam-integration-test gate" bullet in peer-review.md + wrap-up.md (a hook-infra change to a seam-dependent hook must carry a test exercising the real seam), referencing the classifier SSOT
  • The rationale (the mock-hid-the-seam trap + the honest platform-runtime-only residual) in the pact-testing-strategies skill
  • A reference exemplar: a non-mocked seam-integration test for missed_wake_scan that drives the surfacer over the real on-disk task-dir resolution (the seam every existing test mocked), with a negative twin + an in-process neuter proving non-vacuity

Verification

Adversarial design review caught and corrected an over-broad deletion list (the audit's "overloaded-tokens" finding — live-probe-template.md + hook_infra_classifier.py serve a kept discipline and must NOT be deleted). Auditor GREEN against the diff (keep/delete boundary, surgical hooks.json, byte-identical prose mirrors, zero planning artifacts). Full hook suite 9187 passed, 0 failed, 0 errors (three independent runs). Exhaustive clean-grep: no dangling gate refs. PATCH bump 4.4.31 → 4.4.32.

Adds TestRealSeamIntegrationNonMocked — the reference example for the non-mocked seam-integration-test convention. A positive case writes a genuine stale awaiting_lead_completion task to a real on-disk task dir and runs the surfacer over the unstubbed task-dir resolution (the real seam a fully-mocked suite would miss); a negative twin (the same task under a different team dir, where the real resolution finds nothing and the surfacer stays silent) proves the test keys on the real resolved dir, not a handed-in dict. Existing mocked cases unchanged.
…shipped plugin

The live-probe gate ran as a PreToolUse(Bash) hook in every consumer session but only ever acted inside the PACT-plugin's own dev repo (it gated on the plugin's dev-repo marker), silently no-opping everywhere else — maintainer dev-tooling that shipped to consumers for zero benefit. Removes the gate, its hooks.json registration, behavior tests, and dogfood runbook.

Keeps the seam-verification discipline the gate was part of (the SEAM_DEPENDENT_HOOKS classifier SSOT and the reusable probe template, which other hooks' runbooks depend on), and replaces the gate's workflow reminder with a non-mocked seam-integration-test gate: peer-review and wrap-up now require a hook-infra change to a seam-dependent hook to carry a test that exercises the real integration seam, with the rationale in the testing-strategies skill. The classifier's structure meta-test is renamed accordingly. PATCH bump 4.4.31 to 4.4.32.
…ndant exemplar

Peer review found the added missed_wake_scan exemplar duplicated the pre-existing, more comprehensive test_missed_wake_scan_integration.py (the seam-test convention's canonical home). Removes the redundant unit-file copy (the test file returns to its prior content) and points the testing-strategies skill's non-mocked-seam section at the canonical integration test as the worked reference example.
@michael-wojcik michael-wojcik merged commit 9723dc3 into Synaptic-Labs-AI:main Jun 20, 2026
1 check passed
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.

Remove maintainer-internal live_probe_gate from the shipped plugin; replace with non-mocked seam-integration-tests

1 participant