Runtime · Phase 1 + 2a + 2b
Models are LIVE (5 JSON files · validated · all fields grounded in B contracts).
Phase 2a live: policy engine service wraps these models with an HTTP boundary →
service.html
(FastAPI · 7 endpoints · 24/24 example vectors pass · decision-only · dev-mode only).
Phase 2b live: additive on top →
phase-2b.html
(Bearer JWT resolver · file-backed approval store · TTL enforcement · audit sink
boundary) · parity 24/24 preserved · rationale at
admin-control-plane-phase-2b.html.
Still not built: real JWKS/IdP verification · Postgres persistence · approval CRUD · Kafka audit producer · admin flip UI (Phase 2b+ infra / Phase 2c / Phase 3).
Spec files:
role_registry.json ·
access_policy.json ·
assist_model.json ·
approval_queue_model.json ·
audit_event_model.json ·
schema.json.
4. Approval Queue Preview 6 แถว · phase 1 (sample_item_count = 0)
Queue shape + state machine ready. No items live yet — Phase 2 wires the submission + sign-off runtime.
Queues by approval_matrix row
Matrix Row
Required Signers
SLA
Items (live)
Queue state machine
pending→in_review→signed_partial→signed_full→approved
Branches: any state → rejected / sent_back / withdrawn / expired. Sent-back re-enters pending after revision.
5. Audit Event Model 18 event types · WORM + hash-chain integrity
Planned integration with Kafka ptt.audit.trail (7yr retention · compress=none per CLAUDE.md). Hash chain detects tampering. 4 example events:
// view-as-tenant session start
{
"event_id": "aud-260418-a1b2c3d4",
"event_type": "view_as.start",
"actor": { "role_key": "support_success", "user_id": "U-support-007" },
"subject": { "type": "tenant", "id": "tenant-acme-001" },
"rationale": "Case CASE-260418-0042 · dashboard blank on login",
"session_ref": "va-260418-001"
}
// unmask granted
{
"event_type": "unmask.granted",
"actor": { "role_key": "tenant_dpo", "tenant_id": "tenant-acme-001" },
"subject": { "type": "user", "id": "U-end-user-9901" },
"approval_refs": ["APP-260418-0099"],
"mask_level_at_event": "unmasked-tenant",
"honest_note_if_any": "TTL 30min · auto-expires 11:12"
}
// approval signer
{
"event_type": "approval.sign",
"actor": { "role_key": "platform_governance" },
"before_state": { "state": "in_review", "signers_count": 0 },
"after_state": { "state": "signed_partial", "signers_count": 1 },
"approval_refs": ["APP-260418-0100"]
}
// governance break-glass (superadmin)
{
"event_type": "governance.break_glass",
"actor": { "role_key": "superadmin" },
"action": "break_glass_unmask",
"rationale": "P0 incident · tenant DB corruption · emergency · founder notified",
"honest_note_if_any": "60min TTL · post-hoc written approval deadline +24h"
}