Skip to content

refactor(paths): centralize server process PATH policy - #1221

Merged
joelteply merged 1 commit into
canaryfrom
hygiene/path-ownership-defaults
May 14, 2026
Merged

joelteply merged 1 commit into
canaryfrom
hygiene/path-ownership-defaults

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • adds a server-only ProcessPathPolicy for daemon PATH and sandbox PATH construction
  • removes duplicated PATH assembly from both Claude providers
  • keeps Node process policy out of core/shared/browser-facing modules
  • updates sandbox tests to assert against the shared server policy instead of a copied list

Validation

  • npx vitest run tests/unit/code/ExecutionSandbox.test.ts
  • npm run build:ts
  • git diff --check
  • precommit hook: TypeScript compile + ESLint baseline ratchet passed
  • pre-push hook: TypeScript clean + ESLint baseline ratchet passed

Refs #1212.

@joelteply
joelteply merged commit 4a864a1 into canary May 14, 2026
4 checks passed
@joelteply
joelteply deleted the hygiene/path-ownership-defaults branch May 14, 2026 18:42
joelteply pushed a commit that referenced this pull request May 14, 2026
… HOME-unset surfaces as Unsupported

Two non-blocking review nits from sibling on PR #1229:

1. **HOME-unset diagnostics**: previous shape used unwrap_or_else(|_| /) which
   silently returned the wrong path /Library/... when HOME is unset, then
   surfaced as NotFound. New shape returns Unsupported with reason
   '/Users/joelteply env var not set' — distinct from 'platform not supported' (macOS
   IS supported, the host is just misconfigured) and from 'file not present'
   (the path can't even be resolved).

2. **paths::docker policy module**: extracted the Docker-related path
   resolution into a dedicated paths::docker module mirroring codex's
   ProcessPathPolicy.ts pattern (#1221). The probe (modules::docker_tier)
   asks 'go stat this known path'; the policy (paths::docker) answers
   'what IS the known path on this OS'. Separating them means future
   consumers (cap-on-install logic in #1222 PR-2 that touches Docker
   settings.json) don't have to import the probe just to know paths.

## New module shape

src/workers/continuum-core/src/paths/
  mod.rs  — module index + the 'why this exists' rationale
  docker.rs — DockerRawPath enum + raw_image_path() resolver

DockerRawPath is a total enum (Resolved / HomeUnset / Unsupported(os))
so callers handle every case exhaustively. Same shape rule as
DockerTierProbe + AnalysisError — typed at the boundary.

## Tests

paths::docker:
  - raw_image_path_never_panics — total-shape contract
  - macos_with_home_resolves_to_docker_raw — cfg(macos), asserts the
    happy path produces a path ending in Docker.raw under com.docker.docker

modules::docker_tier:
  - All 5 tests still pass (probe_never_panics, serde round-trip,
    not_found diagnostics, macOS detect-or-not-found, ts-rs binding)

Total 7 tests pass. Clippy stays at baseline 162.

## Why this matters for the umbrella

The 'policy lives once' rule from Joel directive 18:40 ('we code concurrency
ONCE then incorporate it') extends to path resolution. paths::docker is
the Rust analog of codex's ProcessPathPolicy.ts: any 'where does X live on
disk' question gets one answer in one place. Future tiers (HF cache, NVMe
pool) slot in as paths::hf_cache, paths::nvme_pool — same shape, no
inline path strings scattered across modules.

Refs #1222, addresses sibling review nits 1+2 on PR #1229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant