Skip to content

test: exercise real gate authorization refusals - #29332

Merged
OrcaWin merged 31 commits into
mainfrom
OrcaWin/test-audit-gate-authorization-proof
Oct 16, 2026
Merged

OrcaWin merged 31 commits into
mainfrom
OrcaWin/test-audit-gate-authorization-proof

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

A gate authorization test claimed to reject another Run's task but never called the operation. It now calls the real handler and proves the request fails without changing the task or creating a gate.

What Changed

Move the no-legacy-adoption case into the existing gate-handler suite, asserting the exact task_not_found response for the caller's Run and unchanged persisted state. Strengthen the existing revoked-caller gate case to require run_required instead of accepting any error except legacy_read_only. Production behavior is unchanged.

Why

The old setup-only case stayed green when authorization was deliberately broken. Reusing the existing handler harness covers ordinary current Runs without expanding the legacy-adoption dispatcher fixture; those dispatcher cases continue covering their separate transport and compatibility behavior. The exact-code assertion catches a misleading refusal that the old check accepted.

Linked Issue

No new issue; internal test coverage repair. References the existing #11745 regression suite.

Visual Proof

N/A — tests only; no visual or interaction change.

Testing

  • I manually tested these changes locally (Linux automated execution and deliberate regression controls; no UI interaction).
  • Automated tests added/updated.

All 49 affected owner/sibling cases pass with pinned CI runtimes Bun1.4.3 and Node24.21.0. Dynamic collection preserves 48 case/file/project identities and replaces only the setup-only case with the real handler case, moving it from the Node project to the existing Bun owner. Node typecheck, targeted formatting, changed-code quality and diff checks pass.

Two deliberate production mutations proved the repaired tests matter: allowing cross-Run gates only when adoption is absent left the original tests green but failed the replacement; returning consumer_fenced instead of run_required left the original H2 gate case green but failed its new assertion. Production files were restored byte-for-byte before the final green run.

Three stable local timing pairs had median 15.063s before / 14.915s after, with one pair slower by 0.633s. No meaningful speed improvement claimed. A preliminary pair was excluded after dependency synchronization between its runs. After refreshing to main 5db05e8ed4, all 49 cases pass again in a fresh baseline/candidate pair and with shuffle104729. Fresh wall 20.661s → 21.177s, module 18.857s → 19.319s; this pair is slower. All local checks pass. The candidate and two production owners match the previously reviewed source exactly. Fresh exact-head hosted qualification has passed, as recorded below.

AI Disclosure

Review

Independent preservation and mutation-evidence review approved without findings. All unrelated test bodies remain unchanged.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Tests only: production 0 lines changed; tests +29/-28. Existing adopted-Run and same-Run success cases remain. No SSH, folder-workspace, cross-platform, wire or provider behavior changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Applicable full lint/typecheck/test checks passed in PR CI; targeted local checks pass; build jobs were intentionally skipped by workflow conditions.

Hosted measurement

Selected-module worker time was effectively neutral: 16.493 → 16.595s (+0.6%) between clean parent run 38834270914 and candidate 38835131363. All five artifacts per run passed with zero errors, all three selected modules passed, and actual merge-checkout trees match their heads. Both use Node24.21.0/Bun1.4.3, five ARM shards/four workers; workflow and routing sources are unchanged. The repaired G4 case moves from the Node verification owner to the real Bun handler owner; 48 other identities remain unchanged. Historical unpaired worker cost and local elapsed medians (15.063 → 14.915s, preliminary dependency-sync pair excluded) show no stable speed improvement. This PR is retained for stronger authorization proof. Full exact-head aggregate validation remains required.

Current-head hosted validation

Exact head d69eb72b3dd945643350a1457781b78aef3ed14e passed full PR workflow 38898304073, including verify / PR checks passed, and all 31 separate/current checks passed or were intentionally skipped. Independent review reconciled all five shard inventories against clean lease baseline 38896587663: identical 12,356 discovered/executed files, zero errors or omissions.

Selected three-module worker time 8.375 → 8.467s, test execution 1.297 → 1.290s; no speed improvement claimed. Both hosted runs used Node24.19.0/Bun1.4.3. Relevant production owners, harness, dispatcher, workflow, runner and lockfile match; unrelated authorization fixture, SSH state effects and replay spec changes are disclosed. The candidate actual checkout matches the entire published head. This repair earns its place through real authorization regression detection.

@OrcaWin
OrcaWin changed the base branch from OrcaWin/test-audit-ssh-lease-startup to main October 16, 2026 12:06
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11033ebe-57d7-4358-9729-d87008883b76
📥 Commits

Reviewing files that changed from the base of the PR and between 5db05e8 and d69eb72.

📒 Files selected for processing: 2
  • src/main/runtime/rpc/methods/orchestration/gates/gates.test.ts
  • src/main/runtime/rpc/orchestration-11745-regression-verification.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

The changes add a gate test for a task in a different Run, including checks for the rejection code, message, task state, and absence of a gate. They remove a coordinator-pane resolution test and its OUTSIDER_PANE alias. Another gate-path test now explicitly expects run_required.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d69eb

This PR changes only tests and does not alter production behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: adding tests that exercise real gate authorization refusals.
Description check Passed The description is comprehensive and follows the template. It explains the change, rationale, testing, scope, review status, and checklist completion. The Linked Issue section references issue #11745 …
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description is comprehensive and follows the template. It explains the change, rationale, testing, scope, review status, and checklist completion. The Linked Issue section references issue #11745 but does not provide a direct issue link; this is a minor template gap.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit bf22760 into main Oct 16, 2026
31 checks passed
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.

1 participant