Repository navigation
Commit 6a5ac72
authored
refactor(authority): centralize coordination state rules (#3410)
Centralize the existing todo, handoff, and task-lease coordination rules in
one provider-neutral, side-effect-free decision core
(loopx/control_plane/coordination/authority_core.py), keeping legacy /
soft_claim / hard_lease behavior, public error codes, local Markdown/JSON
formats, lock order, and lease tombstone fencing intact while removing
duplicated rule ownership from the writers.
- decide(snapshot, command) -> TransitionPlan is the single entry point; the
writers keep I/O and locking and persist the returned plan (version,
lease_epoch, owner, idempotency key) instead of re-deriving rules.
- ownership_gate_requirement and the terminal-fence auto-acquire eligibility
are single-sourced in the core; mutation probes flip end-to-end CLI
behavior for the delegated door, the holder gate, and the completion
fence, proving the core is load-bearing rather than a parallel copy.
- local_snapshot.py / local_lease_record.py own the behavior-preserving
adapter edge (mapping normalization; JSON/tombstone shape). Disclosed
fail-closed change, pinned by test: hand-corrupted lease records (negative
or non-integer version, corrupt replay-fingerprint ttl) are typed
corrupt_lease rejections instead of silent input or raw ValueError.
- The Workbench MCP sidecar forwards the already-required lease version for
complete_task; the kunluncode settlement test pins the forwarding through
the 5-command settlement flow.
- The bilingual RFC gains the Stage 1 Part 2 boundary: no provider
persistence, no synthetic revisions, no durable semantic receipts here;
the file-backed provider shadow and the NoKV runner remain Stage 2.
Validation at the merged head: coordination core suite 44 passed; focused
handoff/lease/authority/CLI suites 187 passed; kunluncode settlement 35
passed; tests/control_plane + tests/canary 1697 passed with 4 failures that
reproduce identically on unmodified origin/main in the same environment;
architecture + maintainability ratchet + m6 gates 25 passed; mypy and
changed-path ruff clean; canary premerge including the public boundary scan
passed.1 parent 02a714f commit 6a5ac72
17 files changed
Lines changed: 3369 additions & 620 deletions
File tree
- docs/architecture/rfcs
- loopx
- control_plane
- coordination
- todos
- work_items
- kunluncode_goal_mode
- skills/loopx-self-repair/references
- tests
- control_plane
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
658 | 690 | | |
659 | 691 | | |
660 | 692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
568 | 597 | | |
569 | 598 | | |
570 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments