Skip to content

Commit a2afee7

Browse files
committed
docs(rfc): add qualitative change plan for m6
1 parent e7b4e2a commit a2afee7

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

docs/architecture/rfcs/agent-loop-effect-interpreter-v0.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ that model over time.
4848
| M3 Focused test families | Mostly complete (#2916-#2918, #2925, #2929) |
4949
| M4 Architecture documentation | Mostly complete (#2921, #2923, #2924) |
5050
| M5 Steady-state review | Mostly complete (#2922, #2931) |
51-
| M6 General effect-program abstraction | Mostly complete (#2938-#2958); R4 executor deferred |
51+
| M6 General effect-program abstraction | In progress; quality gate pending (#2938-#2959) |
5252

5353
## Why This Matters
5454

@@ -307,6 +307,42 @@ R1, R2, and R3 are complete:
307307
R4 remains pending and must not be implemented until a real multi-step
308308
host/turn-driver caller executes an ordered effect program.
309309

310+
### Qualitative Change Plan
311+
312+
The current effect abstraction is a read lens plus three small runtime
313+
replacements. It is not yet a qualitative change. M6 must not be called mostly
314+
complete until all of the following are true:
315+
316+
1. Hot modules shrink to bounded sizes:
317+
- `loopx/quota.py` below 2000 lines;
318+
- `loopx/status.py` below 2000 lines;
319+
- `loopx/heartbeat_prompt.py` below 1200 lines.
320+
2. `loopx quota should-run` builds through a bounded `should_run` decision
321+
module, and `loopx.quota.build_quota_should_run` becomes a thin
322+
compatibility wrapper.
323+
3. `EffectTurn` and `EffectProgram` are consumed by CLI quota, turn driver,
324+
and bootstrap construction, not only by tests and renderers.
325+
4. No effect abstraction remains test-only.
326+
5. Maintainability, import-graph, CLI output, and hot-path interface ratchets
327+
pass without new exceptions.
328+
6. Doubao/model-behavior shadow qualification covers changed agent-facing
329+
packets.
330+
331+
Phases:
332+
333+
- Q1: Stop milestone claims; keep M6 in progress.
334+
- Q2: Characterize hot modules and capture parity fixtures for
335+
`quota.py`, `status.py`, and `heartbeat_prompt.py`.
336+
- Q3: Extract the quota `should-run` decision and packet builder into
337+
`loopx/control_plane/quota/should_run.py`.
338+
- Q4: Extract status read models, collection, and presentation into bounded
339+
modules.
340+
- Q5: Extract heartbeat prompt builders into bounded modules.
341+
- Q6: Make CLI quota, turn driver, and bootstrap construction consume
342+
`EffectTurn` / `EffectProgram`.
343+
- Q7: Add quality gates and focused tests for each extraction.
344+
- Q8: Re-evaluate M6 only after the gates pass.
345+
310346
### Replacement-First Rule
311347

312348
Every M6 code change must replace an existing real runtime call path, not add
@@ -561,6 +597,9 @@ For every runtime replacement:
561597
- Do not create a generic `Effect` abstraction without two real callers.
562598
- Do not count test-only lenses as M6 progress; every M6 change must replace a
563599
real runtime call path.
600+
- Do not mark M6 mostly complete while `quota.py`, `status.py`, or
601+
`heartbeat_prompt.py` remain oversized or while effect abstraction is
602+
test-only.
564603
- Do not treat the current `EffectTurn` lens as a general runtime abstraction
565604
until a second interpreter and a real executor caller exist.
566605
- Do not rewrite `quota should-run` for the sake of naming.

0 commit comments

Comments
 (0)