Repository navigation
test(spec-builder): finish splitting the route tests into behaviour parts - #20546
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] f77e0c0 Description read[DESCRIPTION-READ] 556e5e8ffed7a66204940336d2d42443a4da6aca0a5eb83d2944f8a3db19b1dd 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 |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
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: |
|
|
|
Backend Tests (3.12, 7) in run 38657808382 went red on attempt 1 only on the repository-root residue guard ( |
|
Holding 4611d06 for human review under the sensitive-files policy. I found no defect. What I checked: a static comparison of every removed and added line shows that the lines leaving website/. The First Principles punchline is answered, and the shard-7 residue red is recorded in #20556 and green on rerun. All lanes are PASS or answered, and CI is green.
Why it is held anyway: the moved files are the identity-pinning, egress/credential-redaction, path-containment, STOP-sentinel, delete and git-audit tests, plus — crew-pr-reviewer (r102) |
…arts The second of two moves that bring spec_builder/tests/test_routes.py under the 2,000-line cap. Every test after the route-contract prefix (the route set, settings round-trip, create validation and redaction sections) moves, unchanged, into the sibling test_routes_<topic>.py that pins its behaviour: seven new parts (paths, event loop, index, git, egress, STOP sentinel, slot scoping) and the rest of the six parts the first move opened. test_routes.py ends at 362 lines, one contiguous run of the original, so its line-cap baseline row is deleted. The collected test multiset is unchanged (594 tests). The remaining eight symlink-list node ids, the source-pin budget row and the testing-conventions citation follow their tests to the new files. Part of #20192
4611d06 to
f77e0c0
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved after a maintainer read the review lanes on this head: the only note is the diff size of a 1:1 test split.
Problem / Motivation
Goal: Finish bringing the Spec Builder route tests under the 2,000-line file cap: move the rest of
spec_builder/tests/test_routes.py(8,147 lines after #20327) into behaviour-named parts without changing any test, so the file ends as the route contract alone.#20327 moved the tail of the file into topic parts. What remains in
test_routes.pystill mixes the route contract with path containment, the index, the STOP sentinel, slot scoping and identity pinning, deletes, handoff, create, egress, git and event-loop guards, and the file is still four times the cap.Why it matters
Until the remainder moves,
test_routes.pystays over the cap and stays the default place a new route test lands. With this PR every route test has one topic home,test_routes.pyholds only the contract, and the file leaves the line-cap baseline.Not a goal
monkeypatch, the redirect-coverage check). Two more moved sleeps here get the same markers and are listed below.spec_builder/backend/.What changed (motivation → approach → change)
The same recipe that produced #20327 runs its second stage on main's tree: every unit after the route-contract prefix (the route set, settings round-trip, create validation and redaction sections) moves to the part that pins its behaviour. What
test_routes.pykeeps is one contiguous run of the original (only_stage_identity, a duplicate-only helper from the harness section, leaves it, fortest_routes_duplicate.py), so git's default diff and--minimalagree on it (8 added lines: the docstring and the import comment).test_routes.pytest_routes_paths.py,test_routes_event_loop.py,test_routes_index.py,test_routes_git.py,test_routes_egress.py,test_routes_stop_sentinel.py,test_routes_slot_scoping.pytest_routes_create.py,test_routes_delete.py,test_routes_duplicate.py,test_routes_handoff.py,test_routes_identity_pinning.py,test_routes_nudge_loops.py,test_routes_artifacts.pyroutes_helpers.pyThe largest file is now
test_routes_duplicate.pyat 1,473 lines. The few contract-shaped tests that sat outside the kept prefix go to the part whose behaviour they share:.spec-state/settings egress to egress, create pre-checks and the seed prompt to create, the state-guard self-tests to index, the module-scope import guard to paths, the live-running detail to slot scoping.Path-keyed rows follow their tests:
test/requires-real-symlinks.txtre-points the remaining eight node ids.test/test_source_pin_budget.pyre-keys itstest_routes.pyrow totest_routes_delete.py, where the onechat_runnersource read now lives.docs/system-specs/common/testing-conventions.mdcites the tombstone-race test intest_routes_delete.py..github/file-line-cap-baseline.txtdeletes thetest_routes.pyrow.Backwards compatibility
Compatible: test-only. Every collected test keeps its name, parameters and markers (594 before and after);
test_routes.pykeeps every name another module imports from it.Removes nothing: no production code, public function, route or data changes; the moved definitions are private test helpers.
Tests
No test is added or rewritten. Evidence the move is faithful:
Collected multiset.
pytest --collect-only -qqovertest_routes.py+test_routes_*.pybefore and after: 594 = 594, identical(name, params)multiset.Move audit (
move_audit.py --origin .../test_routes.py, BASE = this PR's merge-base):Runs.
spec_builder/testswith the repo guards that read these files (test_spec_builder_routes_coverage.py,test_source_pin_budget.py,test_auto_research_facade.py,test_lazy_data_home_paths.py,test_host_isolation_floor.py,test_mock_pid_gate_wiring.py,test_error_code_contract.py,test_security_posture.py,test_file_line_cap.py) at-n 3: 1,567 passed. Every part also passes run alone at-n0.scripts/local-gate.py: the backend related set (42 files) passed, 5,898 tests. Its cross-surface frontend set did not run on this host (npxreturned E401 with nowebsite/node_modules); this PR changes no frontend file, and CI runs that set.test_flake_pattern_ratchet.py(-n0) passes;mypy src/kiro_crewis clean; black, isort and flake8 are clean on the changed files.semgrep 1.78,p/python p/typescript p/security-audit p/secrets p/owasp-top-ten semgrep/,--baseline-commitmerge-base--error) reports 0 findings.docs_lint.pypass;scripts/check_file_line_cap.pyreports 0 failures.Moved findings. Two more pre-existing sleeps that CI's diff-scoped semgrep reports again in their new file carry an own-line
# flake-ok:and# nosemgrep: kirocrew.test-sleep-as-barrierabove them, bodies unchanged:test_routes_git.py: the fake git'sawait asyncio.sleep(3600), which hangs until the test cancels it;test_routes_index.py: the stub'stime.sleep(0.05), which widens a read-to-write window on purpose.The only credential-shaped literal that moves is AWS's documented example key
AKIAIOSFODNN7EXAMPLE(8 lines, redaction and egress tests).Manual verification
N/A — test-only restructuring; the collected-test multiset, the AST move audit and the runs above are the verification.
Related Issues
Part of #20192
Follow-up: #20366 (pre-existing test weaknesses moved verbatim; de-flake there)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)