Repository navigation
Open
Description
Goal
Separate context storage from execution provisioning and separate Kubernetes attachment details from the client-facing Context API.
Context Service already creates, lists, reads, and deletes PVC-backed contexts independently from Sandboxes. This issue maps the remaining work to one focused Context Service PR.
Current state
- A context is identified by its Kubernetes namespace and user-facing name.
POST /v1/contextscreates only a PVC. It does not create a Sandbox.- Context Service already tracks owners, grants, consumers, revisions, snapshots, clones, and deletion protection.
- Public Context responses currently expose the backing PVC claim name because
contextctluses it for direct Kubernetes sync.
Scope
- Keep
(namespace, name)as the stable Context identity. Do not add an opaque ID solely for obscurity. - Add an authenticated service-to-service operation that resolves a Context into the PVC attachment descriptor MOCA needs.
- Require the requested subject to have
attachpermission on the Context. - Return the namespace, claim name, backend kind, and storage access mode only from this protected operation.
- Keep the existing public
attachmentfield temporarily for compatibility withcontextctl. - Mark that public field as deprecated and remove it only after Add scoped upload and materialization capabilities for managed contexts #45 migrates sync to scoped upload capabilities.
- Add explicit regression coverage that Context creation creates a PVC and no Sandbox resource.
Acceptance criteria
- Existing Context CRUD behavior remains compatible.
- An authenticated MOCA service can resolve an authorized Context attachment.
- Missing or invalid service credentials are rejected.
- A subject without
attachpermission receives the same not-found response used elsewhere for unauthorized Context access. - Ordinary clients do not gain a new way to enumerate PVCs.
- Context creation produces no Sandbox resources.
- Unit and Kind-compatible tests cover the new behavior.
Related work
- Scoped upload and materialization: Add scoped upload and materialization capabilities for managed contexts #45
- Final removal of Sandbox provisioning: Remove Sandbox provisioning after the MOCA storage migration #46
- MOCA subject-to-PVC authorization: /workloads: authorize caller-named PVCs per subject, and scope workload names moca#358
Metadata
Metadata
Assignees
Labels
No labels
Activity
moonlight16 commentedon Oct 1, 2026
Agreed implementation sequence, with one issue mapped to one PR:
The intended ownership boundary is:
Implementation will proceed one issue at a time. Each change remains local and uncommitted until reviewed.
[-]Explore contextctl sync with Serverless Harness workloads[/-][+]Explore contextctl sync with MOCA workloads[/+][-]Explore contextctl sync with MOCA workloads[/-][+]Add a storage-only Kubernetes context lifecycle API[/+]moonlight16 commentedon Oct 1, 2026
Roadmap correction: #44 was folded into this issue and closed. This issue now maps directly to the storage-only Context Service PR. #45 follows it, MOCA issue rossoctl/moca#358 tracks the MOCA-side authorization and provisioning change, and #46 is the final Sandbox-provisioning removal.
[-]Add a storage-only Kubernetes context lifecycle API[/-][+]Separate Context attachment resolution from the public API[/+]