Skip to content

refactor(acp): bind AcpRuntime spawn, kill and session-start owners - #22085

Merged
chenmingwei23 merged 1 commit into
mainfrom
refactor/linecap-g05-runtime
Oct 20, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
refactor/linecap-g05-runtime

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring src/kiro_crew/acp/runtime.py toward the 2,000-line cap with no behaviour change: the first of two PRs, moving AcpRuntime's spawn, process-tree teardown and session-start behaviour into owner modules the class binds by name.

acp/runtime.py is 9,176 lines, and one class (AcpRuntime, 7,909 lines) is most of it. It is one of the files the line-cap guard lists as over the cap (.github/file-line-cap-baseline.txt). It also changes often (20 commits in the last week), so every feature PR that touches the multiplexed runtime edits a file far past the size where a reviewer can hold it.

Why it matters

The 2,000-line cap is the repository's rule (AGENTS.md, scripts/check_file_line_cap.py). Left alone, runtime.py keeps growing, every runtime fix lands in a 9,000-line diff context, and the session-start and spawn code, where most of the recent fixes landed, stays mixed with the reader loop, the wire and the death attribution.

Not a goal

  • No behaviour change: every moved body is byte-identical apart from the dedent (and three comment lines, listed below).
  • Not the whole split: the reader loop, wire, liveness, host requests, frame accounting, session registry and mode activation owners, and the class statement's own home, are the second PR. runtime.py stays over the cap after this one, so its line-cap row stays as main has it.
  • No new tests of runtime behaviour; the existing suite is the proof. The one new test file pins the binding contract.
  • No change to AcpRuntime's public or private surface, its constructor, its properties or its class constants.

What changed (motivation → approach → change)

runtime.py is over the cap because one class holds everything, and a class cannot be split by moving definitions. The approach is the one acp/client.py and acp/session_handle.py already use (binding, KC28 L33): each moved member's body becomes a module-level function in an owner module, with self as its first parameter, and the class binds it by name (spawn = _rt_entry.spawn). The instance keeps all of the runtime's state, so a patch of a method on the class or an instance, an AcpRuntime.__new__ build and an unbound AcpRuntime.m(stub, ...) call all still reach the one function. _own_methods restores each bound function's __qualname__ and drops its type-checker-only self annotation, so task reprs and inspect.signature read as before. It matches the explicit _MEMBER_OWNERS set rather than a module-name prefix, because runtime_models, runtime_process_tree and runtime_start share the runtime_ prefix and are not owners (the dashboard's exported own_methods matches only its own package).

This PR moves the six owners that hold the file's most-edited code: the process tree and kill, the child launch and its handshake, the spawn entry, and the three session-start owners (what a session is built from, session/new, session/load). The module-level helpers only they read move with them. The facade switches from its own forwarding class to kiro_crew._facade_mirror, keeping its forward table unchanged, so a patch through kiro_crew.acp.runtime still reaches every module that holds the moved code.

Owner Owns
acp/runtime_tree_kill.py the process tree and its teardown: root identity, descendant snapshot, tree signal, kill
acp/runtime_spawn_launch.py the child launch: spawn plan, projected spec, launch tail, initialize handshake, failed-start guard
acp/runtime_spawn_entry.py spawn under cold-start admission, the re-derive retry, the revive
acp/runtime_session_setup.py what session/new and session/load are built from and checked against
acp/runtime_session_create.py session/new end to end
acp/runtime_session_load.py session/load end to end

Tests that read runtime.py's text now read it joined with these owners (or the one owner that holds the pinned code), with every assertion unchanged; the owning spec (acp-client.md) gains the runtime owner table, and the docs that named where the moved code is defined now name its owner.

Backwards compatibility

Compatible: every name kiro_crew.acp.runtime bound before stays bound to the same object (test_every_base_import_stays_bound_on_the_facade and test/campaign_facade_inventories/kiro_crew.acp.runtime.json pin it), every AcpRuntime member keeps its name, kind, coroutine-ness and signature (the member inventory pins it), and a write through the facade reaches every owner that reads the name.

Reader: src/kiro_crew/acp/runtime_spawn_launch.py:_spawn_admitted -- chat -- the extra_hidden_dirs=plan.extra_hidden_dirs launch argument moved verbatim with _spawn_admitted; the runtime spawn hands the sandbox the same credential mask (test_acp_harness_contract.py::test_the_spawn_mask_reaches_the_sandbox)
Reader: src/kiro_crew/acp/runtime.py:AcpRuntime -- subagent -- the class is the same object with the same members; session.py, session_provider.py, providers/acp_runtime_start.py and review_pool.py import it from the facade unchanged (test_runtime_bindings.py::test_every_inventory_member_is_still_on_the_class)

Tests

  • test/test_runtime_bindings.py (new) pins the binding contract: the 156-member inventory (every member stays, with its kind, coroutine-ness, signature digest and owner; a member added later needs no row), each bound member is its owner's function with the BASE __qualname__, typing.get_type_hints resolves for the class ({}, as on main) and for every member, the fields a moved member assigns first are declared for type checkers only (a mutation that turns them into runtime annotations goes red), no owner keeps an unbound self function or needs its class body (zero-argument super(), __class__, name mangling, with a planted self-test), no owner imports the facade at run time and owners import only owners listed before them, each owner's docstring names the fields it writes and reads, owners log under kiro_crew.acp.runtime, moved exceptions keep the facade as their __module__, every name the test trees patch through the facade reaches every owner reading it (with a self-test that the scan can fail), the mirror forwards exactly the old forward table, and every import the facade binds is accounted for: a BASE name, the glue's, a name an owner defines, or one the facade's or an owner's code reads (the setup.cfg F401 row's stand-in; a planted self-test shows an unread import and an owner import of a name that owner does not define are reported, and a read one is not).
  • Source pins re-pointed or joined (L30 / L40(8)); each has a mutation proof that breaking the construct in its new home turns the pin red (31 distinct mutations, all red: pytest exits 1, a failed assertion, under each one).
  • Determinism: test/test_runtime_bindings.py (257 tests) passed 5 runs at -n0 and one at -n 3; it sleeps on nothing and orders nothing it did not define.

Manual verification

N/A — a pure move: the existing runtime suite drives every moved body, and the binding guards pin the contract.

Move audit

  • src/kiro_crew/acp/runtime.py: 9176 -> 5195 lines; moved 54.68% (python-ast) (move_audit.py, raw: it counts every moved member as changed because its first parameter gains the type-checker self: AcpRuntime annotation and black re-indents its docstring).
  • Normalized comparator (docstrings through inspect.cleandoc, the self annotation and a dropped @staticmethod undone): 229 units, 225 moved unchanged, 4 changed, all facade glue: _ReExportModule (replaced by _facade_mirror), the if not TYPE_CHECKING: __getattr__ (declines the names the mirror serves), _EXPORTS (bound empty, filled from the mirror), the class swap.
  • Non-move edits inside moved text (comments only, AST-identical): the _INITIALIZE_TIMEOUT comment says "the plain request budget (_REQUEST_TIMEOUT)" instead of "the plain budget above" (that constant stays in runtime.py); one # type: ignore[union-attr] (_mirrored_session_mcp) and one # type: ignore[misc] (the _adopt closure in _collect_late_start), each with a two-line reason: an owner is type-checked before the class that binds it, so mypy checks those closures on their own and loses the mirror is None / late_adopter is not None narrowing their enclosing function establishes.
  • Added in the class: @_own_methods, an if TYPE_CHECKING: block declaring the three fields a moved member assigns first (_native_skill_projection, _skill_projection_generation, _spawn_skill_projection; mypy sees them, and the class carries no annotations at run time, so typing.get_type_hints(AcpRuntime) is {} as on main), and the binding block.

Upstream code this PR carries

Diff layout (L36)

Every changed file adds the same lines under git's default diff and --minimal (runtime.py: +160/-4141 both). Total diff 635,597 bytes.

CI path references

None: no workflow path filter or explicit file list names runtime.py or acp/**.

Logger names

Owners log under logging.getLogger("kiro_crew.acp.runtime"), the literal name (39 caplog sites and 5 record.name == filters read it, and runtime_start.py already does the same); the facade keeps logging.getLogger(__name__), the same logger object.

Known limits

  • A closure defined inside a bound member keeps the owner's qualname: _own_methods restores the bound function's own __qualname__ (AcpRuntime._collect_late_start), not its closures', so the closure in _collect_late_start is _collect_late_start.<locals>._adopt where BASE had AcpRuntime._collect_late_start.<locals>._adopt.
  • A moved function's __code__.co_qualname is its owner-level name (create_session, BASE AcpRuntime.create_session), and a log record it emits carries the owner in module, filename and pathname (runtime_session_create); record.name stays kiro_crew.acp.runtime.
  • Nothing in the tree reads these: every log formatter prints %(name)s only, and no test, filter or repr keys on a closure qualname or co_qualname of these functions (the binding guard pins co_qualname to the owner-level name on purpose).

Edits outside the claim (granted)

  • setup.cfg: one per-file src/kiro_crew/acp/runtime.py: F401 row with its reason (the facade keeps every import it bound; test_runtime_bindings.py's import check, with a planted self-test, stands in for it: each import is a BASE name, glue, owner-defined, or read by the family's code).
  • test/test_worker_agent_spawn_gate.py: _gate_calls also reads a module-level function when called with class_name=None, and is called on the owner of _resolve_spawn_plan; assertion and message unchanged. Mutations: removing the gate call from runtime_spawn_launch.py turns it red, and a gate planted in KiroHarness.resolve_spawn still turns it red through the class path.
  • test/test_facade_mirror_guards.py: _OWN_CREATE_GUARDS gains kiro_crew.acp.runtime → test/test_acp_refactor_create_guard.py, the guard that already covers this facade's forwards.

Source pins re-pointed (L30 / L40(8)); every assertion unchanged

Text joins of runtime.py with _RUNTIME_OWNERS (or the one owner holding the pinned code): test_acp_liveness_remote_flat.py, test_acp_mcp_ref_guard.py (3), test_acp_runtime_load_session.py, test_acp_sandbox_init_classification.py (2; one window's end marker re-pointed to the unit that follows the failed-start helpers in their owner), test_browser_cli_launch.py, test_tool_call_classification_kas.py, test_worker_agent_load_bracket.py (3), test_windows_cleanup_capacity.py, test_acp_client_capabilities.py (3), test_per_runtime_process_resources.py (3), test_reconcile_sandbox_tool_exclusion.py, test_mcp_remote_header_secret_refs.py. Rows and paths: test_secc_poc_scratch_owner_symlink.py SPAWNERS, test_worker_agent_spawn_gate.py (seam caller), test_harness_parity.py (_RUNTIME_PATH_MODULES + 3 identity rows), test_deny_bounded_write.py (SITES + 6 empty owner rows), test_agent_admission_paths_ratchet.py (keys), test_kill_chokepoint_ratchet.py (kill). Comment: test_acp_refactor_facade.py:1801-1811 (the shared-binding readers now live in owners). Each re-pointed pin has a mutation that breaks the construct in its new home and turns the pin red (31 distinct mutations, all red).

Citations edited (L29, SD27)

  • src/kiro_crew/acp/client_start.py: three comments acp/runtime.py → acp/runtime_spawn_launch.py (the twin guard, the liveness anchor, the owner-marker join).
  • src/kiro_crew/constants.py: the INITIALIZE_TIMEOUT_SECS comment names acp.runtime_spawn_launch, where _INITIALIZE_TIMEOUT and its reasoning now live.
  • docs: acp-client.md (runtime owner block), harness-parity.md H6, code-style.md and error-handling.md (where the binding and session-start errors live), agent-spec-fields.md (2 rows), rfc-leaked-runtime-reclaim.md, rfc-overload-resilience.md (E11 create_session), rfc-resumable-subagent-sessions.md (5 stale line cites → symbols; their 4 line-ref rows deleted from .github/docs-lint-baseline.txt by hand).
  • Not edited, still true: session_pid_tracking.py _replace_child_pids names kiro_crew.acp.runtime.AcpRuntime._snapshot_descendants, a class-attribute path the binding keeps; _untrack_root_by_identity names acp/runtime.py as the caller that logs a full retirement, _retire_tracking_after_exit, which stays in runtime.py in this PR.

Gates run locally

  • Floor: 295 test files (every file that imports, patches or names kiro_crew.acp.runtime / AcpRuntime, the tree-scan fences, the mirror and facade guards, and the mount-check tests), -n 3: 18,048 passed, 48 skipped, 0 failed. scripts/local-gate.py --dry-run selects 1,298 backend and 535 frontend files (the bare stem runtime), so it was not run whole.
  • Per-owner line coverage on that floor (measured on the first cut, before _start_mount_check joined session_setup; the mount-check tests drive it): tree_kill 95.1%, spawn_launch 91.7%, spawn_entry 97.3%, session_setup 85.9%, session_create 95.1%, session_load 88.1%; runtime.py 94.4%.
  • Cold mypy src/kiro_crew (fresh cache): no issues in 3,211 files. black / isort / flake8 on every changed file, comment-history, brand, harness parity, line cap (0 failures), subprocess-encoding, black gate, woke, take-away (2 Reader lines), PR template check, docs_lint, flake-pattern ratchet, campaign inventory check: all pass. semgrep 1.78 with the CI configs and --baseline-commit: 0 findings, no parse error.
  • Installed mode: a wheel built from git archive of this commit imports the facade and all six owners under an isolated home.

Related Issues

Part of #20192
Follow-up: #22257 (the shared _own_methods helper)

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

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 19, 2026 05:41
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision d5a4aff74a7cd657d986b78592358d969b37df46 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 added the readiness: checking Automated validation is still running label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Check that test_harness_parity.py::_RUNTIME_PATH_MODULES stays in step with AcpRuntime._MEMBER_OWNERS before the second split PR lands. Today the list is maintained by hand. If an owner is left off it, a harness-identity comparison moved into that owner disappears from the completeness scan, and no test fails.

Suggestions

  • Build _RUNTIME_PATH_MODULES's runtime half from kiro_crew.acp.runtime._MEMBER_OWNERS, or assert the two are equal. Then a new owner in PR 2 cannot drop out of the identity gate (H6 completeness), and the kill-chokepoint scan can follow the same rule.

[DESIGN-REVIEWED] d5a4aff

Description read

[DESCRIPTION-READ] e0d08634e4fc4b73218fc003c541b6361ca124f5c3dbb6ffec5c0b0ea39938c3

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 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of d5a4aff74a7cd657d986b78592358d969b37df46 — 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

Spawn and session start are availability paths. Before merge, check the move audit's claim that 225 of 229 units moved unchanged and the other 4 are facade glue only.

What this change ships

Inventory (10 items) — 10 justified

Intent: get acp/runtime.py closer to the 2,000-line cap with no behaviour change (first of two PRs). This is a refactor, not a FIX or an ADDITION.

  1. AcpRuntime's process-tree and kill code now lives in acp/runtime_tree_kill.py — justified
  2. Child launch, the initialize handshake and the failed-start guard now live in acp/runtime_spawn_launch.py — justified
  3. spawn admission, the re-derive retry and the revive now live in acp/runtime_spawn_entry.py — justified
  4. Session setup, session/new and session/load now live in three runtime_session_* owners — justified
  5. The facade's own forwarding class is replaced by the existing kiro_crew._facade_mirror, with the same forward table — justified
  6. _own_methods in runtime.py restores qualnames for an explicit owner set (the same helper pattern five other facades already carry) — justified
  7. runtime.py gets an F401 per-file ignore in setup.cfg, backed by an import-accounting test — justified
  8. New test/test_runtime_bindings.py pins the member inventory and the binding contract — justified
  9. Source-text tests now read the moved code from its new home or a joined text, with assertions unchanged — justified
  10. Specs, RFCs, comments and the docs-lint baseline now point at the new owner locations — justified

[FIRST-PRINCIPLES-REVIEWED] d5a4aff

Description read

[DESCRIPTION-READ] 4b295cb84814db90b3e01e42376d1da074af75292dac81589a953bc5decfd223

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 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d5a4aff

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

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d5a4aff

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

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

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Design punchline: full CI suite, Windows lane included, at this SHA

accepted: this head is driven to full green before it is reported merge-ready; every Backend Tests shard (3.12, Windows, macOS) must pass at 9f64956, and a red shard is triaged, never overridden.
Local evidence for the move at this tree: the 295-file floor that imports, patches or names kiro_crew.acp.runtime ran 18,016 passed, 0 failed at -n 3, plus cold mypy clean over 3,191 files.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • First Principles punchline: the per-file F401 row for runtime.py

rebutted (by design): the facade keeps every name it bound before because callers and tests read and patch them as attributes of kiro_crew.acp.runtime, so flake8's F401 would flag those deliberate re-exports; the row follows the acp/session_handle.py precedent.
The stand-in runs in every backend shard: test_every_facade_import_is_accounted_for fails on any facade import that is not a BASE name, the mirror glue, owner-defined, or read by the facade's or an owner's code, and test_the_import_check_reports_only_what_nothing_accounts_for plants an unread import to prove it can fail. A later unused import is caught in CI at PR time, as F401 would catch it.

@bolichen97
bolichen97 enabled auto-merge (squash) October 19, 2026 06:05
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 19, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-g05-runtime branch from 9f64956 to c7a9754 Compare October 19, 2026 07:09
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Design punchline: patches through kiro_crew.acp.runtime reach every owner reading the name

verified: test_every_name_patched_through_the_facade_reaches_the_owners_reading_it collects every patch target the test trees aim at the facade and asserts each owner that reads the name is in the mirror's holder index for it, and test_the_reach_scan_can_fail plants a gap to prove the scan can fail.
test_a_patch_through_the_facade_lands_on_every_owner_and_is_undone patches runtime._INITIALIZE_TIMEOUT and reads it back from runtime_spawn_launch, then checks the undo; test_acp_mcp_mount_check.py::test_runtime_passes_send_time_and_liveness patches rt.schedule_mount_check and the bound _start_mount_check in runtime_session_setup sees it. The 295-file floor of every test that patches or names the facade passed (18,016 tests).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • First Principles punchline: the per-file F401 row for runtime.py

rebutted (by design): the facade keeps every name it bound before because callers and tests read and patch them as attributes of kiro_crew.acp.runtime, so flake8's F401 would flag those deliberate re-exports; the row follows the acp/session_handle.py precedent.
The stand-in runs in every backend shard: test_every_facade_import_is_accounted_for fails on any facade import that is not a BASE name, the mirror glue, owner-defined, or read by the facade's or an owner's code, and test_the_import_check_reports_only_what_nothing_accounts_for plants an unread import to prove it can fail. A later unused import is caught in CI at PR time, as F401 would catch it.

@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 19, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-g05-runtime branch from c7a9754 to 707aa09 Compare October 19, 2026 11:12
@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 labels Oct 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Design punchline: patches through kiro_crew.acp.runtime reach every owner reading the name

verified: test_every_name_patched_through_the_facade_reaches_the_owners_reading_it collects every patch target the test trees aim at the facade and asserts each of the six owners that reads the name is in the mirror's holder index for it; test_the_reach_scan_can_fail plants a gap to prove the scan can fail.
test_a_patch_through_the_facade_lands_on_every_owner_and_is_undone patches runtime._INITIALIZE_TIMEOUT, reads it back from runtime_spawn_launch and checks the undo. The 295-file floor of every test that patches or names the facade passed at this tree (18,048 tests, 0 failed).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • First Principles punchline: a sixth private _own_methods copy

rebutted (proportionality): each copy is the per-class half of the binding split (KC28 L33), keyed to that class's own owner set (_MEMBER_OWNERS here) and pinned by that class's binding test (test_the_qualname_restore_reaches_exactly_the_owner_modules); this one is the same 15 lines as session_handle_class.py's.
Folding the six into one shared helper would edit five other modules and their guards, a cross-cutting change outside this PR's goal (a structural split of runtime.py with no behaviour change); it is relayed to the campaign as a consolidation candidate rather than absorbed here.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 19, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision 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 labels Oct 19, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-g05-runtime branch from 707aa09 to 86fbee5 Compare October 19, 2026 14:05
@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 labels Oct 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • First Principles concern: a local _own_methods with an explicit owner set

rebutted: the exported helper (dashboard/state_parts/__init__.py:own_methods) matches only its own package (_PREFIX = "kiro_crew.dashboard.state_parts."), so it cannot serve this class, and importing a dashboard module from acp/ would invert the layering.
A prefix match on kiro_crew.acp.runtime_ is not equivalent here: three earlier modules share that prefix and are not owners (runtime_models, runtime_process_tree, runtime_start), so the explicit _MEMBER_OWNERS set keeps the rename to exactly the owners, which test_the_qualname_restore_reaches_exactly_the_owner_modules pins. Consolidating the per-class copies is a cross-cutting change outside this PR's goal and is logged as a campaign follow-up.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Design punchline: Windows and macOS lanes green before merge

accepted: this head is reported merge-ready only when every Backend Tests shard (3.12, Windows, macOS) is green at it; the previous heads 9f64956 and 707aa09 ran the Windows and macOS shards green with the same moved bodies, and the on-demand macOS suite is part of the same check.

@iamwhatever

Copy link
Copy Markdown
Contributor

Holding at 86fbee5b68775c8020edd4cfcbe4690e6f9614c3.

This PR moves AcpRuntime's process-tree kill, spawn admission and sandbox cleanup into new owners. It also swaps the facade's forwarding class for _facade_mirror. A change like that is reserved for human review. The move looks careful: in my AST comparison, all 45 moved methods match BASE once docstrings are stripped, and the kill-chokepoint and admission ratchets re-key one for one.

Blockers:

  1. The First Principles CONCERNS on this head (a sixth _own_methods copy at runtime.py#L813-L843) has no disposition at 86fbee5; the rebuttal is on 707aa09. If the consolidation stays deferred, it also needs an issue linked from the description.
  2. The PR conflicts with main in docs/system-specs/modules/harness-parity.md.
  3. CI and the GPT 6.1 lane are still running on this head.
  4. A maintainer needs to sign off on the kill and spawn paths and the forwarding-mechanism swap.

A rebased head needs a fresh review.

— crew-pr-reviewer (r112)

@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 19, 2026
AcpRuntime's process-tree teardown, child launch and handshake, spawn
entry, and session/new and session/load setup move into six
acp/runtime_* owner modules. Each moved member is a module-level
function there that takes self, and the class binds it by name, so the
instance keeps its state and every patch, __new__ build and unbound
call reaches the same function. The facade keeps every binding and its
forward table and switches to kiro_crew._facade_mirror, so a patch
through kiro_crew.acp.runtime still reaches the moved code.

Part of #20192
@bolichen97
bolichen97 force-pushed the refactor/linecap-g05-runtime branch from 86fbee5 to d5a4aff Compare October 19, 2026 18:22
@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 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • First Principles punchline: the move audit's 225-of-229 claim on the availability paths

verified at this head against main 3e39e7a: the normalized comparator reports 229 units, 225 moved unchanged, 4 changed, and the 4 are facade glue only (_ReExportModule replaced by _facade_mirror, the if not TYPE_CHECKING: __getattr__ declining served names, _EXPORTS bound empty and filled from the mirror, the class swap); every spawn and session-start member body is among the 225.
Behaviour on those paths is also covered by the 295-file floor of every test that imports, patches or names the runtime (0 failed) and by the binding guard's member inventory (kind, coroutine-ness, signature digest per member); the deferred _own_methods consolidation is tracked in #22257.

@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 19, 2026
@chenmingwei23
chenmingwei23 merged commit 0636f2a into main Oct 20, 2026
116 checks passed
@chenmingwei23
chenmingwei23 deleted the refactor/linecap-g05-runtime branch October 20, 2026 00:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 20, 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.

3 participants