You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: preserve consensus validation intent before deletion
Record the feature intent, symbol-level inventory, wire-blockers, and git
recovery path for teaagent/consensus/consensus_validation.py before any
runtime deletion. This keeps Option D reversible as archaeology while making
clear that restore-from-history is not authority to rewire the module.
Action: G-P2-8
Roadmap-Status: unchanged
Constraint: documentation and guard test only; no consensus code deletion or behavior change in this commit; unrelated .omo work orders left untracked
Tested: ruff format --check tests/test_docs_consistency.py; ruff check tests/test_docs_consistency.py; scripts/validate_docs_consistency.py (29/29 risk, 21/21 ticket); pytest tests/test_docs_consistency.py -q (45 passed); docs-inventory and OKF catalog --check clean
Not-tested: consensus module deletion, full acceptance/nightly suite, live providers, real dogfood
Confidence: high
this spec exists so the expiry review is a decision, not an investigation.
61
61
62
+
### 2.1 Pre-deletion preservation record (2026-07-22)
63
+
64
+
This section exists so `consensus_validation` remains recoverable after Option D
65
+
deletes the code. Deletion must remove the runtime surface, not the historical
66
+
intent, feature inventory, or revival path.
67
+
68
+
#### 2.1.1 Original intent
69
+
70
+
`consensus_validation` was intended as a **post-approval multi-agent consensus
71
+
validator** for collaborative or destructive actions that had already passed the
72
+
normal approval queue. It was never supposed to replace ADR-0022's centralized
73
+
approval queue; the safe wiring shape was a second key behind the queue for a
74
+
narrow action class.
75
+
76
+
The surviving design question, if revived, is: "Do we need a separate N-of-M /
77
+
role-based sign-off gate after the existing queue has approved a destructive
78
+
action?" Absent that owner friction or governance-gap evidence, DR-006 favors
79
+
deletion over preserving dormant code.
80
+
81
+
#### 2.1.2 Feature inventory to preserve in history
82
+
83
+
The module at `teaagent/consensus/consensus_validation.py` contained:
84
+
85
+
| Area | Symbols / behavior | Revival note |
86
+
| --- | --- | --- |
87
+
| Status model |`ConsensusStatus`: `pending`, `approved`, `rejected`, `expired`, `cancelled`| Keep terminal-state semantics explicit if rebuilt. |
88
+
| Rule model |`ConsensusRuleType`: `N_OF_M`, `UNANIMOUS`, `MAJORITY`, `SUPERMAJORITY`, `ROLE_BASED`; `ConsensusRule.check_consensus()`| Rebuild only the rule types needed by real policy; do not automatically restore `SUPERMAJORITY`. |
89
+
| Role-based voting |`ROLE_BASED` rules consult `voter_roles`; absent a mapping, `voter_id` is treated as the role | This was the 2026-06-30 A-P2-7 fix; keep it if role-based consensus returns. |
90
+
| Request model |`ConsensusRequest`: action, context, requester, votes, voter roles, timestamps, expiry, metadata | Revote currently overwrote silently; audited revote events are required before destructive-action wiring. |
91
+
| Storage |`ConsensusStore`: tenant-scoped JSON under `.teaagent/consensus-rules` and `.teaagent/consensus-requests` using `atomic_write_text`| Reuse only if file-backed request state is still desired; otherwise prefer the approval queue's store. |
92
+
| Validator facade |`ConsensusValidator`: `create_rule`, `request_consensus`, `cast_vote`, `get_consensus_status`, `create_default_rules`| Facade was not imported by production paths. A revived version must integrate through the approval queue. |
93
+
| Policy bridge |`create_rule()` created `PolicyType.CONSENSUS` allow policies with `rule_id` metadata | Bridge was inert without a queue hook; rebuild with a real policy condition contract or delete it. |
94
+
| Default rules | 2-of-3 production deploy, unanimous destructive action, majority operational decision | Treat as examples, not product requirements. |
95
+
96
+
Known wire-blockers that history must not hide:
97
+
98
+
-`SUPERMAJORITY` counted only votes cast, not `total_voters`; a single YES vote
99
+
could approve. Destructive-action revival must use quorum semantics or remove
100
+
this rule type from wireable policy.
101
+
-`ConsensusRequest.add_vote()` overwrote prior votes silently. Revival needs an
102
+
audited revote or immutable-vote contract.
103
+
- The module emitted no ADR-0032 audit events and had no approval-queue hold
104
+
hook. Any revival starts with the event/queue integration, not the old facade.
105
+
- The CLI `consensus *` commands used the separate ADR-0019 federated engine;
106
+
they were not proof that this validation module was live.
107
+
108
+
#### 2.1.3 Git recovery path
109
+
110
+
Known-good code anchor when this preservation record was written:
111
+
`7a7799d` (`docs: record owner-ratified intent decisions and intent-roadmap survey`).
112
+
The deletion commit's parent should also contain the final pre-deletion code.
0 commit comments