-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(autofix): clamp gate test load explicitly instead of via RUNNER_NAME #10671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
041d8c4
d8c42f0
8f96efe
325bdf4
63fb0dc
a720f12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8944,6 +8944,57 @@ exit 1 | |||||||||||||||||||
| expect(reviewVerificationRunner).toContain( | ||||||||||||||||||||
| 'strip_runner_channels npm run test', | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| // The load clamps must actually reach every vitest the gate launches. | ||||||||||||||||||||
| // Dropping the expansion from any of the three legs is silent — | ||||||||||||||||||||
| // `set -eo pipefail` without `-u` swallows an empty array — and the | ||||||||||||||||||||
| // gate reverts to 15s timeouts, unbounded workers and coverage on, | ||||||||||||||||||||
| // which is the incident this script's clamps exist to prevent. | ||||||||||||||||||||
| // Pinned on reviewVerificationRunner only: the inline issue-fix gate | ||||||||||||||||||||
| // keeps unclamped copies by design — RUNNER_NAME is present there, so | ||||||||||||||||||||
| // its package legs keep the config-level clamps, and its contracts leg | ||||||||||||||||||||
| // accepts the web-shell 5s default. | ||||||||||||||||||||
| expect(reviewVerificationRunner).toContain( | ||||||||||||||||||||
| '--changed origin/main --passWithNoTests "${VITEST_LOAD_CLAMPS[@]}"', | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| expect(reviewVerificationRunner).toContain( | ||||||||||||||||||||
| 'strip_runner_channels npm run test --workspace "${ws}" --if-present -- "${VITEST_LOAD_CLAMPS[@]}" "$@"', | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| expect(reviewVerificationRunner).toContain( | ||||||||||||||||||||
| 'AUTOFIX_VITEST_FLAGS="${VITEST_LOAD_CLAMPS[*]}"', | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| expect(reviewVerificationRunner).toContain('export AUTOFIX_VITEST_FLAGS'); | ||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] R3-1: nothing pins the Witness:
Suggested change
The pin must be an explicit ordering check rather than reliance on any shell error: the gate script runs 中文说明R3-1:没有任何测试钉住 (证据见英文区 Witness 代码块:完整树与"数组移到消费者下方"的变异体均 254/254 全绿;bash 探针确认未定义数组的 修复约束:结构钉必须是显式的顺序断言,不能依赖任何 shell 报错——gate 脚本以不带 — qwen3.8-max via Qwen Code /review (v0.22.3) |
||||||||||||||||||||
| // ...and the array definition sits above its consumers: `set -eo | ||||||||||||||||||||
| // pipefail` without `-u` expands a not-yet-set array to zero words, so | ||||||||||||||||||||
| // a definition moved below them silently empties every clamp while the | ||||||||||||||||||||
| // position-blind toContains above stay green. | ||||||||||||||||||||
| expect( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf('VITEST_LOAD_CLAMPS=('), | ||||||||||||||||||||
|
Comment on lines
+8980
to
+8982
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] R3-2: the pin suite pins the establish side of the Witness: Add the symmetric ordering pin after this block: expect(
reviewVerificationRunner.indexOf(
'bash "${RUNNER_TEMP}/check-autofix-contracts.sh"',
),
).toBeLessThan(
reviewVerificationRunner.indexOf('unset AUTOFIX_VITEST_FLAGS'),
);The unset must stay after 中文说明R3-2:结构钉套件钉住了 (证据见英文区 Witness 代码块:变异体(把 unset 移到 contracts 调用上方)下现有钉套件 修复约束:unset 必须留在 — qwen3.8-max via Qwen Code /review (v0.22.3) |
||||||||||||||||||||
| ).toBeLessThan( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf( | ||||||||||||||||||||
| 'AUTOFIX_VITEST_FLAGS="${VITEST_LOAD_CLAMPS[*]}"', | ||||||||||||||||||||
| ), | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| // ...and above the contracts call: run_check_no_ab spawns a child bash | ||||||||||||||||||||
| // that inherits exported variables only, so an export missing or moved | ||||||||||||||||||||
| // below the call leaves the drift leg at vitest's 5s default. | ||||||||||||||||||||
| expect( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf('export AUTOFIX_VITEST_FLAGS'), | ||||||||||||||||||||
| ).toBeLessThan( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf( | ||||||||||||||||||||
| 'bash "${RUNNER_TEMP}/check-autofix-contracts.sh"', | ||||||||||||||||||||
| ), | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| // ...and the unset stays below the contracts call: the child inherits | ||||||||||||||||||||
| // the export at spawn time, so an unset moved above the call (or | ||||||||||||||||||||
| // deleted) strips the clamps from the drift leg while every | ||||||||||||||||||||
| // establish-side pin above stays green. | ||||||||||||||||||||
| expect( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf( | ||||||||||||||||||||
| 'bash "${RUNNER_TEMP}/check-autofix-contracts.sh"', | ||||||||||||||||||||
| ), | ||||||||||||||||||||
| ).toBeLessThan( | ||||||||||||||||||||
| reviewVerificationRunner.indexOf('unset AUTOFIX_VITEST_FLAGS'), | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| // The check sits BEFORE the no-commit/no-op exits: a no-op audit round | ||||||||||||||||||||
| // whose verdict is sound with nothing left to fix still needs the artifact. | ||||||||||||||||||||
| const verdictGateAt = reviewVerificationRunner.indexOf( | ||||||||||||||||||||
|
|
@@ -11953,7 +12004,10 @@ exit 1 | |||||||||||||||||||
| join(dir, 'npm'), | ||||||||||||||||||||
| [ | ||||||||||||||||||||
| '#!/usr/bin/env bash', | ||||||||||||||||||||
| 'printf \'%s\\n\' "$*" >> "${NPM_LOG}"', | ||||||||||||||||||||
| // One bracketed line per argv word: $*-joined logging renders a | ||||||||||||||||||||
| // joined-blob flag identically to separate words, so a [*]-for- | ||||||||||||||||||||
| // [@] regression in the contracts script would survive it. | ||||||||||||||||||||
| 'printf \'[%s]\\n\' "$@" >> "${NPM_LOG}"', | ||||||||||||||||||||
| 'if [[ "$*" == "run check-i18n" ]]; then', | ||||||||||||||||||||
| ' exit "${I18N_EXIT:-0}"', | ||||||||||||||||||||
| 'fi', | ||||||||||||||||||||
|
|
@@ -11977,14 +12031,45 @@ exit 1 | |||||||||||||||||||
|
|
||||||||||||||||||||
| expect(run('packages/core/src/config/config.ts\n').status).toBe(0); | ||||||||||||||||||||
| expect(readFileSync(npmLog, 'utf8').trim().split('\n')).toEqual([ | ||||||||||||||||||||
| 'run check-i18n', | ||||||||||||||||||||
| '[run]', | ||||||||||||||||||||
| '[check-i18n]', | ||||||||||||||||||||
| ]); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| writeFileSync(npmLog, ''); | ||||||||||||||||||||
| expect(run('packages/core/src/tools/tool-names.ts\n').status).toBe(0); | ||||||||||||||||||||
| expect(readFileSync(npmLog, 'utf8').trim().split('\n')).toEqual([ | ||||||||||||||||||||
| 'run check-i18n', | ||||||||||||||||||||
| 'run test --workspace packages/web-shell -- client/components/messages/toolFormatting.drift.test.ts', | ||||||||||||||||||||
| '[run]', | ||||||||||||||||||||
| '[check-i18n]', | ||||||||||||||||||||
| '[run]', | ||||||||||||||||||||
| '[test]', | ||||||||||||||||||||
| '[--workspace]', | ||||||||||||||||||||
| '[packages/web-shell]', | ||||||||||||||||||||
| '[--]', | ||||||||||||||||||||
| '[client/components/messages/toolFormatting.drift.test.ts]', | ||||||||||||||||||||
| ]); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // web-shell's config sets no timeouts and has no RUNNER_NAME branch, | ||||||||||||||||||||
| // so without caller flags the drift test runs at vitest's 5s default; | ||||||||||||||||||||
| // the review gate launches it on a saturating shared host and hands | ||||||||||||||||||||
| // its clamps down through this variable. The issue-fix gate leaves | ||||||||||||||||||||
| // it unset (the case above) and accepts the 5s default there. | ||||||||||||||||||||
| writeFileSync(npmLog, ''); | ||||||||||||||||||||
| expect( | ||||||||||||||||||||
| run('packages/core/src/tools/tool-names.ts\n', { | ||||||||||||||||||||
| AUTOFIX_VITEST_FLAGS: '--maxWorkers=25% --testTimeout=60000', | ||||||||||||||||||||
| }).status, | ||||||||||||||||||||
| ).toBe(0); | ||||||||||||||||||||
| expect(readFileSync(npmLog, 'utf8').trim().split('\n')).toEqual([ | ||||||||||||||||||||
| '[run]', | ||||||||||||||||||||
| '[check-i18n]', | ||||||||||||||||||||
| '[run]', | ||||||||||||||||||||
| '[test]', | ||||||||||||||||||||
| '[--workspace]', | ||||||||||||||||||||
| '[packages/web-shell]', | ||||||||||||||||||||
| '[--]', | ||||||||||||||||||||
| '[--maxWorkers=25%]', | ||||||||||||||||||||
| '[--testTimeout=60000]', | ||||||||||||||||||||
| '[client/components/messages/toolFormatting.drift.test.ts]', | ||||||||||||||||||||
| ]); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| writeFileSync(npmLog, ''); | ||||||||||||||||||||
|
|
@@ -11995,7 +12080,7 @@ exit 1 | |||||||||||||||||||
| I18N_EXIT: '1', | ||||||||||||||||||||
| }).status, | ||||||||||||||||||||
| ).toBe(1); | ||||||||||||||||||||
| expect(readFileSync(npmLog, 'utf8').trim()).toBe('run check-i18n'); | ||||||||||||||||||||
| expect(readFileSync(npmLog, 'utf8').trim()).toBe('[run]\n[check-i18n]'); | ||||||||||||||||||||
| expect(readFileSync(output, 'utf8')).toContain('outcome=failed'); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| writeFileSync(npmLog, ''); | ||||||||||||||||||||
|
|
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.