Repository navigation
Description
Context
Sequant's skills know two checkout modes. Orchestrated (SEQUANT_ORCHESTRATOR set): the phase uses SEQUANT_WORKTREE, verified by the #899 existence guard. Standalone (SEQUANT_ORCHESTRATOR unset): the skill creates a worktree itself (exec/SKILL.md:301–318, :507; qa/SKILL.md:407 resolves one via npx sequant worktree resolve and halts otherwise). Neither mode can run a phase on a branch in the current clone.
That is exactly what a claude.ai cloud session is: a fresh clone of main, no sibling ../worktrees/, no sequant binary, no .claude/.local/ overrides. The 2026-09-24 matcha-maps credit plan (one cloud session per issue-phase, invoking /exec and /qa as the top-level agent) had to override the skills by prompt, and its reviewer needed four quoted anchors to do it:
exec/SKILL.md:507and:315–320— do not run./scripts/dev/new-feature.sh, do not create a worktreeexec/SKILL.md:465–475— skip thenpm run dev &smoke test- never invoke
/test— its.claude/.local/skills/test/overrides.mdis gitignored and absent in the clone qa/SKILL.md:407— treat$PWDas the worktree;worktree resolvewould bail
Prompt-level overrides of a 2,152-line skill are untested and drift with every skill edit. The mode should be first-class.
Design constraint
Explicit opt-in, never inferred. #899 closed the failure where skills silently executed in the main checkout because nothing verified the worktree. Auto-detecting "fresh clone on main" would reopen it. The mode is entered only by an env flag the launcher sets (proposed: SEQUANT_CHECKOUT=in-place); with the flag unset, behaviour is byte-identical to today.
The commit guard in pre-tool.sh already allows commits on a non-base branch in the main checkout (the #1079 cloud run committed and was stopped only by GitHub App push permissions), so no hook change is needed.
Fix shape
In-place mode, in exec and qa (and loop/testgen if they resolve a worktree):
- On entry: if the current branch is the base branch, create and check out
feature/<N>-<slug>fromorigin/<base>; if already on a non-base branch, keep it. Never callnew-feature.sh,git worktree add, orworktree resolve. - Skip the dev-server smoke section unless
SEQUANT_SMOKE=1. - Never invoke
/test. - Everything else (AC loop, suite, PR creation, verdict comment) unchanged.
- The mode table (
orchestrated/standalone/in-place) goes in the skill's env-var section and a docs reference page.
Consumer: the claude-cloud driver (filed separately) sets this flag for every cloud phase.
Acceptance criteria
- AC-1:
execwithSEQUANT_CHECKOUT=in-placeand cwd on the base branch creates and checks outfeature/<N>-<slug>in the current clone and never invokesnew-feature.sh,git worktree add, orworktree resolve— Verify: gate test on the delimited in-place section oftemplates/skills/exec/SKILL.md, mutation-verified per CLAUDE.md - AC-2:
qawith the flag treats$PWDas the worktree, skipsnpx sequant worktree resolve, and halts if the current branch is the base branch — Verify: gate test on the delimited section oftemplates/skills/qa/SKILL.md, mutation-verified - AC-3: with the flag unset, the bug(fullsolve/exec): the worktree is never created and never verified — skill-driven runs execute in the main checkout, or in another repo's worktree #899 guards are untouched and the mode is never inferred from git state — Verify: existing bug(fullsolve/exec): the worktree is never created and never verified — skill-driven runs execute in the main checkout, or in another repo's worktree #899 gate tests green and
grep -c "in-place" templates/skills/exec/SKILL.mdmatches only inside the delimited section - AC-4: all three skill directories carry the change — Verify:
npm run lint:skill-syncgreen - AC-5: docs reference page lists the three modes with their entry condition and what each skips — Verify:
grep -l "in-place" docs/reference/*.mdnon-empty - AC-6: dogfood — one real cloud session on a project issue with the flag set opens a PR, and its run log shows no worktree attempt; the session URL and PR link are posted on this issue — Verify: the comment
- AC-7:
npm run build && npm testgreen
Not in scope
Launching cloud sessions from sequant run (the driver issue), hook changes, /test portability.
Related
#899 (the guard this must not weaken) · #901 (checkout-scoped locks) · #1096 (driver conformance item 6, skill load) · #1079 (the cloud run that proved commits pass the hook)
Activity
admarble commentedon Sep 24, 2026
AC-6 (dogfood cloud session) is blocked, and I have not ticked it. Every other AC is implemented and verified on branch
feature/1136-feat-exec-qa-explicit-in-place-checkout-mode-. The PR follows.A real cloud session with
SEQUANT_CHECKOUT=in-placehas to push a branch and open a PR. The #1079 cloud run showed the claude.ai GitHub App has no write access tosequant-io/sequant: the commit passed the hook and the push was rejected. One of these unblocks AC-6:sequant-io/sequant, or on the project repo the dogfood will use. Then the dogfood session runs and its URL and PR link get posted here.Deferred to #NNNN. A comment alone does not change the gate that/qareads.Until one of those happens, the PR's
Closes #1136would close this issue with AC-6 unmet.admarble commentedon Sep 24, 2026
QA Review for Issue #1136
PR #1139, reviewed at
283560c1. Standalone QA, standard pipeline: the diff is 1,250 lines, all additive.AC Coverage
feature/<N>-<slug>, never reaches worktree toolingorigin/main,resolveIssueWorktreeresolves it,listWorktrees= 1, and thenpxshim was called 0 times.$PWDas the worktree, skips resolve, halts on baseverifyWorktreePath, with 0npxcalls. qa's Phase 0 resolve is behind a skip marker.grep -c "in-place"returns 20, all 20 inside regions. The skill diff deletes 0 lines. The #899 regions hash-identical toorigin/main(3 roots × 4 skills). The #899 gate tests pass 51/51. The unset-flag no-op is executed in the test.npm run lint:skill-sync: 44 synced, 0 diverged. The changed files hash-identical across roots.grep -l "in-place" docs/reference/*.mdreturnscheckout-modes.md, plus a table-shape gate.sequant-io(#1079). See the comment above for the two ways to unblock.npm run buildexit 0.timeout 900 npm test: 337 files, 8,376 passed, 0 failed.Coverage: 6/7 met.
CI Status
testis pending. The other 9 checks pass, including canary, typecheck, validate-skills and tautology-advisory.Quality Checks
any, 0 deleted or skipped tests. Onerow!is guarded bytoBeDefined.[a-z0-9-]before reachinggit. Every expansion is quoted.rmSynctouches only the mkdtemp scratch dir.Detection Pattern Verification (§6c)
The
sedslug pipeline was run against 10 recent realfeature/branches recomputed from their issue titles. 10 of 10 differ. Those branches came fromsequant run, whoseslugifyinworktree-manager.ts:108cuts the slug at 50 characters. The in-place block copiesnew-feature.sh, which cuts the whole branch at 58. The two rules agree only when the slug is at most 45 characters.ensureWorktreelooks up an existing branch by exact name, so a later localsequant runphase would miss a long-titled in-place branch and branch again. That is the #1137 hand-off path. Resolver lookups key on the issue number and are unaffected.Status: Failed for the "same name" claim. The AC-1 text does not specify which slug rule to use.
Mutation Verification
in-place-checkout-skill.integration.test.ts > … > creates feature/<N>-<slug> …… > qa > treats $PWD as the worktree …… > never inferred > every mention …… > checkout modes reference page (AC-5) > …Status: Verified. There are six recorded mutations, each failing exactly one test, and all four markers parse
valid.Trust-Boundary Check
Finding: Clean. The diff implements only the issue's product requirements. The issue body carries no agent-directed instructions.
Status: Clean
Adversarial Re-Read
Findings:
sequant runspreadsprocess.env, so an exportedSEQUANT_CHECKOUTcollides withSEQUANT_WORKTREE. It halts loudly and the docs cover it./fullsolveand/testalso create or resolve worktrees and have no in-place entry. The issue scopes them out../scripts/dev/new-feature.sh, which is not tracked in the repo. It is harmless inside a prohibition.Status: Gaps Found
Risk Assessment
sequant runphase does not reuse.ghtitle fetch against the real API inside the entry block. The test shimsgh.fullsolveandtestskills, out of scope. The worktree-managerslugifyis covered by the finding.CHANGELOG Verification
Result: The entry is present under
[Unreleased] / Addedand carries the issue number.Verdict: AC_NOT_MET
AC-6 is not met and cannot be met from code. It needs the App permission or an edit to the AC text. All other ACs are met with executed evidence. The slug finding is a small fix that will land in the same PR.
Next Steps
worktree-manager.tsslugify, which cuts the slug at 50. Extend the corpus check.Closes #1136would otherwise close the issue with AC-6 unmet.fix(#1136): in-place branch name matches sequant run's slugify
admarble commentedon Sep 24, 2026
Field evidence from the matcha-maps credit run (2026-09-24), relevant to the design and to AC-6.
Two cloud sessions ran
/specand/execon a fresh clone ofmainwith the in-place behaviour carried by prompt overrides (the four anchors in the issue body). Observed in the run logs (docs/internal/graph-2026-09-credits/HANDOFF.mdin admarble/matcha-maps):Skill{skill:"spec"}andSkill{skill:"exec"}both loaded the vendored 2.17.0 skills. With the overrides, the worker branched in place fromorigin/main, created no worktree, ran nonew-feature.sh, skipped the dev-server smoke test, and opened a PR. So the override path works; this issue makes it a flag instead of ~400 words of prompt.ghis not installed in the cloud environment. The spec skill's preflight printedGITHUB_AVAILABLE=falseand the worker fell back to the GitHub MCP connector for the issue read, the plan comment and the PR. In-place mode must not assumegh; either the skill's platform preflight tolerates MCP-only, or the docs say the environment needs a setup script that installs it.pre-tool.shenv-dump guard and the repo'sBash(env)deny both fired on the worker'senv | grep -i sequantprobe (unanchored). Thenode -ekey-name probe works. Not a defect; noting so the mode's docs recommend the node probe..sequant/settings.jsonis untracked in that repo, so it is absent in the clone (SETTINGS_AVAILABLE=false). In-place mode must not require it.AC-6 status: the GitHub App now has write access on
admarble/matcha-maps(both runs pushed and opened PRs). It still lackssequant-io, so the dogfood run for this AC can happen on matcha-maps once the flag exists there, or on this repo after the App is granted.fix(#1136): in-place entry block takes the issue title as a placehold…
admarble commentedon Sep 24, 2026
AC-6 evidence and updated QA verdict
Session: session link removed (
cse_01W6MSXo6CpVP1WmyNMwxWVz, Sonnet 5, cloud environment "Sequant in-place" carryingSEQUANT_CHECKOUT=in-place, fresh clone ofsequant-io/sequantonmain).PR it opened: #1142 (fix for #1123, on
feature/1123-fix-init-yes-init-replaces-a-user-modified-agents-).What the run log shows (read through the routines API, all pages):
echo SEQUANT_CHECKOUT=$SEQUANT_CHECKOUT→in-place, set by the environment, not by the agent.git worktree list→ one entry,/home/user/sequant, before and after.main:Switched to a new branch 'feature/1123-fix-init-yes-init-replaces-a-user-modified-agents-'…set up to track 'origin/main'. The name equalssequant run's slugify of the issue title, so a later local phase reuses it.git push -u origin feature/1123-…→[new branch]. Cloud push protection did not block a skill-created branch.### Settled against baseblock, andCloses #1123.new-feature.sh,git worktree add, orworktree resolveanywhere in the session.What the dogfood found, fixed on PR #1139 (
7f6d0ba1): the first attempt halted inside the entry block withgh: command not found. Cloud sandboxes have nogh; the title is now an<issue-title>placeholder the agent fills fromghor the GitHub MCPissue_readtool, and the block never namesgh. Mutation-verified: restoring theghfetch fails the AC-1 gate.Side findings for #1137's Phase-0 list: the environment setup script does not run in the repo checkout (
npm cithere fails); cloud clones are shallow, so__tests__/evals-fixture-commit.test.tsfalse-fails 5 cases (the session filed #1140 after settling it against base); the repo's Stop hook errors in the cloud; a stopped run leaves a readable log with runner lines. One caveat on the evidence: the session prefixed the block with its ownexport SEQUANT_CHECKOUT=in-place, redundant with the environment value it had already printed.AC Coverage
7f6d0ba1is 10/10 greenAdversarial Re-Read
Findings:
/fullsolveand/teststill have no in-place entry (scoped out by the issue). An exportedSEQUANT_CHECKOUTin asequant runshell halts every phase on the mutual-exclusion check (fails safe, documented). The dogfood agent added anexportline to the block, showing agents may embellish the block; the flag check still gates entry.Status: Gaps Found
Verdict: AC_MET_BUT_NOT_A_PLUS
All seven ACs are met with executed evidence. The remaining gaps are follow-ups, not blockers.
feat(#1136): explicit in-place checkout mode for exec, qa, loop and t…
docs(exec): doc-gate tests must call production code; red-main re-run…