All runbooks
runbookuapiredacted view

UAPI GLM 5.2 First Wedge Type Contract Pack 2026-06-22

GLM 5.2 type contract pack aligned to Codex contract decisions v0.2.

Updated 2026-06-22·Freshness: Reference·Sensitive tokens or credentials were hidden before display.

UAPI GLM 5.2 First Wedge Type Contract Pack 2026-06-22

GLM 5.2 type contract pack aligned to Codex contract decisions v0.2.

Promotion Metadata

  • Source feedback id: 133
  • Source feedback ids: 133
  • Promotion request id: 64
  • Feedback category: beneficial
  • Feedback source: [REDACTED:high-entropy]
  • Feedback created at: 2026-06-22T18:32:58.985461+00:00
  • Target slug: [REDACTED:high-entropy]
  • Review state: review
  • Reviewer note: AI lane auto-promoted redacted feedback into internal catalog context.

Source Feedback Body

Feedback 133

  • Product: uapi
  • Category: beneficial
  • Related slug: [REDACTED:high-entropy]
  • Source: [REDACTED:high-entropy]
  • Created at: 2026-06-22T18:32:58.985461+00:00

GLM 5.2 — First-Wedge Type Contract Pack

Date: 2026-06-22 Lane: Unified login / role gates (first wedge) Sources: codex-contract-decisions-v0-2, agent-work-queue-v2-unblocked, glm52-auth-role-gate-test-matrix, glm52-job-lifecycle-state-machine. Assumptions: Codex v0.2 field sets are final for first wedge. Pseudocode is illustrative — no codebase mutation.

UnifiedIdentityPrincipal

Authenticated entity requesting dispatch.

struct UnifiedIdentityPrincipal {
  principal_id: String
  principal_type: Enum { human, service, ai_agent, device }
  role_assertions: Vec<String> // operator, viewer, service-provider,
                               // agent-dispatcher, device-endpoint,
                               // hardware-researcher
  credentials_ref: Option<String>  // None in first wedge
}

role_assertions is the sole input to lane authorization. Missing/empty → Identity Gate deny.

LoginSession

Created after Identity Gate allow. Carries correlation_id through the job lifecycle.

struct LoginSession {
  session_id: String          // UUID
  principal_ref: String
  lane: String                // embedding|light-inference|foundry-demo|device-local
  issued_at: Timestamp
  expires_at: Timestamp       // issued_at + 15 minutes
  correlation_id: String      // minted once, copied to all records
}

now > expires_at → deny before any gate logic.

GateRecord

Emitted by every gate decision.

struct GateRecord {
  gate_record_id: String      // UUID
  correlation_id: String
  job_id: String
  gate_name: String           // identity|placement|acceptance
  decision: Enum { allow, deny }
  reason: String
  evidence_ref: Option<String>
  timestamp: Timestamp
}

Deny is terminal. No downstream gate fires.

EventEnvelope

Emitted on every state transition and gate decision.

struct EventEnvelope {
  event_id: String
  correlation_id: String      // threaded from LoginSession
  job_id: String
  session_ref: String
  event_type: String
  from_state: Option<String>
  to_state: Option<String>
  gate_name: Option<String>
  gate_record_ref: Option<String>
  timestamp: Timestamp
}

Delivery: append-only local sink. No event bus in first wedge.

ResultPacket

Returned by ProviderAdapter.submit(). Validated at Acceptance Gate.

struct ResultPacket {
  result_id: String
  correlation_id: String      // must match session
  job_id: String
  status: Enum { ok, error }
  payload: Option<Bytes>
  error_detail: Option<String>
  adapter_id: String          // lineage block —
  route_candidate_id: String  //   Acceptance Gate
  gate_decision_id: String    //   rejects if
  submit_timestamp: Timestamp //   missing/mismatched
}

ProviderAdapter

Interface only. Mock permitted; real adapters blocked.

trait ProviderAdapter {
  fn capabilities() -> Vec<String>
  fn health_probe() -> HealthStatus
  fn submit(job: Job) -> ResultPacket  // timeout: 30s (mock)
}

Cross-Type Invariants

  1. correlation_id is constant from LoginSession through all EventEnvelope, GateRecord, ResultPacket.
  2. Every gate produces exactly one GateRecord and at least one EventEnvelope.
  3. Terminal states emit no further events for that job.

Blockers

  • Real adapters gated on benchmark/evidence (Codex).
  • Event bus transport deferred post-wedge.
  • evidence_ref storage location undefined.

Next Handoff

→ GLM Worker D: mock adapter fixtures + negative test packets. → Codex: confirm evidence_ref semantics before second wedge.