Skip to content

feat: export bounded environment artifacts - #171

Merged
vincentkoc merged 4 commits into
mainfrom
fix/performance-candidate-execution
Sep 11, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/performance-candidate-execution

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Consumers need bounded diagnostic files from an OCM environment without running
candidate commands or directly reading another user's private state.

Why This Change Was Made

Adds ocm env artifact export ENV --path RELATIVE --max-bytes N. On Unix,
descriptor-relative reads reject traversal, symlinks, nonregular files and
multiple hard links, enforce the byte bound, and reject observed file changes.
stdout contains raw bytes only; callers own the destination and must discard
partial output on failure and independently bound transport time and bytes.

The original 10-path export scope is unchanged after integrating fixed main.
There is no candidate execution, UID redesign, service-policy change or new
dependency in the PR delta. Non-Unix export fails closed. Incoming main's
version metadata is retained; this PR does not perform a release.

User Impact

Callers can run the whole OCM command as the environment owner while retaining
destination ownership. Export does not attest candidate data or provide an
atomic snapshot; final diagnostics still require producer quiescence.
Export reads the registered environment home, not an owned or borrowed
execution-source checkout, including when a borrowed checkout has moved.
Downstream activation will pin the actual landed OCM commit for its integrated
qualification; that campaign is separate from this generic export PR.

Downstream stack: Kova invocation,
Kova collection,
benchmark transport,
isolation harness, and
workflow activation.

Evidence

  • Signed refreshed head: a1ff45af8b54aa4fa65a8b1fdf1de1dacf7d3dc0, integrating
    fixed main 9ed6256922b3e5cc6e933f2f119074ce91e4be3b without conflicts.
    Exporter and handler bytes are unchanged; the only new authored change is
    one owned/borrowed home-routing table in the existing artifact test file.
  • 30 tests passed: seven artifact, nine CLI, two archive-export and twelve
    selected registry, dev-source, handoff and cleanup cases. The routing table
    uses real main/linked Git checkouts and public registration, with distinct
    home/source bytes, source-only rejection and displaced-source preservation.
  • Native macOS arm64 Rust 1.95 locked all-target compilation, formatting and
    whitespace checks passed. Fresh scoped review found no P0-P2 issues.
  • Exact-head hosted CI
    passed on a1ff45af8b54aa4fa65a8b1fdf1de1dacf7d3dc0: Format, Rust 1.88
    minimum, Windows compile, Test (ubuntu-latest), and Test (macos-latest).
    CodeQL also passed.
    All 15 checks are terminal: 14 success and one optional [code]smith skip;
    that skip is not counted as a pass.
  • Strict up-to-date protection must be checked against live main before
    landing. The fixed integration base is not a claim that main has stopped
    advancing; no enforced check or review is waived.
  • Integrated Linux cross-UID, metadata-denial, workload and cleanup acceptance
    remains with downstream activation and is not claimed here. Local
    compilation is not Linux, Windows or MSRV proof.

Punchcard-Session: coral-orchard-orchard-d4

Punchcard-Session: coral-orchard-orchard-d4
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 6:11 AM ET / 10:11 UTC (Revision 8).

ClawSweeper review

What this changes

Adds a Unix command that exports one size-limited environment file as raw stdout, with path safeguards, change detection, documentation, and tests.

Merge readiness

✅ Ready for maintainer review

The capability remains distinct from current main, and no blocking defect was found. The refreshed head resolves the previous integration concern. This member-authored PR remains eligible for normal review and required CI.

Priority: P2
Reviewed head: a1ff45af8b54aa4fa65a8b1fdf1de1dacf7d3dc0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused implementation and substantial regression coverage support a normal good-quality rating, with no blocking defect identified.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Supplied macOS test results exercise the exporter through CLI fixtures, including home/source routing; downstream cross-user acceptance is not claimed or required by this unchanged-permission boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Supplied macOS test results exercise the exporter through CLI fixtures, including home/source routing; downstream cross-user acceptance is not claimed or required by this unchanged-permission boundary.
Evidence reviewed 7 items Repository policy: Read the complete root AGENTS.md, CONTRIBUTING.md, README.md, and PR template. Only the root AGENTS.md is tracked; no maintainer-notes directory was present. Applied fixture-isolation, scoped-change, and release-safety guidance.
Verified refreshed integration: Raw records confirm the original head includes pinned main as its second parent. The test merge has pinned main followed by the exact head as parents, and its tree equals the checkout tree. Its main-relative delta contains only the ten intended files and 681 additions.
Exporter boundary: Read the complete exporter and handler. They resolve registered home metadata without executing environment code, enforce no-follow component access, reject nonregular and multiply linked files before output, bound emitted bytes, and propagate instability and output errors. No identity switching, delegated authorization, dependency change, or persistent-format change is introduced.
Findings None None.
Security None None.

How this fits together

