Skip to content

test(kas): build the governance-off handle with bare_session_handle - #39274

Closed
bolichen97 wants to merge 1 commit into
mainfrom
crew/LinuxFlackyGuard/kas-refresh-bare-handle
Closed

bolichen97 wants to merge 1 commit into
mainfrom
crew/LinuxFlackyGuard/kas-refresh-bare-handle

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make main's Backend Tests green again by building the governance-off test handle through bare_session_handle.

On main, test/test_bare_session_handle_guard.py::test_no_test_builds_a_bare_session_handle_directly fails with test_kas_token_refresh_recovery.py:245. Every open PR's Linux backend job inherits the red (failing job).

Why it matters

Every PR's CI is red on this one test until main is fixed, so nothing can auto-merge.

Not a goal

  • No change to the guard, the helper, or product code.
  • No new prevention mechanism for merge-order conflicts; that is a separate discussion.

What changed (motivation → approach → change)

Root cause is a merge-order conflict. The guard (#38996) landed first and moved every existing AcpSessionHandle.__new__ to bare_session_handle. #38978 was branched before it, passed CI on its own base, and added _governance_off_handle() with a direct AcpSessionHandle.__new__. Each was green alone; together main is red.

_governance_off_handle() now calls bare_session_handle(_SID, runtime=None). The old handle had no _runtime, and the MCP wait reads it through getattr(..., None), so runtime=None keeps the tests on the same no-connect-progress, no-re-attempt path. The helper's settle_kas_model_select mock is never reached: these tests end at the governance-off error first.

Backwards compatibility

Compatible: test-only change.

Removes nothing: only how one test fixture builds its handle changes.

Tests

test/test_kas_token_refresh_recovery.py (21 passed) and test/test_bare_session_handle_guard.py pass locally; the three TestAFailClosedStart tests still assert the same errors.

Proof: not provable -- test-only change

Manual verification

N/A — unit coverage sufficient: the change is one test fixture and the guard test checks it.

Real-machine verification

Machine: dev desktop, Amazon Linux 2023 (kernel 6.12), aarch64, 32 vCPU / 123 GB
Before (main 640338a): pytest -n0 test/test_bare_session_handle_guard.py -> 1 failed (test_kas_token_refresh_recovery.py:245), 2 passed; the failure is deterministic, not flaky
After (head cede4b4): pytest -n0 test/test_kas_token_refresh_recovery.py test/test_bare_session_handle_guard.py -> 21 passed
Cleanup: own computer; the temporary base worktree was removed

Related Issues

Follows #38996 and #38978.

Sibling sweep

Swept: git grep -nE "AcpSessionHandle.new|object.new(AcpSessionHandle" -- test/
Sibling: test/session_handle_helpers.py -- not affected -- the one allowed construction site
Sibling: test/test_bare_session_handle_guard.py -- not affected -- docstrings and fixture strings the guard scans, not real builds

Pattern harvest

Not generalizable: the guard already names the fix; the defect is merge order between two PRs, not a code pattern.

Checklist

  • A Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 18, 2026 21:23
@bolichen97
bolichen97 enabled auto-merge (squash) November 18, 2026 21:23
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision cede4b4b1439f86901d0f502f4b29758e481a2e1 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision cede4b4b1439f86901d0f502f4b29758e481a2e1 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of cede4b4b1439f86901d0f502f4b29758e481a2e1 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing to check. This is a one-fixture, test-only change that builds the handle the way the existing guard already requires.

[DESIGN-REVIEWED] cede4b4

Description read

[DESCRIPTION-READ] 250835f16b5b2dc32c88193e20440c0cf1dd01062814091113df95d99c61d236

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed cede4b4b1439f86901d0f502f4b29758e481a2e1 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] cede4b4

Verdict parsed from the review's SHA-scoped output markers for commit cede4b4b1439f86901d0f502f4b29758e481a2e1.

False positive or not applicable? A repository writer can comment:
/ai-review override fable cede4b4b1439f86901d0f502f4b29758e481a2e1 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of cede4b4b1439f86901d0f502f4b29758e481a2e1 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] cede4b4

False positive or not applicable? A repository writer can comment:
/ai-review override gpt cede4b4b1439f86901d0f502f4b29758e481a2e1 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 18, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Superseded by #39262, which landed the same fix on main first.

@bolichen97 bolichen97 closed this Nov 18, 2026
auto-merge was automatically disabled November 18, 2026 22:01

Pull request was closed

@bolichen97
bolichen97 deleted the crew/LinuxFlackyGuard/kas-refresh-bare-handle branch November 18, 2026 22:01
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant