Repository navigation
test: key composition and facade records per item instead of shared totals - #37681
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a test-only change that swaps shared totals for exact per-item records. Two PRs that each add an item now either merge cleanly or conflict; neither leaves Notes
[DESIGN-REVIEWED] fd29fa0 Description read[DESCRIPTION-READ] dcaaa021bb9119c3b734b028d9466b23f49b78034bac2c802d516cb23c778ce1 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 — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
…otals Two PRs that each add one route, re-export, owner module or error-code row rewrote the same total line to the same new number, git merged both, and main held one more than the record said. Store the MCP route table one row per line in a fixture, list each package re-export, served handler and facade route by name, and drop totals the exact records beside them already decide.
|
Rebased: main moved in (d470c46 -> 4dec84c); one commit added kiro_crew.dashboard.handlers.members_app and re-pinned test/test_members_handler_facade.py's |
d6926d5 to
fd29fa0
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 7% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 813 lines, more than the 400 it may approve on its own. Test-only change that swaps shared counts for exact per-item records. The MCP route table is now compared row by row against a new fixture. Re-export and served-handler counts become sorted name tuples, with a check that distinct handler objects equal distinct names. The facade owner counts become exact module tuples. Each deleted total is redundant with an exact record that stays: a literal written in the test, the shape digest, An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed head fd29fa0. All 15 changed test files pass on this head, and they still pass after current main is merged in, with no conflict and clean lint. Removing a row from the new route table fixture makes the table test fail with a clear message, so the per-row comparison is not vacuous. Every shared total this PR removes is still fixed by an exact record that remains: the literal owner lists, the shape digests, the facade definition set, or the per-file error-code rows that must equal the live scan. Nothing blocks.
… give the shared-runtime test a real GitHub token test_dashboard_files_composition_contract (#37681) forbids an owner's runtime import of kiro_crew.security.exfil; the facade exports refuses, as the sibling file_api owners import theirs. test_claude_shared_runtime (#37540) used ghp_ + 36 a's, which the rule table does not read as a credential because it checks GitHub's CRC32 suffix; build the token with base62_crc32 like the other redaction tests.
Problem / Motivation
Goal: The composition-contract and facade tests stay green on
mainwhen two pull requests that were each green on the same base both merge.Many of these tests stored one shared number (a row count, a re-export count, a served-handler count, a whole-file total) beside or instead of a per-item record. Two PRs that each add one item rewrite that number to the same value, git merges the identical edit cleanly, and
mainholds one item more than the number says. The hottest line,_MCP_TABLE_ROWSwith its digest on the next line, was re-pinned 33 times onmainin 30 days.Why it matters
A red
main(or a conflict on one shared line) fails or blocks every open PR that touches the counted thing until someone re-pins it.Not a goal
_BASE_ALL_SIZEwith its digest,len(_BASE_PROJECT_IMPORTS) == 60) stay: no later change edits them.test_context_composition_contract.py's golden outlines stay exact: each scenario's sha256 sits on its own line beside its outline, so two edits conflict rather than merge wrong.What changed (motivation → approach → change)
test/test_dashboard_server_composition_contract_reach.py_MCP_TABLE_ROWS = 352+_MCP_TABLE_DIGESTtest/fixtures/dashboard_mcp_route_table.txt, one<method> <path> <handler>row per line in registration order, compared exactly; the failure prints the rows to writelen(reexports) == N,len({id(h) for h in served}) == N) in the messaging, files and agents contracts_PACKAGE_REEXPORTS/_SERVED_HANDLERS, one name per line; an id-count equals name-count check still catches two objects served under one namelen(names) == len(set(names)) == N,len(lines) == Nnext to a digest,len(defined | moved) == N,len(_BASE_NAMES) == N,sum(missing_code) == 80/== 37,sum(_CENSUS_HOMES.values()) == 12,len(on_disk)/len(owners) == Nin 8 facade tests_OWNERSin the module under test is the recordlen(routes) == 7(crew-log routes),len(redacting) == 4(agents)Files:
test/test_dashboard_server_composition_contract_reach.py,test/test_handlers_messaging_composition_contract.py,test/test_dashboard_files_composition_contract.py,test/test_dashboard_agents_composition_contract.py,test/test_hooks_composition_contract.py,test/test_slack_handler_composition_contract.py,test/test_crew_log_routes_facade.py,test/test__dispatch_facade.py,test/test_agent_discovery_parts_facade.py,test/test_mcp_dashboard_facade.py,test/test_members_parts_facade.py,test/test_skill_projection_facade.py,test/test_work_ledger_facade.py,test/test_members_handler_facade.py,test/test_work_ledger_handler_facade.py, and the new fixture.The rule is the one in
docs/system-specs/common/testing-conventions.md§ Merge-safe ratchets and counts (PR #37660).Backwards compatibility
Compatible: test files and one test fixture only.
Removes nothing: every dropped total is implied by an exact record that stays or is replaced by one.
Tests
Two-branch merge simulation (scratch clone; A and B cut from one base, each adds one item at a different place and updates the record exactly as the test asks, then
git merge):origin/mainassert 55 == 54assert 39 == 38assert 9 == 8_OWNERSentryassert 82 == 81assert 9 == 8assert (14 + 82) == 95On this branch rebased onto current
main: the 15 changed test files plustest/test_flake_pattern_ratchet.pyandtest/test_ratchet_scope.py, 670 passed; black, isort and flake8 clean.Proof: not provable -- test-only change
Manual verification
N/A — tests only; the simulation above is the behavioral check.
Related Issues
Part of #37656
Checklist