tenant-engine/tests
tegwick f91c5323c3
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 43s
Correct the audit-core envelope to the published wire contract
audit-core registered our sender (AUDIT-IN-0002) and, reviewing the
emitter, found that no event we sent could ever have been accepted.
envelope_for sent five of the eight required fields under its own names
-- event_id, action, resource, observed_at, details -- and omitted
correlation_id entirely. normalize() rejects that whole, 400.

Our drain treated 400 as terminal, so every event would have been marked
handled here while audit-core held only an unchained dead letter: lost on
both sides, silently, with the integration looking healthy.

- envelope_for emits exactly the eight required fields and none of the
  six audit-core derives. The acting principal moves into `data`, where
  it reads as our claim rather than the archive's finding.
- Thread correlation_id through create / revoke / plan, which had no such
  field. Optional on those three bodies for compatibility; when a caller
  supplies none this engine mints req-<uuid> for the operation it
  performed and returns it. The store mints op-<uuid> as a floor for
  direct callers, written into the local payload so both records agree.
- Send Idempotency-Key equal to the body id.
- A 400 no longer dead-letters. The row stays pending with the reason
  recorded on it: a 400 is an integration defect to fix, not a delivery
  outcome to record.
- wire_envelope upgrades outbox rows written in the old shape at send
  time, and refuses to send one whose correlation cannot be recovered
  from its payload rather than inventing one.

Verified by running all nine event types, through the API, through
audit-core's actual normalize() with a matching SenderIdentity -- all
accepted. A live non-production 202 still needs the token, so
TEN-WP-0012-T01 stays `wait`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFmHM6fugwfqoobUCp9GiQ

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 2106375@bnt-lap001
Assistant-Session: aa26c34d-71e8-4478-a962-c79c74694dc8
2026-09-10 18:46:16 +02:00
..
helpers.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
postgres_backend.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_api_guardrails.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_api_lifecycle.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_api_reads.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_api_writes.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_app.py Implement PostgreSQL production store path 2026-08-19 14:43:08 +02:00
test_audit_core.py Correct the audit-core envelope to the published wire contract 2026-09-10 18:46:16 +02:00
test_authz_flex.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_backend_selection.py Implement PostgreSQL production store path 2026-08-19 14:43:08 +02:00
test_domain.py TEN-WP-0002 T01-T03: service skeleton, domain model, storage layer 2026-07-23 22:01:23 +02:00
test_events_scoped.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_flex_auth.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_grouping_mutation.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_guardrail_domain.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_guardrail_store_conformance.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_layer_conformance.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_lifecycle_domain.py Implement tenant update and reversible retirement API (TEN-WP-0005 T01-T04) 2026-08-10 20:00:43 +02:00
test_lifecycle_store_conformance.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_pep_write_path.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_pip_claims.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_sqlite_store.py Deploy durable tenant authority runtime 2026-08-09 01:35:00 +02:00
test_staged_promotion.py Onboard tenant-engine to the staged-promotion contract 2026-08-29 14:51:27 +02:00
test_store.py Implement TEN-WP-0011 security layer conformance 2026-08-29 13:02:51 +02:00
test_transfer.py Implement PostgreSQL production store path 2026-08-19 14:43:08 +02:00
validate_app_toml.py Onboard tenant-engine to the staged-promotion contract 2026-08-29 14:51:27 +02:00