Skip to content

feat: support CL paths distinct from Antares mount paths - #36

Open
Ivanbeethoven wants to merge 10 commits into
mainfrom
codex/scorpiofs-0.4.0
Open

feat: support CL paths distinct from Antares mount paths#36
Ivanbeethoven wants to merge 10 commits into
mainfrom
codex/scorpiofs-0.4.0

Conversation

@Ivanbeethoven

Copy link
Copy Markdown
Collaborator

Summary

  • add an optional cl_path to Antares mount requests
  • map CL content into the requested monorepo subpath while retaining root mounts
  • release scorpiofs 0.4.0

Why

Orion can construct a Buck-root mount while a CL targets /project/distribution; the CL layer must be rebased to that path.

Validation

  • published and Cargo-verified scorpiofs 0.4.0 on crates.io
  • Antares-backed buck2 build //project/distribution:distribution succeeded with 3,219 local actions

@Ivanbeethoven
Ivanbeethoven marked this pull request as ready for review July 31, 2026 03:28

@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: 7c11e6624e

ℹ️ 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 src/daemon/antares.rs
.build_cl_layer(&request.path, cl_link, &cl_dir_path)
.build_cl_layer(
&request.path,
request.cl_path.as_deref().unwrap_or(&request.path),

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 Preserve cl_path as part of mount state

When a mount is created with a distinct cl_path (for example path: "/", cl_path: "/project/distribution"), this initial build uses that value to decide where CL-relative file entries are placed, but the value is then discarded: it is not stored on the mount, not part of the duplicate/idempotency identity, and later CL rebuilds pass the mount path as the CL path. In that scenario, POST /mounts/{id}/cl can rebuild the same CL with relative entries at the mount root instead of under project/distribution, and retries with a different cl_path can incorrectly return an existing mount. Persist and compare cl_path, and reuse it for rebuilds.

Useful? React with 👍 / 👎.

@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: 387d30498a

ℹ️ 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 src/daemon/antares.rs
}

/// Type alias for path index: maps (monorepo_path, optional_cl, cl_path) to mount_id.
type PathIndex = Arc<RwLock<HashMap<(String, Option<String>, Option<String>), Uuid>>>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the post-mount race check for the new key

The new PathIndex key now has three components, but the post-mount duplicate check in create_mount still probes it with (request.path.clone(), request.cl.clone()). That leaves this commit unable to build against HashMap<(String, Option<String>, Option<String>), Uuid>; the race check needs to include request.cl_path just like the fast path and insertion do.

Useful? React with 👍 / 👎.

Comment thread src/daemon/antares.rs
Comment on lines +2071 to +2074
(
PathBuf::from(&entry.upper_dir),
entry.cl_dir.as_deref().map(PathBuf::from),
)

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 Reject change scans while the CL layer is quiescing

When POST/DELETE /mounts/{id}/cl is rebuilding a CL layer, it marks the mount Quiescing, drops the mount lock, and removes or recreates the CL directory before remounting. This new /changes path copies cl_dir without checking that state, so a concurrent scan of a CL-backed mount can read a disappearing/partial CL directory and return a 500 or incomplete change set instead of rejecting until the remount finishes.

Useful? React with 👍 / 👎.

@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: 720727caa5

ℹ️ 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 src/daemon/antares.rs Outdated
Comment on lines +2086 to +2087
tokio::task::spawn_blocking(move || {
scan_mount_changes(mount_id, &upper_dir, cl_dir.as_deref())

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 change scans behind the CL quiesce barrier

When a CL-backed mount starts POST/DELETE /cl immediately after this snapshot, the read lock has already been released, so the CL operation can set Quiescing and remove/recreate cl_dir while this blocking scan is still using the copied path. The fresh evidence is that the new state check only protects the snapshot, not the scan itself, so /changes can still return a 500 or an incomplete set during the CL switch window; keep the quiescence barrier active for the scan or block CL switches until in-flight scans finish.

Useful? React with 👍 / 👎.

Comment thread src/daemon/antares.rs
Comment on lines +2175 to +2178
if entry.cl.is_some() {
return Err(ServiceError::InvalidRequest(
"cannot bind a Libra worktree base to a mount with a CL layer".into(),
));

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 Reject base binding while CL builds are quiescing

If POST /cl is building a CL for a clean mount, it sets the mount to Quiescing and drops the lock while entry.cl is still None; a concurrent /worktree/base call can pass this CL-only guard and set base_revision, after which build_cl resumes and records a CL layer on the already-bound worktree. That leaves a mount with both a Libra base binding and a CL layer even though both APIs are meant to reject that combination, so the binding path should also reject non-mounted/ready transition states or the CL build should recheck base_revision before committing.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant