Repository navigation
refactor: share runtime parsing and routing owners - #180175
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. |
9e477aa to
f72e238
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces repeated parsing, routing, filesystem, and FIFO implementations with shared internal owners while preserving existing behavior. Example: The ops agent uses mainKey "work" and receives a forced heartbeat target of "agent:ops:subagent:child".
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the consolidation is useful, and no actionable introduced bug was found; exact-head CI remains unresolved. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThese internal helpers sit between CLI arguments, provider payloads, filesystem paths, and session configuration and their runtime consumers, producing parsed values, canonical paths, routing selections, and bounded deduplication state. flowchart TD
A[CLI arguments and runtime payloads] --> B[Shared parsing owners]
C[Session configuration] --> D[Heartbeat target owner]
E[Filesystem paths] --> F[Shared path owners]
B --> G[Core and package consumers]
D --> G
F --> G
Technical reviewBest possible solution: Retain the shared internal owners and preserved consumer contracts, with exact-head CI failures attributed before clearance. Do we have a high-confidence way to reproduce the issue? This PR reports duplicated implementations rather than a broken user flow; source comparison confirms those duplicated algorithms and their shared replacements. Is this the best way to solve the issue? The consolidation fits the existing owners, removes replaced implementations, and keeps meaningful differences such as Doctor global-store routing and asynchronous versus ancestor-based realpath fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 461123273058. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -248, Tests +228, Other +6. Total -14 across 64 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 21, 2026, 11:20 PM ET / October 22, 2026, 03:20 UTC. |
Exact-head inherited failure evidence for #180175Standing Peter campaign instruction authorizes landing after every failure is attributed. Head f72e238, completed pull_request CI run39714358517 attempt1. Actual fetched checkout15c14dcff37b85e44e18f0bb6bd1099a021375f2 has ordered parents cce29b2 and f72e; treef675da22fd1ade545cd66af2cb62d02804858f15. All170 check runs were enumerated; no pending or missing runtime suite. Independent security-fast119613284297 passed. No failed CI is claimed green.
Merge replay141568ms and actual-parent baseline131416ms each run the same seven selected cases plus eight existing selector exclusions. Both pass allowlist=false. CI Linux/Node24 versus local macOS/Node26-wrapper difference is explicit; both local sides use identical environment and pinned Bun. Five exact errors on base, six on merge; the sixth baseline timeout is not evidence by itself. The stronger causal proof is the actual physical-owner regression: unchanged production throws transferRegistrationTo160/adopt99; the four-line no-op after live-owner validation fixes that regression plus every selected catalog case. Distinct-owner collision/transfer and authority/disposal guards unchanged. Actual main-parent→merge only catalog-reader change removes private duplicate auth preparation already performed by its outer owner. It does not change the self-transfer owner; fixture warm auth and outer boundary preparation remain. No speculative auth restoration, whole-family rollback or security-guard deletion selected. The current-main bug fix is separate from this cleanup and receives no deletion credit. Coordinator main-flakes checked; no matching custody/scaffold entry. Last six completed scheduled ci.yml runs refreshed:39712703143,39707038848,39703131373,39693906280,39687169253,39679539559. Earlier six inventories were read; newest39712703143 has its own Windows/macOS/dependency/core failures and is not asserted matching. Source equality, serial five-case baseline reproduction and independently proven main-owner defect establish this attribution, not a job-name match. No CI reruns or branch update just for green. Original scoped proof stays valid: exact conflict packet has production/test native types, typed lint,27 path+35 wizard cases, wrapper closure,zero runtime/static cycles,14 suppression cases and planner passing;150 captures/15 unique inputs match signed head. Earlier composed proof and independent full-context reviews retained in native review.json. Phase E untouched; no SDK/config/schema/protocol/dependency contract change. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* refactor: share runtime parsing and routing owners * chore: shrink assertion allowances after reader consolidation
Merges upstream main at 3cd9bdd. No textual conflicts. - src/media/media-reference.ts: main moved relativePathEscapesBase to infra/path-guards as relativePathEscapesRoot and dropped this file's node:fs/promises import (openclaw#180175). The grounding helpers this branch added still call both, so they now use relativePathEscapesRoot and the import is restored.
What Problem This Solves
Measured clone families repeat field readers, CLI option parsing, heartbeat targets, filesystem fallback, string filtering, bounded scanning, and FIFO bookkeeping across core and package consumers.
User Impact
No user-visible change is intended. Alias precedence, false/zero handling, parsing offsets, path containment, session routing, cache bounds, and public signatures remain intact. No migration or operator action is required.
Why This Change Was Made
Use the existing responsibility owners instead of repeating their algorithms. A shared heartbeat-target leaf serves the two core consumers; the standalone root CLI scanner stays import-free. Plugins do not acquire core-private imports, and no public Plugin SDK export is added.
This is the runtime/readers area of the originally proposed 505-net-runtime-production-line cleanup split by ownership area for CI attribution. This slice changes 63 source paths plus their shrink-only assertion baseline and removes 248 net runtime production lines, or 241 after charging seven handwritten declaration lines. The other areas touch disjoint files. Settlement #180148 was withdrawn without merging; its LOC is not credited. The adapter area is #180221.
Best-effort tradeoffs accepted
No new unlikely-event tradeoff: the private catalog reader drops a repeated internal auth preparation already performed by its owning outer operation. Security-effect authorization, external-input validation, cleanup/settlement, lexical escape checks, fallback ordering, and realistic concurrency behavior remain in place.
The whole-path asynchronous realpath fallback and synchronous existing-ancestor projection remain separate contracts. FIFO duplicates do not promote entries; the existing 64/200 limits remain. No config, schema, transaction, retention, permissions, protocol, dependency, or public SDK contract changes. The standalone session-memory backend is untouched.
Evidence
All 63 originally applied postimages matched the signed accumulated cleanup. Reused per-family focused evidence covers carriers, heartbeat routing, paths, CLI/usage, bounded scanner/FIFO, string consumers, records/catalog, ordered field readers, and discovery/logger/TTS consumers. These are historical focused results, not a fresh nine-family replay or a full transitive-graph certification.
Proof reuse explicitly excludes five captured-input differences: unrelated additive dependency-lock metadata; an unselected wrapper-inventory entry; the current stronger approval test; an unselected installer factoring; and the current stronger service-command timing test. No unselected change is copied into this PR. The current approval selection and complete timing suite have been rerun successfully. The wizard regression independently exercises the retained spread prompter adapter; no real-installation proof is claimed.
Current composed targeted native types, typed lint, formatting, wrapper closure, all 14 suppression cases, and planner dry-run passed. Runtime and static cycle checks each report zero cycles. Fresh isolated review completed three full context passes with no actionable P0–P2 findings. Local commands are low-priority, serial, one-worker, and isolated from operator state. Hosted exact-head CI is the broad gate; no broad local suite, build, E2E, live Gateway/provider, or device proof is claimed. No timeout, retry, skip, suppression, or retained assertion is weakened.
Initial exact-head CI correctly required shrinking four stale assertion allowances after this cut removed those assertions. The repair lowers three counts and removes the zero-count row, without changing production source or expanding any allowance. The exact-base native assertion ratchet and all 14 suppression cases pass; independent review of that mechanical repair found no actionable P0–P2 issue. The initial UI shard also has the “Reorder Beta” focus timeout independently observed on scheduled main run 39707038848. Current-head hosted CI remains the broad gate, not a claimed passing replay of the earlier red.
GitHub subsequently reported CONFLICTING, so the branch was rebased onto main c5a6a30. Both rewritten commits are signed. Every production postimage remains byte-identical to the independently reviewed 9e477 head. Main's wizard/path test consolidations are retained; the distinct spread-prompter regression remains instead of resurrecting the removed plain progress-order test. Original independent reviews are reused for the unchanged production patch, with the conflict composition inspected directly.
Fresh conflict-graph proof passed on f72e238: 27 path cases and 35 wizard cases, production/test native types, typed lint, formatting, wrapper closure, both cycle checks (zero), all 14 suppression cases and planner. Ten receipts/150 captures/15 unique inputs match the final signed head. The native checkout's missing compiler install and its pinned-pnpm download timeout were setup failures; proof ran instead in the lane's existing qualified installation on that exact head. No alternate compiler or shared-install reconciliation was used. Prior-head CI remains prior-head evidence; the new exact-head CI is the gate.
Exact-head CI39714358517 attempt1 has completed with inherited failures; it is not green. The scoped maintainer campaign authorizes the native pre-existing-failure exception. Actual fetched CI merge15c14dc has main parentcce29b2 and headf72e238. Two leaves fail on main's newly introduced physical registry self-handoff; independent main repair52df852cd5be3b3691ef27d0942a4db7b2258eb1 is now ancestry-verified.
All170 exact-head checks enumerated. No CI rerun, repush for green, timeout increase, retry, skip, auth-guard removal or whole-family rollback. Coordinator flakes and latest six completed scheduled-main runs inspected; no invented matching custody/scaffold scheduled signature. Local replays are macOS/Node26 wrapper with pinned Bun versus hosted Linux/Node24; that platform gap is explicit. The five exact baseline errors, unchanged raw owner and independently proven/fixed main defect support the attribution; the sixth baseline timeout alone does not.