Repository navigation
test(taskq): stop pinning the other task routes and cover child_record's read failures - #34259
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: this PR changes only tests and docs, removes no decision without saying why, and keeps the exact route-table pin, now in the route file's own tests. Notes
What this change shipsInventory (7 items) — 5 justifiedIntent: keep the timeline tests from failing when an unrelated task route changes, and test the read failures of
[FIRST-PRINCIPLES-REVIEWED] 4cef26a Description read[DESCRIPTION-READ] 438a5b3c349629933d5998547c29a56ecf4bb5e25b0afd03d2aac30a549cc1dc That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: this change only touches tests and docs. The exact route-table pin moves unchanged to Notes
[DESIGN-REVIEWED] 4cef26a Description read[DESCRIPTION-READ] c60e4a145bb9a73494a06c9473875508316c20d205bec736632a9f9fcf07f088 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: |
ad9e792 to
4ea3a3c
Compare
|
span=f5e0895b9793
|
|
span=12b7dfb4bf33
|
…d's read failures
4ea3a3c to
4cef26a
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only change: splits the timeline structure scans into their own file, drops the byte-for-byte pin on the other task routes, and adds tests for child_record read failures; the two spec edits only describe those tests and the existing route gate. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/learn-cron-dashboard.md, docs/system-specs/modules/taskq.md.
Problem / Motivation
Goal: the task-timeline tests pin what the timeline route owns; the task route table is pinned where the task routes are tested.
Follow-up to #19942, from its review notes.
test/test_taskq_timeline.pycarried_BASE_GOLDEN, eight captured responses of the five existing task routes, and an exact equality on the task route table. Both pinned routes the timeline does not touch, so an unrelated later change to any of them turns this file red, though the route-table equality is also the only test that fails when a route is added to or dropped from/api/tasks. The failure paths ofcrew_log.resolve.child_recordhad no test: the one failure-path test replaceschild_recorditself, so itsstrict=Trueunit listing and its fold-readUnitSearchFailedwere never exercised. The file was also 1,708 lines, past the 1,600-line point at whichAGENTS.mdasks a change to split a code file. Andlearn-cron-dashboard.mdsaid only the two action routes are owner-gated, which the timeline route made untrue.Why it matters
A pin on another route's bytes makes the next change to that route fail in a test file its author has no reason to open. An untested failure path is how "an unreadable stream never shows as empty" stops being true without a red test.
Not a goal
src/.What changed (motivation → approach → change)
Approach. Keep every behaviour test of the timeline; remove the captured responses of the other routes; move the exact route-table equality, unchanged, to the routes' own test file; drive the real
child_recordinto failure the waytest/test_subagent_panel_fold_replay.pydoes; move the source-tree scans to their own file.test/test_taskq_timeline.py:_BASE_GOLDENandtest_every_existing_task_route_answers_byte_for_byte_as_beforeare removed.test_the_task_routes_are_the_old_set_plus_one_getbecomestest_the_timeline_get_route_is_registered, which asserts thatGET /api/tasks/{task_id}/timelineis registered. Four new tests patchsession_ledger._excluded_unitsorcrew_log.projection.fold_sessionto fail:child_recordandread_child_entriesraiseUnitSearchFailedfor a unit listing that fails and for a fold read that fails, andrender_timelinereports the crew-log streamunavailable (read_failed)with no entries, never an emptyokstream, while the queue's lines still render. Each test first shows the same log read correctly. The file is 1,534 lines.test/test_api_tasks.py:test_the_task_route_table_is_exactly_these_routesholds the exact six(method, path)pairs under/api/tasks, the same assertion the timeline file carried, next totest_routes_are_registered_in_order. Dropping the cancel route's registration fails it.test/test_taskq_timeline_structure.py(new, 141 lines): the five source-tree scans, moved unchanged from the file above with their owntree_scan_xdist group.docs/system-specs/modules/learn-cron-dashboard.md: the owner-only sentence names the timeline route and its gate,require_owner_dashboard_request, which also refuses app tokens. The two action routes' facts are unchanged.docs/system-specs/modules/taskq.mdand the tests paragraph oflearn-cron-dashboard.md: the coverage lines match the files.Backwards compatibility
Compatible: tests and docs only. No route, key, field or default changes.
Removes nothing a user or caller can reach. The removed test pinned other routes' responses; the exact
/api/tasksroute table is still pinned, intest/test_api_tasks.py.Tests
child_recordis changed to return an emptyChildRecord()instead of raising in either failure branch: two reportDID NOT RAISE UnitSearchFailed, and the two rendered cases readno_recordinstead ofread_failed. The other 136 tests pass under that change.test/test_api_tasks.py: 176 passed, three runs in a row at-n0, and three more with the repo's default-n auto --dist loadgroupandKIROCREW_TMP_RESIDUE_STRICT=1, as the new-test stability job runs them. Withtest_crew_log_resolver.py,test_api_tasks.py,test_dashboard_handlers_lazy_tasks.py,test_taskq_startup.py,test_chat_utils_facade.py,test_subagent_panel_fold_replay.pyandtest_tree_scan_budget.pyat-n 4 --dist loadgroup: 354 passed.flake8,isort, the black gate, the comment-history gate,scripts/check_file_line_cap.py,scripts/docs-lint.sh, and the 28 ratchet, xdist and tree-scan-budget test files (493 passed) pass. The whole backend suite on a merge with main passed on the first revision of this change, apart from tests that fail the same way on main in this environment.python -m pytest test/test_taskq_timeline.py test/test_taskq_timeline_structure.py test/test_api_tasks.py -n0Review round on ad9e792. GPT and Opus blocked the presence check that had replaced the route-table equality (a ratchet may only tighten): nothing else failed when a task route was added or dropped. The equality moves unchanged to
test/test_api_tasks.py, and the timeline file keeps its presence check. The new-test stability job failed on both runs ontest_the_route_finds_a_channel_or_cron_parents_log_with_no_tab_open[cron:job1-cron-job1], a case from #19942: the crew-log stream readabsent (no_record)withcron-job1among the slots tried. The four cases share one tmp path (each passed case's directory is removed, and the next case gets the same numbered name), and all of them created unitacp-1under a different slot. The store's slot index reuses the headers it proved under a root with the same path, device and inode, asstore_units.session_units_by_slotsays (unit ids are fresh per ACP session in a gateway), so a re-created root that keeps its inode makes the case readacp-1under the previous case's slot. That the CI runner's filesystem reuses the inode is inferred, not observed. A local run that keeps the root and its inode between the cases reproduces it,absent (no_record)withacp-1, and passes with one unit id per case, which the test uses.Manual verification
N/A: tests and docs only.
Screenshots / video
N/A: no file under
website/changes.Related Issues
Follow-up to #19942 (its review notes).
Pattern harvest
Not generalizable beyond the review note: a new route's tests pin the new route, not the bytes of routes the change does not touch.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement