Repository navigation
fix(review): screen content filters before the probe tree's restore too (#9558) #9741
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 5 commits
971494d
a25e8e6
1fe2fae
49ba19a
c06aab3
4c5bff7
c959a08
c137f03
deba877
8cfb0ab
5258b5e
c9cec1e
eb6a46b
1567ea0
7e65377
ad017a8
526575b
832ad51
776e147
377ec3a
4c4eca3
90e1494
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,6 +56,8 @@ import { writeStdoutLine, writeStderrLine } from '../../utils/stdioHelpers.js'; | |
| import { baseWorktreePath } from './lib/paths.js'; | ||
| import { | ||
| discardWorktree, | ||
| INERT_GIT_ARGS, | ||
| localFilterRefusal, | ||
| sanitizedGitEnv, | ||
| worktreeCreateFailureDetail, | ||
| type SweepResult, | ||
|
|
@@ -260,12 +262,44 @@ export function runBaseTree(args: BaseTreeArgs): BaseTreeReport { | |
|
|
||
| // The parameter re-narrows: TS narrowing does not cross function scopes. | ||
| function buildBaseTree(baseSha: string): BaseTreeReport { | ||
| // The creation checkout rewrites every file the base commit carries, which | ||
| // EXECUTES a planted filter — screen it the way the probe tree's creation | ||
| // is screened. The refusal reads as an unavailable A/B (infrastructure), | ||
| // never as a finding against the PR. | ||
| const filterRefusal = localFilterRefusal( | ||
| worktree, | ||
| "the base tree's creation checkout", | ||
| ); | ||
| if (filterRefusal) return unavailable(filterRefusal); | ||
| let sweep: SweepResult | undefined; | ||
| 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); | ||
| git(worktree, 'worktree', 'add', '--detach', tree, baseSha); | ||
| // Re-screen beside the add, after the sweep: this is the only screened | ||
| // checkout that overlaps LIVE probes — the lock excludes other base-tree | ||
| // builders, not shards running attacker code, and the sweep's completion | ||
| // is the public signal a watcher plants on. A filter landing between the | ||
| // screen above and the add below executed in the creation checkout the | ||
| // screen certified clean (measured: 6/6 race iterations pwned); the | ||
| // re-screen narrows that window to the gap between itself and the add. | ||
| const rescreenRefusal = localFilterRefusal( | ||
| worktree, | ||
| "the base tree's creation checkout", | ||
| ); | ||
| if (rescreenRefusal) return unavailable(rescreenRefusal); | ||
| // INERT_GIT_ARGS: the screen reads filters only, while `worktree add` | ||
| // also fires `post-checkout` from the shared common hooks dir and runs | ||
| // a repo-local `core.fsmonitor` — both plantable, both measured live. | ||
| git( | ||
| worktree, | ||
| ...INERT_GIT_ARGS, | ||
| 'worktree', | ||
|
Comment on lines
+295
to
+297
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 (budget-warning round). Fix stands: bound base-tree’s git helpers with a checkout-sized ceiling plus 中文说明顺延到下一轮(预算警告轮)。修复不变:给 base-tree 的 git 助手加 checkout 量级上限与 |
||
| 'add', | ||
| '--detach', | ||
| tree, | ||
| baseSha, | ||
| ); | ||
|
Comment on lines
+294
to
+302
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. Still open — deferred to the next round. This round was a same-run verification repair: the previous commit was rejected because unrelated full-suite tests failed under CI load, and the round's single commit fixes exactly that rejection (see the round summary). No review-pipeline code changed, so this finding's fix stays queued for the next round's batch. 中文说明仍然打开——顺延至下一轮。本轮是同轮验证修复:上一个提交因与本次改动无关的全套件测试在 CI 负载下失败而被门禁拒绝,本轮的单一提交精确修复该拒绝(见轮次总结)。review 管线代码未变动,该发现的修复继续排入下一轮批次。
Comment on lines
+294
to
+302
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 (budget-warning round). Fix stands: bound base-tree’s git helpers with a checkout-sized ceiling plus 中文说明顺延到下一轮(预算警告轮)。修复不变:给 base-tree 的 git 助手加 checkout 量级上限与 |
||
| } catch (e) { | ||
| 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 (budget-warning round). Fix stands: bound base-tree’s git helpers with a checkout-sized ceiling plus
killSignal: 'SIGKILL', with the FIFO’d-loose-object witness. Batched with the other unbounded-spawn items.中文说明
顺延到下一轮(预算警告轮)。修复不变:给 base-tree 的 git 助手加 checkout 量级上限与
killSignal: 'SIGKILL',附 FIFO 松散对象见证。与其他无界 spawn 项合并一批。