Repository navigation
refactor: remove unread private owner projections - #178345
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Agent review detailsHow this fits togetherPrivate 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
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 729f30224f07. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -103, Tests -36. Total -139 across 19 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 7:11 AM ET / 11:11 UTC. |
|
Merged via squash.
|
* refactor: remove unread private owner projections * test(matrix): remove obsolete device health mock
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.
* 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.
…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.
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.
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.