Skip to content

feat(#111): update /fullsolve to invoke child skills and add --chain to /solve - #112

Merged
admarble merged 1 commit into
mainfrom
feature/111-feat-update-fullsolve-to-invoke-child-skills-a
Jan 18, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/111-feat-update-fullsolve-to-invoke-child-skills-a

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Updates /fullsolve skill to invoke child skills (/spec, /exec, /test, /qa) via the Skill tool instead of running phases inline
  • Adds --chain flag recommendations to /solve skill for dependent issues

Changes

/fullsolve improvements

  • Skill invocation: Each phase now uses Skill(skill: "...", args: "<issue>") instead of inline implementation
  • Orchestration context: Environment variables (SEQUANT_ORCHESTRATOR, SEQUANT_PHASE, etc.) passed to child skills
  • Failure handling: Graceful error handling with iteration loops for each phase
  • Quality loops: Preserved iteration logic between skill calls (max 3 for exec/test, max 2 for QA)

/solve --chain recommendations

  • Chain Mode section: Output now includes chain recommendation for 2+ issues
  • Detection logic: Checks for dependency keywords, sequence labels, related issue references
  • Visualization: Shows chain structure diagram (origin/main → #10 → #11 → #12)
  • CLI documentation: Updated with --chain flag examples and explanation

Test plan

  • All existing tests pass (378 passed)
  • Build succeeds
  • No type safety issues
  • No deleted tests
  • Manual verification: Run /fullsolve on a test issue
  • Manual verification: Run /solve with multiple issues

AC Coverage

AC Status
Use Skill tool for child skills ✅ MET
Maintain orchestration context ✅ MET
Handle skill failures gracefully ✅ MET
Preserve quality loop iteration logic ✅ MET
Recommend --chain when appropriate ✅ MET
Do NOT recommend --chain when inappropriate ✅ MET
Add Chain Mode section with visualization ✅ MET

Fixes #111

🤖 Generated with Claude Code

…to /solve

Updates /fullsolve skill to invoke child skills (/spec, /exec, /test, /qa)
via the Skill tool instead of running phases inline. This provides:
- Proper audit trail with structured skill output
- GitHub comments posted by each skill phase
- Consistent orchestration context via environment variables
- Graceful failure handling with iteration loops

Adds --chain flag recommendations to /solve skill:
- Chain Mode section in output for 2+ issues
- Detection logic for dependencies, sequence labels, and related issues
- Visualization of chain structure (origin/main → #1 → #2 → #3)
- Clear guidance on when to use vs. not use chain mode

Fixes #111

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit 982a62b into main Jan 18, 2026
@admarble
admarble deleted the feature/111-feat-update-fullsolve-to-invoke-child-skills-a branch January 18, 2026 02:01
admarble added a commit that referenced this pull request Aug 6, 2026
* fix(#899): create the worktree in /fullsolve, verify it in /exec

Skill-driven /fullsolve never had worktree isolation. Three links failed
together since #111/#112 (2026-01-17):

1. /fullsolve claimed /spec creates the feature worktree. /spec never has.
2. /fullsolve exported SEQUANT_WORKTREE as an unexpanded glob, at three sites.
3. /exec was told to `cd $SEQUANT_WORKTREE` and skip creation without checking.

The cd failed, creation was skipped by contract, and the agent implemented in
whatever directory it was already in. Single-session runs degraded silently;
concurrent ones interleaved checkout/reset/commit in one working tree.

A second failure mode compounded it: ../worktrees/ is derived from the parent
of the git root, so every sibling repo shares one flat namespace, and both
lookups keyed on the issue number, which is per-repo. Creation was never the
exposed surface (git worktree add onto a foreign path fails loudly);
resolution was.

Changes:

- New `sequant worktree` command group. `resolve <issue>` prints this repo's
  worktree path; `verify <path> [--issue N]` refuses a missing, foreign, or
  stale one. Both read `git worktree list` in the current repository, so a
  sibling project's worktree structurally cannot appear, and both select on
  the branch git reports rather than the directory slug — the two already
  diverge in practice (578-seo-expand-city-coverage holds
  feature/578-city-expansion-clean).
- /fullsolve gains Phase 1.5: creates the worktree via new-feature.sh
  (idempotent, safe on resume), resolves the absolute path, exports it. All
  three glob exports replaced. The false /spec claim and the Phase 1
  post-state are corrected.
- /exec verifies before it trusts, halting on a named error rather than
  continuing in place; its standalone lookup resolves through git.
- /spec states its worktree contract explicitly again (dropped by #515).
- All three skill mirrors synced.

Every new failure mode halts: SEQUANT_WORKTREE_NOT_FOUND,
SEQUANT_WORKTREE_FOREIGN, SEQUANT_WORKTREE_ISSUE_MISMATCH,
WORKTREE_NOT_FOUND, WORKTREE_AMBIGUOUS. The bug was a fail-open one; the fix
does not replace it with a lenient guard.

The `sequant run` CLI path is unaffected — it always called ensureWorktree
before setting SEQUANT_WORKTREE, which is what /exec's skip branch was
written against.

Absorbs #900.

Fixes #899

* fix(#904): close the unverified-worktree defect in every skill, not just /exec

#899 fixed /exec. The same pattern had been copied into five more skills, each
found by widening the search rather than trusting the first fix.

Unguarded `cd $SEQUANT_WORKTREE` (the exact line #899 removed from /exec):
  - /qa  — reviewed the main checkout while reporting on the feature branch
  - /loop — worse: it WRITES, so it applied fixes and committed them there

Filesystem globbing of the shared ../worktrees/ namespace:
  - /qa, /loop, /testgen — /testgen writes test stubs, so a cross-repo match
    scatters them into an unrelated project

Prefix matching on the issue number instead of the branch:
  - /merger ×2 — `git worktree list | grep "feature/$ISSUE"`, and the next
    line is `git worktree remove --force`. With ISSUE=89 that matches
    feature/899-* and force-removes an unrelated issue's worktree.
  - /qa Phase 0 — `grep -i "<issue-number>"` gated the "no implementation
    found" verdict on a bare-number match
  - /assess — read-only probe, corrected for the same reason

All now route through `sequant worktree verify` / `resolve` from #899.

Rather than pin the six known sites, two completeness invariants close the
class: every `cd $SEQUANT_WORKTREE` in ANY skill must sit inside a
verify-bearing guard region, and no skill may glob ../worktrees/ or grep
`git worktree list` for an issue number. A new skill reintroducing either
pattern now fails the build. The bug reached six skills by being copied, so
pinning known sites would not have held.

Both invariants are scoped to spare legitimate uses: /assess's
`grep "^worktree"` enumerates every worktree for diff-overlap and keys on
nothing, so it is not flagged. Narrowing that exemption is what caught the
`--porcelain` variant in /merger that the first regex missed.

Fixes #904
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.

feat: Update /fullsolve to invoke child skills and add --chain to /solve recommendations

1 participant