#2609

api: move the substrate core into pplx-space-substrate

Openac-pplxwants to merge intofrom

Summary

Moves the substrate core into pplx-space-substrate (crates/l40_api/substrate/core): the SubstrateAdapter trait, the vocabulary shared code and the substrates pass across it, and ControllerError. The Substrate dispatch wrapper and both adapters stay in pplx-space-api, which re-exports everything that moved, so every existing crate::… and pplx_space_api::… path still resolves, including cluster-controller-server's. This is the second and last stage of the substrate core extraction; #2510 started the crate. It is a refactor: no runtime, wire, schema or metric-name change.

controllers/substrate/mod.rs moves onto the crate's lib.rs, which keeps the crate doc and the module declarations #2510 put there. The wrapper is the new controllers/substrate.rs. Because lib.rs already exists on main, git diff -M shows it as modified and mod.rs as deleted; with break detection (git diff -B -M) git pairs mod.rs → lib.rs at 67% similarity.

Moved

  • From controllers/substrate/mod.rs:

    • the trait and its default helper delete_observed_execution_via_node_api;
    • the shared types: ExecutionBinding, ExecutionActivation, CreateExecutionRequest, SubstrateError, DurableSnapshotError, SubstrateCapabilities and the rest;
    • DbContext, substrate_db_error, pool_error;
    • the node-api artifact backup and state helpers, NodeSchedulability, and the Retry-After constants.

    The wrapper keeps Substrate, Inner, impl Substrate, impl SubstrateAdapter for Substrate, ReflectorReady and CommandReadyProbe.

  • Whole files:

    • from controllers/substrate/: execution_fence, environment_placement, recovery_charge, runtime_upgrade, node_api_client, live_count, local_artifact, pool_claims, sandbox_state_probe, slot_headroom, unscheduled_backlog, runtime_rpc and pool_eligibility_tests;
    • node_group_placement, with store.rs and its tests;
    • metrics/sandbox/api/client_id.rs.

    unscheduled_backlog is two pure types, like slot_headroom.

  • From controllers/mod.rs:

    • ControllerError and its kinds (SandboxNotRunning, TemplateReleaseMiss, SnapshotUploadInFlight, SnapshotUploadCheck, ControllerRetryAfterCause);
    • DbErrorLike and its DbError impl;
    • node_draining, is_activation_sealed;
    • the From<tonic::Status> and IntoResponse impls, which the orphan rule requires to move.

    #2452 changed these blocks after this PR's base; its changes are ported verbatim: ControllerRetryAfterCause::{NodeDrain, NodeDrainUntilUndrained}, node_draining's cause, the new node_draining_until_undrained, From<tonic::Status>'s sealed-node answer, and SubstrateError::NodeSealed's orphaned field with its two arms in From<SubstrateError> for ControllerError.

    internal_error, db_contention_error, resolved_create_release, pool_store_error and DrainV2Switch stay. The From<MaterializeOwnerError> for ControllerError impl becomes api's controllers::materialize_owner_error, with the same body, called at its three conversions. auth's AuthLookupError keeps its DbErrorLike impl.

  • Two more impls the orphan rule requires:

    • impl FileCallFailure for ControllerError (from routes/public/files.rs);
    • impl TryFrom<PoolConfigWithCounts> for ClusterPoolConfigResponse and its two helpers (from kubernetes/pool.rs).
  • Types the trait's signatures use:

    • models::{ClusterPoolConfigRequest, ClusterPoolConfigResponse} and default_cluster_pool_enabled;
    • metrics::sandbox::api's SandboxApiSurface, ClientClass, ParseClientClassError and SandboxApiMetricIdentity.
  • controllers::sandbox::fetch_sandbox. The Direct adapter calls it, so moving it is groundwork for that adapter's own crate. controllers::sandbox::fetch_sandbox still resolves through a re-export.

  • Metric families recorded only by moved code, unchanged:

    • environment_placement.would_refuse;
    • node_group_placement.resolved;
    • node_group_placement.local_restore_preflight.

    Their vocabularies move with them. environment_placement.running_pods and pending_pods, node_group_placement.pool_claim_admission and restore_shortlist_emptied, and the other operations families stay in api, which records them.

Stays in api:

  • ClusterActivationClass, SandboxQuota and SubjectSandboxQuota;
  • native_access and worker_channels;
  • driver_db::DriverDbContext;
  • Substrate::from_env, the one sqlx-typed function on this path.

