Skip to content

fix(performance): collect diagnostics across the OCM transport - #123

Merged
vincentkoc merged 7 commits into
mainfrom
fix/performance-ocm-transport
Sep 11, 2026
Merged

vincentkoc merged 7 commits into
mainfrom
fix/performance-ocm-transport

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Collectors need bounded diagnostics without mistaking accepted stop requests for shutdown.

Why This Change Was Made

Preserves bounded exports, closed active snapshots, exit-flushed profiles and
native/mock-provider lifecycles. One shared deadline checks exact-environment
shutdown; unknown shutdown withholds final export/destruction, preserving
original failure and unrelated cleanup.

Base: main, including landed #125.
Export dependency: openclaw/ocm#171, landed as
1fc114e4.

User Impact

Kova provides operator-configured argv/export transport, not UID, permissions,
sudo or immutable-input provisioning. Caller-selected measurement destinations
require noncandidate-writable ancestors. OCM shutdown confirmation orders
collection, not UID extinction.

Before openclaw/openclaw#127240 activates, its outer
harness must prove privileged-UID quiescence and candidate-write denials.
This integrated proof remains unpassed and is required before activation.

Evidence

  • Head: d41d871ec325fc7707b34857c4b10fd756586359; 13 files, +850/-113,
    patch-identical restack.
  • Retained 86bbc79f5bd38f6121ddc6968d25d7f327f7c67a proof: six intended red,
    12 lifecycle/31 boundary passes; closed-stdout destination preserved,
    zero temporary files; scoped review zero P0-P2.
  • Real-subprocess byte, deadline, exit, settlement, destination-preservation
    and lifecycle proof qualifies transport, not OS confinement.
  • Exact-head CI:
    Ubuntu/macOS checks and install smoke passed; CodeQL passed.
  • Joint Linux/sudo/cloud proof remains unrun.

Punchcard-Session: coral-orchard-orchard-d4

Route OCM commands through a configured candidate-principal transport while
keeping evaluation, mock-provider ownership, and retained reports on the
measurement principal. Bound diagnostic exports, snapshot active artifacts,
and join owned export cleanup before returning.

Preserve baseline and candidate instrumentation, support the selected release
scenarios, and cover nested calls, mock auth, timeout cleanup, and teardown
ordering. Native Linux cross-UID and sudo behavior remain draft proof gaps.

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 commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 11, 2026, 6:03 AM ET / 10:03 UTC (Revision 12).

ClawSweeper review

What this changes

Kova gains bounded diagnostic exports, active-file snapshots, and shutdown-aware profile retention for four OpenClaw performance scenarios run through OCM across users.

Merge readiness

⛔ Blocked before merge - 6 items remain

This remains useful work beyond the merged transport foundation. The earlier shutdown defect is addressed, and no additional concrete correctness defect was established; the required cross-principal boundary evidence remains outstanding.

Priority: P2
Reviewed head: d41d871ec325fc7707b34857c4b10fd756586359

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused fault coverage are useful, but the material authority boundary remains insufficiently demonstrated.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the production exporter now retains candidate diagnostics under measurement authority, but the captured body explicitly leaves cross-principal and sudo-cleanup acceptance unrun. Reported real-subprocess deadline recovery remains useful; it does not demonstrate allowed exports, denied candidate writes, or privileged candidate-UID quiescence. The member-author exemption remains intact for unrelated proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the production exporter now retains candidate diagnostics under measurement authority, but the captured body explicitly leaves cross-principal and sudo-cleanup acceptance unrun. Reported real-subprocess deadline recovery remains useful; it does not demonstrate allowed exports, denied candidate writes, or privileged candidate-UID quiescence. The member-author exemption remains intact for unrelated proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 10 items Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer notes were found. Applied its OpenClaw-focused reporting, harness boundary, and cleanup guidance. No scenarios or tests were executed.
Distinct work remains beyond main: The pinned main implementation rejects configured cross-user scenario execution pending diagnostic integration. GitHub verifies #125 merged the invocation foundation, not this collection integration. No implemented-on-main or shipped-fix conclusion is supported.
Introduced artifact authority boundary: The introduced collection code validates relative inventory paths, restricts staged files to the selected environment directory, and selects measurement-side destinations itself. The exporter independently bounds bytes, requires successful process termination, and renames a completed temporary file.
Findings None None.
Security Needs attention Separate-principal artifact isolation remains unproven: The production exporter writes candidate bytes under measurement authority. Source constrains destinations, but the submitted evidence explicitly leaves candidate write denial against retained artifacts, their ancestors, and executable inputs untested across actual users.

