code-to10 v6 A1: delete server merge-gate modes, hard only
Server POST /tasks/{id}/merge no longer has record/enforce/off:
hard_mode_from_env and HARD_MODES deleted (not re-defaulted),
handler always evaluates the hard gate, env CLOUD_MERGE_GATE_MODE
and body merge_gate_mode are ignored server-side. The record
'no-evidence passes' and 'unprotected+confirm passes with
merge_gate_risk' server paths are gone with the dead risk audit;
no production caller justified keeping them (only production
caller of the non-hard evaluator was the merge handler itself;
audit_loop_wiring already used the hard gate). cloud/merge_gate
pure functions keep their #209 semantics but are documented as
non-server: they are no longer wired to any endpoint.
Server-level record/enforce/off tests rewritten to the new
behavior (renamed, not deleted silently); pure-function tests
unchanged.
(cherry picked from commit 08e75edbd6d04701965c5db951fa054cfbb75bb0)
Reconcile-port: handler_lifecycle.py hunks redirected into cloud/server.py _merge_task (target keeps 6-mixin split; mixin file does not exist here); handler_support.py kept at HEAD (its A1 hunk is a docstring of _validate_hard_gate_body, ported to server.py copy); test mock paths cloud.handler_lifecycle.* rewritten to cloud.server.*.
This commit is contained in:
1 parent
593197a4a2
commit
e6a1346420
8 files changed
+200
-183
No files matched your search
@@ -601,10 +601,13 @@ class EndpointChainTestCase(unittest.TestCase):
|
||||
self._hard_body(), self.owner_key)
|
||||
self.assertEqual(status, 200, merged)
|
||||
|
||||
def test_pushback_blocks_even_in_record_mode(self):
|
||||
def test_pushback_blocks_with_full_hard_evidence(self):
|
||||
# A1 改写:旧用例 test_pushback_blocks_even_in_record_mode
|
||||
# 已改名。本用例的性质不变——链上推回阻塞时,即使五项
|
||||
# 证据全齐也 409;只是不再经 record 模式证明“与模式无关”,
|
||||
# 因为服务端已无其它模式可比。
|
||||
task = self._completed_task()
|
||||
self._block_task(task)
|
||||
os.environ["CLOUD_MERGE_GATE_MODE"] = "record"
|
||||
status, blocked = self._req(
|
||||
"POST", "/tasks/%s/merge" % task["id"],
|
||||
self._hard_body(), self.owner_key)
|
||||
|
||||
Reference in new issue
Block a user