Skip to content

refactor(dashboard): move DashboardState into state_parts owners - #21647

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/linecap-g04-state-p2
Oct 18, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/linecap-g04-state-p2

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring dashboard/state.py under the 2,000-line cap: move DashboardState into dashboard/state_parts/ owners while every import path, patch target and behaviour stays the same.

src/kiro_crew/dashboard/state.py is still 5,469 lines after #20507, almost all of it DashboardState (about 4,940 lines). The campaign rule is that no hand-written file exceeds 2,000 lines, and this file is one of the most-edited in the repo, so every feature PR that touches it pays for its size in review and merge conflicts. #20507 moved the module helpers and _ChatSlot; this PR moves the class that remains.

Why it matters

A reader looking for "how slots are pushed to the browser" or "where approvals are resolved" has to search one 4,940-line class. Splitting it by responsibility gives each part a file named for it and a place for new code to go, without asking any caller or test to change, and takes state.py off the line-cap baseline.

Not a goal

  • No behaviour change, no new feature, no fix: a real defect found while moving code is reported separately, not fixed here.
  • No change to who owns state: DashboardState keeps every field on itself; collaborators hold behaviour only.
  • No change to what is redacted or where: every redactor call moves byte for byte; the posture panel's two re-keyed rows only name the owner that now holds the call.
  • No CI workflow, gate or baseline is relaxed.

What changed (motivation → approach → change)

DashboardState is split the way #20507 split _ChatSlot: by binding, not inheritance. state_parts/dashboard_state.py keeps the class with its docstring, class-level defaults, __init__, properties and one binding line per method (notify = _dashboard_services.notify). Each method's body moves, unchanged, into the collaborator that already holds that responsibility's module helpers, as a function whose first parameter is self. own_methods restores each bound function's __qualname__ (DashboardState.notify), so signatures, coroutine kinds, MagicMock(spec=DashboardState) and patch.object(DashboardState, ...) see what the one-module class had.

state.py keeps its import block, re-exports every name it bound, and installs kiro_crew._facade_mirror, so kiro_crew.dashboard.state.<name> patches still reach every reader. request_slot_origin, set_build_info (with the _build_info global it rebinds), _DEFAULT_PORT and _SSE_INTERVAL_SECS move with the class.

Owner (dashboard/state_parts/) DashboardState members added Lines
dashboard_services.py coordinators, background-turn budget, approvals and questions, notifications, periodic flush, context snapshots, yolo 666
session_events.py channel-transport registry; compact, recycle, bind and unbind callbacks and their notices 668
status_payload.py status_snapshot, served bundle, lesson count 298
slot_directory.py getting, resolving and counting slots; Slack thread links; member rows; request_slot_origin 822
sidebar_stores.py folders, cron folders, chat pins, the pinned-session order, tags and boards, and their strict JSON writers 842
source_links.py source-link URLs, activity and status pushes 611
slots_frame.py slot serialisation and views, channel and source links, lineage rows 1,190
slots_push.py slots broadcast and pacing, patches, card and progress pushes, _broadcast, the websocket fan-out 1,030
dashboard_state.py (new) the class shell 1,186

state.py: 5,486 → 538 lines; its .github/file-line-cap-baseline.txt row is deleted.

Move audit

