Skip to content

fix(spec): the explorer fan-out prescription has a 0% execution rate over 169 runs — delete it or make it real #927

Closed

Description

@admarble

Problem

spec/SKILL.md's "Agent Spawn Rules" section (.claude/skills/spec/SKILL.md:133-148) prescribes spawning 1–3 sequant-explorer subagents per /spec run, keyed by issue type:

Issue Content Agents What to Spawn
Database/SQL/migration keywords 3 Similar features + Codebase area + Database schema
UI/frontend 2 Similar features + Codebase area
CLI/script changes 2 Similar features + Codebase area
Docs/config/simple-fix 1 General context only

It has never fired. Measured over the local transcript corpus (~/.claude/projects/**/*.jsonl, 1,332 transcripts, 2026-07-07 → 2026-08-09):

Agent Skill-body runs Spawns Rate
sequant-explorer 169 (/spec) 0 0%
sequant-implementer 276 (/exec) 2 0.7%
sequant-qa-checker 188 (/qa) 127 healthy
sequant-testgen 6 (/testgen) 0 n too small to claim anything

Meanwhile the generic built-ins absorbed the role: general-purpose 133 spawns, Explore 101.

Breaking down the 169 /spec runs: 131 (78%) spawned no subagent at all; the other 38 used Explore/general-purpose. Across 98 headless dogfood runs (matcha-maps + ad-motion): 0 explorer spawns.

Availability is not the cause. sequant-explorer.md is installed in .claude/agents/ in this repo and in both consumer testbeds. The recording mechanism works for sequant-namespaced agents — sequant-qa-checker logs 127 spawns through the identical subagent_type field. The agent is available and simply never chosen.

Why it probably never fires: compare the two prescriptions. /qa gives literal, copy-pasteable invocations tied to a size gate (qa/SKILL.md:1226, :1236) — 127 spawns. /spec gives a descriptive table of counts with no invocation to copy and no gate that requires one — 0 spawns. The agent reads the table, concludes targeted inline Read/Grep serves better, and proceeds. That conclusion is not wrong: it matches the repo's own preference for targeted reads over explorer fan-out for known files, and /qa already documents that ad-hoc background agents "hallucinate about file existence, misattribute API patterns" (qa/SKILL.md:165).

Why this matters beyond tidiness

Dead prescription is not free:

  1. It misleads design work. feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922 was specced end-to-end on the premise that explorers run and their findings feed the Implementation Plan. Its Phase A ("measure the phantom-citation rate over ≥10 explorer transcripts") is unsatisfiable — the corpus is empty — and its Phase B would have gated a code path that never executes. That issue is now being re-aimed; the cost was one full planning cycle.
  2. It bloats every /spec run. The table is tokens in the context window of all 169 runs, describing behavior none of them perform, in a skill that has already had a dedicated prompt-compression pass (perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515).
  3. It hides the real behavior. The skill's stated context-gathering strategy and its actual one have diverged, so nobody tuning /spec context quality is looking at the code path that runs.

Design

Two options; recommending (A).

(A) Make the skill describe what actually happens — recommended. Replace the spawn-rules table with the observed-and-preferred strategy: targeted inline Read/Grep when the issue names specific files (the common case), escalating to a single Explore agent only for genuinely open-ended discovery ("where does X live?"). Retire sequant-explorer.md. This is a documentation-truth change with a token saving, no behavior regression — the behavior is already this.

(B) Make the prescription real. Give /spec literal copy-pasteable Agent(subagent_type="sequant-explorer", prompt=…) invocations behind an explicit gate, the way /qa does. Only worth it if there is evidence that explorer fan-out beats targeted reads for plan quality — and there is not; the accumulated guidance points the other way.

Rejected: leaving it and re-measuring later. Two years of zero is not a sampling problem.

