Skip to content

discovery:research: the acceptance gate's bash dependency closes the dispatched route and silently self-grades the inline one #2616

Closed

Description

@kyle-sexton

Problem

/discovery:research routes dispatch-by-default, and grades the dispatched run with two bundled shell scripts:

bash .../scripts/check-dispatch-artifact.sh <slice> --index-name RESEARCH.md --newer-than <slice>/.research-dispatch --expect-index <artifact>
bash .../scripts/check-coverage-complete.sh <ledger>

The skill's own rule is unambiguous: "Any non-zero exit halts the workflow — and a gate that could not run at all is a FAIL, never a skip. An invocation above that is denied, prompts and is declined, or errors out halts exactly as a non-zero exit does."

So if bash is unavailable for any reason, the default route becomes a guaranteed halt: full subagent cost, zero usable result.

Observed

In a real session another plugin's still-armed skill-scoped PreToolUse hook (disk-hygiene, see #2591) denied every Bash command except four whitelisted shapes. Both gate scripts were unrunnable, so the dispatched path was closed before it began.

The run took the inline escape hatch instead — which the skill sanctions, but for three named reasons (tight iteration, cost, already-being-a-subagent). "The acceptance gate is not executable in this session" is none of them. The correct decision was reached by reasoning from the halt rule, not by following the routing.

The deeper half: inline is not a valid escape either

This is the part that matters most, and it was not obvious at first.

The bash dependency is not confined to the dispatch gate. Outcome-gate criterion 11 is owned by "run, script verdict" — an inline run over a bounded corpus must also execute check-coverage-complete.sh and cite its exit status.

The artifact from that inline run proves the failure. RESEARCH.md records:

| 11 | Coverage ledger fully marked | PASS |

with no exit status — i.e. the table-reading the criterion explicitly forbids. Running the script afterwards gave rows=7 unmarked=0 status=complete, exit 0: right verdict, forbidden mechanism.

So a bash denial does not merely close the dispatched route. Taking the inline route converts a loud, deliberate halt into a silent self-grade — the exact fail-open the gate exists to prevent.

Suggested fixes

  1. Pre-flight, gating both routes. Probe that bash and the two scripts are invocable before committing — each script already has a side-effect-free --help. Currently the skill spends substantial text on what to do when the gate returns 1, 2, or 3, and nothing on whether it can run at all.
  2. Do not add a fourth escape-hatch bullet. The existing three are preferences; this is a precondition failure, and inline does not remedy it.
  3. If an UNGRADED outcome is introduced, it must halt identically to FAIL. It may change what the artifact says; it must never change what the workflow does. Any implementation that lets UNGRADED proceed reintroduces the defect.

Two adjacent findings from the same audit

The artifact schema is prose-specified and unenforced. The single sidecar produced diverges at 5 of 5 points a verifier parses, and none of the five mandated fetch-log outcome values appears anywhere in the log. Neither shipped gate opens a sidecar header, so nothing catches it. If a schema is worth specifying this precisely, one of the gates should validate it.

A sourced claim has gone stale, and in the plugin's favour. ${CLAUDE_PLUGIN_ROOT} is now substituted in allowed-tools Bash rules for plugin skills (Claude Code skills reference, fetched 2026-08-14). That removes leg 1 of the plugin's three-leg argument for why it cannot ship a grant, and unblocks a real fix. Worth re-verifying before implementing, and note that the docs changing is not the same as confirming a ${CLAUDE_PLUGIN_ROOT}-bearing rule matches at runtime.

What must not be damaged by any fix

Verified as working and load-bearing during the same run:

  • Phase 0 corpus enumeration forced two items to be recorded as Gaps rather than quietly dropped.
  • The tier/pool + independent-corroborator rule drove the run to primary sources (codex --help, upstream archive_thread.rs, the published config schema) and inverted a 4.05 GB disposition that name-and-age heuristics had backwards.
  • The recency gate is cheap and correct.
  • Full depth regardless of task size — stated at four sites and empirically paid off. The separable cost is the fixed envelope ceremony, not the depth. Do not trade depth for speed.

Lower-priority note

The default artifact destination <memory_dir>/<slug>/ falls back to .work/<slug>/. On the machine in question ~/.work is also a real operator work directory (12 topic folders, 777 files), so the plugin defaulted into a namespace it does not own and authorised a .gitignore write into a non-repo directory where it is inert. Any change here needs a migration story — moving the default orphans every existing slice.

Environment

discovery 0.15.3, Windows 11 26200, PowerShell 7 with Git Bash present. Found during a /plugin-quality:audit pass; evidence packet retained locally. The trigger for the un-run gate was environmental (a sibling plugin's hook) and will not reproduce without it — but the criterion-11 inline defect is independent of that trigger and reproduces from the artifact alone.

Activity

  1. added
    needs-triage
    on Aug 14, 2026
  2. kyle-sexton commented on Aug 14, 2026

    @kyle-sexton
    MemberAuthor

    Claimed by cloud orchestrator lane discovery (Wave 2).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions