Skip to content

OSEP-0004/0005/0014: mark implemented and add tenant namespace startup validation - #1389

Merged
hittyt merged 8 commits into
mainfrom
chore/osep-status-implemented
Aug 14, 2026
Merged

hittyt merged 8 commits into
mainfrom
chore/osep-status-implemented

Conversation

@Pangjiping

@Pangjiping Pangjiping commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Mark three OSEPs as implemented and close the one implementation gap that blocked OSEP-0014 from that status.

OSEP status updates

Reflect current implementation state across all proposal indexes (frontmatter, oseps/README.md, docs/community/oseps.md, ROADMAP.md):

  • OSEP-0004 Pluggable Secure Container Runtime Support: implementing → implemented
  • OSEP-0005 Client-Side Sandbox Pool: implementing → implemented
  • OSEP-0014 Multi-Tenancy Support for Kubernetes Runtime: draft → implemented

last-updated bumped to 2026-07-27 for each.

Tenant namespace startup validation (OSEP-0014)

OSEP-0014 requires (line 75) that startup MUST validate all tenant namespaces exist and are accessible (fail-fast). This was previously missing — validate_tenant_config() only checked runtime type and legacy API key, so the server could start with an invalid tenant namespace and fail only at request time.

  • Added validate_tenant_namespaces() in server/opensandbox_server/tenants/__init__.py: reads each tenant namespace via CoreV1Api, dedupes shared namespaces, and aggregates all missing/inaccessible namespaces into a single fatal error.
  • Wired into the lifespan startup path in server/opensandbox_server/main.py, after the tenant provider starts and before serving traffic; failures exit the process.
  • Added focused tests in server/tests/test_tenants.py (ok / dedup / 404 missing / 403 forbidden / aggregated failures).

Verification

  • uv run ruff check — clean
  • uv run pyright (tenants) — 0 errors
  • uv run pytest tests/test_tenants.py — 36 passed

Notes

Addresses Codex review feedback on this PR (index sync + OSEP-0014 fail-fast guard).

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 138141ce99

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread oseps/0005-client-side-sandbox-pool.md
Comment thread oseps/0014-multi-tenancy.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2178f376d9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread oseps/0004-secure-container-runtime.md
Comment thread oseps/0005-client-side-sandbox-pool.md
Enforce the OSEP-0014 fail-fast requirement that all tenant namespaces
exist and are accessible at startup. Adds validate_tenant_namespaces()
and wires it into the lifespan startup path after the tenant provider
starts, aggregating all failing namespaces into a single fatal error.

Addresses Codex review feedback on PR #1389.
@github-actions github-actions Bot added component/server size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 27, 2026
@Pangjiping Pangjiping changed the title docs(oseps): mark 0004, 0005, 0014 as implemented OSEP-0004/0005/0014: mark implemented and add tenant namespace startup validation Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95a15c4fe0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/opensandbox_server/main.py Outdated
Comment thread server/opensandbox_server/main.py Outdated
@Pangjiping
Pangjiping marked this pull request as draft July 27, 2026 01:56
@Pangjiping
Pangjiping marked this pull request as ready for review August 11, 2026 03:08
- Grant the Helm ClusterRole get/list access to namespaces so
  CoreV1Api.read_namespace works under the default deployment
  (fixes crash-loop on 403 during tenant startup validation).
- Add supports_enumeration to TenantProvider: file provider
  enumerates its config at startup, HTTP provider cannot.
- validate_tenant_namespaces_on_startup() skips validation with
  an explicit warning for non-enumerable providers instead of
  validating an empty set and reporting success.
- Document the HTTP provider skip in docs/guides/multi-tenancy.md.
@github-actions github-actions Bot added the component/k8s For kubernetes runtime label Aug 11, 2026
Comment thread server/opensandbox_server/tenants/provider.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7ffbab018

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread kubernetes/charts/opensandbox-server/templates/server.yaml Outdated
…ol marker

- Split namespaces into its own ClusterRole rule with get/list only;
  the startup guard only calls read_namespace, so the full write verbs
  on namespaces are not needed (addresses Codex P1).
- Declare supports_enumeration as a protocol attribute instead of a
  property stub to satisfy the static-analysis no-effect check.
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

status: implemented

P2 Badge Keep OSEP-0014 non-implemented until opt-in matches

For operators following the newly implemented OSEP, this still advertises that tenants.toml alone is the sole trigger for multi-tenant mode (oseps/0014-multi-tenancy.md:71), but the server only builds a tenant provider when [tenants] is present in server.toml (_build_tenant_provider() returns None when config.tenants is None). In that scenario, placing ~/.opensandbox/tenants.toml as specified leaves the server in single-tenant mode and also avoids the Docker+tenants rejection promised by the OSEP; either revise the proposal/status to match the documented [tenants] opt-in or implement the file-existence trigger before marking it complete.

AGENTS.md reference: AGENTS.md:L44-L44

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jwx0925 jwx0925 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hittyt hittyt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hittyt
hittyt merged commit 138ce5c into main Aug 14, 2026
66 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59e78e4f02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

last-updated: 2026-05-07
status: draft
last-updated: 2026-07-27
status: implemented

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep OSEP-0014 open until tenant keys use constant-time checks

For file-backed tenants, this implemented status advertises the requirement at line 74 that API-key authentication use constant-time comparison, but FileTenantProvider.lookup() still authenticates with self._lookup.get(api_key) (server/opensandbox_server/tenants/file_provider.py:110-112), and the tenant authentication path contains no compare_digest call. Retain an in-progress status or implement and test constant-time tenant-key matching before declaring the proposal fully implemented.

AGENTS.md reference: AGENTS.md:L44-L44

Useful? React with 👍 / 👎.

last-updated: 2026-05-07
status: draft
last-updated: 2026-07-27
status: implemented

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align the implemented status with the actual activation contract

When an operator follows OSEP-0014 and mounts tenants.toml without adding [tenants] to server.toml, _build_tenant_provider() returns None solely because config.tenants is absent (server/opensandbox_server/main.py:66-68), leaving the server in legacy single-tenant authentication despite line 71 requiring file existence to be the sole trigger. The operations guide instead documents [tenants] as mandatory, so update the proposal's requirement/design to match that shipped contract or keep the proposal in progress rather than marking the contradictory contract fully implemented.

AGENTS.md reference: AGENTS.md:L44-L44

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/k8s For kubernetes runtime component/server documentation Improvements or additions to documentation size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants