Repository navigation
Conversation
…mes why not The SDK's default system prompt is a bare stub that drops the line telling the model to run /skill through the Skill tool. runAgentSdkTest now refuses a missing, empty or bare-string prompt; non-preset callers name a reason; a free tripwire scans test/ and scripts/ for the same mistake. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
…and baseline its tripwire harness-version: runAgentSdkTest validates systemPrompt before starting; every live caller already passed the claude_code preset, so no verdict can change. test-of-test ratchet: the tripwire's subject is the eval harness by design. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…usal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Conflict: test/helpers/touchfiles-data.ts 'ship-measure-seeded-flake' kept both sides (main's scripts/lib/shard-jobs.ts and this branch's test/helpers/sdk-system-prompt.ts). Product diff vs main unchanged: 14 files, +269/-77. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Frozen in wave |
3 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
* Attribute every paid trial's cost: bind label-named records by testName, price aborted SDK sessions from streamed usage, model-free cases cost $0 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: case cost adds streamed sessions to record sums and keeps record cost_known Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: the paid report headline counts ledger-only session cost once Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: a cost-only record never sets the trial model Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: recordE2E writes cost_case_id only for a registered label-named case Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: CHANGELOG for paid-report cost attribution (Unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: the headline adds only streamed session cost; cache writes without a 5m key Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: how the paid report prices a trial and what stays cost-unknown Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Price PTY sessions from their transcripts: pin a session id, sum the session's and its subagents' usage into the ledger's streamed_cost_usd Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: transcript pricing never throws from a PTY ledger writer Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: pin transcript-cost.ts as non-behavioral at HARNESS_VERSION 6 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: recognise --session-id= and --resume= forms Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: CHANGELOG for PTY transcript pricing (Unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: PTY sessions priced from their transcripts Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: price PTY transcripts without adding a launch argument; native AUQ capture opts out Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: harness notes and CHANGELOG match the transcript claim Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): gstack-flaky run reruns a failed JUnit test once and ledgers the flake (GSTA-158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): stream output, keep unreported runner failures red, fail-closed duplicates and nonzero reruns Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes gstack-flaky never greens an incomplete run: a targeted rerun needs the runner's summary proving the first run complete, otherwise (and always for generic runners) the rerun repeats the whole command. A rerun clears a test only when it exits 0 and the test passes once on its first attempt. Killed runners exit 3 (FLAKY_COMMAND_KILLED) and signals are forwarded. The first report is restored at --junit with reruns kept beside it; ids are redacted at every output; the ledger gets its own GSTACK_FLAKE_LEDGER_JUNIT; fixtures are registered in FREE_FIXTURES. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: latch cancellation and check whole-command rerun reports A cancel forwarded to a runner that traps the signal now counts as killed for every later attempt, so a cancelled job is never rerun or greened. A whole-command rerun clears nothing when its report has a failed test, misses a first-run test, or its runner counted failures outside the report. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: whole-command rerun when coverage or runner-flaky tests can fail the run A coverage threshold or a fail-on-flaky policy fails a run for a reason a narrowed rerun cannot reproduce, so either forces a whole-command rerun. --junit refuses an existing file that is not a JUnit report instead of deleting it. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): rerun the whole command by default; targeted rerun is opt-in A rerun counts only on the runner's own full green verdict: exit 0, no failed or missing test, nothing counted outside the report. That covers every way a run can fail, which a narrowed rerun cannot (a coverage threshold with an lcov reporter, a fail-on-flaky policy, a test never reached). --rerun-scope test reruns the failed test alone, with its preconditions documented and the complete-run checks kept as a safety net. An unreadable existing --junit file is a usage error, not a crash. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: gstack-flaky CHANGELOG entry and standalone-binaries row (GSTA-158) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(flaky): quarantine registry for repeat flakes (GSTA-158 P2) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): bound renewal dates; match non-ASCII paths in check --base Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(flaky): reword the FLAKY_QUARANTINE_BASE hint so the egress scanner does not read it as a network op Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(agent-sdk): every SDK caller passes the claude_code preset or names why not The SDK's default system prompt is a bare stub that drops the line telling the model to run /skill through the Skill tool. runAgentSdkTest now refuses a missing, empty or bare-string prompt; non-preset callers name a reason; a free tripwire scans test/ and scripts/ for the same mistake. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: record the SDK prompt guard as a non-behavioral harness change and baseline its tripwire harness-version: runAgentSdkTest validates systemPrompt before starting; every live caller already passed the claude_code preset, so no verdict can change. test-of-test ratchet: the tripwire's subject is the eval harness by design. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: name the preset literal callers pass and the unnamed-prompt refusal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(eval-plan): frontier models under test (R54) Haiku and Sonnet are not models under test. dry-run refuses a plan whose every arm is Haiku or Sonnet unless --tier-question names what it asks about that tier, warns on a mix, and re-costs the plan on Opus 5.5 and GPT-6.1 Sol. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): trim R54 skill prose and raise the eval-plan context ceiling The R54 paragraph and CHECK: frontier bullet were cut to the minimum; the exemptions and verdict rule stay in docs/TESTING_INTERNALS.md. The remaining growth is the feature, so only the eval-plan eager ceiling moves (4887 -> 5458, the capture helper's value); other skills' ceilings are left as they were. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): pilot start keeps the R54 refusal; --tier-question rejects a flag Review pass 1 (full depth) found the frontier refusal could be skipped by starting a pilot on Haiku or Sonnet arms behind a dry run made on other arms, or behind a dry-run.json written before the check existed. startPilot now refuses a pilot whose every arm is Haiku or Sonnet unless its dry run recorded a tier question. dry-run --tier-question no longer takes the next flag as its answer. The testing doc now says the frontier re-cost is printed for comparison with the brief cap, not enforced. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(support-tiers): Windows CI in the present tense now that windows-smoke is required (#3806) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: empty commit for a clean check set at the same tree (cancelled orphan free-suite check at 97487df) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(skills): /eval-plan entry names the R54 frontier check Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 2, 2026
Closed
Contributor
|
Landed in wave #3847 as v1.93.10.0 (daf6613), merged from this PR's pin cf0ae6b. Integrator changes touching this PR's files: c1c8161 (merge of #3591, resolved by hand: scripts/harness-version.json), ba30ee0 (merge of #3819, resolved by hand: scripts/harness-version.json, test/helpers/agent-sdk-runner.ts). |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The new tripwire test fails on main with the 9 unnamed SDK callers and passes at this head. (Image rendering failed on the 1-core build machine, so this uses the text version.)
Before/after as text: The new tripwire fails on main with the 9 unnamed SDK callers and passes at this head
test/helpers/sdk-system-prompt.ts. It holdsCLAUDE_CODE_PRESETand two named exceptions,{ type: 'sdk-default', reason }and{ type: 'custom', text, reason }.sdkSystemPrompt()turns a caller's choice into SDK options.runAgentSdkTestrefuses a missing, empty, bare-string or unnamed prompt before it starts. Before this change,''silently meant the SDK's stub prompt.test/sdk-system-prompt-tripwire.test.ts. It scans everyrunAgentSdkTestcall and every direct SDKquery()call under test/ and scripts/. It fails on an omitted, bare or unnamed prompt, and it checks itself against negative controls.preflight-agent-sdk.ts --liveconnectivity probe. Each one now names its reason.scripts/harness-version.jsonrecords the runner change as non-behavioral, and the test-of-test ratchet lists the tripwire, whose subject is the eval harness by design.Proof
The tripwire run on origin/main (1ea8692) fails with the 9 sites listed. At this head it passes, and so do the 21 nearby test files (476 tests, with one timing failure in test/auq-parallel.test.ts that passes alone, 37/37), typecheck and the test-typecheck ratchet (814 known diagnostics, none new).
Why
FOUN-32 and gstack-evals found that "Agent SDK evals ran on the SDK's default system prompt", which voided another crew's null result. That default is a bare stub, and it drops the line that tells the model to run
/skillthrough the Skill tool, so a skill arm never loads its skill. Now no SDK caller can land on the stub without naming why, and free CI catches it.Blast radius
This touches test harness code, docs and one script only. No product code, no workflow edits, no network calls and no new dependencies. Every caller that reaches a real model already passed the preset, so no paid case changes behavior. We checked this by reading every
runAgentSdkTestand SDKquery()caller, and the tripwire passes at this head.scripts/preflight-agent-sdk.tsnow imports the dependency-free helper from test/helpers.Approvals
No approvals recorded for branch garrytan/sdk-preset-tripwire.
Summary
Agent SDK evals could quietly run on the SDK's stub prompt. Now every caller passes Claude Code's preset or names why not. The runner enforces this when a test runs, and a free tripwire enforces it in CI. Two follow-up commits fix the CI guards this change tripped (the harness-version record and the test-of-test ratchet baseline), and a docs audit corrected the new docs section's wording.
Test Coverage
The tripwire's three cases cover the scanner on every real caller, the scanner's negative controls, and the runner refusing a bare or unnamed prompt. The tripwire fails on origin/main (1ea8692) and passes at this head.
Pre-Landing Review
One reviewer, one round (Opus 5.5 at medium, the lightest depth for test-harness and docs changes). There are no blocking findings.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen dispatches=1
Gate edits: none detected (26 listed, 21 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: not run. This is test-harness, docs and one script, with no security, user-data, money or merge-check surface.
Review notes
These are three gaps in the tripwire's static scanner. None of them misses a current caller, and none blocks.
test/sdk-system-prompt-tripwire.test.ts:78: the scanner accepts anyquery()argument that contains a spread or mentionssystemPromptanywhere. Directquery()callers have no runtime guard, soquery({ prompt, options: { ...base } })would pass even ifbasehas no prompt. Possible fix: look only insideoptions:, and accept a spread only when the call forwards its arguments unchanged.test/sdk-system-prompt-tripwire.test.ts:71: the scanner misses an aliased import (import { query as sdkQuery }) or a namespace import (sdk.query(). Possible fix: read the local name from the import, or flag namespace imports.test/sdk-system-prompt-tripwire.test.ts:50: the scanner accepts any bare identifier as asystemPromptvalue. The runner still catches a bad value when a test runs, but a directquery()call has no such check. Possible fix: accept onlyCLAUDE_CODE_PRESETand*.systemPromptforwards.Design Review
No frontend files changed, so design review was skipped.
Eval Results
No paid evals ran. Every live caller already passed the preset, so no paid case changes behavior. Evals are deferred to the train's full gate.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual fix in the PR's new docs/TESTING_INTERNALS.md section; no blockers.
Scope: branch
garrytan/sdk-preset-tripwireagainst base1ea86923, committed changes (2 commits, 14 files); no staged, unstaged or new files. Searched every authored.md/.tmplforsystemPrompt,runAgentSdkTest,agent-sdk-runner,claude_code,sdk-system-promptandpreset, then checked the new section againsttest/helpers/sdk-system-prompt.ts,test/helpers/agent-sdk-runner.tsandtest/sdk-system-prompt-tripwire.test.ts.Documentation health:
CLAUDE_CODE_PRESETis the same value, also exported) and says the runner also refuses an unnamed prompt.Coverage:
sdkSystemPrompt/CLAUDE_CODE_PRESET/ thesdk-defaultandcustomforms: reference and how-to in docs/TESTING_INTERNALS.md#agent-sdk-system-prompt; explanation in the same section.test/sdk-system-prompt-tripwire.test.ts: reference only (named in the same section).Debt: the section uses "R48" and "FIX-METHOD", which no repo doc defines; a reader outside the crew can't look them up. A one-line gloss or link is the author's call. No diagrams drifted.
Test plan
bun teston the 14 focused files: 333 pass, 0 failbun run typecheck: exit 0bun run typecheck:test: 814 known diagnostics, none new