Skip to content

feat(security-audit): add first-class audit tenant contract - #13

Merged
man4ish merged 4 commits into
mainfrom
feat/audit-tenant-contract
Aug 30, 2026
Merged

feat(security-audit): add first-class audit tenant contract#13
man4ish merged 4 commits into
mainfrom
feat/audit-tenant-contract

Conversation

@man4ish

@man4ish man4ish commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recover and release the SAT-1 first-class tenant contract for Security Audit.

Contract

  • Adds nullable organization_id to the signed event envelope and durable record.
  • Adds tenant_scope: organization, global, or unknown.
  • organization requires an explicit authoritative organization ID.
  • global is explicit only; missing tenant context remains unknown.
  • context is never used as tenant authority.
  • Legacy events remain organization_id=null, tenant_scope=unknown.

Integrity and storage

Tenant fields are serialized before signing and remain covered by the existing HMAC. Migration 0003_tenant_contract adds backward-compatible columns and the organization/time/event index. Existing platform-admin HTTP behavior is unchanged; organization-scoped authorization is not introduced.

Validation

  • 77 focused SAT-1 tests passed
  • Ruff passed on changed production files
  • Changed-file Python compilation passed
  • Migration/index validation passed
  • git diff --check passed

Dependency

SAT-2 producer propagation must not begin until this contract is merged. This PR does not modify producer repositories.

@man4ish
man4ish merged commit a410ae1 into main Aug 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant