Skip to content

fix(test): give the Slack code-channel fake slot the real approval lookup - #34669

Closed
kyleseaman wants to merge 1 commit into
mainfrom
fix/slack-code-channel-trust-tests-red
Closed

kyleseaman wants to merge 1 commit into
mainfrom
fix/slack-code-channel-trust-tests-red

Conversation

@kyleseaman

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Main's Backend Tests pass again: the Slack code-channel trust and approval tests stop failing on a test fake that predates the approval-instance lookup.

Twelve Slack code-channel tests fail on main at every commit since about 15:25 UTC on 2026-11-10, on Linux and Windows. Their cards come back refused instead of set, futures raise InvalidStateError: Result is not set, and a channel card is never rewritten. The log behind each one reads AttributeError: 'types.SimpleNamespace' object has no attribute 'approval_instance', logged as approval mode change failed.

Why it matters

Every open PR inherits these reds in Backend Tests shards 5, 6 and 7 and the Coverage Gate, so none of them can reach readiness: passed until main is green.

Not a goal

  • Changing how a trust or yolo grant sweeps pending approvals.
  • Changing the Slack code-channel approval or trust behaviour.
  • The unrelated test_session_markdown.py long-s case some shards also showed; it passes on main locally.

What changed (motivation → approach → change)

#27511 made the trust/yolo sweep (_sweep_pending_approvals) read each pending card's row through slot.approval_instance(...) before approving it. #21991 landed fifteen minutes later with tests whose fake slot, _slot() in test/test_slack_code_channel_trust_from_slack.py, was written before that lookup existed. Each branch was green on its own; together the sweep raises on the fake, the grant reports failure, and the tests see refused cards.

The fake slot now carries _approval_instances and binds the real slot_turns.approval_instance to itself, so the sweep reads a card the way a dashboard slot answers it. The three other test files share this fake through imports, so one change covers all twelve tests. No product code changes.

Backwards compatibility

Compatible: test-only change; no product contract is touched.

Removes nothing: the fake slot only gains the attribute and method the real slot already has.

Tests

  • The 12 failing tests in test_slack_code_channel_worker_approvals.py, test_slack_code_channel_mode_reaches_workers.py, test_slack_code_channel_trust_from_slack.py and test_slack_code_channel_approval_prepush.py pass; all 911 tests in test/test_slack_code_channel_*.py pass.
  • Determinism: the four files passed 5 of 5 repeated runs and again in reversed test order.

Proof: not provable -- test-only change

Manual verification

N/A — unit coverage sufficient: the change is to a test fake, and the affected tests run end to end through the real trust sweep.

Related Issues

Part of #16389 (the owner-bound approval decide that added the approval_instance lookup); the tests were added by #21991.

Sibling sweep

Swept: git grep -l -E "_approval_futures\s*=\s*{" -- test, then kept files that never mention approval_instance
Sibling: test/test_slack_code_channel_trust_from_slack.py -- changed here
Sibling: test/test_slack_code_channel_approval_select.py -- not affected -- sets only the state-level futures map and never reaches the per-slot sweep; passes on main
Sibling: test/test_chat_resume_all.py -- not affected -- its fake slots never receive a trust or yolo grant; passes on main
Sibling: test/test_conductor_context_cap.py -- not affected -- no trust or yolo grant reaches its fakes; passes on main
Sibling: test/test_conductor_wake_reset.py -- not affected -- no trust or yolo grant reaches its fakes; passes on main
Sibling: test/test_finish_queue_cycle_terminal_order.py -- not affected -- no trust or yolo grant reaches its fakes; passes on main
Sibling: test/test_session_health.py -- not affected -- no trust or yolo grant reaches its fakes; passes on main
Sibling: test/test_subagent_stop_refuses_permission.py -- not affected -- no trust or yolo grant reaches its fakes; passes on main

Pattern harvest

Rule candidate: review-prompt
Pattern: a hand-built SimpleNamespace stand-in for a production class drifts when the class gains a method a shared helper calls; prefer binding the real method or building from the real class.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners November 10, 2026 17:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 97e6eefdb7183ade0dcbdb2f3ff4676136e540c9 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

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 97e6eefdb7183ade0dcbdb2f3ff4676136e540c9 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

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing to check. This is a test-only fix: the fake slot now calls the real approval_instance method instead of copying it, so it stays in step with the production lookup.

[DESIGN-REVIEWED] 97e6eef

Description read

[DESCRIPTION-READ] 554d201bd10571ffae8d022a825bd183e9702439bb5e9991095b360806ac59bb

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 97e6eefdb7183ade0dcbdb2f3ff4676136e540c9 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 97e6eef

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 97e6eefdb7183ade0dcbdb2f3ff4676136e540c9 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 97e6eefdb7183ade0dcbdb2f3ff4676136e540c9 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 97e6eef

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

@buluoray

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Thanks for jumping on this. The Slack code-channel break this PR targets is now fixed on main by #34646 (merged as 4477b72). That PR gave the shared _slot fake in test/test_slack_code_channel_trust_from_slack.py the approval_instance method, which covers every file that imports it, and also pinned markdown-it-py below 4.3 for the second break.

Main CI has passed since then (4431fa7 and 4febed4, both containing the fix), so this PR is no longer needed to turn main green. #34666 is already closed for the same reason. Feel free to close this one too, unless it carries something beyond that fix that you still want.

@kyleseaman

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #34646, which is on main and fixes the same Slack code-channel tests.

@kyleseaman kyleseaman closed this Nov 17, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 17, 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.

2 participants