Skip to content

fix: keep profiled performance evidence diagnostic - #89

Merged
vincentkoc merged 5 commits into
mainfrom
fix/deep-profile-resource-gating
Aug 4, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
fix/deep-profile-resource-gating

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Related: openclaw/openclaw#119121

What Problem This Solves

Fixes an issue where users running Kova with --node-profile or --deep-profile could get false CPU, RSS, and latency failures caused by profiler overhead. Those diagnostic runs could also be compared with normal runs as if their performance values were equivalent, producing false regressions or false resolutions.

Why This Change Was Made

Kova now records a first-class performance-threshold assessment for every profiled record while preserving raw measurements. The performance owner boundary uses command and process-role provenance, so only values produced by profiled command trees are skipped; persistent Gateway readiness, health, functional behavior, cleanup, containment, malformed evidence, and safety checks remain gateable.

Required release scenarios with skipped performance evidence produce PARTIAL until rerun without profiling. Cross-profile report comparisons return INCONCLUSIVE; same-profile instrumented comparisons remain comparable. Complete profiled records carry an explicit complete-zero assessment so consumers can distinguish "nothing skipped" from erased evidence.

The OpenClaw consumer pins this exact producer, validates assessment and gate-card evidence one-to-one, and keeps PARTIAL and INCONCLUSIVE non-approving. Kova's OpenClaw fixture helper now supports both current canonical config and the legacy list-shaped contract selected by the consumer workflow.

This also removes duplicate command classification between evaluation and profiler attribution. Core runtime delta is +1,173/-110, primarily the provenance taxonomy and first-class assessment, gate, baseline, comparison, and rendering contracts. Fixture support is +69/-28; docs are +45/-2; self-checks and snapshots are +996/-22.

User Impact

Operators can use deep profiling to diagnose OpenClaw without profiler overhead being mistaken for a product regression. Raw profiler-influenced values remain visible, real failures still block, and release approval still requires normal user-path performance evidence.

Evidence

  • Exact Kova head: 0f9e678e239b45db46d2bd930b7983203580df78.
  • Exact OpenClaw consumer: fix(ci): accept profiled partial Kova gates openclaw#119121 at 58654d948334033db9258cb2643e2455fad4d157.
  • Current normal report kova-260804-065059-4340fd:
    • OpenClaw 74d084e00c2de6279de4559ee84c481573d4fd26, mock auth, packaged local-build runtime.
    • One agent-cold-warm-message record passed.
    • Kova returned filtered PARTIAL; the strict consumer accepted it as filtered-partial.
  • Current deep-profile report kova-260804-065210-f02720:
    • Raw agent-process peak RSS remained 1064.6 MB.
    • 15 profiler-affected RSS, CPU, and latency thresholds became explicit SKIPPED assessments.
    • The record passed functional checks, the release gate remained non-approving PARTIAL, and the strict consumer accepted the evidence one-to-one.
  • Intentional negative report kova-260804-065327-b1705c:
    • Auth was intentionally skipped; the agent turn failed and Kova returned DO_NOT_SHIP.
    • The consumer also exited non-zero instead of reclassifying the failure.
  • Historical Kova 283070760a16655b28835061774158b8b11b4aff emitted marker-free kova.report.v1 report kova-260804-065433-f6ac8d:
    • The consumer accepted it only in automatic compatibility mode.
    • Strict current-producer mode rejected it for missing provenance mirrors.
  • Proved clean persistent-Gateway RSS and startup latency still fail their thresholds during a profiled run.
  • Proved command failures, malformed evidence, count thresholds, soak minimum duration, cleanup/invariant failures, and failing role children remain blocking.
  • Proved normal-to-instrumented comparisons are INCONCLUSIVE in both directions, finding-only mismatches cannot return OK, and same-profile instrumented reports remain comparable.
  • Consumer proof: 154/154 focused tests cover historical marker-free v1 reports, strict pinned-producer validation, mixed-contract rejection, complete-zero assessments, required/advisory skipped-threshold cards, repeated-record reconciliation, nullable measurements, erased evidence, malformed cards, count drift, and canonical/legacy fixture selection.
  • npm run check:full: 276/276 self-checks, 21/21 snapshots, web payload check, and release-contract checks passed.
  • GitHub CI: Ubuntu and macOS passed on the exact head; Socket checks passed.
  • Exact-commit autoreview and TruffleHog: clean.
  • Security/trust audit against Kova main 9e52f321e6a3f8999249d16bb53b365759c3b33e found no package, lockfile, installer, or workflow delta; no dependency lifecycle scripts; and no added outbound-network or credential path.

Compatibility Decision

Owner sign-off: accept the additive SKIPPED, PARTIAL, and INCONCLUSIVE report contract. The paired OpenClaw consumer validates pinned current producers strictly, retains marker-free historical kova.report.v1 compatibility, rejects mixed or erased contracts, and keeps incomplete or cross-profile evidence non-approving.

@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 6:03 AM ET / 10:03 UTC.

ClawSweeper review

What this changes

The PR adds provenance-based handling for profiler-affected performance thresholds, gates, baselines, comparisons, reports, and OpenClaw mock-auth fixture contracts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The exact head coherently makes profiled CPU, RSS, and latency evidence diagnostic while retaining functional and persistent-service gates; no blocking patch defect was found. The documented producer-first rollout remains the merge-sensitive condition.

Priority: P2
Reviewed head: 0f9e678e239b45db46d2bd930b7983203580df78

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A well-supported, broad contract repair with no discrete correctness finding in the reviewed head.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body still records exact-head real-run outcomes and green platform checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body still records exact-head real-run outcomes and green platform checks.
Evidence reviewed 7 items Profiler attribution: The new attribution layer limits skipped thresholds to profiled command trees and preserves gateway and other independent measurements.
Gate remains non-approving: Required scenarios with skipped profiled performance evidence are explicitly incomplete and produce PARTIAL rather than SHIP.
Cross-profile comparisons are guarded: Comparison code marks mismatched performance profiles INCONCLUSIVE while retaining same-profile comparisons.
Findings None None.
Security None None.

How this fits together

Kova runs OpenClaw scenarios and turns command, health, and resource measurements into records, release gates, and comparison reports. This PR changes how diagnostic profiling affects those downstream assessments without hiding functional failures.

flowchart LR
  A[OpenClaw scenario] --> B[Commands and measurements]
  B --> C[Profiler attribution]
  C --> D[Threshold assessment]
  D --> E[Release gate]
  D --> F[Baseline comparison]
  E --> G[Kova report]
  F --> G
  G --> H[Paired consumer]
Loading

Before merge

  • Resolve merge risk (P1) - The additive report contract must land producer-first and the paired OpenClaw consumer must retain its immutable producer pin; reversing that order could leave consumer validation unable to interpret the new evidence correctly.
  • Complete next step (P2) - No narrow repair is identified; normal maintainer merge handling should preserve the documented producer-first rollout.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change surface 19 files, +2,283/-162 The report contract spans evaluator, gate, baseline, comparison, rendering, fixture, and self-check paths.
Production versus validation delta runtime +1,173/-110; self-checks/snapshots +996/-22 The substantial contract change is accompanied by focused validation coverage.

Merge-risk options

Maintainer options:

  1. Retain the approved producer-first rollout (recommended)
    Merge this Kova producer first at the reviewed head, then validate and merge the paired consumer with its immutable producer pin.

Technical review

Best possible solution:

Merge this producer at the reviewed exact head first, then refresh and land the paired consumer against the reachable immutable producer commit.

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

Yes, by source: current main sends profiled measurements through ordinary thresholds, while this head adds the explicit profiled assessment path and exercises it in focused self-checks.

Is this the best way to solve the issue?

Yes. Provenance-based suppression preserves raw diagnostics, keeps independent and functional checks gateable, and prevents profiled evidence from approving a release.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9e52f321e6a3.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded release-validation correctness fix with operator-facing performance-report impact.
  • merge-risk: 🚨 compatibility: The new SKIPPED, PARTIAL, and INCONCLUSIVE producer contract must remain synchronized with the paired OpenClaw consumer.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body still records exact-head real-run outcomes and green platform checks.

Evidence

What I checked:

  • Profiler attribution: The new attribution layer limits skipped thresholds to profiled command trees and preserves gateway and other independent measurements. (src/performance/instrumentation.mjs:158, 0f9e678e239b)
  • Gate remains non-approving: Required scenarios with skipped profiled performance evidence are explicitly incomplete and produce PARTIAL rather than SHIP. (src/matrix/gate.mjs:128, 0f9e678e239b)
  • Cross-profile comparisons are guarded: Comparison code marks mismatched performance profiles INCONCLUSIVE while retaining same-profile comparisons. (src/reporting/compare.mjs:195, 0f9e678e239b)
  • Focused regression coverage: The added self-check exercises instrumented threshold suppression, intact functional failures, partial gates, baseline handling, and bidirectional cross-profile comparison behavior. (src/selfcheck.mjs:2564, 0f9e678e239b)
  • Current-main comparison: The PR head is based on current main and introduces the missing producer contract rather than duplicating an implementation already present there. (src/performance/instrumentation.mjs:1, 0f9e678e239b)
  • Recent area history: Performance evaluation on current main was recently maintained in the released agent-RSS change, supporting Vincent Koc as a routing candidate. (src/evaluator.mjs:1, 8c5b9ff6fd63)

Likely related people:

  • Vincent Koc: Authored the current PR and the recent main-branch agent-RSS performance change. (role: recent performance-area contributor; confidence: high; commits: 8c5b9ff6fd63, 0f9e678e239b; files: src/evaluator.mjs, src/performance/instrumentation.mjs, src/reporting/compare.mjs)
  • Peter Steinberger: Introduced the prior release fixture configuration change in the mock-auth helper now extended for legacy contracts. (role: adjacent fixture-contract contributor; confidence: medium; commits: 1bf080f6dbf8; files: support/configure-openclaw-mock-auth.mjs)

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-08-04T06:01:21.873Z sha 2bd33f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T06:22:15.892Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T07:02:02.419Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T07:21:13.768Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T07:28:42.759Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T07:31:54.155Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T09:01:12.251Z sha 0f9e678 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T09:11:27.150Z sha 0f9e678 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Owner compatibility sign-off is recorded in the PR body. The exact OpenClaw consumer adapter is openclaw/openclaw#119121 at e1833ac8d7085a90bf2de266bf1415b60fadf612 with 149/149 focused tests. @clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact producer head: 0f9e678e239b45db46d2bd930b7983203580df78; paired OpenClaw consumer head: 58654d948334033db9258cb2643e2455fad4d157.

Prior before-merge items are resolved:

  • Producer and consumer semantics were reviewed and exercised together. Current instrumented reports select strict validation; real historical marker-free v1 reports retain default compatibility; mixed or partially erased current contracts reject.
  • The PR body is refreshed to the current producer and consumer heads with exact report IDs, hashes, and decisions.
  • The exact Kova trust root was audited: signed commits, unchanged package/lock files, registry-integrity dependencies, zero production audit vulnerabilities, and no added installer, workflow, credential, download, dynamic-eval, or outbound-network surface.

Proof:

  • Kova full check passes: 276/276 selfchecks, 21/21 snapshots, web payload, and release contracts.
  • Kova macOS, Ubuntu, and Socket CI are green.
  • Paired OpenClaw consumer tests pass 154/154.
  • Fresh current normal/deep reports pass as filtered partials, an intentional auth-negative report blocks, and an actual historical Kova v1 report passes automatically but fails under strict mode.
  • Exact-commit autoreview reports no P0/P1 findings.

Please refresh the durable exact-head verdict and Rank-up moves: list.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 0f9e678e239b45db46d2bd930b7983203580df78.

Release-owner decision:

  • The paired consumer is OpenClaw PR fix(ci): accept profiled partial Kova gates openclaw#119121 at 58654d948334033db9258cb2643e2455fad4d157.
  • That consumer validates the additive SKIPPED, PARTIAL, and INCONCLUSIVE contract, rejects partially erased current contracts, and preserves historical marker-free v1 compatibility outside strict current-producer mode.
  • Merge order is Kova producer PR fix: keep profiled performance evidence diagnostic #89 first, then OpenClaw consumer PR #119121. OpenClaw remains pinned to this immutable Kova head, so the producer contract cannot drift between those landings.
  • Exact-head CI and full local Kova validation are green.

Please clear the durable Before merge and Rank-up moves: lists if no new finding remains. Neither PR will be merged before both durable reviews are clear.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 0f9e678e239b45db46d2bd930b7983203580df78.

Release-owner decision:

  • The paired consumer is OpenClaw PR fix(ci): accept profiled partial Kova gates openclaw#119121 at 58654d948334033db9258cb2643e2455fad4d157.
  • That consumer validates the additive SKIPPED, PARTIAL, and INCONCLUSIVE contract, rejects partially erased current contracts, and preserves historical marker-free v1 compatibility outside strict current-producer mode.
  • Merge order is Kova producer PR fix: keep profiled performance evidence diagnostic #89 first via merge commit, then OpenClaw consumer PR #119121. The merge commit preserves signed head 0f9e678e on Kova main; squashing would require a new OpenClaw pin, proof run, and exact-head review, so it will not be used.
  • Exact-head CI and full local Kova validation are green.

Please clear the durable Before merge and Rank-up moves: lists if no new finding remains. Neither PR will be merged before both durable reviews are clear.

@vincentkoc
vincentkoc marked this pull request as ready for review August 4, 2026 07:26
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head 0f9e678e239b45db46d2bd930b7983203580df78 has completed maintainer review and is approved for the documented paired rollout. Kova PR #89 must land first via merge commit so this signed exact head remains reachable, then OpenClaw PR #119121 must land with the immutable pin. All exact-head Kova checks are green, and the owner decision is recorded at #89 (comment).

Please refresh the durable Before merge list against this completed producer-first decision.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Release-owner audit and approval for exact head 0f9e678e239b45db46d2bd930b7983203580df78:

  • directly read the changed evaluator, gate, baseline, instrumentation, report-comparison, renderer, command-executor, runner, fixture, docs, and selfcheck paths
  • all five commits from origin/main through the exact head have valid signatures from the expected maintainer key
  • the head branch is owned by openclaw/Kova; GitHub reports it mergeable and clean
  • package.json and package-lock.json have the same Git blob IDs as origin/main; there is no dependency or lockfile delta
  • the source adds no outbound network, credential-read, install-hook, or dependency-execution path
  • profiler environment changes remain bounded to non-service product commands; persistent service commands do not inherit profiler NODE_OPTIONS
  • functional failures, timeouts, malformed evidence, cleanup/safety contracts, profiling-artifact thresholds, gateway-only measurements, and minimum-duration contracts remain blocking
  • exact-head Ubuntu and macOS CI are green

I approve the coordinated rollout in this order:

  1. merge Kova fix: keep profiled performance evidence diagnostic #89 at 0f9e678e239b45db46d2bd930b7983203580df78
  2. retain that immutable pin in OpenClaw #119121
  3. refresh OpenClaw exact-head proof after the producer merge, then merge the consumer

Do not release or merge the consumer before the producer is landed at this SHA.

@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Maintainer decision for exact head 0f9e678e239b45db46d2bd930b7983203580df78: approve the additive SKIPPED, PARTIAL, and INCONCLUSIVE producer contract and the documented producer-first rollout.

  • This Kova producer PR will land before OpenClaw consumer PR fix(ci): accept profiled partial Kova gates openclaw#119121.
  • The consumer remains open until this exact SHA is reachable from Kova main.
  • The exact source and lockfile were directly audited; package and lock blobs are unchanged from Kova main, commits are signed, and the delta adds no installer, credential-read, dynamic-eval, or outbound-network path.
  • Exact-head CI is green.

The ordering concern is resolved for this producer PR; no consumer merge will occur first.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Maintainer decision for exact head 0f9e678e239b45db46d2bd930b7983203580df78: producer-first rollout is approved.

Kova #89 will land before OpenClaw #119121, preserving this exact signed SHA. The exact upstream source and lockfile were directly audited, and the consumer remains blocked until this producer commit is reachable from Kova main.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 4, 2026
@vincentkoc
vincentkoc merged commit a39dd64 into main Aug 4, 2026
12 checks passed
@vincentkoc
vincentkoc deleted the fix/deep-profile-resource-gating branch August 4, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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