Skip to content

ci(skills): no gate catches a second precompute line silently breaking a git-bearing skill under worktree isolation #1662

Closed

Description

@kyle-sexton

Surfaced while probing #1619. Not a defect in any shipped skill today — a latent regression path
with no gate on it.

The sharp edge

#1619 established, by direct probe, that a skill is refused in a worktree-isolated agent iff its
## Pre-computed context block contains a git command and has more than one precompute line.
A single git precompute line loads fine (proven: code-tidying:batch-simplify). A multi-line block
with no git loads fine (proven: knowledge:course-digest). Only the combination trips the guard,
because the harness composes all !`cmd` lines into one shell invocation.

That makes the following skills safe only by line count:

  • code-tidying:batch-simplify
  • discovery:research
  • discovery:research-deep
  • planning:audit-answers
  • planning:design
  • planning:design-handoff

Each has exactly one precompute line, and that line is git-bearing.

Adding a second precompute line to any of them — however innocuous — silently moves it into the
refused set.
The author gets no signal: it renders fine in a normal session, CI stays green (CI
never invokes a skill from an isolated agent), and the breakage only appears to whoever next invokes
that skill from a worktree-isolated agent.

The same edge applies in reverse to any skill remediated under #1619: re-introducing a git
precompute line alongside an existing one re-breaks it just as silently.

Proposal (needs a decision)

A scripts/-style static check, wired into CI alongside the existing skill gates
(check-skill-portability.sh, check-changed-skills.sh, …):

For each plugins/**/SKILL.md: if the precompute block contains a git command and has more
than one !`…` line, fail with the file, the line count, and a pointer to #1619.

Cheap to implement, purely lexical, no harness invocation needed. It encodes the one rule the probe
actually established, and it is the only thing that can catch this class before merge — the
authoritative test (isolated-agent invocation) is not something CI can run.

Open question for the maintainer: gate at error severity, or warn-only until the #1619
remediation is complete across all 18 affected plugins? Erroring now would fail CI on the 43 skills
that are already in violation, so warn-first is probably the sequencing — but that is a call, and a
warn-only gate that never graduates is the failure mode this repo already tracks elsewhere.

Related

Activity

  1. added
    needs-owner-decision
    on Jul 27, 2026
  2. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    Re-scope needed. The trigger this gate was proposed to catch is not what I described when filing.

    A second precompute line is not the hazard — see the correction on #1619. The surviving rule is: a skill is refused under worktree isolation iff its pre-compute block contains a $-expansion in any form other than bare $HOME / "$HOME". Line count and git content are both irrelevant (a single-line git-bearing block loads; a four-line git-bearing block with no $ loads).

    So the gate this issue asks for should be:

    For each plugins/**/SKILL.md: fail if any ``!…``` pre-compute line contains a $`-expansion other than bare `$HOME`/`"$HOME"`, pointing at #1619.

    That is a simpler and more precise check than the multi-line-plus-git rule originally proposed, and unlike that one it catches the real defect. The sequencing question in the body still stands: 21 skills are currently in violation, so warn-first is probably right before erroring.

    The silent-regression concern that motivated this issue is unchanged and, if anything, sharper — adding a ${VAR} to any pre-compute block breaks the skill under isolation with no signal in a normal session and no CI coverage at all.

  3. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    Second re-scope — see #1687.

    The gate rule I proposed in the previous comment ("fail if any pre-compute line contains a $-expansion other than bare $HOME") would produce false positives. \, \, and \ are substituted by the harness into literal paths before any shell sees them — they are $-shaped in source but never reach the guard, and skills using only them load fine under isolation (confirmed on three).

    A gate using my previous rule would flag claude-config:audit-automation-gaps, prototype:pressure-test, docs-hygiene:audit-noise, source-control:commit, and others that are demonstrably working.

    Corrected rule for the gate:

    For each plugins/**/SKILL.md: fail if a !\ pre-compute line contains a $-expansion after excluding the harness-substituted plugin variables (CLAUDE_PLUGIN_ROOT, CLAUDE_PLUGIN_DATA, CLAUDE_SKILL_DIR) — i.e. flag real shell expansions: $(…), \default, bare $var locals, and any \ not on the plugin-variable list.

    Two open details before implementing:

    1. Is the plugin-variable list exactly those three? Those are the ones observed to substitute. Others may exist — check the plugins-reference rather than assuming.
    2. $HOME handling is unsettled. Bare $HOME and "$HOME" pass; \/c/Users/KyleSexton refuses. Whether $HOME inside a longer quoted string passes is being probed now and is load-bearing — merged code depends on it.

    A trailing $ before a quote (e.g. grep '\.md$') must not be flagged; docs-hygiene:audit-noise carries one and loads fine.

  4. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    The comment immediately above is mangled — a shell-escaping accident stripped the variable names
    out of it, leaving empty backticks. Ignore it; this is the intended text.

    Second re-scope — see #1687

    The gate rule I proposed earlier ("fail if any pre-compute line contains a $-expansion other than
    bare $HOME") would produce false positives.

    The three harness-substituted plugin variables — CLAUDE_PLUGIN_ROOT, CLAUDE_PLUGIN_DATA,
    CLAUDE_SKILL_DIR — are replaced with literal paths before any shell sees them. They are
    $-shaped in source but never reach the guard, and skills whose pre-compute uses only them load fine
    under isolation (confirmed on three).

    A gate using my previous rule would flag claude-config:audit-automation-gaps,
    prototype:pressure-test, docs-hygiene:audit-noise, and source-control:commit — all
    demonstrably working.

    Corrected rule for the gate

    For each plugins/**/SKILL.md: fail if a pre-compute line contains a $-expansion after
    excluding the three harness-substituted plugin variables above
    — that is, flag real shell
    expansions: command substitution, a :-default parameter expansion, a bare $var local, or any
    braced ${VAR} whose name is not on the plugin-variable list.

    Two open details before implementing

    1. Is the plugin-variable list exactly those three? Those are the ones observed to substitute.
      Others may exist — check the plugins-reference rather than assuming.
    2. $HOME handling is unsettled. Bare $HOME and "$HOME" pass; the braced form refuses.
      Whether $HOME inside a longer quoted string passes is being probed now and is load-bearing —
      merged code in session-flow:find-handoff depends on the answer.

    One exclusion the gate must get right

    A trailing $ before a closing quote — as in a regex anchor like grep '\.md$' — is not an
    expansion and must not be flagged. docs-hygiene:audit-noise carries one and loads fine.

    Stated narrowly: that observation is equally explained by a lexical rule ($ not followed by an
    identifier character or {) as by real shell parsing. Do not build the gate on an assumption that
    the guard parses shell.

  5. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — gate-audit claim). Claiming this item for one gate-audit cycle: an independent panel re-classifies whether the needs-human / status: needs-decision gate is still warranted, or whether the item is C2/C3 and liftable to agent-ready. Outcome comment follows in this cycle.

  6. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — gate audit). Independent panel: two fresh-context agents (one fable, one opus), each given only the issue content and the repo's own plugins/autonomy/reference/guardrails/work-classes.md, plus the triage lane's own read. This lane never executes work items, authors fixes, or merges.

    Gate audit: GATE UPHELD — detection rule not final, plus an open severity call

    Panel: 2-of-2 STAYS-GATED, both C3. Lane read concurs. (This item carries status: needs-decision only, not needs-human.)

    Two independent blockers, both in the issue's own words:

    1. The rule is not settled. It has already been re-scoped twice (line-count-plus-git, then any non-$HOME $-expansion, then $-expansion excluding harness-substituted plugin variables), and the latest comment leaves two load-bearing unknowns open: "Is the plugin-variable list exactly those three?" and "$HOME handling is unsettled … being probed now and is load-bearing — merged code in session-flow:find-handoff depends on the answer."
    2. The severity question is put directly to the maintainer — error now, failing 21+ currently-violating skills, versus warn-first.

    Implementing before the $HOME probe lands risks a gate that flags demonstrably-working skills — the exact false-positive failure the second re-scope already caught once.

    Decision required

    Ship the pre-compute $-expansion gate at error severity now, or warn-only until remediation completes?

    RECOMMENDED — warn-only at launch, with a hard graduation trigger recorded in the same PR: severity flips to error when the violating-skill count reaches zero, tracked on #1619. This avoids red-lining CI on ~21 known violations while directly addressing the issue's own stated worry that "a warn-only gate that never graduates is the failure mode this repo already tracks elsewhere" — the trigger is what makes warn-first safe rather than permanent.

    Alternative — error immediately with a checked-in baseline allowlist of the 21 current violators that may only shrink (the scripts/*-baseline.txt pattern already exists in this repo). Stricter and self-enforcing, at the cost of a second file to keep in sync.

    Sequencing constraint either way: the $HOME-in-quoted-string probe must land first — the lexical rule depends on its answer, and session-flow:find-handoff already depends on the behaviour.

  7. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI (triage lane — claim release). Gate-audit cycle complete for this item; the triage claim posted earlier this cycle is released. No lease is held — another instance or lane may pick this up immediately. The outcome comment above this one carries the classification and either the lift rationale or the decision summary.

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-owner-decision

    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