OCM manages registered OpenClaw environment homes separately from their execution-source checkouts. The new exporter resolves an environment name, reads a bounded file from its home using the invoking user's permissions, and sends bytes to the caller.

flowchart LR
  A[Environment name and file path] --> B[Registered environment home]
  B --> C[Descriptor-relative file access]
  C --> D[Path and size checks]
  D --> E[Bounded raw stdout]
  E --> F[File stability check]
  F --> G[Success or error requiring output discard]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +238 lines; tests +410 lines; documentation +33 lines The added production code implements a distinct bounded-file operation, with larger regression coverage for its filesystem boundary.

Technical review

Best possible solution:

Keep the exporter as a narrow, caller-permission file reader with explicit partial-output disposal and producer-quiescence requirements.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this adds a command rather than repairing a reported existing-behavior failure; its filesystem scenarios are covered by the inspected tests.

Is this the best way to solve the issue?

Yes: a separate bounded raw-file operation fits the need better than the existing whole-environment archive writer and preserves existing commands and settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9ed6256922b3.

Labels

Label justifications:

  • P2: Bounded diagnostic export is a useful, scoped environment-management improvement without an established urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Supplied macOS test results exercise the exporter through CLI fixtures, including home/source routing; downstream cross-user acceptance is not claimed or required by this unchanged-permission boundary.

Evidence

What I checked:

  • Repository policy: Read the complete root AGENTS.md, CONTRIBUTING.md, README.md, and PR template. Only the root AGENTS.md is tracked; no maintainer-notes directory was present. Applied fixture-isolation, scoped-change, and release-safety guidance. (AGENTS.md:1, a1ff45af8b54)
  • Verified refreshed integration: Raw records confirm the original head includes pinned main as its second parent. The test merge has pinned main followed by the exact head as parents, and its tree equals the checkout tree. Its main-relative delta contains only the ten intended files and 681 additions. (79cdf9c17a02)
  • Exporter boundary: Read the complete exporter and handler. They resolve registered home metadata without executing environment code, enforce no-follow component access, reject nonregular and multiply linked files before output, bound emitted bytes, and propagate instability and output errors. No identity switching, delegated authorization, dependency change, or persistent-format change is introduced. (src/env/artifact.rs:15, a1ff45af8b54)
  • Distinct from released archive export: Existing export writes a complete environment archive to a selected local destination; it does not supply bounded raw single-file stdout. Searching pinned main found no artifact-export command. The pinned main is tagged v0.2.44, also confirmed as the latest published release. (src/store/envs.rs:866, 9ed6256922b3)
  • Regression coverage and supplied validation: Read all 410 test lines: raw bytes and limits, invalid arguments, traversal, links and special files, source mutation, closed output, and home routing across owned and borrowed checkouts are covered. The captured body reports 30 focused tests and native macOS checks passing; this read-only review did not execute builds or tests. Cross-user downstream qualification is explicitly unclaimed and does not establish a dependency contract for this standalone exporter. (tests/env_artifact_tests.rs:78, a1ff45af8b54)
  • Re-review continuity: The previous completed review contained no findings and identified base integration as its next step. Tree-entry inspection confirms the exporter and handler have identical blob IDs at the previous and current heads. An attempted broader historical diff and blame encountered unavailable historical blobs; no source-line introduction attribution is claimed. (src/env/artifact.rs:1, 03400ffd4452)

Likely related people:

  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-09T06:18:57.196Z sha 46496ba :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T06:56:48.291Z sha 46496ba :: needs changes before merge. :: none
  • reviewed 2026-09-10T14:22:25.590Z sha 46496ba :: needs changes before merge. :: none
  • reviewed 2026-09-10T19:57:38.507Z sha cba9b8f :: needs changes before merge. :: none
  • reviewed 2026-09-10T20:20:21.513Z sha 03400ff :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T20:33:05.536Z sha 03400ff :: needs changes before merge. :: none
  • reviewed 2026-09-10T20:57:42.066Z sha 03400ff :: blocked before merge. :: none

Preserve the reviewed artifact export while incorporating the fixed main
baseline and its existing lifecycle, private-config, and CI changes.

Punchcard-Session: coral-orchard-orchard-d4
Preserve the reviewed artifact export while incorporating the fixed main
baseline and its native dev UI, readiness, and journal-test changes.

Punchcard-Session: coral-orchard-orchard-d4
@vincentkoc
vincentkoc marked this pull request as ready for review September 10, 2026 20:16
Integrate current main while retaining the bounded artifact export contract.
Cover owned and borrowed source registrations through the real CLI, including
source-only rejection and export after a borrowed checkout moves.

Punchcard-Session: coral-orchard-orchard-d4
@vincentkoc
vincentkoc merged commit 1fc114e into main Sep 11, 2026
15 checks passed
@vincentkoc
vincentkoc deleted the fix/performance-candidate-execution branch September 11, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant