Skip to content

refactor: remove unread private owner projections - #178345

Merged
steipete merged 2 commits into
mainfrom
deslop/z38-16-unread-owner-projections-20261015
Oct 20, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z38-16-unread-owner-projections-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several private producers still build facts that their callers no longer read. Remove those facts and the work performed only to construct them, leaving their existing owners and observable behavior intact.

  • Claw workspace errors no longer assemble diagnostic/partial-file arrays after feat: add Claws as ordinary agents and resources #171623 retired their reader. Bootstrap errors no longer copy an unread code. All source/path/digest checks, create-only writes, authority checks, rollback, successful records, error names and visible messages stay.
  • Tool-loop results lose the unread liveness marker and its copies. Real churn classification, warning/block decisions and separately recorded recovery observations stay.
  • Browser adapters lose four internal capability flags that neither named consumers nor dynamic action tables read. Actual operation gates, single-page limits, config and status contracts stay.
  • Safe-bin policy no longer returns a test-only writable-directory report. The exact operator warning, permission checks when warning, and allowlist/trust decisions stay.
  • Matrix health returns its only consumed value—the stale OpenClaw-device list—instead of a report with unread current-device projections. Startup, pruning and account setup share that predicate. Public device results, warning text and current-device deletion protection stay.
  • QA credential admin errors lose the unread HTTP status copy. CLI code/message output, actual HTTP error messages, authentication, response limits and broker contracts stay.

Production: +35/-138, 103 net lines removed across 13 production paths. Complete candidate: 20 paths, +45/-189. Tests, support, fixtures, generated and declaration files are excluded from production LOC. Base: e449e9ad3fcd44f013a1dc577d871ff0cb6dcee4.

Best-effort tradeoffs accepted

No runtime guard is removed or weakened. The deleted facts have no production consumer; no new timing or failure tradeoff is introduced. Claw diagnostic/code readers were retired by the completed ordinary-agent Add cutover (#171623). The browser engine extraction (#154508) is complete; the remaining Docker follow-up does not activate the removed flags. Churn recovery from #112620 remains intact.

Per-field whole-tree, Gateway, SDK, dynamic-access, serialization and introducing/retired-reader checks are recorded in the lane census. Phase E standalone session memory, its factory, registry, expiry, federation and tests remain untouched. No configuration, schema, persisted shape, permission, retention, durability, dependency or protocol change.

Evidence

Author simplification completed: remove unused projections and obsolete field-only assertions without replacing them with another owner or abstraction. Matrix's existing stale-device, pruning and startup-warning cases retain their meaningful assertions.

Frozen installation passed. Explicit-root core, browser and Matrix/QA consumer type graphs, canonical type-aware lint and formatting passed. Final runtime/Madge cycles are zero/zero; changed-planner dry-run and whitespace passed. Fresh independent P0–P2 review is scoped-clean (0.98), with final source verification. Final pre-push lint-suppression tests passed (14/14, 7.835 seconds test time; 32.57 seconds wrapper wall). No broad gate or runtime suite is relabeled as local proof.

Ordinary Node runtime selections on the previous branch required prohibited shared whole-tree compiler preparation and were stopped before cases. That unsupported local route is not retried or claimed as passing here. Exact-head PR CI owns runtime, broad types/check-changed, build, platform and E2E proof under the campaign host budget. No live Matrix, browser or credential-service execution is claimed.

The first exact-head CI run passed runtime, UI, types, lint and security, but caught one PR-caused stale Matrix mock-export allowance. The repair deletes that now-unused mock (startup maintenance is already mocked independently) and shrinks its exact baseline row. Local mock-export ratchet passed (8,112 grandfathered factories), type-aware helper lint passed, and suppression tests passed 14/14 (7.126 seconds test time; 25.26 seconds wrapper). Fresh independent repair review is scoped-clean (0.99). No assertions or production code changed in the repair; the new exact-head CI remains the landing gate. No CI rerun was requested.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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.

@steipete
steipete marked this pull request as ready for review October 20, 2026 10:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T10:53:02.475828Z 8be91f8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 803b31d254fec086ffa3fc2661aa3a3c258cb2df
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/infra/exec-safe-bin-runtime-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes unused private result fields and consolidates Matrix stale-device filtering in its existing owner.

Example: Matrix lists current device du314Zpw3A and stale OpenClaw device BritdXC6iL.

  • Before: Startup warns about BritdXC6iL, and pruning excludes du314Zpw3A.
  • After: The same warning and pruning behavior remain, without constructing unused current-device projections.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The production cleanup is coherent, but the introduced mock-ratchet violation blocks the current patch.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is outside the ordinary contributor proof gate; the body explicitly claims no live Matrix, browser, or credential-service execution, and no authority-bearing value or persisted format changes.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; private producers perform unnecessary work constructing facts their consumers no longer read.
Reason: The maintainer-directed change reduces maintenance and runtime work while retaining the existing owners, public outputs, and operation guards.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This maintainer-directed cleanup is useful and preserves the inspected production behavior, but the changed Matrix mock violates the export-preservation ratchet and needs repair.

Priority: P3
Reviewed head: 8be91f8b888a42a29ee6a2fb319559ef3def3618

Before merge

  • Preserve real exports in the renamed Matrix mock (P2) - Renaming this closed factory changes its token fingerprint, so its existing allowance in config/test-mock-exports-baseline.txt no longer matches. scripts/check-test-mock-exports.mts rejects the replacement factory and the stale allowance; exact-head CI also reports mock-exports failing. Use importOriginal pass-through, as startup.test.ts already does, and prune the obsolete baseline entry rather than replacing its fingerprint.

Findings

  • [P2] Preserve real exports in the renamed Matrix mock — extensions/matrix/src/matrix/monitor/index.test-helpers.ts:304-306
Agent review details

How this fits together

Private producers supply Claw file-write results, tool-loop decisions, browser capabilities, Matrix device selections, safe-bin policy, and QA credential errors to their existing runtime and CLI consumers.

flowchart TD
  A[CLI and runtime callers] --> B[Existing operation owners]
  B --> C[Validation and authority checks]
  C --> D[Filesystem and transport operations]
  B --> E[Consumed results and warnings]
  E --> A
Loading

Technical review

Best possible solution:

Keep the production simplification, preserve real exports in the Matrix mock, and prune its obsolete baseline entry.

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

The mock-ratchet failure follows directly from the changed factory tokens, unchanged exact baseline, and scanner implementation; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Removing unread projections at their producers is the smallest complete cleanup, and the migrated Matrix predicate preserves all inspected callers' selections.

Full review comments:

  • [P2] Preserve real exports in the renamed Matrix mock — extensions/matrix/src/matrix/monitor/index.test-helpers.ts:304-306
    Renaming this closed factory changes its token fingerprint, so its existing allowance in config/test-mock-exports-baseline.txt no longer matches. scripts/check-test-mock-exports.mts rejects the replacement factory and the stale allowance; exact-head CI also reports mock-exports failing. Use importOriginal pass-through, as startup.test.ts already does, and prune the obsolete baseline entry rather than replacing its fingerprint.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Claw workspace error projections keeps the original intent (ebe2420: The former managed-workspace lifecycle carried diagnostic and partial-file evidence; the ordinary-agent Add cutover retired those readers and now owns rollback.)
  • Claw bootstrap error codes keeps the original intent (60fc2fe: Portable-profile bootstrap added integrity diagnostics; this PR retains checks, error names, and messages while removing the unread code copy.)
  • Tool-loop liveness projection keeps the original intent (79c517d: Stable argument churn required warning-only classification and owner-bound recovery; current admission records the recovery observation independently of the removed result marker.)
  • Browser engine capabilities keeps the original intent (0a5178c: Engine adapters centralized Chromium and Lightpanda differences; the removed flags have no inspected consumer, and operation gates and page limits remain.)
  • Matrix device-health projection keeps the original intent (94693f7: The health summary separated current and stale managed devices; the replacement preserves the consumed stale-device predicate and public current-device results.)
  • Safe-bin diagnostic projection keeps the original intent (4355e08: Trusted-directory diagnostics report writable directories to operators; this PR retains the warning and trust decisions while dropping the test-only returned report.)
  • QA credential HTTP error projection keeps the original intent (3d07dfb: Credential administration supplied structured errors; CLI consumers retain the consumed code and message, including the HTTP failure message.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4355e08 adds src/infra/exec-safe-bin-runtime-policy.ts:127 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4355e0826202; files: src/infra/exec-safe-bin-runtime-policy.ts)
  • Vincent Koc: Raw commit 0a5178c adds extensions/browser/src/browser/engines/types.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0a5178c483b5; files: extensions/browser/src/browser/engines/types.ts)
  • WhatsSkiLL: Raw commit 79c517d adds src/agents/tool-loop-argument-churn.ts:57 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 79c517df8942; files: src/agents/tool-loop-argument-churn.ts)

