Skip to content

refactor(logging): remove private transport test controls - #174646

Merged
steipete merged 1 commit into
mainfrom
deslop/z19-19-logger-test-controls-20261015
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z19-19-logger-test-controls-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The shared file-log transport carried replaceable appenders, a configurable test queue bound and a reset API that no production caller used.

What Changed

Call the same secured file owner directly, use the existing 4,096-record bound and remove the orphaned test controls. Tests intercept their own native file paths and exercise the actual bound. Held appends release and settle before mock restoration. The QA scenario flushes the real owner rather than resetting it.

Async batching, ordering, rotation, symlink/hardlink protection, failure-warning bounds, singleton identity, process hooks, forced-exit rescue and graceful shutdown settlement remain. Raw log/egress-redaction contracts, public SDK, config, CLI, protocol, persisted shapes and dependencies are unchanged. Phase E is untouched.

This is the logging owner slice of a widely imported seam-removal family. Against pinned main 24f9be0a7c945c70ad216399cfab085147e2f698: eight files; production +2/-37 = 35 net lines removed. Tests/support +119/-68 = 51 net lines added; overall 16 lines added. Fixture growth moves controls to the native I/O boundary without deleting existing behavioral coverage.

Best-effort tradeoffs accepted

None newly introduced. The transport's existing already-issued-append tradeoff at abrupt forced exit is retained, not expanded. No security, durability, concurrency, recovery or bounded-resource guard is removed.

Evidence

  • Complete changed modules, shared singleton, actual production append/flush callers and installed fs-safe 0.26.6 append implementation inspected. Introducing PRs perf(logging): flush file transport asynchronously off the request path #114769, fix(logging): prevent Vitest exit listener leaks #115929, refactor: retire due compat-ledger surfaces (context-engine host params, deactivate alias, logging internals) #121845 and fix(logging): report dropped file log records #132672 distinguish retained transport/lifecycle behavior from private test controls. Bounded open-PR checks found no activation dependency on those controls.
  • Eight fresh original hashes matched before application; strict forward/reverse packet witnesses and all eight applied candidate hashes matched. Retired control and entrypoint census has no remaining matches. Targeted formatting passed (2 seconds); whitespace checks passed.
  • Targeted touched-file and run-loop consumer graph types passed after repair (224 seconds), including the QA runtime. Focused worker-dependent runtime proof remains unrun because the canonical cache miss requires forbidden broad artifact compilation. No local build, packaged process, Linux deleted-fd, Darwin watchdog, live Gateway or provider proof is claimed. Executable proof uses isolated HOME/OpenClaw/XDG/TMP state. Exact-head hosted CI owns broad proof under the campaign's no-local-build budget.
  • Initial full lint found one owned no-base-to-string fixture error; real string narrowing replaces that conversion without a cast or suppression. Independent review found the run-loop suite's fs/promises default is a mocked copy, so the fixture now obtains the actual native default before intercepting open. Corrected touched/run-loop graph types passed (224 seconds), and repair-only two-file official core lint passed (249 seconds). Fresh complete independent P0-P2 review finished scoped-clean after final source verification, with no accepted/actionable findings (correctness 0.95). The required suppression suite passed all three tests with one worker (190 seconds).

Release-note context: internal cleanup; logging behavior and public contracts are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M labels Oct 16, 2026
@steipete
steipete marked this pull request as ready for review October 16, 2026 20:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T20:35:08.824567Z 0cfcea6 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes private file-transport controls and moves fault injection into test-owned filesystem interception.

Example: Queue 4,098 records before the file logger drains.

  • Before: The production queue retains the newest 4,096 records and reports two dropped records.
  • After: The same behavior remains, and tests exercise the actual production bound.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported cleanup with no findings; validation is CI and static evidence rather than a demonstrated shipped-entry-point run.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; source and exact-head CI support the changed fixtures, while no live CLI, Gateway, or native-platform result is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: Maintainer-approved direction removes test-only production seams while preserving bounded logging, secured writes, diagnostics, and shutdown behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored cleanup removes unused test controls while preserving production logging behavior; no actionable correctness or security defect was found.

Priority: P3
Reviewed head: 0cfcea6d0aa212f6faf66595386ceee705b585f4

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No post-refactor shipped CLI or Gateway logging run is supplied; this internal refactor claims no runtime bug fix.
Agent review details

How this fits together

The process-wide file transport receives serialized log records, batches secured filesystem appends, rotates files, reports failures, and settles queued writes during shutdown.

flowchart LR
  A[Logger callers] --> B[Serialized records]
  B --> C[Singleton file queue]
  C --> D[Batch and rotation owner]
  D --> E[Secured filesystem append]
  F[Shutdown lifecycle] --> C
Loading

Technical review

Best possible solution:

Retain this focused removal of private test controls and complete the normal exact-head CI gates.

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

No user-facing defect is claimed; source inspection confirms the removed controls served test callers.

Is this the best way to solve the issue?

The change follows the existing filesystem owner and singleton lifecycle, removing production injection machinery without adding a competing implementation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned production change: The introduced hunks replace the mutable appender with the same secured append function, retain the 4,096-record bound, and remove only private reset and injection controls. (src/logging/logger-file-transport.ts:261, 0cfcea6d0aa2)
  • Listener lifecycle provenance: The earlier listener-leak repair used reset-time removal for reloaded modules. The later singleton change shares one transport across module copies; this PR retains that singleton and its install-once guard. (src/logging/logger-file-transport.ts:427, f8f1c8af73a7)
  • Complete caller cutover: Repository references contain no remaining callers of the removed controls. Held appends settle before mock restoration, failure fixtures recover through successful writes, and QA uses the production flush operation. (src/logging/logger-file-transport.test.ts:30, 0cfcea6d0aa2)
  • Dependency contract verified: The changed fixtures intercept code executed by @openclaw/fs-safe 0.26.6, establishing the dependency-contract relevance. Its append implementation uses the native fs/promises default object's open method and the returned handle's appendFile method, with identity checks and permission tightening retained. (src/regular-file.ts:294, 9445e65094f6)
  • Current-main comparison: The touched paths have no changes between the pinned merge base and fetched main; main still contains the private controls this PR removes. (src/logging/logger-file-transport.ts:439, bc18ffb3c37b)
  • Discussion and validation: The full body and comments claim static validation and explicitly leave worker-dependent runtime proof unrun. Exact-head checks show successful changed-node, type, lint, and boundary lanes; the CI gate remains pending with a UI E2E shard in progress. No diff-caused failing check was established. (0cfcea6d0aa2)

Likely related people:

  • Vincent Koc: Raw commit b732322 adds src/logging/logger-file-transport.ts:265 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b73232254088; files: src/logging/logger-file-transport.ts)
  • Alix-007: Raw commit 4b65ebd adds src/logging/logger-file-transport.ts:114 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4b65ebd2280b; files: src/logging/logger-file-transport.ts)

PR surface

Source -35, Tests +51. Total +16 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 37 -35
Tests 7 119 68 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 121 105 +16

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +2/-37; tests/support +119/-68. Production shrinks by 35 lines; fixture growth moves injection to native I/O and exercises the real queue bound while retaining behavioral assertions.

Labels

Label changes:

  • add P3: Internal logging and test-maintenance cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Internal logging and test-maintenance cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 16, 2026, 4:49 PM ET / 20:49 UTC.

@steipete
steipete enabled auto-merge (squash) October 16, 2026 20:51
@steipete
steipete merged commit b74ea7c into main Oct 16, 2026
220 of 221 checks passed
@steipete
steipete deleted the deslop/z19-19-logger-test-controls-20261015 branch October 16, 2026 20:51
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…74646)

Remove private append/queue-bound/reset controls from the file-log transport. Production calls the same secured file owner directly; tests exercise the real queue bound and intercept task-owned native I/O.

Retain batching, ordering, rotation, singleton identity, symlink/hardlink checks, forced-exit rescue and ordinary shutdown settlement. Public SDK/config/CLI/protocol/data shapes remain unchanged. Best-effort tradeoffs accepted: none newly introduced; existing already-issued append behavior at abrupt forced exit is unchanged.

Production: 35 net lines removed; tests/support grow51. Exact reviewed head0cfcea6d0aa212f6faf66595386ceee705b585f4. Focused types, lint, formatting, required suppression suite and full independent review passed. Hosted exact-head CI38962956279 passed without reruns.

All218 exact-head checks enumerated:90success126skipped1neutral, zero failures or pending; the sole canceled job117182166270 is Auto response metadata, superseded by same-head successful117182182567. No canceled runtime proof is counted as passing. Dependency/security/CI status contexts pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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