Repository navigation
test(chat): give the echo-scope fixture a checksum-valid credential - #38019
Conversation
The fixture's ghp_ token had no valid checksum, so under the rule table it reads as a benign placeholder and nothing masks it: the SSE slots frame carried it in last_message and the leak check failed every run. The fixture now uses the synthetic_credentials helper's checksum-valid token, the leak checks look for the credential value, and a non-owner socket's row is pinned to the masked form with the rest kept. Fixes kirodotdev#38012
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Test-only change: it swaps in a checksum-valid credential and makes the leak checks stricter, so nothing blocks. [DESIGN-REVIEWED] 4cfceb8 Description read[DESCRIPTION-READ] edeb859bc22e2f236420f44fc4051175323f44efc41193d62029dd2047b2ff8f 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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 4cfceb8. The test planted a GitHub credential that the new rule table correctly treats as a placeholder, and the fix plants a checksum-valid one that main does mask on every path the test checks, so this repairs a test and hides no leak. Decisive lines: test/test_chat_send_echo_scope.py:18-27, test/test_chat_send_echo_scope.py:194-206, src/kiro_crew/security/redaction_structured/table.py:46-54, src/kiro_crew/security/redaction_structured/checks.py:30-35, src/kiro_crew/security/redaction_structured/checks.py:145-150
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked head 4cfceb8 by running the test. At this head, test/test_chat_send_echo_scope.py passes all 7 cases. With main's version of the file on the same tree, [False-ws-send-id] fails with the unmasked placeholder in the SSE slots frame, which matches #38012. The cause is confirmed in the redaction code: the old ghp_ + x run fails the checksum, so the redactor treats it as a placeholder. The changed assertions are tighter than before. The needle is now the token, which is a substring of the prompt. The observer socket must now receive exactly the owner's row with only the token replaced by [REDACTED: credential]. A socket without slots:user must still receive nothing.
Done well: the fixture uses the shared github_classic() helper, so the test gets a checksum-valid credential and no credential-shaped literal lands in the repo.
Optional:
- #37498 rewrites the same
_PROMPTline in a different way. Whichever PR merges second needs a rebase, and that rebase should keep thegithub_classic()token. - This is older than this PR: the
slotsframe reaches the SSE stream only in the first parametrization a process runs. A follow-up could make that check run in every case.
Problem / Motivation
Goal:
test_user_echo_reaches_only_authorized_ws_clientspasses on main again, and it still proves the echo scope boundary.test/test_chat_send_echo_scope.py::test_user_echo_reaches_only_authorized_ws_clientsfails on every run on main since #37408 merged, at -n0 locally and on shard 3 of every open PR that runs the file.Why it matters
Every open PR whose shard runs this file is red on it, so the failure blocks readiness across the queue.
Not a goal
/api/streamsends to an app in itsslotsframe.What changed (motivation → approach → change)
slotsframe'slast_messagepreview.ghp_followed by 36xcharacters, which fails the GitHub token checksum. Under feat(security): one redaction switch, rule table only, value-only masks #37408 the rule table reads aghp_run without a valid checksum as a benign placeholder, so nothing masks it. A real token on the same path is masked, so this is a fixture problem, not a leak.kiro_crew.testing.synthetic_credentials.github_classic(), the helper the testing conventions name for a token that must be masked.Backwards compatibility
Compatible: only a test file changes.
Removes nothing: no product code or public helper is touched.
Tests
test/test_chat_send_echo_scope.py: 7 passed at -n0, three runs in a row. On main the same file fails.Proof: not provable -- test-only change
Manual verification
N/A — the change is to a test, and the test run is the verification.
Related Issues
Fixes #38012
Sibling sweep
Swept: git grep -n 'ghp_" + "x"' -- test/
Siblings: none -- the other repeated-x ghp_ fixtures are placeholder cases or scan-cost filler, and none asserts the token is masked
Pattern harvest
Not generalizable: the testing conventions already require synthetic_credentials for credentials that must be masked; this fixture predated that rule.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.