How this fits together

Kova measures OpenClaw runtimes managed by OCM. This integration moves candidate-generated diagnostics into measurement-owned storage before existing collectors and evaluators consume them.

flowchart LR
  A[Performance scenario] --> B[OCM candidate runtime]
  B --> C[Candidate diagnostic staging]
  C --> D[Bounded export and validation]
  D --> E[Measurement-owned artifacts]
  E --> F[Collectors and evaluator]
  B --> G[Observe shutdown]
  G --> D
  G --> H[Environment cleanup]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the production exporter now retains candidate diagnostics under measurement authority, but the captured body explicitly leaves cross-principal and sudo-cleanup acceptance unrun. Reported real-subprocess deadline recovery remains useful; it does not demonstrate allowed exports, denied candidate writes, or privileged candidate-UID quiescence. The member-author exemption remains intact for unrelated proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security concern: Separate-principal artifact isolation remains unproven - The production exporter writes candidate bytes under measurement authority. Source constrains destinations, but the submitted evidence explicitly leaves candidate write denial against retained artifacts, their ancestors, and executable inputs untested across actual users.
  • Resolve merge risk (P1) - The newly enabled cross-user runs rely on measurement-owned inputs and artifact ancestors remaining inaccessible to candidate writes; separate-principal final-effect evidence is explicitly pending.
  • Resolve merge risk (P1) - Launcher settlement and candidate-reported shutdown do not establish that all candidate descendants are gone; privileged UID cleanup remains unproven.
  • Resolve merge risk (P1) - Configured diagnostic collection requires the still-unmerged OCM export dependency and cannot be qualified against an OCM build lacking that command.
  • Complete next step (P2) - Land feat: export bounded environment artifacts ocm#171 and add the required cross-principal export, write-denial, and privileged cleanup evidence. Redacted terminal output or logs are suitable; screenshots or recordings can supplement them. Remove private addresses, credentials, and endpoints, then update the PR body to trigger review; if needed, ask a maintainer to comment @clawsweeper re-review.

Findings

  • [medium] Separate-principal artifact isolation remains unproven — src/ocm/transport.mjs:153
Agent review details

Security

Needs attention: No concrete authorization bypass was established, but the introduced cross-principal storage boundary still requires final-effect proof.

Review metrics

Metric Value Why it matters
Production and test delta Production +414/-25; tests +369/-67; documentation +67/-21 Production growth implements the stated diagnostic transport and shutdown lifecycle; tests cover export faults and lifecycle ordering.

Merge-risk options

Maintainer options:

  1. Complete boundary qualification (recommended)
    Land the required OCM export dependency and supply allowed-export, denied-write, and privileged cleanup evidence before merging.
  2. Keep the integration pending
    Leave this PR open while the dependency and cross-principal acceptance evidence are completed.

Technical review

Best possible solution:

Retain the bounded transport design and qualify it with compatible OCM, demonstrated measurement-storage isolation, and confirmed candidate-UID cleanup while preserving native operation.

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

Not applicable as an existing-behavior bug: main intentionally blocks this mode pending integration. Source and fixture coverage establish the proposed paths, but this review did not execute them.

Is this the best way to solve the issue?

Yes, provisionally: extending the landed transport with bounded exports and explicit shutdown observation is cohesive; operating-system boundary qualification is still needed.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded performance-lab integration without evidence of an urgent shipped-user regression.
  • merge-risk: 🚨 security-boundary: The patch enables candidate diagnostics to cross into measurement-owned storage without completed separate-principal isolation proof.
  • merge-risk: 🚨 availability: Cross-user cancellation can leave candidate descendants alive, and required privileged cleanup has not been demonstrated.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the production exporter now retains candidate diagnostics under measurement authority, but the captured body explicitly leaves cross-principal and sudo-cleanup acceptance unrun. Reported real-subprocess deadline recovery remains useful; it does not demonstrate allowed exports, denied candidate writes, or privileged candidate-UID quiescence. The member-author exemption remains intact for unrelated proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Separate-principal artifact isolation remains unproven — src/ocm/transport.mjs:153
    The production exporter writes candidate bytes under measurement authority. Source constrains destinations, but the submitted evidence explicitly leaves candidate write denial against retained artifacts, their ancestors, and executable inputs untested across actual users.
    Confidence: 0.96

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer notes were found. Applied its OpenClaw-focused reporting, harness boundary, and cleanup guidance. No scenarios or tests were executed. (AGENTS.md:1, d41d871ec325)
  • Distinct work remains beyond main: The pinned main implementation rejects configured cross-user scenario execution pending diagnostic integration. GitHub verifies feat(ocm): support cross-user command and config transport #125 merged the invocation foundation, not this collection integration. No implemented-on-main or shipped-fix conclusion is supported. (src/runner.mjs:76, f3bcd5354e59)
  • Introduced artifact authority boundary: The introduced collection code validates relative inventory paths, restricts staged files to the selected environment directory, and selects measurement-side destinations itself. The exporter independently bounds bytes, requires successful process termination, and renames a completed temporary file. (src/ocm/diagnostics.mjs:80, d41d871ec325)
  • Earlier shutdown finding addressed: Shutdown now requires the exact environment's running and desiredRunning fields to become false within a shared deadline. Unconfirmed shutdown withholds final export and destruction while guarded cleanup continues. These files are unchanged from the retained reviewed head. (src/run/teardown.mjs:205, d41d871ec325)
  • Proof scope and continuity: The complete supplied body at sourceRevision 0fc803c2c08021efd2f75356d8ea94e915be1234f6374216b22087d6a9850635 reports retained subprocess deadline recovery, 12 lifecycle cases and 31 boundary passes, but explicitly says joint Linux cross-principal and sudo-cleanup proof remains unrun. Both retained rank-up requests therefore remain applicable; ordinary member-author proof exemptions remain intact. (d41d871ec325)
  • Tests distinguish process recovery from user isolation: The tests exercise the production exporter against real subprocess faults, including stdout closing before process exit, and assert destination preservation and launcher settlement. Scenario lifecycle coverage uses a fixture OCM and a same-user Node prefix, so it does not establish operating-system isolation between candidate and measurement users. (tests/ocm-transport.mjs:232, d41d871ec325)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide compatible-OCM evidence of successful exports and denied candidate writes to measurement artifacts, their ancestors, and executable inputs.
  • Demonstrate privileged candidate-UID quiescence after timeout and shutdown.

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-09T09:43:19.249Z sha ca0705a :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-10T15:01:31.583Z sha 0081d98 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-10T15:07:47.559Z sha 0081d98 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-10T15:19:01.713Z sha 0081d98 :: needs real behavior proof before merge. :: [P2] [P2] Observe shutdown completion before exporting final profiles
  • reviewed 2026-09-10T18:51:20.273Z sha 86bbc79 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-10T19:29:27.213Z sha 86bbc79 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-11T09:26:59.742Z sha 86bbc79 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-11T09:50:14.290Z sha d41d871 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
Race the combined exporter-exit and copy wait against an independently
rejecting absolute deadline. Preserve stream cancellation, bounded launcher
and file-pipeline settlement, and the previous complete destination.

Cover a launcher that emits bytes, closes stdout, and remains alive with a
failure-only outer watchdog and owned-process cleanup.

Punchcard-Session: coral-orchard-orchard-d4
Route direct and nested OCM calls through structured argv with explicit
candidate cwd and environment. Keep fixed state writers and bounded config
reads behind the same transport while preserving native operation.

Block configured scenario execution before provisioning until the dependent
diagnostic collection unit is present. This foundation does not yet provide
isolated benchmark execution.

Punchcard-Session: coral-orchard-orchard-d4
Merge the reviewed command and config transport foundation beneath the
existing diagnostic collection unit. Preserve both branch histories and
the complete ca0705a tree, including the closed-stdout deadline repair.

The dependent unit enables the four supported performance scenarios with
candidate-owned staging, bounded exports, and stop-export-destroy cleanup.
Focused lifecycle and deadline tests passed. Native Linux cross-UID and
sudo behavior remain explicit proof gaps.

Punchcard-Session: coral-orchard-orchard-d4
@vincentkoc vincentkoc changed the title fix(performance): isolate OCM execution and diagnostic transport fix(performance): collect diagnostics across the OCM transport Sep 10, 2026
@vincentkoc
vincentkoc changed the base branch from main to fix/performance-ocm-command-transport September 10, 2026 15:03
Punchcard-Session: coral-orchard-orchard-d4
Propagate the reviewed command transport repair and preserve candidate artifacts when shutdown cannot be confirmed.

Punchcard-Session: coral-orchard-orchard-d4
@vincentkoc
vincentkoc marked this pull request as ready for review September 10, 2026 19:18
Base automatically changed from fix/performance-ocm-command-transport to main September 11, 2026 09:22
@vincentkoc
vincentkoc requested a review from a team as a code owner September 11, 2026 09:22
Merge captured main while preserving the reviewed diagnostic transport delta and current CPU accounting.

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

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant