Skip to content

refactor: remove redundant private freezes and checks - #176838

Merged
steipete merged 2 commits into
mainfrom
dbasync/defcode2-misc-4
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/defcode2-misc-4

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private admission payloads, requester tuples and channel lookup tables pay for runtime freezing despite staying inside their owner and having no mutation path.

User Impact

No intended behavior change. Public admission/requester snapshots remain frozen, caller-owned input remains copied, and credential admission, voice-session ownership and final-effect checks remain intact.

Design

Remove private freezes. Model Setup reuses its parsed provider choice and dispatches saved authentication before the generic role check it already bypasses. Keep readonly types and narrow projections. The Talk projection still copies six primitive fields from the parsed record; its sole production consumer reads it synchronously.

Production: +47/-54, net -7 lines across eight files. The assertion-safety baseline also drops the retired one-assertion allowance for src/channels/ids.ts. No test additions or deletions. The simplification pass retained owner-held values and existing parsers, without new helpers, public exports or compatibility paths.

No SQL, requests, transactions, schema, SDK surface or service lifecycle changes. SQL/request/MAIN impact for this diff is estimated 0/0/0, unmeasured. The lane comparison for the first two cleanup commits measured identical warm medians: 54 [54–57] SQL, 16 [16–17] requests, 0 [0–0] MAIN, with no normalized statement-shape change. That pair does not include this diff. Its candidate completed all turns but failed final restart teardown with Darwin process-inspection unavailable in spawn-broker cleanup; no full-workload or latency claim.

Evidence

Changed-file formatting, type-aware lint and git diff --check pass. Independent Codex source review and the second/final baseline-correction review both completed scoped-clean with final source verification. Frozen install passed.

All owner shards passed on reviewed production head 9418d918c1c in ordinary CI. Final head 1bba74d6892 changes only the obsolete assertion allowance; all eight production blobs are identical. Final CI confirms the corrected assertion-safety, database-worker and dialect ratchets pass. Production/core types, lint and source-contract checks passed; the unrelated failures are recorded below. Knip evidence is reused because the correction changes none of its inputs.

The final skill-library worker test failed at bob-worker-first with an unavailable selected skill revision. The same test already fails on scheduled main, but at the earlier advertised-skill-count assertion. This different-step symptom remains an unresolved CI signal, not an identical-failure or fixed-test claim. No blind rerun was requested.

Inherited diagnostics: the unchanged Codex completionDeliveryRetryDelaysMs TS2353 matches main. The missing Swedish translation catalog matches main i18n. Chat boot gzip exceeds its existing budget on main; this candidate's own comparison reports 1,491,439 → 1,491,439 bytes, zero growth. The generated credentials-matrix mismatch also matches main: the same plugins.entries.subq.config.apiKey entry is absent. No budget was raised and no test assertion was weakened.

Knip on the unchanged production head adds zero findings versus current main: settleInterruptedRestartRecovery and the two unused files are inherited. The supplemental run was cancelled after its required evidence completed. No new main-baseline or supplemental run was dispatched for the one-line baseline correction.

The final aggregate ratchet failure is independently reproduced on fetched main 8e2ea72d83acceb73a9b5876dc31cd29807fc37a: test/scripts/ci-node-test-plan.test.ts:3285 lacks real-export pass-through in its ci-test-timings mock. The unchanged native checker ran through the proof semaphore against an isolated index of that exact main, exiting 1 with the identical rule/file/line. The actual PR correction passes assertion-safety. All inherited failures and the distinct worker signal were routed to the main-repair queue. Landing uses the authorized relaxed policy; aggregate CI is not claimed green.

Candidate Ledger

Candidate Decision Reason
C12808 KEEP The copied profile is returned by getRequesterProfile; retain the snapshot copy and freeze at that public read boundary.
C12809 REMOVE requesterBinding creates a fresh tuple of primitive context fields held only in #binding and read with every; it never escapes.
C12810 KEEP The symbol-carried RequesterProfile object escapes with the context; preserve its frozen opaque carrier surface.
C12906 REMOVE The derived entries array is module-private and only read by set/order/alias construction and label lookup.
C12907 KEEP CHAT_CHANNEL_ORDER is exported and shared with CHANNEL_IDS and the channel registry; retain its public array freeze.
C12908 REMOVE The alias map is module-private and only indexed by normalization/label lookup; no writer or escape exists.
C12927 REMOVE The parser still validates and copies primitive fields; its only production caller stores the fresh result in private ingress binding.
C12928 KEEP AdmissionEvidence escapes as an opaque public carrier; retain its frozen outer surface and private-field brand.
C12929 KEEP PreparedChannelAdmissionEvidence crosses the exported prepare/bind handoff; retain its frozen outer carrier.
C12930 REMOVE Both writeContextAdmission callers construct fresh records; #value is only read inside this module and never returned publicly.
C12931 KEEP ContextAdmission is attached to the external context under a symbol; retain the frozen opaque carrier surface.
C12932 REMOVE The new timestamped payload is private to AdmissionEvidence; public readers return evidence/resolver or a fresh consumed projection.
C12933 REMOVE The unsupported contribution is a fresh private payload and is only read when deriving the consumed projection.
C12934 REMOVE The no-audit unsupported payload is freshly spread into the private evidence slot and has no external reference.
C12935 REMOVE participantContribution constructs a fresh private wrapper read only by the local payload pipeline.
C12936 REMOVE The present participant record is newly constructed from primitive fields and never escapes the evidence owner.
C12937 REMOVE The unknown participant record is a new private constant-shaped value with no writer or external reference.
C12938 REMOVE The fresh ingress binding is held in #binding; only the separately mutable handoff subrecord is written, as before.
C12939 REMOVE The scope and conversation snapshot stay private; retain the conversation spread to detach caller-owned data while removing both freezes.
C12940 REMOVE The unknown contribution is freshly constructed inside the private mint path and is only read.
C12941 REMOVE The contribution wrapper is freshly spread during the private handoff-to-evidence map and has no external reference.
C12942 REMOVE The decision record contains locally computed primitive facts and remains inside the private evidence payload.
C12943 REMOVE Retain [...evidence] to snapshot the caller-owned array; its private copied array has no mutation site and needs no freeze.
C12944 KEEP consumeChannelAdmissionEvidence returns this public projection; its frozen result is an explicit existing test contract.
C12945 KEEP The nested invoker is publicly exposed by the consumed projection; retain its frozen result contract.
C33299 DEFER Keep the credential clone: the supported precommit review path refuses necessary credential-owner source context. No credential-copy change is included.
C33412 REMOVE Six fresh primitive facts are consumed synchronously; retain the readonly projection, stored-data parsing and ownership/open-state checks.

Keep caller-input copies, public carrier/result freezes, one-use/scope/live-owner checks, and all untrusted-input parsing. There is no support added for callers mutating private implementation values.

ID Category Source REMOVE reason
C33287 b src/system-agent/setup-inference-activate.ts Handle saved-auth first (it already unconditionally bypasses generic role validation), then parse the provider-auto choice once and reuse it for role selection and dispatch. Also removes one unindexed saved-auth prefix check.

Saved-auth retains its existing generic-role-validation bypass and delegates role and credential ownership to the same staging owner. Malformed saved-auth choices keep their current error.

ID Decision Reason
C29821 REMOVE Drop only the returned guard's entry assertion; synchronous owner policy reads have no intervening authority mutation. Factory-entry and final execution assertions remain.
C29726 REMOVE The staging environment is privately copied, only read by executable resolution, and merged into fresh spawn environments. Keep its copy and both public pinned-environment freezes.

Accepted edge: an already revoked plugin command may report a policy error before the final revoked-authority error. It still cannot execute. Container daemon selection, target pinning, ownership verification and lifecycle behavior are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T02:49:43.044014Z 9418d91 PR opened
ℹ️ 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 19, 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: 1bba74d6892c4f6949e4ffe583feca0c9d9688cb
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/node-host/plugin-exec-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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@steipete
steipete merged commit 6ec7734 into main Oct 19, 2026
153 of 159 checks passed
@steipete
steipete deleted the dbasync/defcode2-misc-4 branch October 19, 2026 03:10
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
Remove freezes from fresh private requester, admission, channel lookup, container staging and voice-session values. Reuse parsed provider choices and remove one duplicate synchronous policy assertion.

Preserve caller-owned snapshots, public frozen carriers, input parsing and final security-effect checks. Shrink the retired channel assertion allowance. No intended user-visible behavior change.

Two independent scoped reviews completed cleanly. Production change: +47/-54 lines. Validation and inherited or unresolved CI diagnostics are documented in the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. security-sensitive-changed size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant