Skip to content

fix(#960): /loop's orchestrated Step 1A trusts embedded promptContext instead of re-fetching from GitHub - #962

Merged
admarble merged 4 commits into
mainfrom
feature/960-bug-loop-orchestrated-step-1a-re-fetches-qa-fi
Aug 24, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/960-bug-loop-orchestrated-step-1a-re-fetches-qa-fi

Conversation

@admarble

@admarble admarble commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pre-PR AC Verification

AC Description Status Evidence
AC-1 Orchestrated /loop with an embedded promptContext parses it and skips gh issue view ✅ Implemented src/lib/workflow/phase-executor.ts (PROMPT_CONTEXT_SENTINEL, getPhasePrompt), .claude/skills/loop/SKILL.md §Step 1A (step-1a-context-source (#960)), gate test src/lib/__tests__/loop-context-source-skill.test.ts, unit test phase-executor.test.ts
AC-2 Live sequant ready dogfood run with a genuine fix_now gap shows /loop reflecting fresh QA data 🔄 Deferred Needs a real in-flight issue with a genuine fix_now gap under sequant ready to dogfood against — not reproducible synthetically inside this PR's implementation. Recommend running as a follow-up dogfood pass against the next qualifying issue and posting the transcript to #960.
AC-3 Standalone /loop <N> unaffected — still fetches from GitHub/log file ✅ Implemented Step 1B untouched; gate test asserts Step 1B contains no SEQUANT_PROMPT_CONTEXT/gh issue view references (mutation-verified: leaking a sentinel mention into Step 1B breaks the AC-3 test)

Mutation Verification

Mutation-verified: AC-1 — replaced "Check your own invocation first" sentinel-check phrase in Step 1A; 2 AC-1 assertions in loop-context-source-skill.test.ts failed; restored.

Mutation-verified: AC-1 — removed the sentinel wrap in getPhasePrompt's basePrompt += line; the new sentinel unit test in phase-executor.test.ts failed; restored.

Mutation-verified: AC-3 — inserted a stray "check for SEQUANT_PROMPT_CONTEXT" line into Step 1B; the AC-3 guard test failed; restored.

Test plan

  • npx vitest run src/lib/workflow/phase-executor.test.ts -t "getPhasePrompt" — 10/10 pass
  • npx vitest run src/lib/__tests__/loop-context-source-skill.test.ts — 21/21 pass
  • npm run build, npm run lint — clean
  • npm test (full suite) — 273 test files, 5626 passed, 1 pre-existing expected-fail, 2 skipped (no regressions)
  • npm run lint:skill-sync — 44 synced, 0 diverged
  • AC-2 live dogfood (deferred — see AC table above)

Closes #960

🤖 Generated with Claude Code

Follow-up (validation pass)

  • Sentinel-rename drift hole closed: the gate test now builds its sentinel assertions from the imported PROMPT_CONTEXT_SENTINEL constant instead of hardcoded literals — a rename of the TS constant's value now fails the gate until the skill text follows.
  • Step 1A parsing guidance tightened: the embedded block is not QA-comment-shaped, so the skill now states its gap list IS the recommendations, and scopes the "already filtered" claim to the gap list only (batch-executor's Suggestions:/Last output: are raw, unfiltered context).

Mutation-verified: AC-1 — renamed the TS sentinel constant's value; 9 gate assertions failed across all 3 skill mirrors (previously this rename passed both suites — the drift hole this commit closes); restored.

Mutation-verified: AC-1 — deleted the gap-list-to-recommendations bullet from Step 1A; the new mapping assertion failed; restored.

…ing GitHub

getPhasePrompt() now wraps appended promptContext in a SEQUANT_PROMPT_CONTEXT
sentinel; /loop's Step 1A checks its own invocation for that sentinel first
and skips the gh issue view fetch when present, falling back to the fetch
only when absent. Standalone Step 1B (log file) is unchanged.
…asePrompt's own

The sentinel's JSDoc had been inserted between getPhasePrompt's docstring
and the function itself, leaving that docstring describing the wrong
symbol. Found in self-review.
… recommendations

- Gate test now builds its sentinel assertions from the imported
  PROMPT_CONTEXT_SENTINEL constant instead of hardcoded literals, so a
  rename of the TS constant fails the gate until the skill text follows
  (#871-class TS<->prose drift).
- Step 1A now states the embedded block's gap list IS the recommendations
  (the QA-comment parsing greps extract nothing from the block shape) and
  scopes the 'already filtered' claim to the gap list only — batch-executor's
  Suggestions:/Last output: sections are raw, unfiltered context.
@admarble
admarble merged commit 4c20536 into main Aug 24, 2026
9 checks passed
@admarble
admarble deleted the feature/960-bug-loop-orchestrated-step-1a-re-fetches-qa-fi branch August 24, 2026 05:57
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.

bug(loop): orchestrated Step 1A re-fetches QA findings from GitHub instead of trusting the promptContext already embedded in its own prompt

1 participant