Skip to content

fix(testing): clear the can't-fail scan's gating findings on main - #9257

Merged
kyle-sexton merged 4 commits into
mainfrom
fix/9194-cant-fail-findings
Oct 23, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
fix/9194-cant-fail-findings

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #9194

Summary

cant-fail-scan.sh --check exited 1 on main with 11 gating findings, so the CI gate planned in #9184 would start red. Ten were false positives and one was a real test with no assertion (owner decision Q672: clear these first).

Fix

  • docs/conventions/testing.yaml extends the py-pytest adapter's assertion calls with self.refused(...) and self.refused_ops(...). Both planning helpers assert the refusal code (plugins/planning/shared/tests/test_session.py:173-187). The test files are claimed by py-pytest, not py-unittest, because their classes subclass SessionCase rather than TestCase directly. The issue named only refused_ops; refused covers the eleventh false positive, test_an_unknown_proposal_is_not_found. No test is annotated exempt.
  • test_the_owner_can_reopen_an_ended_session now asserts that the session is live after the reopen and that the chat posted after it is stored.
  • A none changelog fragment for planning, since only a test changed.

Verification

  • bash plugins/testing/skills/audit/scripts/cant-fail-scan.sh --check: exit 0, "PASS: no gating findings; 1294 test file(s) fully read."
  • cant-fail-scan.sh --file plugins/planning/shared/tests/test_people_proposals.py: exit 0.
  • python3 -m unittest test_session.TestSessionControls.test_the_owner_can_reopen_an_ended_session: OK; with the phase assertion inverted to ended: FAILED (failures=1); restored.
  • python3 -m unittest test_session.TestSessionControls test_people_proposals: OK.
  • scripts/check-changelog-fragments.sh --check-required origin/main: passes in the pre-push hook.

Related

#9184 (its scan step waits on this), #7581

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 22, 2026 19:41
The planning session tests' refused and refused_ops helpers assert the
refusal code, so the repo's testing layer adds them to py-pytest's
assertion calls. The ended-session reopen test now asserts the session
is live again and the chat after it is stored.

Closes #9194

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 22, 2026 23:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T23:48:27.926076Z f2eece2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 10e072f35ad06b94f5a0986f4ecf6b1f351376d0: 0 finding(s), 0 as inline comments.

No security issues found in PR #9257 at head 10e072f.

The diff touches three files:

  • A bump: none changelog fragment.
  • A test-only edit in plugins/planning/shared/tests/test_session.py that adds assertions to one test.
  • An extend: py-pytest: assertion: calls regex in docs/conventions/testing.yaml. The regex tells the can't-fail scan to count self.refused(...) and self.refused_ops(...) as assertions. It is test-quality scanner config. It gates no runtime action, grants no permission and touches no secret, token or trust boundary.

The diff contains no instruction-surface deletions, no plugin.json or marketplace.json changes, no userConfig guards and no workflow changes, so there are no manifest <field> lines.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 10e072f35ad06b94f5a0986f4ecf6b1f351376d0: 0 finding(s), 0 as inline comments.

No findings on 10e072f.

I checked the three changed files against #9194's criteria and the code they depend on:

  • docs/conventions/testing.yaml: The extend: py-pytest: assertion: calls pattern self\.refused(_ops)?[[:space:]]*\( matches self.refused( and self.refused_ops(. It does not match self.refused_redeem(, so the widening is narrow. Both helpers assert the refusal code (plugins/planning/shared/tests/test_session.py:173-187), so counting them as assertions is correct. The scan reads this extend layer at plugins/testing/skills/audit/scripts/cant-fail-scan.sh:396. No test is annotated exempt, as the issue required.
  • test_the_owner_can_reopen_an_ended_session: The new assertions are valid.
    • end_session with on: False sets phase to exactly {"kind": "live"} (plugins/planning/shared/session.py:5422), and the sibling test at line 3180 reads the same state path.
    • chat returns {"id": ...} and appends {"id", "pid", "text", ...} to state["chat"] (plugins/planning/shared/session.py:3851-3877), so the list comprehension on m["id"] == msg and m["text"] is correct.
    • Both assertions would fail if the reopen did not take effect, which meets the issue's "fails if inverted" criterion.
  • Changelog fragment: bump: none fits a test-only and convention-config change.
  • Plugin manifests: None changed, so there are no manifest <field> lines.

I did not run cant-fail-scan.sh --check or the unittest runs. My shell commands were blocked pending approval, so the PR body's verification results are author-claimed and unverified by me. I confirmed the behaviour only by reading the code.

The closing issue (#9194) was readable. Its criteria are met: the extend entry, a real assertion on the reopened session's state, and no exempt annotations. The PR context file held no embedded instructions.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit bc30613 Oct 23, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the fix/9194-cant-fail-findings branch October 23, 2026 01:46
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.

test(planning): clear main's can't-fail scan findings before it gates

1 participant