qwen-code/.github/scripts
Shaojin Wen 575e62ee46
fix(autofix): bind the sandbox image to its pulled digest (#9527)
* fix(autofix): bind the sandbox image to its pulled digest

The sandbox image was exported as a mutable tag. `docker run <tag>`
resolves against the local store without re-pulling, so a co-resident
process with daemon access can `docker tag` different content under the
same name between the resolve step and the consumer. Export the
`<repo>@sha256:...` RepoDigests entry that matches both the pulled
repository and the digest the pull itself reported: RepoDigests is shared
by every tag of the same content, so index 0 can move off the pulled repo
under a same-content retag, and retagged foreign content keeps its own
repo — only the pair binds the export to what the pull fetched.

Pin the daemon endpoint for both spawns. The docker CLI resolves its
endpoint from DOCKER_HOST, then --context, then DOCKER_CONTEXT, then
`currentContext` in the pool-shared config.json; clearing DOCKER_CONTEXT
falls through to that last one, so the context is named explicitly and
DOCKER_HOST is dropped from the child environment. An inspect answered by
someone else's daemon hands back any digest it likes.

Write the step files through a non-blocking, type-checked append.
$GITHUB_ENV and $GITHUB_OUTPUT live under the runner-writable temp tree,
where a planted FIFO turns a plain append into a block until the step
timeout.

Extracted from #9214, which is frozen; these were R11-1 and R11-2 there.
The inspect timeout is now injectable so the tests can pin it, and the
suite covers the endpoint pin on both spawns, the FIFO and directory
refusals, cross-chunk stdout accumulation, and the timeout itself. Each
new test was checked against a mutant of the code it pins.

Refs #9089, #9524.

* fix(autofix): bind gate image inputs to the resolver step output (#9527)

* fix(autofix): revert repo-hygiene binding outside PR footprint (#9527)

The deterministic gate rejected the previous commit because
repo-hygiene.yml is CI machinery this PR never touched; review
feedback alone cannot authorize changes there. Restore the file
byte-for-byte and scope the workflow contract test to the two
autofix workflows this PR binds. The repo-hygiene binding is real
and is deferred to the review-findings follow-up queue for a
maintainer-owned change.

* fix(autofix): harden sandbox image consumers per review round (#9527)

- R1-2: extract the duplicated spawn guard (endpoint pin, settle-once
  finish, SIGKILL timer, stdout capture, error/close wiring) into one
  spawnDockerCapture helper; pullImage and repoDigestOf share it.
- R2-1: contract test fails when a workflow detects zero sandbox
  consumers instead of passing vacuously.
- R2-2: success-path e2e test for the digest-bound export; verified it
  kills the exportImage(image) mutant.
- R2-3: pin the daemon endpoint (DOCKER_HOST: '', DOCKER_CONTEXT:
  default) on every sandbox-consuming step, closing the $GITHUB_ENV and
  pool-shared currentContext channels past the resolver; contract test
  enforces the pin.
- R2-4: gate the repair step on the resolver outcome so a failed
  resolver can never relaunch the agent unsandboxed.

Also updates the workflow source pin in scripts/tests to the shared
helper's literals (required by the R1-2 refactor).

* test(autofix): pin repair outcome gate, derive contract set (#9527)

- R3-1: the contract test now requires every always()-gated consumer to
  also gate on the resolver step outcome, pinning the R2-4 fail-closed
  clause; verified that deleting the guard from the repair step now
  fails the suite (the mutant shipped green before).
- R3-2: route both main() e2e tests through withDockerStub; the refusal
  test's untouched-file asserts move before the temp-dir cleanup — they
  previously ran after rmSync, so they passed no matter what the
  resolver wrote.
- R3-3: derive the contract test's protected workflow set from the tree
  instead of a hand-enumerated list, so a new resolver step cannot land
  untested; repo-hygiene.yml stays in an explicit, staleness-checked
  exception set until its deferred binding lands.

* fix(autofix): pin resolver binary, make image check digest-aware (#9527)

* test(autofix): share resolver e2e scaffold, tripwire stale exemptions (#9527)

---------

Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
2026-08-21 06:46:52 +00:00
..
ci perf(ci): run docs-only automatic reviews at medium effort (#8648) 2026-08-07 17:00:32 +00:00
dsw-swe-verified feat: chain Terminal-Bench release evaluation (#9120) 2026-08-17 05:53:06 +00:00
fixtures test(ci): stage on-disk session state in the serve A/B (#9444) 2026-08-20 14:09:03 +00:00
assign-issue-owner.mjs feat(ci): auto-assign issues to area owners from labels (#8668) 2026-08-08 23:01:03 +00:00
assign-issue-owner.test.mjs feat(ci): auto-assign issues to area owners from labels (#8668) 2026-08-08 23:01:03 +00:00
auto-minimize-spam.test.mjs fix(ci): minimize new spam comments on creation (#9266) 2026-08-17 05:12:04 +00:00
cap-release-notes.mjs fix(release): keep notes anchored and cap the release body (#8199) 2026-07-31 09:55:38 +00:00
cap-release-notes.test.mjs fix(release): keep notes anchored and cap the release body (#8199) 2026-07-31 09:55:38 +00:00
check-autofix-contracts.sh ci(autofix): add cross-package contract verification (#7642) 2026-07-24 05:13:04 +00:00
check-settings-schema.sh ci(autofix): recover from generated-artifact CI gates and stop silent stalls (#6998) 2026-07-17 03:26:43 +00:00
check-workflow-size.sh fix(ci): keep qwen-autofix.yml under GitHub's 500 KB start-runs limit (#9517) 2026-08-20 01:56:45 +00:00
ci-flaky-rerun.mjs feat(ci): auto-open a deflake fix issue for confirmed flaky tests (#7231) 2026-07-19 16:49:29 +00:00
ci-runner-routing.test.mjs fix(ci): back-port the checkout-heal wipe guard to the triage and serve-ab wipes (#9277) 2026-08-18 06:49:40 +00:00
classify-release-notes.mjs fix(ci): route workflow label mutations through REST (#8761) 2026-08-09 15:05:15 +00:00
classify-release-notes.test.mjs fix(ci): route workflow label mutations through REST (#8761) 2026-08-09 15:05:15 +00:00
create-desktop-update-manifest.mjs feat(desktop): add Aliyun OSS release mirror (#8976) 2026-08-12 10:59:10 +00:00
create-electron-bridge-manifest.mjs fix(desktop): bridge Electron users on Windows and Linux (#9079) 2026-08-13 15:42:31 +00:00
pr-safety-precheck.mjs fix(ci): limit fork PR precheck to safety signals (#6178) 2026-07-02 20:56:41 +08:00
pr-safety-precheck.test.mjs fix(ci): limit fork PR precheck to safety signals (#6178) 2026-07-02 20:56:41 +08:00
qwen-triage-workflow.test.mjs fix(triage): compute the flake-gate diff before the env -i re-exec (#9468) 2026-08-19 14:37:44 +00:00
resanitize-git-config.sh fix(ci): make autofix verification gates hermetic to runner git config (#8961) 2026-08-13 11:39:04 +00:00
resolve-owning-packages.sh fix(autofix): resolve owning package for nested paths; report verify-failed handoffs as not pushed (#7330) 2026-07-20 14:39:56 +00:00
resolve-sandbox-image.mjs fix(autofix): bind the sandbox image to its pulled digest (#9527) 2026-08-21 06:46:52 +00:00
resolve-sandbox-image.test.mjs fix(autofix): bind the sandbox image to its pulled digest (#9527) 2026-08-21 06:46:52 +00:00
run-autofix-review-verification.sh feat(autofix): audit the approach instead of stopping on growth-budget breach (#9262) 2026-08-21 04:54:07 +00:00
serve-ab-diff.mjs test(ci): stage on-disk session state in the serve A/B (#9444) 2026-08-20 14:09:03 +00:00
serve-ab-diff.test.mjs test(ci): stage on-disk session state in the serve A/B (#9444) 2026-08-20 14:09:03 +00:00
serve-ab-drive.mjs test(ci): stage on-disk session state in the serve A/B (#9444) 2026-08-20 14:09:03 +00:00
serve-ab-drive.test.mjs test(ci): stage on-disk session state in the serve A/B (#9444) 2026-08-20 14:09:03 +00:00
upsert-bot-comment.sh perf(ci): run docs-only automatic reviews at medium effort (#8648) 2026-08-07 17:00:32 +00:00
upsert-bot-comment.test.mjs perf(ci): run docs-only automatic reviews at medium effort (#8648) 2026-08-07 17:00:32 +00:00
upsert-deferred-issue.sh feat(autofix): defer verified out-of-footprint findings to a surviving follow-up queue (#9189) 2026-08-16 11:28:05 +00:00
web-shell-visuals-compose.mjs ci(web-shell): denoise cross-job font-AA so visual previews stop false-flagging (#7210) 2026-07-19 11:27:08 +00:00
web-shell-visuals-compose.test.mjs ci(web-shell): denoise cross-job font-AA so visual previews stop false-flagging (#7210) 2026-07-19 11:27:08 +00:00
web-shell-visuals-publish.mjs fix(ci): don't let one failing scenario sink the whole visual preview (#7511) 2026-07-23 02:34:07 +00:00
web-shell-visuals-publish.test.mjs fix(ci): don't let one failing scenario sink the whole visual preview (#7511) 2026-07-23 02:34:07 +00:00