move_audit.py: src/kiro_crew/dashboard/state.py: 5486 -> 538 lines; units 244, moved 62, changed 182 (moved_pct 16.01)
replumb_audit.py (against the one-module BASE, 107c5ef52c with main's later state.py edits ported): identical 487, replumbed 478, changed 1, imports 62

The 182 changed units are DashboardState members moved into collaborators. replumb_audit.py compares every unit of both PRs with the one-module file and finds each equal once the allowed transforms are undone: the self: DashboardState annotation (dropped at run time by own_methods), one level less indentation, and black re-indenting the docstring. The one unit it lists, _atomic_write_json_strict, is a @staticmethod that becomes the binding staticmethod(...), as _todo_text_line did in #20507.

Other justified edits:

  • Nine annotation-only declarations in the class body (notification_bus, notification_channel_settings, resource_pressure_notifier, file_indexes, _chat_pins_lock, _folders_lock, _folders_generation, and the lazily set _lineage_sent), plus a TYPE_CHECKING import of FileIndexRegistry. Owner functions read these through self, and mypy cannot type them before it has inferred __init__. They create no class attribute, so getattr(self, "_lineage_sent", None) still finds none.
  • Nine logging.getLogger(__name__) calls inside moved methods name "kiro_crew.dashboard.state", the BASE logger (L25).
  • Eight comment/docstring rewordings into present tense for the comment-history gate.
  • One cite in a moved comment: acp/client.py::_TOOL_STALL_TIMEOUT names acp/client_timeouts.py::_TOOL_STALL_TIMEOUT, where G03's split put it.

Diff alignment (L36): git diff and git diff --minimal give the same + and - counts for each of the 79 changed files (state.py: +76 / -5,024).

Docs and citations

  • learn-cron-dashboard.md's owner map lists every owner's DashboardState responsibility, names the two methods the shell keeps (note_crew_log_class and _atomic_write_json) and why, and names test/test_state_parts_dashboard_state.py as the member inventory.
  • test/campaign_facade_inventories/kiro_crew.dashboard.state.json gains the rebound homes of DashboardState, request_slot_origin and set_build_info; no base name changes.
  • Prose citations re-pointed under L29: 69 comments and docstrings in 54 files that named state.py for code now defined in an owner. Only the cited path or name changes; a line that grew past 100 columns carries its last words to the next line. Mentions of state.py as the import path, the patch surface, an import-time effect or history are left alone.
Every re-pointed citation (file:line → new home)
  • docs/feature-map/README.md:91 → state_parts/slot_sidebar.py
  • docs/feature-map/README.md:118 → dashboard/state_parts/transcript_rows.py
  • docs/feature-map/README.md:142 → dashboard/state_parts/slot_directory.py, dashboard/state_parts/dashboard_state.py, dashboard/state_parts/slot_transcript.py
  • docs/request-for-change/README.md:84 → dashboard/state_parts/injected_turns.py
  • docs/request-for-change/README.md:98 → state_parts/slots_frame.py
  • docs/request-for-change/rfc-channel-plugin-architecture.md:111 → dashboard/state_parts/dashboard_state.py
  • docs/request-for-change/rfc-crewmate-profile-settings.md:38 → dashboard/state_parts/chat_slot.py
  • docs/request-for-change/rfc-everything-is-an-app.md:179 → dashboard/state_parts/session_events.py
  • docs/request-for-change/rfc-issue-radar-crews.md:363 → state_parts/chat_slot.py
  • docs/request-for-change/rfc-local-notification-bus.md:37 → dashboard/state_parts/dashboard_services.py
  • docs/request-for-change/rfc-notification-bridge.md:45 → dashboard/state_parts/dashboard_services.py
  • docs/request-for-change/rfc-session-address-model.md:148 → dashboard/state_parts/slot_directory.py
  • docs/request-for-change/rfc-transcript-section-markers.md:179 → dashboard/state_parts/slot_transcript.py
  • docs/request-for-change/rfc-transcript-section-markers.md:405 → dashboard/state_parts/slot_transcript.py
  • docs/request-for-change/rfc-transcript-section-markers.md:409 → dashboard/state_parts/transcript_rows.py
  • docs/request-for-change/rfc-transcript-section-markers.md:571 → dashboard/state_parts/transcript_rows.py
  • docs/request-for-change/rfc-transcript-section-markers.md:673 → dashboard/state_parts/slot_transcript.py
  • docs/request-for-change/rfc-webhook-subscriptions.md:346 → dashboard/state_parts/injected_turns.py
  • docs/request-for-change/rfc-webhook-subscriptions.md:570 → dashboard/state_parts/injected_turns.py
  • docs/system-specs/modules/app-kit-platform.md:2197 → dashboard/state_parts/slots_push.py
  • docs/system-specs/modules/app-notifications.md:131 → dashboard/state_parts/session_events.py
  • docs/system-specs/modules/knowledge.md:601 → dashboard/state_parts/dashboard_state.py
  • src/kiro_crew/artifact_store/folders.py:57 → dashboard/state_parts/sidebar_stores.py
  • src/kiro_crew/context_assembly/session_start.py:252 → dashboard/state_parts/slot_transcript.py
  • src/kiro_crew/dashboard/chat_api/chat_send.py:107 → state_parts/transcript_rows.py
  • src/kiro_crew/dashboard/chat_api/chat_send.py:423 → state_parts/slot_directory.py
  • src/kiro_crew/dashboard/chat_api/slot_create.py:430 → state_parts/slot_directory.py
  • src/kiro_crew/dashboard/chat_api/slot_detail.py:308 → state_parts/slot_transcript.py
  • src/kiro_crew/dashboard/chat_api/slot_detail.py:379 → state_parts/slot_transcript.py
  • src/kiro_crew/dashboard/chat_api/turn_stop.py:246 → state_parts/chat_slot.py
  • src/kiro_crew/dashboard/chat_fork.py:419 → state_parts/slot_directory.py
  • src/kiro_crew/dashboard/chat_runner.py:14003 → state_parts/slot_ladder.py
  • src/kiro_crew/dashboard/chat_turn/file_changes.py:1299 → state_parts/transcript_rows.py
  • src/kiro_crew/dashboard/chat_utils_injected_rows.py:80 → state_parts/injected_turns.py
  • src/kiro_crew/dashboard/handlers/updates.py:2650 → state_parts/slots_push.py
  • src/kiro_crew/dashboard/session_control_parts/session_messaging.py:660 → state_parts/dashboard_services.py
  • src/kiro_crew/dashboard/session_memory.py:300 → state_parts/slot_directory.py
  • src/kiro_crew/dashboard/session_pulse_counter.py:14 → state_parts/slot_directory.py
  • src/kiro_crew/dashboard/ws_event_scope.py:97 → state_parts/slots_push.py
  • src/kiro_crew/dashboard/ws_event_scope.py:787 → state_parts/slots_push.py
  • src/kiro_crew/decisions/points/compaction_keep.py:916 → dashboard/state_parts/session_events.py
  • src/kiro_crew/history_projection.py:1530 → state_parts/slot_directory.py
  • src/kiro_crew/knowledge/store.py:259 → dashboard/state_parts/dashboard_state.py
  • src/kiro_crew/messaging/registry.py:8 → dashboard/state_parts/dashboard_state.py
  • src/kiro_crew/release_channel.py:7 → dashboard/state_parts/status_payload.py
  • src/kiro_crew/safety_override.py:2037 → dashboard/state_parts/status_payload.py
  • src/kiro_crew/slack/format.py:30 → dashboard/state_parts/slot_transcript.py
  • src/kiro_crew/snapshot_merge.py:1085 → dashboard/state_parts/notification_log.py
  • test/test_chat_slack.py:734 → state_parts/chat_slot.py
  • test/test_dashboard_chat_compaction.py:191 → state_parts/session_events.py
  • test/test_dashboard_chat_pagination_suffix.py:92 → state_parts/slot_transcript.py
  • test/test_dashboard_chat_pagination_suffix.py:480 → state_parts/transcript_rows.py
  • test/test_dashboard_chat_pagination_suffix.py:592 → state_parts/slot_transcript.py
  • test/test_dashboard_chat_unflushed_tail.py:346 → state_parts/slot_transcript.py
  • test/test_eventlog_hooks.py:446 → state_parts/slot_directory.py
  • test/test_fargate_launch_engine.py:204 → state_parts/dashboard_state.py
  • test/test_is_interrupted.py:168 → state_parts/session_events.py
  • test/test_members_preview_speech_only.py:373 → state_parts/slot_directory.py
  • test/test_members_preview_speech_only.py:567 → state_parts/slot_directory.py
  • test/test_recovery_marker_parity.py:89 → state_parts/injected_turns.py
  • test/test_redact_meta_snapshot.py:142 → state_parts/transcript_rows.py
  • test/test_session_pulse_session_count.py:85 → state_parts/slot_directory.py
  • test/test_session_transfer.py:2969 → state_parts/dashboard_state.py
  • test/test_state_store_preservation.py:1 → state_parts/sidebar_stores.py
  • test/test_stop_handler_idempotent.py:569 → state_parts/chat_slot.py
  • test/test_subagent_scale.py:1883 → state_parts/chat_slot.py
  • test/test_workflows_service.py:1549 → state_parts/chat_slot.py
  • src/kiro_crew/security_posture.py:2326 → the owners' sink rows (state_parts/slot_transcript.py, state_parts/session_events.py), line-neutral
  • src/kiro_crew/security_posture.py:2361 → state_parts/slots_push.py (the WS egress)
  • Two citations sat in files another live scope was splitting, so they were relayed through the Master (KC28 G04 CITE). The chat_runner.py one (state_parts/slot_ladder.py) is edited here after G01's refactor(dashboard): move the runner's turn helpers into chat_turn #21086 merged, rewrapped line-neutral; the handlers/artifacts.py:803 one (state_parts/slot_directory.py) waits for S39.

References not edited (cost)

These comments name state.py for code this PR moves. To keep the frontend lanes out of a backend-only change, they are left as is and re-pointed in Follow-up: #21320.

  • website/scripts/capture-wait-countdown.mjs:484: the owner-websocket frame shape lives in dashboard/state_parts/slots_push.py.
  • website/src/app-sdk/index.ts:151: _serialize_for_client lives in dashboard/state_parts/slots_push.py.
  • website/src/apps/crew-companion/sessionWatch.ts:89: broadcast_ws('approval', ...) lives in dashboard/state_parts/slots_push.py.
  • website/src/hooks/unreadOnAttention.ts:22: wire_session_recycle_callback lives in dashboard/state_parts/session_events.py.
  • website/src/test/ChatSidebar.connectedChannelGlyph.test.tsx:65: the origin link is built in dashboard/state_parts/slots_frame.py.

Security posture rows (justified visible changes)

The posture panel names the module each redaction sink lives in. Two sinks moved, so their rows name the owner that now holds the call:

Row Before After Evidence
Dashboard slot snapshot dashboard/state.py dashboard/state_parts/slot_transcript.py it passes redact=_redact into the slot-payload projection; replacing it with an identity function fails test_preview_text.py (2 credential cases) and test_coordinator_approval_slot_lane.py
Session detach notice dashboard/state.py dashboard/state_parts/session_events.py dropping display_safe(notice) there fails 6 cases of test_inbound_unbind_notice.py

slot_transcript.py leaves NON_EGRESS_REDACTION_MODULES, because a module is in one bucket only (test_a_module_cannot_be_in_both_buckets). slot_directory.py, which holds a redactor call this PR moves, joins it beside the other owners. The count of posture items is unchanged.

Backwards compatibility

Compatible: every module-level name state.py bound still resolves through it, to the same object (frozen in test/test_state_parts_facade.py and the inventory file). DashboardState keeps every member with the same kind, coroutine-ness and signature, __qualname__ and identity with its body (test/test_state_parts_dashboard_state.py). Only __module__ moves.

Reader: src/kiro_crew/cli.py:set_build_info -- release -- imports kiro_crew.dashboard.state.set_build_info, the moved function re-exported; the constructor reads the global it rebinds through the mirror (test_state_parts_facade::test_a_rebound_global_has_exactly_one_holder_and_is_read_live)
Reader: src/kiro_crew/dashboard/handlers/members.py:request_slot_origin -- crew page -- imports kiro_crew.dashboard.state.request_slot_origin, the moved function re-exported (test_state_parts_facade::test_a_moved_name_is_the_object_its_owner_holds)
Reader: src/kiro_crew/dashboard/chat_fork.py:request_slot_origin -- chat -- same re-export (test_state_parts_facade::test_a_moved_name_is_the_object_its_owner_holds)
Reader: src/kiro_crew/dashboard/chat_api/chat_send.py:request_slot_origin -- chat -- reads it through the chat_handlers facade, which imports it from the state facade (test_state_parts_facade::test_a_moved_name_is_the_object_its_owner_holds)
Reader: src/kiro_crew/dashboard/chat_api/slot_create.py:request_slot_origin -- chat -- same path as chat_send (test_state_parts_facade::test_a_moved_name_is_the_object_its_owner_holds)

CI path references

N/A — no workflow path filter or file list names dashboard/state.py.

Tests

  • test/test_state_parts_dashboard_state.py (new, 5 tests) freezes DashboardState's member inventory (kind, coroutine, async-gen, signature) as measured on the one-module file, checks each bound member is its collaborator's function and reads as a method, checks no bound member depends on the class body it left, and checks typing.get_type_hints resolves every member's hints as on the one-module file, except the 8 members it names, whose hints name _ChatSlot, which their collaborator imports only under TYPE_CHECKING, and the 3 that did not resolve on BASE either.
  • test/test_state_parts_session_events.py (new, 4 tests, 5 cases) drives the two callbacks wire_session_recycle_callback registers on a real DashboardState and slot: the recycle and stuck-turn notice rows (role, text, meta.kind="compaction", meta.notice), the banner push after a recycle, no notice and nothing logged for a session with no tab or no live slot, and a failing append or banner push logged under the BASE logger instead of raised. It brings state_parts/session_events.py from 76.6% to 89.5% line coverage.
  • test/test_state_parts_facade.py adds _build_info's single holder and names DashboardState's home.
  • Source pins that read state.py's text for code that moved now read state.py joined with every owner (L30, L40): test_pipeline_board_card_publisher.py, test_stuck_turn_watchdog.py, test_ws_event_scoping_live.py, test_ws_event_scoping_origin.py; test_cron_store_unreadable_boundaries.py and test_dashboard_updates_coverage.py re-key a path row. Assertions are unchanged. Planting one defect in each construct's new owner fails each of the six; the unmutated run passes.
  • Per-file line coverage over the 454 test files that reach the state modules, including every test feat(sidebar): keep the pinned-session order on the gateway #21346, feat(sidebar): drag any session into a manual order kept on the gateway #21519 and fix(security): redact a streamed link cut inside its query as one link #20805 added (--cov on dashboard.state and state_parts): every file is at least 85.2% (sidebar_stores.py); state.py 100%. No coverage baseline row is added.
  • Local floor: the 992 test files that import, patch or read dashboard.state, DashboardState or state_parts (including the tests feat(sidebar): keep the pinned-session order on the gateway #21346, feat(sidebar): drag any session into a manual order kept on the gateway #21519 and fix(security): redact a streamed link cut inside its query as one link #20805 added), plus the mirror, inventory, posture, line-cap, flake-pattern and ratchet guards, at -n 3: 53,140 passed, 0 failed. mypy over src/kiro_crew: clean (2,951 files).

Manual verification

N/A. Unit coverage is sufficient for a structural move with no runtime surface change.

Related Issues

Part of #20192

Follow-up: #21320

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 17, 2026 17:14
@bolichen97

bolichen97 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 23f119e
  • What rule changed: none. src/kiro_crew/security_posture.py re-keys two _REDACTION_SINKS rows to the dashboard/state_parts/ owners that now hold their redactor calls, swaps one NON_EGRESS_REDACTION_MODULES entry, and two comments in that list name the owners instead of state.py.
  • Before -> after (what was allowed/blocked, now): "Dashboard slot snapshot" moves from dashboard/state.py to dashboard/state_parts/slot_transcript.py (it passes redact=_redact into the slot-payload projection); "Session detach notice" moves from dashboard/state.py to dashboard/state_parts/session_events.py (it runs display_safe(notice) before the channel send); state_parts/slot_transcript.py leaves NON_EGRESS_REDACTION_MODULES because a module sits in one bucket only, and state_parts/slot_directory.py, which holds a redactor call moved verbatim, joins it. Nothing is allowed or blocked differently.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture panel would name the wrong file for a sink; no redaction is removed or bypassed, because every redactor call is byte-identical to BASE and still runs at the same call site.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py passes (registry shape, one-bucket rule, log-site census); dropping display_safe(notice) in session_events.py fails 6 cases of test_inbound_unbind_notice.py, and an identity redact in slot_transcript.py fails test_preview_text.py (2 credential cases) and test_coordinator_approval_slot_lane.py; the replumb audit shows each moved redactor call unchanged.
  • No regression:
    • Tools still work (which tools/commands were run, result): the local floor of 964 test files passed (55,232 passed; the one failure was a stale local build directory and passes once it is removed), and after the rebase the state, posture and guard files passed again (1,099 passed on the refreshed head before its push).
    • Backward compatible (old config / old data / old callers still work, how checked): yes, every module-level name and patch target of dashboard/state.py still resolves to the same object through the facade, frozen by test_state_parts_facade.py and the inventory file.
    • Existing tests (which suites passed on this head): test_security_posture.py, test_state_parts_facade.py, test_state_parts_dashboard_state.py, test_state_parts_session_events.py and the posture witnesses above pass unmodified apart from the granted path rows and citations.
  • How to undo: revert this commit; the two rows, the bucket swap and the owners go together, and dashboard/state.py returns to holding DashboardState.

@bolichen97
bolichen97 requested a review from CrysisDeu October 17, 2026 17:14
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 23f119ef671bf48bd7242539906efba80597b422 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @bolichen97 posted a complete reasoning template for 23f119e.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 23f119ef671bf48bd7242539906efba80597b422 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify that the posture panel's re-keyed sink rows (slot_transcript.py, session_events.py) are where the redactor calls actually live after the move.

[DESIGN-REVIEWED] 23f119e

Description read

[DESCRIPTION-READ] de9ebfa8ae4bb2b0a72db40c9f85b6b956c90c1c10b88006ce0f2fc885d73fcb

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 23f119ef671bf48bd7242539906efba80597b422 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check that the security-posture panel's two moved sink paths, now slot_transcript.py and session_events.py, still match where each redactor call actually lives.

What this change ships

Inventory (7 items) — 7 justified

Intent: bring dashboard/state.py under the 2,000-line cap that AGENTS.md mandates, with no change in behaviour (a FIX).

  1. The DashboardState method bodies move into eight state_parts/ owners, with the class shell kept in dashboard_state.py — justified
  2. state.py shrinks to a re-export facade and keeps every import path and patch target working — justified
  3. The state.py row is deleted from the file-line-cap baseline — justified
  4. The security-posture panel's "Dashboard slot snapshot" and "Session detach notice" rows now name their new owner files — justified
  5. slot_transcript.py leaves the non-egress module list and slot_directory.py joins it — justified
  6. The facade inventory JSON records where DashboardState, request_slot_origin and set_build_info now live — justified
  7. New tests check member inventory, binding and qualname, and the session-event notices — justified

[FIRST-PRINCIPLES-REVIEWED] 23f119e

Description read

[DESCRIPTION-READ] d34b93c08431b5b6ee828c977188951a83101f60ee792c4f4828d17ffe7f95ba

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 23f119ef671bf48bd7242539906efba80597b422 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 23f119e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 23f119ef671bf48bd7242539906efba80597b422: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 23f119ef671bf48bd7242539906efba80597b422 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 23f119e

Verdict parsed from the review's SHA-scoped output markers for commit 23f119ef671bf48bd7242539906efba80597b422.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 23f119ef671bf48bd7242539906efba80597b422: <one-sentence reason>

@bolichen97
bolichen97 enabled auto-merge (squash) October 17, 2026 17:35
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 17, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-g04-state-p2 branch from fec8ad8 to b2d62fe Compare October 17, 2026 19:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 17, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-g04-state-p2 branch from b2d62fe to 94f15c3 Compare October 18, 2026 09:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 18, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Posture sink rows still pass security_posture's sink-coverage tests

Checked: test/test_security_posture.py passes at this content (it was in the 992-file local floor, 53,140 passed). It covers the registry shape, the one-bucket rule (test_a_module_cannot_be_in_both_buckets) and the log-site census.
Each re-keyed row's file holds its redactor call: state_parts/slot_transcript.py passes redact=_redact into the slot-payload projection, and state_parts/session_events.py runs display_safe(notice) before the channel send.
Mutation proof: an identity redact in slot_transcript.py fails test_preview_text.py (2 credential cases) and test_coordinator_approval_slot_lane.py; dropping display_safe(notice) in session_events.py fails 6 cases of test_inbound_unbind_notice.py. Both files were restored afterwards.
Outcome: no change needed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Each re-keyed posture path holds its redactor call

Confirmed. "Dashboard slot snapshot" -> dashboard/state_parts/slot_transcript.py, which passes redact=_redact into the slot-payload projection. "Session detach notice" -> dashboard/state_parts/session_events.py, which runs display_safe(notice) on the notice.
The bucket swap runs the other way from the punchline: slot_transcript.py LEAVES NON_EGRESS_REDACTION_MODULES, because it is now a registered sink and a module sits in one bucket only. slot_directory.py JOINS that list, because it holds a redactor call PR B moved verbatim and it adds no egress path.
Mutation proofs for both rows are in the design disposition and the Sensitive change review comment. test_security_posture.py passes.
Outcome: no change needed.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 18, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 18, 2026
dashboard/state.py was still 5,385 lines after #20507, almost all of
it DashboardState. The class is split the way _ChatSlot was: by binding.
state_parts/dashboard_state.py keeps the class shell (docstring, class
defaults, __init__, properties) and binds each method from the
collaborator that already owns that responsibility's module helpers.
Method bodies move unchanged; own_methods restores each binding's
__qualname__, so signatures, coroutine kinds and patch.object targets
are what the one-module class had.

state.py stays the import path and patch surface (5,385 -> 536 lines)
and leaves the line-cap baseline. Tests freeze DashboardState's member
inventory and type hints as measured on the one-module file, and drive
the session recycle and stuck-turn callbacks. The two security-posture
sink rows whose redaction moved name their new owners, and comments
that cited state.py for moved code name the owner instead.

Part of #20192
@bolichen97
bolichen97 force-pushed the refactor/linecap-g04-state-p2 branch from 94f15c3 to 23f119e Compare October 18, 2026 12:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 18, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Re-keyed posture sink rows match where the redactor calls live

At this head: state_parts/slot_transcript.py:598 passes redact=_redact; state_parts/session_events.py:552 passes display_safe(notice).
Checked: test/test_security_posture.py passes at this content (it was in the 992-file local floor, 53,140 passed). It covers the registry shape, the one-bucket rule (test_a_module_cannot_be_in_both_buckets) and the log-site census.
Each re-keyed row's file holds its redactor call: state_parts/slot_transcript.py passes redact=_redact into the slot-payload projection, and state_parts/session_events.py runs display_safe(notice) before the channel send.
Mutation proof: an identity redact in slot_transcript.py fails test_preview_text.py (2 credential cases) and test_coordinator_approval_slot_lane.py; dropping display_safe(notice) in session_events.py fails 6 cases of test_inbound_unbind_notice.py. Both files were restored afterwards.
Outcome: no change needed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Each re-keyed posture path holds its redactor call

At this head: state_parts/slot_transcript.py:598 passes redact=_redact; state_parts/session_events.py:552 passes display_safe(notice).
Confirmed. "Dashboard slot snapshot" -> dashboard/state_parts/slot_transcript.py, which passes redact=_redact into the slot-payload projection. "Session detach notice" -> dashboard/state_parts/session_events.py, which runs display_safe(notice) on the notice.
The bucket swap runs the other way from the punchline: slot_transcript.py LEAVES NON_EGRESS_REDACTION_MODULES, because it is now a registered sink and a module sits in one bucket only. slot_directory.py JOINS that list, because it holds a redactor call PR B moved verbatim and it adds no egress path.
Mutation proofs for both rows are in the design disposition and the Sensitive change review comment. test_security_posture.py passes.
Outcome: no change needed.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 18, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every review lane on the head is clean (only runner notices and PR Scope / Opus size warnings); held by the triage cron on a size, path or checklist rule, not a finding. Approved on the watch holder's request.

@bolichen97
bolichen97 merged commit 9d560c0 into main Oct 18, 2026
105 checks passed
@bolichen97
bolichen97 deleted the refactor/linecap-g04-state-p2 branch October 18, 2026 19:48
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 18, 2026
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.

2 participants