feat: deliver Sense audits to Bell (T-016)
Harness governance / validate (push) Has been cancelled
Harness governance / validate (pull_request) Has been cancelled

This commit is contained in:
QiuSW
2026-08-11 00:24:32 +08:00
parent aca22f4667
commit 4be2386421
35 changed files with 2188 additions and 42 deletions
+17
View File
@@ -60,6 +60,8 @@ class PostgresContractTests(unittest.TestCase):
"011_privileges_reconcile_safety.sql",
"012_bell_events.sql",
"013_privileges_bell_events.sql",
"014_audit_relay.sql",
"015_privileges_audit_relay.sql",
],
names,
)
@@ -129,6 +131,21 @@ class PostgresContractTests(unittest.TestCase):
self.assertIn(marker, text)
self.assertNotIn("D:\\pgsql17\\data", text)
def test_audit_relay_uses_fencing_and_separate_schema_ownership(self) -> None:
migration = normalized(migration_text("014_audit_relay.sql"))
privileges = normalized(migration_text("015_privileges_audit_relay.sql"))
for marker in (
"relay_lease_owner",
"relay_lease_token",
"relay_lease_until",
"create table if not exists bell.audit_events",
"create table if not exists bell.audit_relay_receipts",
"expires_at >= received_at + interval '10 minutes'",
):
self.assertIn(marker, migration)
self.assertIn("grant select, insert on table bell.audit_events to bell_runtime", privileges)
self.assertIn("revoke all on table bell.audit_events, bell.audit_relay_receipts from sense_app", privileges)
if __name__ == "__main__":
unittest.main()