Align native CLI execution with approved T03 targets and authority
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a09cbb-87c6-7900-a145-4ce53ba9f1a6
This commit is contained in:
parent
09422db079
commit
25a7d71cf5
8 changed files with 90 additions and 8 deletions
|
|
@ -359,3 +359,25 @@ def test_confirmed_consume_allows_openbao_resolve(tmp_path, monkeypatch):
|
|||
assert records[-1]["detail"]["approval_consumed"] is True
|
||||
assert records[-1]["detail"]["approval_id"] == "appr_test-1"
|
||||
assert TOKEN not in json.dumps(records)
|
||||
|
||||
|
||||
def test_native_human_control_uses_real_join_not_a_hub_fixture(tmp_path, monkeypatch):
|
||||
entry = validate_entry(dict(VALID, stage="prod", approval={"model": "ccr",
|
||||
"human_control": True, "decision_ref": "CCR-native-provenance"}))
|
||||
authorized = _authorized()
|
||||
monkeypatch.setattr(cli, "authorize_action", lambda *_a, **_k: authorized)
|
||||
monkeypatch.setattr(cli, "apply_unreachable_engine_stance", _allow_prod_stance)
|
||||
monkeypatch.setattr(cli, "resolve_decision", lambda **_k: pytest.fail("native authority must not resolve a legacy fixture"))
|
||||
calls = []
|
||||
def consume(cfg, actual, **kwargs):
|
||||
assert kwargs["binding"] is authorized.binding
|
||||
calls.append("consume")
|
||||
monkeypatch.setattr(cli, "require_production_consume", consume)
|
||||
result = cli._require_lane_approval(_config(tmp_path), entry, "apply")
|
||||
assert result is authorized and result.id == authorized.decision_id
|
||||
assert calls == ["consume"]
|
||||
def refused(*_a, **_k):
|
||||
raise DecisionError("consume refused")
|
||||
monkeypatch.setattr(cli, "require_production_consume", refused)
|
||||
with pytest.raises(DecisionError, match="consume refused"):
|
||||
cli._require_lane_approval(_config(tmp_path), entry, "apply")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue