Mos portability M1: logical identity and durable connector lease fencing #755

Open
opened 2026-07-14 17:25:35 +00:00 by jason.woltje · 0 comments
Owner

Parent: #754.

Implement the first hard security boundary for runtime-neutral Mos failover.

Scope

  • Core normalized logical-agent identity contract independent of harness-native session IDs.
  • PostgreSQL durable connector lease with CAS acquisition/takeover, monotonic fencing epoch, TTL/heartbeat, explicit release, and server-derived tenant/agent/binding scope.
  • Execution/dispatch grant validated against current lease epoch; stale, expired, forged, and cross-tenant holders fail closed before connector/tool side effects.
  • Audit/correlation events for acquire, renew, takeover, reject, release, and expiry.
  • Provider/runtime adapter interfaces consume normalized lease context without importing Claude/Pi/Codex schemas.
  • Unit, migration, repository close/reopen, concurrency, abuse, and gateway integration tests.

Out of scope

Checkpoint payload schema, exactly-once journal, concrete Claude/Pi/Codex adapters, and full failover E2E are later #754 work packages. No channel cutover.

Acceptance

Two contenders for one binding cannot both hold authority; successful takeover increments epoch; every old-epoch operation is rejected and audited; restart preserves lease/fence state; tenant/binding confusion is denied; no secrets in state/logs; typecheck/lint/format/tests/independent security review/CI pass.

Use TDD. Gateway remains the single policy surface. PR-open STOP: worker must not merge.

Parent: #754. Implement the first hard security boundary for runtime-neutral Mos failover. ## Scope - Core normalized logical-agent identity contract independent of harness-native session IDs. - PostgreSQL durable connector lease with CAS acquisition/takeover, monotonic fencing epoch, TTL/heartbeat, explicit release, and server-derived tenant/agent/binding scope. - Execution/dispatch grant validated against current lease epoch; stale, expired, forged, and cross-tenant holders fail closed before connector/tool side effects. - Audit/correlation events for acquire, renew, takeover, reject, release, and expiry. - Provider/runtime adapter interfaces consume normalized lease context without importing Claude/Pi/Codex schemas. - Unit, migration, repository close/reopen, concurrency, abuse, and gateway integration tests. ## Out of scope Checkpoint payload schema, exactly-once journal, concrete Claude/Pi/Codex adapters, and full failover E2E are later #754 work packages. No channel cutover. ## Acceptance Two contenders for one binding cannot both hold authority; successful takeover increments epoch; every old-epoch operation is rejected and audited; restart preserves lease/fence state; tenant/binding confusion is denied; no secrets in state/logs; typecheck/lint/format/tests/independent security review/CI pass. Use TDD. Gateway remains the single policy surface. PR-open STOP: worker must not merge.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#755