The new crate has no normal sqlx dependency, and no non-test moved code names a sqlx type. sqlx is a dev-dependency, because environment_placement/tests.rs and node_group_placement/tests.rs build a PgPool. Four doc comments from the postgres-pool conversion (#2515, #2528) still mention sqlx::Error or sqlx::Decode.

One signature change. RuntimeClient::call takes substrate: &A for any A: SubstrateAdapter + ?Sized instead of &Substrate. Its callers pass &Substrate unchanged, and it compiles to the same code.

Widened to pub, because api still uses them:

  • lib.rs:
    • override_request_policy;
    • LOCK_CONTENTION_RETRY_AFTER, RESTORE_RETRY_AFTER_FLOOR;
    • create_wait_should_preserve_node_work, persist_optional_current_local_artifact, CopyDurableArtifact;
    • durable_snapshot_rpc_error, substrate_db_error, DbContext, pool_error, SubstrateError::demoted_after_side_effect, suspend_rpc_error;
    • delete_observed_execution_via_node_api, enqueue_artifact_backup_via_retrying_node_api;
    • artifact_backup_refusal, parse_reported_pin, node_reported_artifact_from_info;
    • the RuntimeRpcError and GATEWAY_RETRY_AFTER re-exports;
    • the node_api_client module.
  • controller_error.rs:
    • DbErrorLike;
    • SandboxNotRunning with sandbox_id and lifecycle;
    • TemplateReleaseMiss;
    • SnapshotUploadInFlight with check, new and idle_for;
    • SnapshotUploadCheck;
    • is_activation_sealed;
    • ControllerError's activation_rejection, demoted_after_side_effect, lock_contention, sandbox_already_exists, with_template_release_miss, template_release_miss, is_sandbox_already_exists, sandbox_not_running, sandbox_not_running_refusal, snapshot_upload_in_flight, snapshot_upload_in_flight_details, is_cluster_admission_rejection, live_cap_refused, is_live_cap_refusal, node_draining, node_draining_until_undrained and mark_lock_contention_for_test;
    • NODE_DRAIN_RETRY_AFTER, which #2452's api tests read.
  • node_api_client.rs:
    • RuntimeClient's report field, and its new, kept, with_report, endpoint, retire_kept_connection, require_activation_policy_support and internal_client;
    • KeptCallReport and its six fields;
    • SlowKeptCall and its kept, connection_age, idle, redials and connection_closed; slow_call;
    • SLOW_KEPT_CALL, NODE_RPC_TIMEOUT, NODE_RPC_TIMEOUT_SECS, BLOCKING_WAIT_MARGIN_SECS, ALB_IDLE_TIMEOUT_SECS, BUILDER_BEARER_TOKEN;
    • node_api_endpoint, retrying_worker_node_api, node_api_connect_endpoint, require_activation_policy_support, connect_worker_watched and connect_worker_watched_with.
  • recovery_charge.rs:
    • ActivationRejectionKind::controller_error, ActivationAdmissionRejection::new, KeyResolution::pod_label;
    • RecoveryCharge's enforce, paid, exempt, uncapped, after_charge, with_live, take_live, with_cap, reserve_live_cap, live_cap_configured, precheck_live_cap, charge_restore_claim, charge_cold_activation, exempt_for_tests and enforce_for_tests.
  • environment_placement.rs: record_refusals, BindingScope, work_environment, resolved_work_environment, bound_pod_environment.
  • local_artifact.rs: PublishedLocalArtifact::from_published and ::from_committed_suspend_response, reject_deleting_current_local_artifact.
  • node_group_placement.rs: RestoreSourceNode, check_local_restore_source.
  • pool_claims.rs: default_pool_eligible_for_request, pool_eligible_with_env.
  • sandbox_state_probe.rs: observed_sandbox_states.
  • runtime_rpc.rs: RuntimeRpcError, RuntimeClient::call.
  • client_id.rs: ClientIdTag::has_own_bucket.
  • models.rs: default_cluster_pool_enabled.

ControllerError::node_api_transport goes from private to pub(crate).

Of these, 24 serve only api tests of moved code, not api's production code:

  • RESTORE_RETRY_AFTER_FLOOR, artifact_backup_refusal, parse_reported_pin, node_reported_artifact_from_info, observed_sandbox_states, BLOCKING_WAIT_MARGIN_SECS and ALB_IDLE_TIMEOUT_SECS;
  • RuntimeClient.report, KeptCallReport and its six fields, slow_call, SlowKeptCall and its five fields, and SLOW_KEPT_CALL;
  • NODE_DRAIN_RETRY_AFTER, which api re-exports only under #[cfg(test)].

These narrow when the tests that use them move into core.

The wrapper re-exports the crate with pub use pplx_space_substrate::* (controllers/substrate.rs). That makes every pub core item public on pplx_space_api::controllers::substrate::… too, including the helpers widened for api's own use. This is transitional, until dependents import from pplx_space_substrate directly.

Other forced edits

  • test-support feature: it gates the test constructors api's tests use (RecoveryCharge::exempt_for_tests and enforce_for_tests, ControllerError::mark_lock_contention_for_test) as #[cfg(any(test, feature = "test-support"))]. api enables it from [dev-dependencies] only. uncapped, which exempt_for_tests calls, adds test-support to its gate, #[cfg(any(test, feature = "kubernetes", feature = "test-support"))], so it stays in production kubernetes builds, as before.
  • kubernetes feature: it now enables the optional k8s-openapi, pplx-space-node-group-store and pplx-space-sandbox-pod.
  • runtime_rpc tests: they stay in api because they build a Direct Substrate. The wrapper declares them through an inline mod runtime_rpc { use super::*; mod tests; }, so their identity is unchanged.
  • Tests that relied on their old parent module:
    • controllers/tests.rs and controllers/substrate/tests.rs gain the imports use super::* no longer provides;
    • the two template tests read the message through to_string();
    • a runtime_upgrade test reads status() instead of the private field.
  • Path edits in moved code: super:: and crate::controllers:: to the crate's own modules, and crate::models::Sandbox to the store's path. Intra-doc links to items that stay in api become code spans.
  • ARCHITECTURE.toml: pplx-space-substrate joins store_users for the ten stores it uses: cluster-pool, node-group-store, node-status-store, node-template-inventory-store, postgres-pool, runtime-environment-catalog-store, runtime-environment-policy-store, sandbox-store, snapshot-store and template-release-store. pattern_ratchet.kubernetes_access also allows the wrapper's new path, where as_kubernetes is defined.
  • ci/kind-placement-paths.txt: names controllers/substrate.rs. The moved files fall under crates/l40_api/substrate/core/src/**, which it already lists.
  • Kind Direct CI's paths: filter (.github/workflows/kind-direct-ci.yml) adds crates/l40_api/api/src/controllers/substrate.rs and crates/l40_api/substrate/core/src/**. It listed only controllers/substrate/**, which no longer matches the moved core, so later pull requests that edit only the core would not have run the Direct lane before merge. The Kind README says the filter covers the substrate core too.
  • Moved paths in docs/execution-environments.md, three Kind chart comments and controllers/substrate/AGENTS.md.

No caller outside the moved blocks needed an edit, apart from the test files above and materialize_owner_error's three call sites:

  • controllers/sandbox/queries.rs;
  • public_sandbox_operations.rs;
  • routes/e2b/fork.rs.

Each site's one statement is edited, and the behaviour is identical. The new crate also drops two unused dependencies, tokio-util and pplx-space-api-route. SubstrateAdapter's doc points at the contract in controllers/substrate/AGENTS.md. controllers/sandbox/mod.rs and api's lib.rs changed only their re-exports.

Observable names

  • Log targets: tracing events without a target: move from pplx-space-api's module paths to pplx-space-substrate's:

    Old targetNew targetEvents
    pplx_space_api::controllers::substratepplx_space_substrate2
    pplx_space_api::controllers (ControllerError's 500 log)pplx_space_substrate::controller_error1
    pplx_space_api::controllers::substrate::environment_placementpplx_space_substrate::environment_placement4
    pplx_space_api::controllers::substrate::node_api_clientpplx_space_substrate::node_api_client1
    pplx_space_api::controllers::substrate::local_artifactpplx_space_substrate::local_artifact1
    pplx_space_api::controllers::substrate::sandbox_state_probepplx_space_substrate::sandbox_state_probe1
    pplx_space_api::controllers::substrate::runtime_rpcpplx_space_substrate::runtime_rpc1
    pplx_space_api::node_group_placementpplx_space_substrate::node_group_placement3
  • type_name: no moved code uses it.

  • Test identities: 37 tests move from pplx-space-api to pplx-space-substrate:

    • controllers::substrate::environment_placement::tests::* (7), controllers::substrate::recovery_charge::tests::* (3) and controllers::substrate::runtime_upgrade::tests::* (15) become environment_placement::tests::*, recovery_charge::tests::* and runtime_upgrade::tests::*;
    • controllers::substrate::pool_eligibility_tests::* (1) becomes pool_eligibility_tests::*;
    • node_group_placement::tests::* (11) keeps its path.

    No ci/test-duration-budget.toml entry names them.

Validation

At this head (rebased on 3888fde9):

  • cargo fmt --all -- --check: clean.
  • cargo check --locked --workspace --all-targets --all-features: clean, no warnings.
  • cargo check --locked, all clean with no warnings:
    • pplx-space-api (default, --no-default-features, --features kubernetes);
    • pplx-space-substrate (default, --no-default-features).
  • cargo clippy --locked -p pplx-space-substrate --no-default-features --all-targets -- -D warnings: clean.
  • ci/scripts/run-rust-checks.sh clippy: passed.
  • ci/scripts/run-archcheck.sh <merge-base>: 0 required findings. The ten advisory layers.policy_changed findings are the store_users additions.
  • cargo nextest run, each with the repository's Postgres setup script (and Redis for api), and no dependency skips:
    • pplx-space-substrate: 28 passed with default features, 40 with --all-features;
    • pplx-space-api --features kubernetes: 3,012 passed, 1 skipped (the profile's default skip);
    • pplx-space-cluster-controller-server: 1,462 passed.
  • #2452's tests of the ported code pass in that api run:
    • controllers::tests::a_sealed_nodes_refusal_is_the_drains_retryable_503;
    • public_sandbox_operations::tests::{a_node_drain_refusal_defers_without_spending_an_attempt, a_refusal_until_the_undrain_spends_an_attempt_with_the_drains_error, with_retry_deferral_off_a_drain_refusal_spends_an_attempt, a_non_drain_503_with_retry_after_still_spends_an_attempt};
    • controllers::sandbox::lifecycle::drain_guard_tests::{a_v2_refusal_is_a_retryable_503, every_action_is_listed_for_a_sealed_node};
    • controllers::sandbox::lifecycle::drain_guard_postgres_tests::{a_draining_v2_drain_refuses_only_activations_with_a_503, a_stop_on_a_v2_drained_node_is_refused_with_a_503};
    • controllers::substrate::kubernetes::store::k8s_store_postgres_tests::drain_recovery_gate_tests::a_sealed_refusal_with_no_v2_drain_recorded_is_an_orphaned_seal.
  • The new crate drops tokio-util and pplx-space-api-route, which its one dependent, api, keeps, so no package loses them. Cargo.lock loses only the new crate's two edges.

Not run locally: a Kind smoke. The Kind path lists select this change for Pull CI.

Stack

  • #2452 (drain v2 deferral) landed after this PR's base and edited blocks this PR moves. This PR is rebased over it, and #2452's five hunks in controllers/mod.rs and controllers/substrate/mod.rs are ported verbatim into controller_error.rs and lib.rs, the NodeSealed arms kept separate.
  • With #2603, which moves MaterializeOwnerError out of api, this PR replaced the From<MaterializeOwnerError> for ControllerError impl with materialize_owner_error, so the two land in either order.
  • #2613 rewrote controllers/substrate/AGENTS.md after this PR's base. This PR is rebased over it and keeps only its own edit there (the Inner path). The moved SubstrateCapabilities doc names that contract file by path, since the core crate's directory has no AGENTS.md.
  • Open PRs that edit the deleted controllers/substrate/mod.rs hit a modify/delete conflict and must port their hunks into core. Edits to files this PR moved whole follow the rename into core.

Severity and risk

Severity: does not apply (refactor).

Risk: moderate review surface, low runtime risk. The moved code is unchanged apart from the edits listed above. A missed re-export would fail to compile, not misbehave. Open pull requests that edit controllers/substrate/mod.rs, a moved file or a moved block need a rebase onto the new paths. Rollback is a revert.

Rollout

No runtime change. Old and new binaries are equivalent:

  • no schema, migration, protocol, wire or metric-name change;
  • no persisted-state change and no new switch;
  • the same code runs, linked from a different crate.

Log targets are the one observable difference, listed above. A dashboard or monitor that filters on an exact @target from the table needs the new value, or a wildcard, before this deploys. So does a log-filter directive (RUST_LOG, SPACE_TRACE_FILTER) that names pplx_space_api or a moved module path: it no longer covers the moved events. No chart in this repository sets one. During a rolling deploy, old and new replicas log the same events under the two targets. Rollback is a revert.

Not covered

  • The two substrate adapters (direct and kubernetes) and the Substrate dispatch wrapper stay in pplx-space-api, for later steps.
  • Substrate::from_env still takes a driver pool. It goes with the store-API work that removes the last driver handles.
  • driver_db::DriverDbContext stays in api until no call site holds a sqlx::Error.
  • Many core helpers are pub because api uses them: the adapters' and the wrapper's helpers narrow as those move into core or their own crates, and the 24 test-only items above narrow when the tests that use them move into core.

Local review: round 2 (Codex + Claude), READY after fixes.

AI assistance: an AI agent (Claude Code) drafted the code changes and this description.

Activity

6
coderabbitai[bot]19h ago

Automatic approval withheld

Automatic approval is disabled by the configured approval policy for this pull request. Review comments and requests for changes continue normally.

Commit: 49f2d4fa4ab8.

No actionable comments were generated in the recent review.

Walkthrough

The pull request extracts shared substrate contracts, error handling, metrics, and implementations into pplx-space-substrate. It adds a controller wrapper that dispatches operations to Direct or feature-gated Kubernetes implementations. The API adopts substrate-owned types and helpers, updates federated-owner error mapping, and removes superseded local implementations. CI filters, architecture entries, and source references are updated for the new crate layout.

Possibly related PRs

  • perplexityai/SPACE#2510: This PR established the substrate crate and moved initial shared components there; this pull request extracts the remaining substrate core and re-exports its APIs.
Merge Risk: Low · up to 49f2d · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Security architecture risk: Minimal · up to 49f2d

The change broadens what other Rust packages can import, but the paths examined still use the same runtime adapters, authorization checks, and retry behavior. The review did not identify a new way for a request to reach privileged operations or a new deployment or rollback requirement.

Security review details

Security Blast Radius

  • observed — The runtime-client constructor and internal-client accessor become callable across crate boundaries. Their authentication code is unchanged, and the inspected production references remain in the substrate core and existing API controller paths.

Trust Boundaries and Controls

  • observed — The newly public BUILDER_BEARER_TOKEN constant selects the existing NodeApi credential type; the constant is not a bearer-token value.

Resilience and Maintainability Implications

  • observed — Runtime RPC replay still requires proof that the first attempt was never transmitted and shares the original deadline. The access-idle mutation still uses a generation-fenced request and reconciles an ambiguous failure by observing state rather than resending the mutation.

Hardening Proposals

  • proposed — Document which consumers may construct authenticated runtime clients or supply a custom adapter, and require an authority review before adding callers outside the existing controller paths.
Pre-merge checks: 7

Check nameStatusExplanation
Title checkThe title "api: move the substrate core into pplx-space-substrate" matches the main change. The PR moves the substrate core into the pplx-space-substrate crate, and the title uses the lowercase area p…
Description Follows The Pr TemplateThe pull request description (run 987c179e) contains all four required items, each with real content: 1. "## Summary": present. It states that merging moves the substrate core into `pplx-space-sub…
Bug Fixes Name A Regression TestThe check applies only when the pull request fixes a defect in application behavior under crates/, shim/, or ui/. This pull request is a refactor. Its title is "api: move the substrate core into pplx-…
Weakened Safeguards Are JustifiedNo test, assertion, lint, CI check, or repository guard is removed, disabled, or weakened without a stated reason. Findings by check category: - Allowlist additions (ARCHITECTURE.toml). Two kinds …
Agent Tooling Runs No New CommandsThe check covers agent plugin manifests, skills, command files, and guideline files. This PR is a Rust refactor that moves substrate core code into pplx-space-substrate. Evidence: - The changed-file…
External Code Sources Need A PersonThe check fails only if the diff adds or changes where external code comes from. I found no such change in the reviewed range (refs/coderabbit/pre-merge-check/base..head). - Cargo manifests: `crat…
Public-Safe ContentThe Public-safe content check passes. I scanned the 4,847 added diff lines and the commit messages for every risky pattern in the check. Results: - Credentials, tokens, private keys: none. The thr…
Full details: Title check

Explanation

The title "api: move the substrate core into pplx-space-substrate" matches the main change. The PR moves the substrate core into the pplx-space-substrate crate, and the title uses the lowercase area prefix with a colon, followed by a lowercase summary word. Code identifiers keep their case, and there is no trailing period or ticket ID.

Full details: Description Follows The Pr Template

Explanation

The pull request description (run 987c179e) contains all four required items, each with real content: 1. "## Summary": present. It states that merging moves the substrate core into pplx-space-substrate, ControllerError, and the SubstrateAdapter trait, and that the change is a refactor with no runtime, wire, schema, or metric-name change. 2. "## Validation": present. It names the commands run (cargo fmt, cargo check, cargo clippy, ci/scripts/run-archcheck.sh, cargo nextest run) and reports results, such as 28/40 substrate tests, 3,012 API tests with one profile-default skip, and 1,462 cluster-controller-server tests. It also states that a Kind smoke was not run locally. 3. "## Severity and risk": present. It gives "Severity: does not apply (refactor)." and a risk statement: "moderate review surface, low runtime risk," with the rollback path. 4. "AI assistance:" line: present. It reads "an AI agent (Claude Code) drafted the code changes and this description," which names the tool and the parts it drafted. The check tests presence and non-empty content only, so no code verification was needed. No tool calls were required because the description text was supplied in full.

Full details: Bug Fixes Name A Regression Test

Explanation

The check applies only when the pull request fixes a defect in application behavior under crates/, shim/, or ui/. This pull request is a refactor. Its title is "api: move the substrate core into pplx-space-substrate". The description states "It is a refactor: no runtime, wire, schema or metric-name change" and "Severity: does not apply (refactor)". The commit messages match that framing. "settle review findings" covers naming, docs, and dependency cleanup, and says "No runtime change: every response, status, retry hint and log line is as before." The #2452 drain-v2 changes are ported verbatim from another PR, not fixed here. No application bug fix is present, so the check does not apply and passes. The description names regression tests, but that is not required for this result.

Full details: Weakened Safeguards Are Justified

Explanation

No test, assertion, lint, CI check, or repository guard is removed, disabled, or weakened without a stated reason. Findings by check category: - Allowlist additions (ARCHITECTURE.toml). Two kinds of entries were added: - store_users entries for pplx-space-substrate across ten stores. The description gives the reason: the crate uses these stores. - pattern_ratchet.kubernetes_access allows crates/l40_api/api/src/controllers/substrate.rs. The description gives the reason: as_kubernetes is defined there. - The existing controllers/substrate/** entry is kept. No entry is removed. - Attributes in non-test code. - controllers/substrate.rs adds #[cfg_attr(not(feature = "kubernetes"), expect(unused_variables, reason = "..."))]. It has a reason, so it is justified. - #[allow(async_fn_in_trait)] and #[deny(clippy::missing_trait_methods)] moved from api substrate/mod.rs to core lib.rs and the wrapper. They were not added. - #[serde(deny_unknown_fields)] and the serde(default) attributes moved with ClusterPoolConfigRequest into core models.rs. - Lints. No [lints] or [workspace.lints] table changed. - CI and path filters. - .github/workflows/kind-direct-ci.yml and ci/kind-placement-paths.txt only add paths. - controllers/substrate/** stays in the Kind Direct filter. - No change to ci/scripts, ci/check-scopes, .config, or any continue-on-error, || true, or skip setting. - Tests. - Total test attribute count is 10,866 in both base and head. - All mod tests wiring from the base is present in head, moved or re-declared. The runtime_rpc tests are wired through an inline #[cfg(test)] mod runtime_rpc. - No #[ignore] or #[should_panic] was added. - Test assertions. Two template assertions changed from error.message to error.to_string(). ControllerError is declared with #[error("{message}")], so the strings compare the same value. The assertions are equivalent. - Guidance files. controllers/substrate/AGENTS.md changes only a path reference. The rules are unchanged. docs/ changes only paths. No review or approval guidance text changed. Scope note: the review used the base and head refs in the local checkout. Linked-repository inspection was unavailable, and no check depended on it.

Full details: Agent Tooling Runs No New Commands

Explanation

The check covers agent plugin manifests, skills, command files, and guideline files. This PR is a Rust refactor that moves substrate core code into pplx-space-substrate. Evidence: - The changed-file list (git diff --name-status against the review base) contains no plugin manifests (plugin.json/plugin.yaml), no SKILL.md, no skill or command directories, and no MCP or LSP configuration. - The only guideline file changed is crates/l40_api/api/src/controllers/substrate/AGENTS.md. Its diff changes prose only: the Inner location moves from mod.rs to controllers/substrate.rs. It adds no frontmatter, no hook, and no inline shell substitution (! followed by a backtick command). - A pattern search of the added lines for !\``, hooks, allowed-tools, mcpServers, lspServers, "command", and startServer found two hits. Both are Rust doc comments that cite macro names in code spans (tracing::error!). Neither is an agent-run instruction. - Other changes are Rust source, Cargo manifests, ARCHITECTURE.toml, CI path filters, Kind chart comments, and docs/execution-environments.md`. None of these is an agent-executed file under this check. No item needs to be listed for failure.

Full details: External Code Sources Need A Person

Explanation

The check fails only if the diff adds or changes where external code comes from. I found no such change in the reviewed range (refs/coderabbit/pre-merge-check/base..head). - Cargo manifests: crates/l40_api/api/Cargo.toml adds pplx-space-substrate = { workspace = true, features = ["test-support"] }. crates/l40_api/substrate/core/Cargo.toml adds only { workspace = true } entries, plus optional = true and feature flags. Every new dependency inherits from the workspace. The grep for git =, rev =, branch =, tag =, registry =, and path = found no matches. The root Cargo.toml is not in the changed-file list, so no workspace dependency source changed. The [patch] and [replace] sections are untouched. - Cargo.lock: No source lines changed. The only additions are workspace-crate edges, such as pplx-space-content-digest. - Container images and Dockerfiles: No Dockerfile or image reference changed. The grep for FROM and image: found nothing. - Downloads: No URL, version, or checksum of a fetched binary or archive was added. The grep for curl, wget, sha256, and checksum found nothing. - Helm charts: Chart.yaml and Chart.lock are not in the diff. The chart files that changed (_helpers.tpl, two values.yaml files) change comments only. - Other config: ARCHITECTURE.toml, ci/kind-placement-paths.txt, and kind-direct-ci.yml change path and store-user lists only. None of them names an external source. No item matches a failure condition, so the check passes.

Full details: Public-Safe Content

Explanation

The Public-safe content check passes. I scanned the 4,847 added diff lines and the commit messages for every risky pattern in the check. Results: - Credentials, tokens, private keys: none. The three token-like hits are an identifier (BUILDER_BEARER_TOKEN: SpaceBearerToken::NodeApi), a workspace dependency name (pplx-space-bearer-token), and a doc comment that mentions a kubeconfig. None holds a secret value. - URLs and links: no http(s):// links in added lines, commit messages, or the PR description. The description cites only PR numbers (#2510, #2452, #2603, #2613), which are not links to private trackers. - Absolute personal paths: none in added lines, commit messages, or changed file paths (/Users/, /home/). - Cloud account IDs and ARNs: none (no 12-digit IDs, no arn:aws). - Internal hostnames: space.pplx.net/... appears in lib.rs (added lines 158 and 453) as a Kubernetes label-key prefix (space.pplx.net/client-id). The base tree already uses this prefix in 206 places, including workflows and the Tiltfile. It is a label namespace, not a resolvable host or URL, and the moved code carries it unchanged. node_group_placement.local_restore_preflight is a metric name. - Cluster or environment names, production logs, incident details, unfixed vulnerabilities: none found. The description states "Severity: does not apply (refactor)." It has no "Created with ..." line. No file or line fails the check.

Recent review info

Automatic approval policy

Commit: 49f2d4fa4ab8.

SettingEffective valueSource
Automatic approvalsDisabledOverride 3
Merge riskModerateGlobal configuration
Security riskNot setGlobal configuration

Matching overrides (numbered as in the resolved configuration):

  • Override 3 — any author; paths: .coderabbit.yaml, .coderabbit.yml, coderabbit.yaml, coderabbit.yml, .coderabbit.config.ts, .github/**, ci/scripts/ci-image.sh, ci/scripts/mirror-images.sh, ci/scripts/lib/test-deps.sh, ci/scripts/run-space-bundle-builds.py, ci/scripts/ensure-uv.sh, ci/scripts/tfswitch-lite.sh, ci/scripts/notify-main-ci-failure.sh, templates/firecracker/kernel/ci.sh, ci/Dockerfile.ci, ci/mirrored-images.txt, ci/scripts/pull-ci-reuse.py, .claude/settings*.json, **/.mcp.json, **/hooks.json, .agents/plugins/**/hooks/**, .agents/plugins/**/scripts/**, .agents/plugins/**/commands/**, .agents/plugins/**/agents/**, **/skills/**/hooks/**, **/skills/**/scripts/**, **/skills/**/commands/**, **/skills/**/agents/**, .claude/commands/**, .claude/agents/**, **/marketplace.json, .pre-commit-config.yaml, lefthook.yaml, .cargo/**, rust-toolchain.toml, supply-chain/**, **/pyproject.toml, **/uv.lock, **/package.json, **/package-lock.json, **/go.mod, **/go.sum, **/requirements*.txt, **/requirements*.in, db/**, !db/README.md, proto/**, docs/versioning.md, ci/guest-update-required-since, crates/l40_api/api/src/auth.rs, crates/l40_api/api/src/auth/**, crates/l40_api/api/src/middleware/auth*, crates/l40_api/api/src/middleware/auth/**, crates/l40_api/api/src/routes/authz.rs, crates/l10_foundation/bearer/**, crates/l10_foundation/rustls/**, crates/l10_foundation/guest/**, crates/l10_foundation/pii/**, infra/space/aws/**, infra/space/cluster/**, infra/space/identity/**, infra/space/observability/**, infra/space/packer/**, LICENSE, SECURITY.md; automatic approvals: disabled.

Any matching disabled override withholds approval, regardless of risk. Otherwise, the strictest explicitly set limit wins for each score. Limits omitted by all matching overrides inherit the global configuration.

Not set means no limit was configured after inheritance. Use @coderabbitai configuration to inspect the resolved settings and their sources.

Run configuration

  • Source mode: Auto
  • Repository: perplexityai/SPACE
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 1f24179
  • Layers: Repository YAML; Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e08be77e-eccf-4703-b179-270cdeb9837b
Commits

Reviewing files that changed from the base of the PR and between 1f24179281731e3ec4d7ff9fe2cc78b93a324184 and 49f2d4fa4ab8e0b8b04742602c2e0f7361bd2ec7.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
Files selected for processing: 58

  • .github/workflows/kind-direct-ci.yml
  • ARCHITECTURE.toml
  • ci/kind-placement-paths.txt
  • crates/l40_api/api/Cargo.toml
  • crates/l40_api/api/src/controllers/mod.rs
  • crates/l40_api/api/src/controllers/sandbox/mod.rs
  • crates/l40_api/api/src/controllers/sandbox/queries.rs
  • crates/l40_api/api/src/controllers/sandbox/responses.rs
  • crates/l40_api/api/src/controllers/substrate.rs
  • crates/l40_api/api/src/controllers/substrate/AGENTS.md
  • crates/l40_api/api/src/controllers/substrate/kubernetes/pool.rs
  • crates/l40_api/api/src/controllers/substrate/kubernetes/store/restore_source.rs
  • crates/l40_api/api/src/controllers/substrate/mod.rs
  • crates/l40_api/api/src/controllers/substrate/tests.rs
  • crates/l40_api/api/src/controllers/template/tests.rs
  • crates/l40_api/api/src/controllers/tests.rs
  • crates/l40_api/api/src/lib.rs
  • crates/l40_api/api/src/metrics/environment_placement.rs
  • crates/l40_api/api/src/metrics/node_group_placement.rs
  • crates/l40_api/api/src/metrics/sandbox/api.rs
  • crates/l40_api/api/src/models.rs
  • crates/l40_api/api/src/public_sandbox_operations.rs
  • crates/l40_api/api/src/routes/e2b/fork.rs
  • crates/l40_api/api/src/routes/public/files.rs
  • crates/l40_api/substrate/core/Cargo.toml
  • crates/l40_api/substrate/core/src/controller_error.rs
  • crates/l40_api/substrate/core/src/environment_placement.rs
  • crates/l40_api/substrate/core/src/environment_placement/tests.rs
  • crates/l40_api/substrate/core/src/execution_fence.rs
  • crates/l40_api/substrate/core/src/lib.rs
  • crates/l40_api/substrate/core/src/live_count.rs
  • crates/l40_api/substrate/core/src/local_artifact.rs
  • crates/l40_api/substrate/core/src/metrics.rs
  • crates/l40_api/substrate/core/src/metrics/environment_placement.rs
  • crates/l40_api/substrate/core/src/metrics/node_group_placement.rs
  • crates/l40_api/substrate/core/src/metrics/sandbox.rs
  • crates/l40_api/substrate/core/src/metrics/sandbox/api.rs
  • crates/l40_api/substrate/core/src/metrics/sandbox/api/client_id.rs
  • crates/l40_api/substrate/core/src/models.rs
  • crates/l40_api/substrate/core/src/node_api_client.rs
  • crates/l40_api/substrate/core/src/node_group_placement.rs
  • crates/l40_api/substrate/core/src/node_group_placement/store.rs
  • crates/l40_api/substrate/core/src/node_group_placement/tests.rs
  • crates/l40_api/substrate/core/src/pool_claims.rs
  • crates/l40_api/substrate/core/src/pool_eligibility_tests.rs
  • crates/l40_api/substrate/core/src/recovery_charge.rs
  • crates/l40_api/substrate/core/src/recovery_charge/tests.rs
  • crates/l40_api/substrate/core/src/runtime_rpc.rs
  • crates/l40_api/substrate/core/src/runtime_upgrade.rs
  • crates/l40_api/substrate/core/src/runtime_upgrade/tests.rs
  • crates/l40_api/substrate/core/src/sandbox_state_probe.rs
  • crates/l40_api/substrate/core/src/slot_headroom.rs
  • crates/l40_api/substrate/core/src/unscheduled_backlog.rs
  • docs/execution-environments.md
  • infra/space/kind/README.md
  • infra/space/kind/charts/space-api-local/templates/_helpers.tpl
  • infra/space/kind/charts/space-data-plane-local/values.yaml
  • infra/space/kind/charts/space-node-api-local/values.yaml
Files with no reviewable changes: 2

  • crates/l40_api/api/src/controllers/sandbox/responses.rs
  • crates/l40_api/api/src/controllers/substrate/mod.rs

Limit details: You’ve used all 10 included reviews currently available. Your 20 included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

github-actions[bot]19h ago

Thanks for opening this pull request! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.