Repository navigation
feat: writable per-run copy of a workload's context - #532
Conversation
|
#520 is merged so rebase can be done |
d19d87b to
5bcdf5e
Compare
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Reviewed the writable per-run context copy (harness overlay + sweep + cleanup scripts, /v1/runs contextWritable validation, mocactl --writable, spawn preflight, client-side workload names, grant contentType check) and the docs/OpenAPI updates against main 67366cf. No blocking issues found.
- The
cp -a→chmod u+w→touch→ rename sequence stays inside the ref the run holds, and cleanup neverchmod -Rs through the link. The sweep skips links, so it never touches the shared cache. rejectInvalidContextWritableruns before the async/workload gates.workloadId: nullstill reachesresolveWorkloadRun, sotruecan't be silently dropped.chmod -R u+rX,a-wkeeps dirs traversable and keeps exec bits, and the real-shell tests cover it.
There are a few nits, all about wrapping. CI is green on this head, and the one commit has a DCO sign-off.
| archive with more entries than the entry limit, extracts it read-only (directories `0555`, files | ||
| `0444`) and publishes the revision atomically under `flock`. | ||
| archive with more entries than the entry limit, extracts it read-only (write permission removed; | ||
| directories stay traversable and executable files keep their exec bit) and publishes the revision atomically under `flock`. |
There was a problem hiding this comment.
nit: this line runs to ~123 chars after the edit. Please reflow the paragraph to the file's ~100-column wrap.
| After the run, its view is removed and, by default, so is any revision no run still uses. Shared | ||
| After the run, its view, or its writable copy, is removed and, by default, so is any revision no | ||
| run still uses. A writable copy left by a harness that died is swept a day later, as abandoned | ||
| uploads are. Shared |
There was a problem hiding this comment.
nit: uploads are. Shared is left as a stub line by the insertion. Reflow the paragraph so it wraps evenly.
| * identical content. The owner's part of the key is an HMAC under a secret agents never see, so an | ||
| * on a miss. A writable run gets its own copy of the cached revision there instead of a link, which | ||
| * it may change and which cleanup removes; the cached copy stays read-only. Keying the cache by | ||
| * owner means two users never share a copy, even when both uploaded identical content. The owner's part of the key is an HMAC under a secret agents never see, so an |
There was a problem hiding this comment.
nit: this doc-comment line is ~165 chars, and prettier won't rewrap comments (printWidth 100). Please reflow it by hand.
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
A workload run may set contextWritable: true (mocactl spawn --workload ID --writable). That run gets its own writable copy of the workload's files, discarded when the run ends; the shared cache stays read-only. The cache now keeps exec bits while removing write permission. Also addresses rossoctl#520 review: workloads create generates the name client-side, spawn --workload checks the workload is ready first, and the upload sends the grant's content type. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
537b4ac to
8f565d0
Compare
Follow-up to #520 (
mocactl workloadsandspawn --workload, now merged). Implements the middle option from #517 (seed sandbox files before a leaf runs), for flows such as a "fix" subagent that edits a repo and reruns its tests.Writable per-run copy
contextWritable: true;mocactl spawn --workload ID --writablesends it. Onlytruerequires aworkloadId; a non-boolean is400 context_writable_invalid../test.shruns in both read-only and writable runs.mocactl subagents --jsonshows"writable": trueon rows that have it.ubi9-minimalcontainer as the sandbox user: edits, new files and./test.shwork in the writable copy; writes to the cache are refused; cleanup leaves nothing behind.#520 review follow-ups
workloads creategenerates the name client-side (wl-plus 8 hex characters) when--nameis omitted, so a lost reply still says which workload to delete.spawn --workloadchecks the workload withGET /workloads/{id}first and fails fast if it is missing or not ready.contentTypeand refuses any other value.Durable writes that outlive a run are #476 (phase 2: per-workload sandboxes and storage).
🤖 Generated with Claude Code