Skip to content

Check linked closing issues for untrusted edits in Review runs (#2296) - #2300

Merged
JacobStephens2 merged 8 commits into
mainfrom
issue-2296
Nov 19, 2026
Merged

JacobStephens2 merged 8 commits into
mainfrom
issue-2296

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Review run and pull-request Custom process execution now guard against untrusted title or body edits on any linked closing issue (including issues linked earlier in the run and later unlinked) across .thirdshift-review-input.md preparation, every Step, session, Repair, Resume, Delivery, and Self-merge, without converting the pull request into a draft.

 ReviewProcess::execute
+  closing_issues = ClosingIssues::new(pr, run_started, run_name)
+  guard = Guard { github, pr, closing_issues }
+  guard.check_known_issues(&input.closing_issues)   # before writing .thirdshift-review-input.md
   for step in steps:
+    guard.compatible / guard.unchanged             # before every Step
     ReviewAndAddress | Skill | SecurityReview
+      before_session + after_session guard.check_* # around each session and Resume
     StepKind::Delivery
+      before_validation + guard.check_issues()
+      delivery::Delivery { guard, .. }
+        guard.check_* / guard.compatible           # CI watch, Repair loop, push_fixes, unchanged_head, comment
     StepKind::SelfMerge
-      Delivery::fix_run (hardcoded "Fix run", pre-Repair only, drafts PR on fail)
+      Delivery::review_self_merge(..., &closing_issues, ...)
+        RepairContext::PullRequest { pr, closing_issues, self_merge: true }
+          hand_over_pull_request + RunOutside      # before/after Repair & Base fix, push, CI watch, mergeability, merge; skips drafting on UntrustedEdit

Also updated GLOSSARY.md, docs/guide.md, regenerated site/docs/index.html, and updated hand-written site/index.html, site/how-it-works/index.html, and site/architecture/index.html to reflect closing-issue trust checks across Review runs.

Evidence

Execution evidence

  • Before: CARGO_INCREMENTAL=0 cargo test --test review_merge untrusted_closing_issue_edit_during_self_merge -- --nocapture (at 120e7be5, before Self-merge guard extraction) exited 101: both untrusted_closing_issue_edit_during_self_merge_repair_stops_without_merging (tests/review_merge.rs:443:5, left: Some(0) / right: Some(1), stderr ended with thirdshift: merging the PR into main and thirdshift: step self-merge: 9s succeeded) and untrusted_closing_issue_edit_during_self_merge_repair_stops_before_push_and_merge (tests/review_merge.rs:497:5, left: Some(0) / right: Some(1), stderr ended with thirdshift: merging the PR into main and thirdshift: step self-merge: 10s succeeded) failed.
  • After: on HEAD 4fabd56f:
    • CARGO_INCREMENTAL=0 cargo test --test base_fix --test ci --test failed_run --test fix_pass --test fix_review_hold --test fix_run --test merge_run --test mergeable --test pr_lifecycle --test process --test review_fix_trust_cutoff --test review_head_lag --test review_merge --test review_pass --test review_run --test review_security --test review_spec_regression --test skip_authors --test spec_review_706_regressions -- --test-threads=2 — exited 0: 524 passed; 0 failed; 38 ignored across all 19 integration suites (the 2 ignored entries per suite are support::child_lifetime guardian subprocess entrypoints), including:
      • tests/review_merge.rs: 14 passed; 0 failed; 2 ignored (untrusted_closing_issue_edit_during_self_merge_repair_stops_without_merging, untrusted_closing_issue_edit_during_self_merge_repair_stops_before_push_and_merge, untrusted_closing_issue_edit_before_self_merge_repair_stops_cleanly all passed)
      • tests/review_run.rs: 46 passed; 0 failed; 2 ignored
      • tests/process.rs: 244 passed; 0 failed; 2 ignored
    • CARGO_INCREMENTAL=0 cargo test --bin thirdshift -- --test-threads=2 — exited 0: 1976 passed; 0 failed; 3 ignored; explicit CARGO_INCREMENTAL=0 cargo test --bin thirdshift prompts_page exited 0: 14 passed; 0 failed; 0 ignored; 1965 filtered out.
    • CARGO_INCREMENTAL=0 cargo test --test share_card --test site_deploy — exited 0: share_card: 4 passed; 0 failed; 0 ignored; site_deploy: 7 passed; 0 failed; 0 ignored.
    • cargo fmt --check, npm run docs:check --prefix site, python3 scripts/generate-release.py --check, CARGO_INCREMENTAL=0 cargo clippy --all-targets -- -D warnings, and python3 -m unittest discover -s scripts -p 'test_*.py' (Ran 72 tests ... OK) — all exited 0.
    • CARGO_INCREMENTAL=0 NEXTEST_TEST_THREADS=2 scripts/affected-tests main:
      • npm test --prefix site — PASS (112.02s, 72 passed; 0 failed; 0 skipped).
      • cargo nextest run — passed 535/536 tests before stopping under default fail-fast on an unrelated host-load 5s reqwest HTTP timeout in tests/console.rs:195 (plan_usage::harness_summary_keeps_identities_restrictions_and_freshest_unidentified_state_in_scope, while shared VM load spiked externally to 5.64 / 141.1% per CPU; 4305/4841 tests unrun). Re-running CARGO_INCREMENTAL=0 cargo test --test console plan_usage:: -- --nocapture passed all 9 tests (9 passed; 0 failed; 0 ignored in 11.24s).
  • After merging main (d6213579):
    • npm test --prefix site — exited 0: 74 passed; 0 failed; 0 skipped (112263.22ms).
    • CARGO_INCREMENTAL=0 cargo build --locked && npm test --prefix console — exited 0: 265 passed; 0 failed; 0 skipped (436881.10ms).
    • CARGO_INCREMENTAL=0 cargo test --test share_card --test site_deploy — exited 0: share_card: 4 passed; 0 failed; 0 ignored; site_deploy: 7 passed; 0 failed; 0 ignored.
    • CARGO_INCREMENTAL=0 cargo test --bin thirdshift prompts_page — exited 0: 16 passed; 0 failed; 0 ignored; 1973 filtered out.
    • npm run docs:check --prefix site, python3 scripts/generate-release.py --check, cargo fmt --check, CARGO_INCREMENTAL=0 cargo clippy --all-targets -- -D warnings, and python3 -m unittest discover -s scripts -p 'test_*.py' (Ran 72 tests in 35.100s ... OK) — all exited 0.
    • CARGO_INCREMENTAL=0 cargo nextest run --test-threads=2 --no-fail-fast — 4866 passed (31 slow), 3 failed, 219 skipped (7518.617s); all tests touched by #2296 passed, and the 3 failures were contention-induced timing bounds in unrelated tests (otlp_endpoint a_stalled_receiver_cannot_delay_a_session_by_its_span_count: baseline 2.321031892s; stalled 4.364525062s during concurrent site-test Chromium execution; release experiments::repaired_content_waits_for_its_own_experiment_before_tagging [413.585s] & experiments::unpublished_tag_recovery_keeps_the_prior_experiment_baseline [416.907s] hitting the 300s EXPERIMENT_BOUND while running in parallel). Re-running uncontended passed cleanly:
      • CARGO_INCREMENTAL=0 cargo test --test otlp_endpoint -- --nocapture — exited 0: 4 passed; 0 failed; 2 ignored (11.12s).
      • CARGO_INCREMENTAL=0 cargo test --test release experiments:: -- --test-threads=1 — exited 0: 7 passed; 0 failed; 146 filtered out (850.67s).

Visual evidence

Before — Docs Review runs closing-issue trust checks, desktop 1440×900

Before Docs Review runs closing-issue trust checks at 1440x900

After — Docs Review runs closing-issue trust checks, desktop 1440×900

After Docs Review runs closing-issue trust checks at 1440x900

Merge Danger

Door: two-way

Tightens pull-request closing-issue trust validation inside Review runs and Self-merge without altering persistence schemas or external state formats; reversible by reverting these commits.

Blast Radius: targeted

Scoped to Review run / custom pull-request Process execution (src/processes/review*), shared ClosingIssues PR guard (src/delivery.rs), integration tests (tests/review_run.rs, tests/review_merge.rs), and Review run documentation (GLOSSARY.md, docs/guide.md, site/).

Unaddressed findings

None. All actionable findings reported in the local review (3 Standards findings: StepKind::SelfMerge bypass, Data Clump / shallow Middle Man / duplicated guard checks across review.rs & delivery.rs, and duplicated test setup in tests/review_run.rs; plus 1 Spec finding: StepKind::SelfMerge closing-issue enforcement gap) were reproduced and resolved in 4fabd56f.

  • Review coverage disclosure: All hand-written changed files (11 of 12) were read by both review axes. Generated file site/docs/index.html was intentionally excluded from direct review reading under Generated-Output Exclusion (thirdshift-code-review) and verified through its sources (docs/guide.md, site/generate-docs.mjs), npm run docs:check --prefix site, rendered diff inspection, and the 72-test site browser suite.

Security

No unaddressed introduced findings.

CI notes

All 7 failed checks on d6213579 hit a transient Ubuntu Noble apt mirror failure during runner provisioning (or downstream needs gates waiting on those setup failures); this branch changes zero workflow, scripts/, console/, or apt files, both merge parents passed full CI (4fabd56f in runs 44517439931 / 44517439847; 58b411cb in 44512945394), and the affected suites were verified locally on d6213579 (see ### Execution evidence above):

  • site-test (job 135548119079): failed in npx playwright install --with-deps chromium (apt-get exited 100 -> 1 with Could not wait for server fd - select (11: Resource temporarily unavailable) / Connection failed on security.ubuntu.com / apt-mirrors.txt) before running npm test; unrelated to this branch (npm test --prefix site passes locally on d6213579 with 74 passed; 0 failed, and 4fabd56f passed in 44517439931).
  • console-test (job 135548119520): Run cargo build --locked and Run npm ci passed, then npx playwright install --with-deps chromium failed (exit code 100 -> 1) with the same security.ubuntu.com apt timeout; unrelated to this branch (console/ and workflows untouched, npm test --prefix console passes locally on d6213579 with 265 passed; 0 failed, and 4fabd56f passed in 44517439931).
  • rust-x86 / run (3) (job 135548119947): failed in Install sandbox dependencies (sudo apt-get install --yes apparmor bubblewrap socat, exit code 100 with Could not connect to azure.archive.ubuntu.com:80, connection timed out / Unable to connect to azure.archive.ubuntu.com:http:) before compiling or running tests; unrelated to this branch (.github/workflows/rust-tests.yml untouched, sibling partitions run (1) [1195 passed] / run (2) [1242 passed] succeeded on PR merge commit 3b27cad5, and all 4,869 tests ran locally on d6213579).
  • rust-x86 / run (4) (job 135548119774): failed in Install sandbox dependencies (sudo apt-get install --yes apparmor bubblewrap socat, exit code 100 with Connection failed on http://security.ubuntu.com/ubuntu) before compiling or running tests; unrelated to this branch (.github/workflows/rust-tests.yml untouched, sibling partitions run (1)/run (2) succeeded on PR merge commit 3b27cad5, and all 4,869 tests ran locally on d6213579).
  • rust-x86 / complete (job 135554107401): downstream gate failed (test "$RESULT" = success with RESULT: failure, exit code 1) solely because rust-x86 / run (3) and run (4) failed apt-get setup; unrelated to branch changes.
  • test (job 135554209223): downstream gate failed (test "$RESULT" = success with RESULT: failure, exit code 1) solely because rust-x86 / complete failed; unrelated to branch changes.
  • build-local-artifacts (x86_64-unknown-linux-musl) (job 135548435065): failed in Install dependencies (sudo apt-get install musl-tools, exit code 100 with 503 Service Unavailable and Connection failed on security.ubuntu.com / apt-mirrors.txt) before dist build; unrelated to this branch (dist-workspace.toml and .github/workflows/release.yml untouched, sibling build-local-artifacts (aarch64-unknown-linux-musl) [135548435144], release-tag-guard, and plan passed in 44520668064, and 4fabd56f passed Release in 44517439847).

Closes #2296

Built with agy 1.5.9 · gemini-4-hydrogen-xhigh · default effort

Security review outcome

No unaddressed introduced findings.

@JacobStephens2
JacobStephens2 merged commit 0237297 into main Nov 19, 2026
25 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2296 branch November 19, 2026 16:38
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check linked closing issues for untrusted edits in Review runs

1 participant