Acceptance Criteria

  • AC-1: spec/SKILL.md's Agent Spawn Rules table is replaced with a description of the strategy actually in use — targeted inline Read/Grep by default, single Explore escalation for open-ended discovery — mirrored across all 3 skill dirs and sync-verified.
  • AC-2: sequant-explorer.md is removed from .claude/agents/ and templates/agents/, or an explicit rationale for keeping it is recorded in the PR body.
  • AC-3: Any remaining reference to sequant-explorer across skills, agent frontmatter allow-lists, and docs is removed; grep -rn 'sequant-explorer' --include='*.md' . returns only CHANGELOG history.
  • AC-4: The consumer-project upgrade path is verified: confirm whether sequant sync/update prunes an agent file deleted upstream, and if it does not, state the residual in the PR body and the CHANGELOG entry.
  • AC-5: Token delta of the /spec skill body is measured before and after and reported in the PR body.
  • AC-6: CHANGELOG entry.

Non-Goals

References

Complexity

Simple — prose replacement across 3 mirrors, two file deletions, one grep sweep. No runtime code.

Self-assessed workflow

spec → exec → qa

Activity

  1. added
    enhancement
    on Aug 9, 2026
  2. admarble commented on Aug 10, 2026

    @admarble
    ContributorAuthor

    Spec — Plan for #927

    Complexity: Standard (6 ACs, 2 logical areas — skill mirrors + agent dirs)

    Scope

    Non-Goals present (implementer/testgen triage, #922's grounding work, qa-checker). Scope verdict: ⚠️ SCOPE_WARNING (feature count 2, 6 ACs) — mechanical yellow from AC count; the work itself is prose + file deletions with zero runtime TS references (verified: grep -rn sequant-explorer src/ scripts/ bin/ is empty). Quality loop auto-enables per the yellow verdict.

    Findings from planning (read before exec)

    1. AC-3's grep has a guaranteed false positive. vscode-extension/README.md:34,45 contains sequant-explorer-0.0.1.vsix — that's the VS Code extension package name, unrelated to the agent. The literal acceptance grep grep -rn 'sequant-explorer' --include='*.md' . will always hit it. Treat AC-3 as: only CHANGELOG history and vscode-extension/ hits remain (or exclude that dir in the grep). Do not rename the extension.
    2. AC-4 is already answered: copyTemplates (src/lib/templates.ts:578) is purely additive — it iterates template entries and writes; there is no unlink/prune path. sequant sync/update will NOT remove a consumer's stale .claude/agents/sequant-explorer.md. Residual: inert orphan agent file in consumer projects (harmless — nothing invokes it). State this in the PR body + CHANGELOG per the AC.
    3. Reference surface is wider than the issue lists. Full inventory (from the planning grep):
      • spec/SKILL.md:16 frontmatter allowed-tools: Agent(sequant-explorer) — ×3 mirrors
      • spec/SKILL.md "Agent Spawn Rules" section — ×3 mirrors
      • _shared/references/subagent-types.md lines 27, 32–37, 179–182, 218, 242–243 — ×3 mirrors (routing table row, dedicated section with copy-paste invocations, decision-table row, and the deprecated-agent pointers pattern-scout/schema-inspector → re-point those to Explore only)
      • docs/features/declarative-agents.md:16,32,68,73 (expected-files list, agent table, section)
      • .claude/agents/sequant-explorer.md + templates/agents/sequant-explorer.md (the deletions)
    4. AC-5 baseline recorded now: each spec/SKILL.md mirror is 18,567 bytes (~4.6k tokens) pre-change; all 3 mirrors are byte-identical, a clean baseline.

    Acceptance Criteria

    • AC-1: Replace the Agent Spawn Rules table with the actual strategy (targeted inline Read/Grep default; single Explore escalation for open-ended discovery), mirrored ×3.
      Verification: Manual — diff the 3 mirrors byte-identical; section reads as described.
    • AC-2: Delete sequant-explorer.md from .claude/agents/ and templates/agents/.
      Verification: Manual — ls both paths.
    • AC-3: Remove remaining references (inventory above).
      Verification: Integration — run the acceptance grep; only CHANGELOG + vscode-extension/ (name collision, see finding 1) remain.
    • AC-4: Document the no-prune residual in PR body + CHANGELOG.
      Verification: Manual — cite src/lib/templates.ts:578 (additive copyDir, no delete path).
    • AC-5: Report token delta in PR body.
      Verification: Manual — before: 18,567 bytes/mirror; measure after with the same method.
    • AC-6: CHANGELOG entry.
      Verification: Manual.

    AC lint: 6/6 passed, none flagged.

    Implementation Plan

    Phase 1 — spec/SKILL.md rewrite (×3 mirrors)

    1. Read each mirror independently before editing (they drift silently).
    2. Replace the "Agent Spawn Rules" subsection (table + agents.parallel execution-mode paragraph + hardcoded-paths note) with a short "Context-gathering strategy" block: default targeted Read/Grep on files the issue names; escalate to one Explore agent only for open-ended discovery ("where does X live?"). Keep the "Discover Project Structure" step.
    3. Frontmatter: replace Agent(sequant-explorer) with Agent(Explore) so the escalation path stays allow-listed (decision below).

    Phase 2 — reference removal
    4. Delete both agent files; update subagent-types.md ×3 (drop row/section/decision-table entry; re-point pattern-scout/schema-inspector migration notes to Explore); update docs/features/declarative-agents.md.

    Phase 3 — verify + document
    5. Acceptance grep sweep (finding 1 carve-out); diff mirror-sync check; token delta vs 18,567-byte baseline; CHANGELOG + PR-body residual note (finding 2).

    Key decisions

    • Option A (delete + describe reality) per the issue's own recommendation; Option B rejected — no evidence explorer fan-out beats targeted reads.
    • No prune logic added to sync — copyTemplates is additive by design (customizable-file preservation, fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814); new deletion machinery is disproportionate for one inert orphan. Documented residual instead, per AC-4's own escape hatch.
    • Frontmatter allow-list: swapping to Agent(Explore) keeps the documented escalation usable; dropping the line entirely would make the new prose prescribe an unlisted tool.

    Open Questions

    1. AC-3 carve-out for vscode-extension/ — Recommendation: accept the package-name hits alongside CHANGELOG (or add --exclude-dir=vscode-extension). Impact if ignored: exec either fails the AC literally or mangles the unrelated extension name.
    2. Follow-up issue for sync-prune of upstream-deleted managed files? — Recommendation: no; single inert file doesn't justify it. File only if more managed files get retired later.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled (SCOPE_WARNING auto-enable)
    Reasoning: No unit/integration-testable code — all ACs verify via commands/diffs, so no testgen; no UI, so no test phase. In-flight worktrees (#916, #919) have empty diffs vs origin/main — no conflict risk.

  3. added
    planned
    on Aug 10, 2026
  4. admarble commented on Aug 10, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #927

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Agent Spawn Rules table replaced with actual strategy, mirrored ×3, sync-verified MET npm run lint:skill-sync reports 44/44 synced incl. spec/SKILL.md; new section reads as targeted Read/Grep default + single Explore escalation
    AC-2 Original sequant-explorer.md removed from .claude/agents/ and templates/agents/ MET Both files deleted (git status shows D); find confirms zero remaining copies
    AC-3 Original Remaining references removed; acceptance grep returns only CHANGELOG history MET (flagged) grep -rn 'sequant-explorer' --include='*.md' . returns CHANGELOG.md (2 history hits) and vscode-extension/README.md (2 hits) — the VS Code extension's package filename sequant-explorer-0.0.1.vsix, an unrelated entity that happens to share the substring. This is a literal mismatch against the AC's own stated grep output. The requirement (no remaining references to the agent) is satisfied; the AC's prescribed verification command is over-broad. Flagged per spec's Open Question 1, not silently rationalized. Renaming the extension package is out of scope and would be a breaking, unrelated change.
    AC-4 Original Consumer upgrade path verified; residual stated in PR body + CHANGELOG PENDING Analysis complete: copyTemplates (src/lib/templates.ts:578) is purely additive, no unlink/prune path — confirmed by reading copyDir's write-only loop. Residual is documented in the CHANGELOG entry now. Not yet in the PR body because no PR exists at QA time in this fullsolve ordering (QA runs before PR creation) — will be included verbatim when the PR is opened in Phase 5.
    AC-5 Original Token delta of /spec skill body measured and reported in PR body PENDING Measured: spec/SKILL.md 18,567 → 18,423 bytes/mirror (−144 bytes, ~−36 tokens) per mirror; subagent-types.md 9,019 → 8,711 bytes/mirror (−308 bytes); 2 agent files deleted (−985 bytes each); docs/features/declarative-agents.md 7,848 → 7,554 bytes. Same PR-body-timing gap as AC-4.
    AC-6 Original CHANGELOG entry MET [Unreleased] > ### Fixed entry added, references #927, follows repo's existing verbose-entry convention

    Coverage: 4/6 MET, 2/6 PENDING (both blocked only on PR-body timing, not on missing work)


    Quality Plan Verification

    N/A — spec's plan used a custom "Findings from planning" format instead of the standard Feature Quality Planning section; no quality-plan table to verify against.


    Precheck Findings

    Section Status Surfaced
    Fixtures not_applicable No motivating-example payload in issue body
    Sibling-grep not_applicable No source-file declarations changed (docs/config/skill prose only)
    AC literal-diff not_applicable No PR body available yet (PR not created — see AC-4/AC-5 above)

    Source: .sequant/gap-precheck.json (schemaVersion 1)


    CI Status

    No PR exists yet (QA runs before PR creation in this fullsolve ordering).


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK (no .ts/.tsx in diff)
    Deleted tests 0 OK (no test files in diff)
    Files changed 10 OK
    Lines added +37 -
    Lines deleted -158 -

    Cache Status

    N/A — no cache configuration invoked for this run.


    Build Verification

    N/A — npm run build passed.


    Test Coverage Analysis

    N/A — no source files (.ts/.tsx/.js/.jsx) in the diff; nothing to cover.


    Code Review

    Strengths:

    • Replacement prose is honest about the actual default (targeted Read/Grep) rather than just deleting the guidance outright — preserves the escalation path for genuinely open-ended discovery.
    • Agent(sequant-explorer) → Agent(Explore) frontmatter swap keeps the escalation path allow-listed instead of leaving the new prose describing a tool the skill isn't permitted to call.
    • All three mirrored copies (.claude/skills, templates/skills, skills) kept byte-identical throughout — verified via diff after each edit, not just at the end.
    • CHANGELOG entry documents the sync-prune residual proactively rather than leaving it as a silent gap.

    Issues:

    • None blocking. AC-3's own verification command has a false-positive carve-out (see AC-3 note) — cosmetic, doesn't affect correctness.

    Suggestions:

    • None — the change is proportionate to the issue (prose + 2 file deletions, no scope creep into the explicitly listed Non-Goals).

    Test Quality Review

    N/A — no test files modified.


    Anti-Pattern Detection

    Dependency Audit

    N/A — package.json not modified.

    Code Patterns

    No anti-patterns detected — diff is prose-only (Markdown), no executable code changed.

    Critical Issues: 0
    Warnings: 0


    Call-Site Review

    N/A — no new exported functions (diff touches no .ts/.tsx files).


    Execution Evidence

    N/A — no scripts/ or CLI files modified.


    Skill Command Verification

    Skill files changed: 6 (3 mirrors × spec/SKILL.md, 3 mirrors × subagent-types.md)

    File Commands Found Verification Status
    spec/SKILL.md (×3) 0 new ✅ Passed (table replaced with prose, no CLI invocations added)
    subagent-types.md (×3) 0 new ✅ Passed (one Agent(subagent_type="Explore", ...) example added — built-in type, no verification needed)

    Verification Status: Passed


    Detection Pattern Verification

    N/A — no diff hunks in changed skill markdown introduce new grep/awk/jq/sed commands or regex literals (precondition false; section omitted per §6c policy, not marked N/A elsewhere but noted here for completeness).


    CLI Registration Verification

    N/A — no option interfaces or bin/cli.ts modified.


    Skill Change Review

    • Command verified: No new commands introduced — N/A for this criterion.
    • Fields verified: N/A — no JSON-field-consuming commands added.
    • Patterns complete: The new "Context-Gathering Strategy" prose covers both the common case (targeted Read/Grep) and the escalation case (single Explore agent) — matches the two behaviors actually observed in the 169-run corpus cited by the issue.
    • Dependencies explicit: No new tool/CLI dependencies introduced.

    Smoke Test

    Applicable smoke tests for a skill-prose change (no runtime server to hit): schema/sync validation in place of a live /spec invocation.

    Test Command Result Notes
    Skill frontmatter validity npx skills-ref validate templates/skills/spec/ ✅ Pass Valid skill: templates/skills/spec/
    3-way mirror sync npm run lint:skill-sync ✅ Pass 44/44 synced, incl. both edited files
    Skill-call qualification npm run lint:skill-calls ✅ Pass No violations
    Skill verdict-gate reachability npm run lint:skill-gates ✅ Pass No violations

    Smoke Test Status: Complete


    Manual Test ACs

    All 6 ACs specify Manual verification in the spec plan.

    AC Verification Method Runtime Test Status Evidence
    AC-1 Manual (diff 3 mirrors) ✅ Executed diff confirmed byte-identical after edit
    AC-2 Manual (ls both paths) ✅ Executed Both files confirmed absent
    AC-3 Manual (run acceptance grep) ✅ Executed Ran; result flagged (see AC-3 note) rather than silently accepted
    AC-4 Manual (cite templates.ts) ⚠️ PENDING Citation done; PR-body inclusion pending Phase 5
    AC-5 Manual (measure post-edit bytes) ⚠️ PENDING Measurement done; PR-body inclusion pending Phase 5
    AC-6 Manual ✅ Executed CHANGELOG entry confirmed present

    Manual Test Enforcement: 4/6 manual-test ACs verified at runtime; 2/6 pending PR-body inclusion (not a missing check — the artifact they require doesn't exist until Phase 5)


    Risk Assessment

    • Likely failure mode: None at runtime — this is a documentation/config change with no executable surface. The only latent risk is future skill-authoring drift: someone re-adds a hardcoded agent count table without re-measuring actual /spec behavior, repeating the original defect.
    • Not tested: No live /spec invocation was run against a real issue to observe an actual Explore escalation in practice — validated statically (schema, sync, frontmatter) instead, since a live run is out of scope for QA and the original defect was itself about un-exercised prescriptive text.
    • Sibling sites considered: none — no cross-file siblings with the same root cause (the sequant-explorer reference was fully enumerated and removed; sequant-implementer/sequant-testgen are explicitly Non-Goals per the issue).
    • Sibling-line audit: none — single dead-prescription removal, not a repeated pattern within one file.

    Trust-Boundary Check

    Finding: Clean — diff implements only the product requirements stated in the issue (replace dead prescription, remove agent files and references, document the residual). No agent-directed instruction from issue body/comments (execute a command, reach the network, read/exfiltrate files, override instructions) was found or acted on. The issue body itself contains only legitimate problem/design/AC content, no hidden HTML-comment or code-block imperatives.

    Status: Clean


    Behavior-Rule Survival Check

    AC Triggered? Survivors Status
    AC-1 No — N/A
    AC-2 No — N/A
    AC-3 No — N/A
    AC-4 No — N/A
    AC-5 No — N/A
    AC-6 No — N/A

    Status: N/A (no AC triggers the behavior-rule heuristic — this is a removal/documentation issue, not a default/always/never rule change)


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix(spec): conventional-commit prefix detected)
    [Unreleased] entry ✅ Present
    Entry format ✅ Valid (action verb, includes #927, correct ### Fixed section)

    Result: CHANGELOG requirements met


    Adversarial Re-Read

    Findings: Ran 5 additional checks beyond the structured pipeline: (1) no verbatim motivating-example fixtures exist in the issue body to re-run (precheck confirmed not_applicable); (2) no "evidence" claims in this PR are pre-fix bug repros — the issue's 0%-spawn-rate claim is a corpus measurement, not a repro, and isn't re-asserted as post-fix validation anywhere in the diff; (3) process state is clean — git status --porcelain empty, one commit ahead of origin/main, branch pushed, no stash relevant to this work; (4) sibling sites — grepped for any other stale agent-count reference (4 custom agents, four custom agents, 4 agents) across .claude/, templates/, skills/, docs/ and found none remaining; also confirmed the diff touches none of the issue's explicit Non-Goals (sequant-implementer, sequant-testgen, sequant-qa-checker files untouched); (5) no Non-Goals silently expanded into scope. The one substantive gap already surfaced (AC-3's grep carve-out) is called out explicitly above rather than hand-waved.

    Status: Clean


    Verdict: NEEDS_VERIFICATION

    All 6 ACs are MET or PENDING — none NOT_MET or PARTIALLY_MET. The two PENDING ACs (AC-4, AC-5) are blocked only on PR-body content that cannot exist until the PR itself is created (this fullsolve run executes QA before PR creation), not on missing analysis or measurement — both are fully worked out above and will be copied verbatim into the PR body in Phase 5, at which point both ACs resolve to MET. No code regression, no security finding, no scope creep, clean 3-way skill mirror sync, all automated skill-validation gates pass.

    Documentation

    • N/A - internal skill-maintenance fix, no user-facing README/docs beyond docs/features/declarative-agents.md (already updated as part of this diff)

    Next Steps

    1. Create the PR with a body that includes the AC-4 residual note and the AC-5 token-delta measurements (content already drafted above) — resolves both PENDING ACs.
    2. No /loop needed — proceed directly to PR creation per the NEEDS_VERIFICATION path (verification is "does the PR body exist with this content," not an external system).
  5. admarble commented on Aug 10, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #927
    Status: NEEDS_VERIFICATION → resolved via PR body (AC-4/AC-5 content now present)

    Summary

    • /spec's dead "Agent Spawn Rules" table (0 spawns / 169 runs) replaced with the strategy actually in use — targeted inline Read/Grep by default, single Explore escalation for open-ended discovery — mirrored across all 3 skill dirs.
    • sequant-explorer.md removed from .claude/agents/ and templates/agents/; all references removed from subagent-types.md (×3) and docs/features/declarative-agents.md.
    • Frontmatter Agent(sequant-explorer) → Agent(Explore).
    • CHANGELOG entry added documenting the sync-prune residual.

    Progress Table

    Phase Iterations Status
    Spec 1/1 Complete (this session, prior to fullsolve invocation)
    Worktree 1/1 Complete
    Exec 1/1 Complete
    Test Skipped No UI labels
    QA 1/2 Complete — NEEDS_VERIFICATION
    PR 1/1 Complete

    AC Coverage

    AC Status
    AC-1 MET
    AC-2 MET
    AC-3 MET (flagged carve-out: vscode-extension package name is an unrelated grep false-positive, documented)
    AC-4 MET (PR body now contains the residual note)
    AC-5 MET (PR body now contains the token-delta table)
    AC-6 MET

    Coverage: 6/6 MET

    Quality Metrics

    • Build: ✅ pass | Lint: ✅ pass | lint:skill-sync: ✅ 44/44 synced | lint:skill-calls: ✅ | lint:skill-gates: ✅ | skills-ref validate: ✅
    • Type issues: 0 | Deleted tests: 0 | Files changed: 10 | +37/−158 lines
    • No source code touched — nothing to unit-test

    Iteration Summary

    • Exec loop: 1 (no retries needed)
    • QA loop: 1 (NEEDS_VERIFICATION resolved by PR creation itself, no /loop invoked)

    Final Verdict: READY_FOR_MERGE (post-PR)

    Both PENDING ACs from the QA pass were PR-body-timing artifacts, not missing work — resolved the moment the PR was opened with the drafted content.

    PR: #931


    Ready for human review and merge.

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

    enhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions