Repository navigation
fix(review): screen content filters before the probe tree's restore too (#9558) #9566
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
b8b27e5
0153c14
1964a18
5cf6f9e
e28e352
3b99ac6
55d2bfa
65edd02
a1cc128
b25670f
17ae6cd
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 |
|---|---|---|
|
|
@@ -56,8 +56,12 @@ import { writeStdoutLine, writeStderrLine } from '../../utils/stdioHelpers.js'; | |
| import { baseWorktreePath } from './lib/paths.js'; | ||
| import { | ||
| discardWorktree, | ||
| INERT_GIT_ARGS, | ||
| localFilterBreach, | ||
| localFilterRefusal, | ||
| sanitizedGitEnv, | ||
| worktreeCreateFailureDetail, | ||
| type LocalFilterBaseline, | ||
| type SweepResult, | ||
| } from './lib/worktree.js'; | ||
| import { runBuildTest, type BuildTestReport } from './build-test.js'; | ||
|
|
@@ -94,8 +98,11 @@ export interface BaseTreeArgs { | |
| // discovery for every call at once — the base tree would be added into the | ||
| // redirected repository and its reuse check would read HEAD from it, an A/B | ||
| // against the wrong program while every check against the given tree passes. | ||
| // The INERT_GIT_ARGS prefix is for the `worktree add` below: its initial | ||
| // checkout fires hooks and `core.fsmonitor` from the common dir otherwise, | ||
| // and a probe's plant lands exactly there. | ||
| function gitOut(cwd: string, ...args: string[]): string { | ||
| const r = spawnSync('git', args, { | ||
| const r = spawnSync('git', [...INERT_GIT_ARGS, ...args], { | ||
| cwd, | ||
| encoding: 'utf8', | ||
| env: sanitizedGitEnv(), | ||
|
|
@@ -108,7 +115,7 @@ function gitOut(cwd: string, ...args: string[]): string { | |
| } | ||
|
|
||
| function git(cwd: string, ...args: string[]): void { | ||
| const r = spawnSync('git', args, { | ||
| const r = spawnSync('git', [...INERT_GIT_ARGS, ...args], { | ||
| cwd, | ||
| encoding: 'utf8', | ||
| env: sanitizedGitEnv(), | ||
|
|
@@ -261,12 +268,67 @@ export function runBaseTree(args: BaseTreeArgs): BaseTreeReport { | |
| // The parameter re-narrows: TS narrowing does not cross function scopes. | ||
| function buildBaseTree(baseSha: string): BaseTreeReport { | ||
| let sweep: SweepResult | undefined; | ||
| // Hoisted above the try: the catch below runs the paired re-read when | ||
| // the add THREW, and a re-read without the baseline the screen | ||
| // captured is blind to every self-erasing shape. | ||
| const captured: { baseline: LocalFilterBaseline | null } = { | ||
| baseline: null, | ||
| }; | ||
| try { | ||
| // Clear a stale base tree left by a crashed run — it would fail `add`. Its | ||
| // stderr is kept, because it is usually what explains that failure. | ||
| sweep = discardWorktree(worktree, tree); | ||
| // BEFORE the checkout runs, directly beside it: the `worktree add` | ||
| // below executes whatever the screen detects — the same surface | ||
| // `scratch-tree` refuses to reset through, one directory over. The | ||
| // screen sits BELOW the sweep, not above it — a plant parked in the | ||
| // stale tree's own admin `config.worktree` is state that sweep just | ||
| // destroyed and the add never reads, and a screen that ran first | ||
| // refused on it forever: every retry re-screened the doomed state and | ||
| // wedged the repository out of every review (measured live). | ||
| const refusal = localFilterRefusal( | ||
|
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. Deferred to the next round — round cap. This round implemented an 8-finding batch within the round cap; this finding is queued for the next round rather than dropped. Queued with the R8-5 twins (scratch rebuild, probe creation) so all four sweep→screen→add sites get the baseline seed in one coherent change. 中文说明推迟到下一轮 —— 每轮数量上限。本轮在每轮上限内实现了 8 个 finding;该 finding 已排入下一轮队列,不会被丢弃。 已与 R8-5 同族项(scratch rebuild、probe creation)一起排队,使全部四个 sweep→screen→add 位置在一个一致的变更中获得基线播种。 |
||
| worktree, | ||
| 'the worktree add this command runs', | ||
| captured, | ||
| ); | ||
|
Comment on lines
+289
to
+293
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. Deferred to the next round: batch capped at the Critical findings. Still valid — same residue-note gap in base-tree's build-gate failure path; queued with R5-22/R5-23. 推迟到下一轮:本轮批次以 Critical 发现为上限。仍然有效——base-tree 构建门失败路径存在同样的残留物注记缺口;与 R5-22/R5-23 一起排队。 |
||
| if (refusal !== null) return unavailable(refusal); | ||
| git(worktree, 'worktree', 'add', '--detach', tree, baseSha); | ||
|
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. Deferred to the next round — round cap. This round implemented an 8-finding batch within the round cap; this finding is queued for the next round rather than dropped. Placement re-validation (an ancestor symlink swapped between the screen and the add) spans five sites; it is queued as one batch so the shared helper and its witnesses land together. 中文说明推迟到下一轮 —— 每轮数量上限。本轮在每轮上限内实现了 8 个 finding;该 finding 已排入下一轮队列,不会被丢弃。 放置位置再验证(在 screen 与 add 之间交换祖先符号链接)横跨五个位置;已作为一个批次排队,使共享辅助函数与其见证测试一起落地。 |
||
| // Re-read AFTER the checkout, paired with the screen above: the | ||
| // screen is a point-in-time read, and a concurrent writer the | ||
| // pipeline itself schedules (a sibling shard's suite, a toggler the | ||
| // reap did not reach) can plant between the two reads — the add's | ||
| // initial checkout executes the plant while both reads see nothing. | ||
| // A key that APPEARED — or a screened file that CHANGED, the trace | ||
| // a self-erasing plant leaves when its unset lands before this | ||
| // re-read — is reported as a breach and the just-added tree rolled | ||
| // back: the run is never certified clean with a REPO-LOCAL plant | ||
| // behind it. A filter defined only in the GLOBAL config is the | ||
| // screen's disclosed limit and leaves no repo-local trace the | ||
| // re-read can see. | ||
| const breach = localFilterBreach( | ||
| worktree, | ||
| 'the worktree add this command ran', | ||
| captured.baseline, | ||
| ); | ||
| if (breach !== null) { | ||
| discardWorktree(worktree, tree); | ||
|
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. Deferred to the next round — round cap. This round implemented an 8-finding batch within the round cap; this finding is queued for the next round rather than dropped. Queued with the R8-8 timeout batch (the rollback / runRestore / discardWorktree spawns). 中文说明推迟到下一轮 —— 每轮数量上限。本轮在每轮上限内实现了 8 个 finding;该 finding 已排入下一轮队列,不会被丢弃。 已与 R8-8 超时批次一起排队(rollback / runRestore / discardWorktree 的 spawn)。 |
||
| return unavailable(breach); | ||
| } | ||
| } catch (e) { | ||
| // A checkout that THREW may still have executed a plant first — a | ||
| // smudge that kills git mid-checkout fires and only THEN makes the | ||
| // spawn throw — and the failure detail below would bury the | ||
| // execution under an add error. Attribute it while the baseline the | ||
| // screen captured still stands; the next call's screen may read | ||
| // clean, the plant having erased itself. | ||
| if (captured.baseline !== null) { | ||
| const breach = localFilterBreach( | ||
| worktree, | ||
| 'the worktree add this command ran', | ||
| captured.baseline, | ||
| ); | ||
| if (breach !== null) return unavailable(breach); | ||
| } | ||
| return unavailable( | ||
| worktreeCreateFailureDetail('base', e, String(sweep?.stderr ?? '')), | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferred to the next round — round cap. This round implemented an 8-finding batch within the round cap; this finding is queued for the next round rather than dropped. The GIT_TIMEOUT_MS deadline for the timeout-less spawns is queued as one batch (mechanical but each site needs its own FIFO witness) so the fixes and their witnesses land together.
中文说明
推迟到下一轮 —— 每轮数量上限。本轮在每轮上限内实现了 8 个 finding;该 finding 已排入下一轮队列,不会被丢弃。 为无超时的 spawn 添加 GIT_TIMEOUT_MS 截止时间已作为一个批次排队(改动是机械性的,但每个位置都需要自己的 FIFO 见证),使修复与见证一起落地。