PR surface

Source -103, Tests -36. Total -139 across 19 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 13 35 138 -103
Tests 6 11 47 -36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 46 185 -139

Review metrics

Metric Value Why it matters
Production versus test change Production +35/-138; tests and support +11/-47 The reduction removes unused projections and obsolete field assertions without adding replacement machinery.

Labels

Label changes:

  • add P3: This is behavior-preserving maintenance with a focused test-validation repair and no established user-facing regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is behavior-preserving maintenance with a focused test-validation repair and no established user-facing regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 20, 2026, 7:11 AM ET / 11:11 UTC.

@steipete
steipete merged commit 7d46d41 into main Oct 20, 2026
144 of 146 checks passed
@steipete
steipete deleted the deslop/z38-16-unread-owner-projections-20261015 branch October 20, 2026 11:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
* refactor: remove unread private owner projections

* test(matrix): remove obsolete device health mock
steipete added a commit that referenced this pull request Oct 23, 2026
Prune 70 stale max-lines entries (508 -> 438). Reconcile the counted OPENCLAW_* budget from 452 -> 461 and rename the internal agent FTS schema constant.

Record FACTORY_GITHUB_PROOF, FACTORY_ACTOR_ID, FACTORY_SESSION_KEY (#173668), IMAGE_ACTIVATION_CAPTURE_MARKER (#173711), UPDATE_DOCTOR_HISTORICAL_SCANS (#177933), SESSION_WATCHDOG (#176915), PACKAGE_PERMISSIONS_REPAIRED (#175423), PLUGIN_NPM_ROOTS_FALLBACK (#176121), DISABLE_CRON_HOST_EXECUTION and DISABLE_GATEWAY_LOCAL_TERMINALS (#177855), and the removal of DEVICE_NAME_PREFIX (#178345). All names above use the OPENCLAW_ prefix. AGENT_FTS_SCHEMAS is an internal constant, not an environment variable.
steipete added a commit that referenced this pull request Oct 23, 2026
* fix(ci): block baseline inventory drift in CI and keep shard size advisory

The max-lines suppression inventory and the OPENCLAW_* budget used the limit
severity policy, so GitHub Actions only annotated a tree that disagreed with
its own inventory. Main absorbed moved suppressions, stale entries, and
unrecorded env names with green CI, and every later local ratchet run failed
on debt the branch did not create.

Inventory/tree consistency (unlisted suppression, stale entry, name count
different from the budget) now blocks everywhere, like the sibling shrink
ratchets. Growth relative to the merge base keeps the limit policy so
owner-approved growth still lands with a CI warning.

The core tsgo shard root budget is a shared cost signal its contract marks
advisory; routing it through the limit reporter made it locally fatal. It now
warns everywhere.

Proof: new ratchet and env-budget regressions fail on the base scripts and
pass with the fix; the real boundary check on main's shard layout exits 0 with
four advisory warnings instead of failing.

* ci(tsgo): rebalance core test shards under the root budget

agents-tools (722), gateway-root (725), infra (728), and plugins-platform
(728) exceeded the advisory 720-root limit. Move whole test globs to shards
with headroom: src/media to messaging, src/acp to gateway-other,
src/security to config-cli, and root src/gateway/github* to gateway-methods.
The largest shard is now 719 roots and exactly-once ownership holds.

Messaging test-root selection of the shard guard now includes src/media.

* ci(tsgo): move agents CLI backend tests into the commands shard

Newer main tests pushed agents-root to 722 roots. Root-level
src/agents/cli-*.test.ts files join the commands shard, which already owns
src/agents/command and CLI program tests: agents-root 693, commands 516.

* test(ui): split chat message rendering coverage

Preserve current main coverage across grouping, markdown, tools, attachments, and images, sharing render lifecycle and attachment fixtures. Keep all 59 direct cases and eight parameterized declarations, expanding to the same 79 passing tests.

The image disclosure case now waits for its lazy renderer instead of depending on an earlier image test. All seven files have line-cap headroom; UI types and scoped lint pass. Independent review found no actionable P0-P2 defects.

* chore(ci): reconcile max-lines baseline and env budget with main

Prune 70 stale max-lines entries (508 -> 438). Reconcile the counted OPENCLAW_* budget from 452 -> 461 and rename the internal agent FTS schema constant.

Record FACTORY_GITHUB_PROOF, FACTORY_ACTOR_ID, FACTORY_SESSION_KEY (#173668), IMAGE_ACTIVATION_CAPTURE_MARKER (#173711), UPDATE_DOCTOR_HISTORICAL_SCANS (#177933), SESSION_WATCHDOG (#176915), PACKAGE_PERMISSIONS_REPAIRED (#175423), PLUGIN_NPM_ROOTS_FALLBACK (#176121), DISABLE_CRON_HOST_EXECUTION and DISABLE_GATEWAY_LOCAL_TERMINALS (#177855), and the removal of DEVICE_NAME_PREFIX (#178345). All names above use the OPENCLAW_ prefix. AGENT_FTS_SCHEMAS is an internal constant, not an environment variable.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…aw#179181)

* fix(ci): block baseline inventory drift in CI and keep shard size advisory

The max-lines suppression inventory and the OPENCLAW_* budget used the limit
severity policy, so GitHub Actions only annotated a tree that disagreed with
its own inventory. Main absorbed moved suppressions, stale entries, and
unrecorded env names with green CI, and every later local ratchet run failed
on debt the branch did not create.

Inventory/tree consistency (unlisted suppression, stale entry, name count
different from the budget) now blocks everywhere, like the sibling shrink
ratchets. Growth relative to the merge base keeps the limit policy so
owner-approved growth still lands with a CI warning.

The core tsgo shard root budget is a shared cost signal its contract marks
advisory; routing it through the limit reporter made it locally fatal. It now
warns everywhere.

Proof: new ratchet and env-budget regressions fail on the base scripts and
pass with the fix; the real boundary check on main's shard layout exits 0 with
four advisory warnings instead of failing.

* ci(tsgo): rebalance core test shards under the root budget

agents-tools (722), gateway-root (725), infra (728), and plugins-platform
(728) exceeded the advisory 720-root limit. Move whole test globs to shards
with headroom: src/media to messaging, src/acp to gateway-other,
src/security to config-cli, and root src/gateway/github* to gateway-methods.
The largest shard is now 719 roots and exactly-once ownership holds.

Messaging test-root selection of the shard guard now includes src/media.

* ci(tsgo): move agents CLI backend tests into the commands shard

Newer main tests pushed agents-root to 722 roots. Root-level
src/agents/cli-*.test.ts files join the commands shard, which already owns
src/agents/command and CLI program tests: agents-root 693, commands 516.

* test(ui): split chat message rendering coverage

Preserve current main coverage across grouping, markdown, tools, attachments, and images, sharing render lifecycle and attachment fixtures. Keep all 59 direct cases and eight parameterized declarations, expanding to the same 79 passing tests.

The image disclosure case now waits for its lazy renderer instead of depending on an earlier image test. All seven files have line-cap headroom; UI types and scoped lint pass. Independent review found no actionable P0-P2 defects.

* chore(ci): reconcile max-lines baseline and env budget with main

Prune 70 stale max-lines entries (508 -> 438). Reconcile the counted OPENCLAW_* budget from 452 -> 461 and rename the internal agent FTS schema constant.

Record FACTORY_GITHUB_PROOF, FACTORY_ACTOR_ID, FACTORY_SESSION_KEY (openclaw#173668), IMAGE_ACTIVATION_CAPTURE_MARKER (openclaw#173711), UPDATE_DOCTOR_HISTORICAL_SCANS (openclaw#177933), SESSION_WATCHDOG (openclaw#176915), PACKAGE_PERMISSIONS_REPAIRED (openclaw#175423), PLUGIN_NPM_ROOTS_FALLBACK (openclaw#176121), DISABLE_CRON_HOST_EXECUTION and DISABLE_GATEWAY_LOCAL_TERMINALS (openclaw#177855), and the removal of DEVICE_NAME_PREFIX (openclaw#178345). All names above use the OPENCLAW_ prefix. AGENT_FTS_SCHEMAS is an internal constant, not an environment variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: matrix Channel integration: matrix extensions: browser extensions: qa-lab P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant