Skip to content

Commit bd40a63

Browse files
committed
refactor(control-plane): move status collection into status bounded context
1 parent 1f10cb4 commit bd40a63

6 files changed

Lines changed: 9 additions & 7 deletions

File tree

docs/development/control-plane-course/04-state-substrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ return redacted_status_todo_fields(fields)
631631

632632
### 4. Status collection 是聚合器,不是第二套状态机
633633

634-
`loopx/control_plane/status_collection.py::collect_status` 的调用顺序很值得照抄到白板:
634+
`loopx/control_plane/status/collection.py::collect_status` 的调用顺序很值得照抄到白板:
635635

636636
```python
637637
registry = context.load_registry(registry_path)

docs/product/core-control-plane/rule-seam-map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The next module-boundary PR should therefore:
110110
| Project assets | `build_project_asset` | Public-safe asset packer over status and run-history inputs. | Project-asset-backed queue items remain the only authority for owner/gate/stop-condition semantics. |
111111
| Attention queue | `loopx.control_plane.work_items.attention_queue.build_attention_queue` with `loopx.status.build_attention_queue` as the compatibility entry | Queue builder over normalized goal status, todos, gates, and project assets. | Queue ordering, project-asset enrichment, quota guards, and candidate lanes remain explicit and stable. |
112112
| Task graph projection | `loopx.control_plane.work_items.task_graph.build_task_graph_projection` with `loopx.status.build_task_graph_projection` as the status-facing wrapper | Read-only graph projection module. | Node caps include truncation metadata; full cold-path detail remains outside the hot graph. |
113-
| Status collection assembly | `loopx.control_plane.status_collection.collect_status` with `loopx.status.collect_status` as the compatibility entry | Thin collector/orchestrator that wires registry, runtime, state, and read models. | CLI status JSON shape remains compatible; wrapper/direct parity stays covered by `examples/control_plane/status-collection-readmodel-smoke.py`. |
113+
| Status collection assembly | `loopx.control_plane.status.collection.collect_status` with `loopx.status.collect_status` as the compatibility entry | Thin collector/orchestrator that wires registry, runtime, state, and read models. | CLI status JSON shape remains compatible; wrapper/direct parity stays covered by `examples/control_plane/status-collection-readmodel-smoke.py`. |
114114
| Markdown rendering | `loopx/presentation/renderers/status_markdown.py` | Render-only module/helpers over the status payload. | Rendering cannot become the source of scheduler or quota truth. |
115115

116116
## Proposed Extraction Order

examples/control_plane/status-collection-readmodel-smoke.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
sys.path.insert(0, str(ROOT))
1616

1717
from loopx import status as status_module # noqa: E402
18-
from loopx.control_plane import status_collection as collection_read_model # noqa: E402
18+
from loopx.control_plane.status import collection as collection_read_model # noqa: E402
1919

2020

2121
GOAL_ID = "status-collection-fixture"
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
"""Status collection assembly inside the `status` bounded context."""
2+
13
from __future__ import annotations
24

35
from dataclasses import dataclass
46
from pathlib import Path
57
from typing import Any, Callable
68

7-
from .goals.contract_health import project_contract_health_for_goal
8-
from .runtime.runtime_projection_route import (
9+
from ..goals.contract_health import project_contract_health_for_goal
10+
from ..runtime.runtime_projection_route import (
911
collect_runtime_projection_route_diagnostics,
1012
)
1113

loopx/status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
apply_skillsbench_verifier_bootstrap_missing_score_attribution,
99
)
1010
from .control_plane import compact_control_plane_policy
11-
from .control_plane.status_collection import (
11+
from .control_plane.status.collection import (
1212
StatusCollectionContext,
1313
collect_status as _collect_status_read_model,
1414
)

tests/control_plane/test_status_collection_material_capability_wiring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from loopx.control_plane import status_collection
8+
from loopx.control_plane.status import collection as status_collection
99
from loopx.control_plane.agents.management_projection import (
1010
build_agent_management_projection,
1111
)

0 commit comments

Comments
 (0)