Finish KG-WP-0003: stream completeness and live qonto observation
Classify evidence as load-bearing or attributive, draft the emission-cadence declaration for Taxonomy, treat silence as a stream finding, keep completeness separate from record richness, forbid immune memory as a state plane, and make containment proposals reconstructable to their origin. Observe real qonto-assistant audit events; deny-class completeness stays unknown until the source publishes a heartbeat. Assistant: grok Assistant-Session: 01a05ef1-9e5a-70f2-b0ff-0b05d6b38ae9
This commit is contained in:
parent
c85646dc3c
commit
9daea96c43
35 changed files with 2023 additions and 138 deletions
|
|
@ -64,6 +64,37 @@ def test_checker_passes_on_the_real_tree():
|
|||
assert result.returncode == 0, result.stderr
|
||||
|
||||
|
||||
def test_agent_principal_rule_checks_are_honest():
|
||||
"""§3.4 claims that are tests, and claims that remain assertions, are named."""
|
||||
data = yaml.safe_load(DECL.read_text())
|
||||
checks = data["agent_principal_rule_checks"]
|
||||
assert checks["no_standing_credential"]["form"] == "test"
|
||||
assert checks["memory_is_not_a_state_plane"]["form"] == "test"
|
||||
assert checks["tool_use_shapes"]["form"] == "assertion"
|
||||
assert checks["reconstructable_as_caller"]["form"] == "mixed"
|
||||
assert data["agent_principal_rules"]["no_standing_credential"] is True
|
||||
|
||||
|
||||
def test_checker_catches_a_standing_credential(tmp_path, monkeypatch):
|
||||
import importlib.util
|
||||
|
||||
spec = importlib.util.spec_from_file_location("check_layer_conformance", SCRIPT)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
fake_src = tmp_path / "src" / "kings_guard"
|
||||
fake_src.mkdir(parents=True)
|
||||
(fake_src / "secrets.py").write_text('VAULT_TOKEN = "s.standing-secret"\n')
|
||||
(tmp_path / ".env").write_text("OPENBAO_TOKEN=s.also-standing\n")
|
||||
monkeypatch.setattr(module, "SRC", fake_src)
|
||||
monkeypatch.setattr(module, "ROOT", tmp_path)
|
||||
|
||||
hits = module.scan_standing_credentials()
|
||||
assert hits, "a standing credential was not detected — the checker is blind"
|
||||
kinds = " ".join(reason for _, reason in hits)
|
||||
assert "credential-shaped file" in kinds or "standing-credential" in kinds
|
||||
|
||||
|
||||
def test_checker_catches_an_undeclared_tooling_client(tmp_path, monkeypatch):
|
||||
"""The negative case: a direct OpenBao client must fail the check.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue