Skip to content

refactor(config): deslop config fifth pass - #161076

Merged
steipete merged 5 commits into
mainfrom
deslop/l161-config5
Sep 29, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/l161-config5

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #159588

What Problem This Solves

The fifth config cleanup pass removes repeated orchestration and brings src/config/config-env-vars.ts from 757 to 698 lines, below the 700-line limit, through consolidation inside its existing owner.

User Impact

No intended user-visible change. Config schemas and generated snapshots, defaults, environment names/precedence/preservation, Doctor-owned migrations, redaction, and persisted-state contracts remain unchanged. Reserved src/config/sessions/session-accessor* files are untouched.

Why This Change Was Made

  • Environment publication now uses one ordered pending-publication collection for rollback authority, supersession, and reset; commit/rollback share settlement and snapshot construction. The service env collector uses the canonical collector directly.
  • Environment-reference preservation shares retained-item matching in both directions, common unchanged-array matching, and one correlated-array input type. Active and escaped references keep their distinct identity rules.
  • Config writes share post-commit rollback/error reporting, immutable path updates, normalized roster-ID checks, invalid-source snapshot construction, default materialization, audit field extraction, and artifact timestamp formatting.
  • Transcript worker requests share the retained-database custody and success-reply boundary while preserving database-free requests, usage-cost ownership, read fences, transaction scopes, and error encoding.
  • Session maintenance shares reference counting, archive suffix parsing, preserve-key normalization, plugin-slot cleanup, warning outcomes, and ordered terminal-run deduplication.
  • Session target selection shares configured-target preparation and registry/filesystem owner inspection; session paths reuse existing path owners; migration ledger inserts and updates use the same written values.
  • Config path candidates and include scanning use their existing canonical owners. Numeric validation and public-share/secret defaults types reuse their owning contracts.
  • Removed unreachable plugin-owned field metadata from core; simplified documentation baseline projection, skipped-fence accounting, and validation issue ranking without changing generated output.

Measured production diff: 731 additions / 1,213 deletions, 482 net lines removed. Test diff: 26 additions / 1 deletion. The assertion-safety baseline shrinks three allowances to their measured counts (one reduced, two removed); the max-lines baseline only drops the now-unused disk-budget exception; config-env-vars is never added. This is below the 1,000-line target after completing the file-by-file sweep; the coverage log below records every eligible production file over 200 lines. Recent config changes since September 18, including the fourth-pass name-only diff, were reviewed before editing.

Fixes Found Along the Way

The explicit line-limit target is resolved without a new sibling file or baseline exception. The existing timezone subprocess fixture now preloads the canonical source runtime so the shared normalization import resolves; its eight DST inputs, assertions, and timeout are unchanged. No additional product bug fix is claimed.

Evidence

Landed by the maintainer-authorized pre-existing-failure exception: exact reviewed head 8a0bd340769de1dd29a90e0e1dcdfde3ecd3ccd2 was squash-merged as f5e5f75f2b775adef5fd87f5cd5d5017fe2d086b. Verified ancestry on origin/main and reconstructed merge-tree equality. Failed/cancelled hosted CI remains explicitly recorded below; no CI rerun or budget increase was used. All task-owned Testbox leases are stopped.

Hosted CI on exact head 8a0bd340769de1dd29a90e0e1dcdfde3ecd3ccd2 has one independently reproduced root failure: checks-node-compact-small-3, run 36540677740. The two failures in test/scripts/plugin-sdk-surface-report.test.ts are keeps default public surface budgets pinned to current source counts and rejects callable surface growth from the canonical source graph: actual public SDK exports/callables are 4,594/2,698 against unchanged budgets of 4,591/2,695. The same two tests and exact counts fail on the current unrelated PR run 36537630985, at head 7fa68ac79a1133adb2796998719a2f84b9cf6f7c. This config patch changes no SDK entrypoints, report/budget implementation, package exports, or public SDK export names. Its new internal config helpers have no public SDK re-export route. The three inherited additions are loadAgentHarnessMcpConfig, decodeHeaderEnvPlaceholder, and resolveConfiguredMcpTransport, exported by src/plugin-sdk/agent-harness-runtime.ts in commit b4ae783fbfd2d50307ef9af357ed944120a1824d (#160931), without updating the 4,591/2,695 budgets. Neither that facade nor its export owners are changed here. The aggregate CI gate failure and sibling cancellations are fail-fast consequences, not passing CI.

ClawSweeper completed its exact-head review with no introduced code or security finding. Its requested published-updater compatibility proof now passes through the existing synthetic-state upgrade-survivor harness. Fresh-install defaults are already covered by the passing io.best-effort.test.ts missing-config case and io.load-async.test.ts missing-config parity case (4 ms and 3 ms respectively) in the full config run. The migration ledger edit shares identical insert/upsert values; columns, transaction ownership, conflict keys, stored report bytes, and migration triggers are unchanged. Existing passing mutation tests exercise runtime-refresh rollback through root/include writers and preserve concurrent include edits; legacy-main-session-migration.ledger.test.ts covers ledger completion, rearming, and Doctor rescanning. These fault-path checks complement the published updater/backup-restore scenario rather than being described as the same proof.

All required Testbox proof is complete. Final changed-file checks and focused worker proof used source tree d0fd89afd1c8a21f32c5facf8a691940577845e1, matching the final commit tree. Provider: blacksmith-testbox; final lease tbx_01m3nvw7hs5e85fke4dhd34sxm (run).

  • node scripts/check-changed.mjs: passed in 1,548 s, including full core/script lint, all type shards, Knip, schema/storage guards, formatting, and narrowed baselines. Core lint had zero errors and five pre-existing line-count warnings outside the edited files; config-env-vars.ts is 698 physical lines.
  • pnpm build: passed in 310 s. pnpm config:schema:check and pnpm config:docs:check: passed with zero generated drift. These ran on the same production changes before the final callback rename/comment removal (earlier Testbox run).
  • node scripts/run-vitest.mjs src/config: 469 files passed, 3 skipped; 5,806 tests passed, 10 skipped (eight Windows-only cases and two opt-in benchmarks), in 750 s. The only later production delta is the reviewed callback rename and obsolete lint comment removal.
  • node scripts/run-vitest.mjs import-boundary import-boundaries: 19 files / 98 tests passed, 89 s, including fs-safe and all sibling boundary tests.
  • Focused transcript-worker schema-freshness, lane, and matching tests: 3 files / 13 tests passed, 32 s, after the rename.
  • Session-cleanup, plugin host cleanup, Gateway config reload, and reload-handler consumers: 4 files / 404 tests passed, 91 s.
  • Published-driver compatibility: OPENCLAW_UPGRADE_SURVIVOR_PUBLISHED_BASELINE=1 [email protected] OPENCLAW_UPGRADE_SURVIVOR_CANDIDATE=current OPENCLAW_UPGRADE_SURVIVOR_SCENARIO=legacy-operator-state OPENCLAW_UPGRADE_SURVIVOR_UPDATE_RESTART_MODE=manual bash scripts/e2e/upgrade-survivor-docker.sh passed, 1,183 s including candidate package build/validation. Provider blacksmith-testbox, lease tbx_01m3p5zcg64sa0ek970zfmytbc (run); source tree was verified as the exact final candidate. Published baseline CLI-authored state and its updater survived automatic migration for both agents, schema validation, cron ownership, candidate agent turn, Gateway health/status, a second update with no package mutations, clean Doctor, formerly bundled plugin repair, and backup restoration. All state and providers were synthetic/isolated; no live Gateway was modified.

Changed-test cost: pnpm test src/config/config.env-vars.test.ts --maxWorkers=1 passed 27 tests in 34 s wall (32.01 s Vitest duration, 94% cold transformation; the two new overlap cases each took 1 ms). pnpm test src/config/sessions/reset-policy.test.ts --maxWorkers=1 passed 20 tests in 3 s wall. The timezone cases need real subprocess-local TZ semantics; the patch only supplies the repository loader. Hosted CI stopped early on the inherited SDK-budget failure; no additional per-file CI timings are claimed.

Independent review through P2 is complete. A reported blank-agent-ID concern was rejected against the unchanged canonical guard, which throws before normalization. The rebase integration, fixture correction, and final lint changes received separate clean reviews. No accepted actionable findings remain.

Initial validation exposed the required assertion-baseline shrink, two callback-shadowing lint errors, an obsolete max-lines suppression, and eight deterministic subprocess loader failures. All were corrected without weakened assertions, added retries, timeout increases, schema updates, or new lint allowances.

File-by-file coverage (141 production files over 200 lines)

Config fifth-pass coverage

Base: dc7fe2a. Production files over 200 lines, sorted by initial size. Reserved src/config/sessions/session-accessor* files are excluded by lane instruction. Each module was read in full; smaller production modules were also swept.

Base lines Production file Result
1742 src/config/io.write-prepare.ts READ: Unified immutable setters and normalized roster-ID uniqueness validation; include/roster reference projection branches retain distinct contracts.
1162 src/config/mutate.ts READ: Shared rollback reporting; root/include lock custody, reread, and runtime activation remain writer-owned.
1001 src/config/zod-schema.core.ts READ - Strict schema fragments already own provider, media, channel, and secret contracts; further grouping would change schema layout or merely abbreviate declarations.
857 src/config/sessions/types.ts READ — persisted fields, SDK contracts, normalization and write-once provenance remain explicit; fourth-pass consolidation retained.
819 src/config/zod-schema.agent-runtime.ts READ - Fourth-pass common tool-policy and exec schema owners already remove runtime/default duplication; retained refinements carry distinct errors and policy contracts.
791 src/config/schema.labels.ts READ - Removed unreachable copies of plugin-owned Discord, Google Chat, and Mattermost field labels.
772 src/config/sessions/disk-budget.ts READ — shared reference counting and removed a one-use orphan predicate; eviction and durable-index ordering unchanged.
757 src/config/config-env-vars.ts READ - Consolidated pending-publication rollback authority and settlement; shared snapshot capture and removed the service collector alias; now 698 lines.
748 src/config/sessions/combined-store-gateway.ts READ — logical/physical ownership, sentinel projection and awaited admission checks serve distinct contracts.
745 src/config/sessions/session-transcript-reconcile.ts READ - Deferred execution, incognito ownership, publication, lease recovery, and readiness waits have distinct lifecycle contracts; no safe simplification of their sequencing established.
733 src/config/sessions/transcript.ts READ - SQLite and legacy JSONL reads plus delivery-mirror append guards retain separate supported contracts; fourth pass already simplified this owner.
727 src/config/io.snapshot.ts READ: Unified unavailable/parse/include invalid-source snapshot construction; preparation, validation, and environment compensation remain separate boundaries.
722 src/config/io.observe-recovery.ts READ: Existing generator already owns sync/async recovery; prepared recovery and last-good promotion have distinct authority/provenance contracts.
716 src/config/sessions/store-maintenance.ts READ — removed repeated preservation projection and warning classification.
716 src/config/sessions/targets.ts READ — consolidated configured target preparation across selection and availability.
705 src/config/runtime-snapshot.ts READ — generation, preparation, publication, and authority phases have distinct contracts; fourth-pass owner consolidation retained.
702 src/config/sessions/legacy-main-session-migration-operations.ts READ — generation-copy, quarantine and verified deletion retain distinct transaction and custody requirements.
700 src/config/sessions/session-transcript.worker.ts READ - APPLIED one retained-database custody and success-reply boundary for 27 typed request cases; per-action readers, transaction boundaries, environment policy, and error encoding preserved.
687 src/config/io.write.ts READ: Atomic publication, audit, rejection artifacts, and rollback ordering each have an invariant; failure auditing deliberately differs from shared post-commit recovery.
682 src/config/sessions/session-entry-read-runtime.ts READ — native/file readers, synchronous consumers and data-only reads intentionally retain different custody and cleanup checks.
669 src/config/sessions/legacy-main-session-migration.ts READ — unified ledger insert/update values without changing written columns.
662 src/config/doc-baseline.ts READ - Baseline builder now groups directly into its output; writer has one result projection for check/write mode.
662 src/config/sessions/cleanup-service.ts READ — preview/apply flows remain distinct; preview key sets serve CLI action reporting.
658 src/config/sessions/session-transcript-worker.types.ts READ - Discriminated worker operations and result projections describe different contracts; reducing them further would obscure request/result correlation.
656 src/config/includes.ts READ: Heap-based traversal, include-chain limits, and lexical/canonical guards have distinct contracts; fourth pass already removed default read forwarding wrapper.
647 src/config/schema.help.runtime.ts READ - Live field help text is schema metadata; retained it byte-for-byte to preserve generated surfaces.
642 src/config/sessions/session-transcript-projection-rebuild.ts READ - Shared visitor already owns memory/disk projection; source fingerprints, bounded catch-up, and finalization checks protect independent invariants.
640 src/config/redact-snapshot.ts READ — schema/heuristic URL sensitivity and identity-aware restore are intentionally asymmetric; no equivalent shared simplification found.
636 src/config/channel-compat-normalization.ts READ — per-slot streaming precedence and root/account inheritance preserve shipped migration behavior; fourth-pass consolidation retained.
636 src/config/env-preserve.ts READ - Unified forward/backward retained-item matching and common unchanged-array matching, with one correlated-array parameter type; active and escaped-reference policies stay distinct.
627 src/config/validation-plugin-rules.ts READ - Lazy registry ownership, plugin availability, schema defaults, and warning precedence differ by path; no safe additional consolidation found.
617 src/config/sessions/session-transcript-worker-resources.ts READ - Separate foreground, projection, maintenance, and usage lanes are required to retain read availability and native cleanup custody.
614 src/config/sessions/session-transcript-index.ts READ - Watermark writer, active insertion, and FTS owner already shared; append/suffix/rebuild paths enforce different mutation guarantees.
613 src/config/sessions/session-history-eviction.ts READ - Archive-before-delete, lifecycle holds, physical remeasurement, and checkpoint deferral are required retention ordering.
609 src/config/sessions/session-transcript-worker-runtime.ts READ - Single-target reads already share batch custody; usage operations additionally retain host effects and cannot use the history-only settlement path.
609 src/config/zod-schema.root-shape.ts READ - Root feature schemas and cross-field refinements express separate contracts; retained exact schema and refinement order.
604 src/config/io.write-safety.ts READ: Path identity, publication identity, compensation, and suspicious-write policy cannot be collapsed without changing guards.
603 src/config/sessions/session-cold-storage.ts READ - Preparation, serialized mutation, admission protection, restore cooldown, and maintenance rotation have distinct ownership responsibilities.
600 src/config/sessions/session-canonical-key.ts READ — admission, snapshot, continuation and committed-proof lifetimes remain intentionally separate.
593 src/config/io.audit.ts READ: Replaced repeated object/string error probing with normalization-core; explicit persisted projection retained to avoid leaking extra process metadata.
586 src/config/sessions/session-cold-storage-worker.ts READ - Archive preparation, externalization, and restoration retain different integrity and transaction checks; persisted envelope contracts unchanged.
581 src/config/defaults.ts READ — authored/catalog/provider defaults have distinct identity and omission rules; fourth-pass changes retained.
579 src/config/sessions/session-history-worker-runtime.ts READ - Request capture intentionally uses per-kind allowlists/cloning; merging generic capture paths would widen transported fields or change clone semantics.
569 src/config/sessions/restart-recovery-state.ts READ — ordered Set replacement preserves last-occurrence tombstone ordering and the 64-entry bound; consolidated true-only field normalization.
562 src/config/zod-schema.gateway.ts READ - Shared endpoint fetch shape is already reused; role, TLS, portal, proxy, and pairing refinements have distinct boundary contracts.
556 src/config/plugin-auto-enable.shared.ts READ — manifest, setup, provider, voice, and channel selection use different activation contracts; existing shared candidate owner retained.
544 src/config/io.runtime.ts READ: Source-reader aliases are live MCP/public facades; pinned async readers and managed runtime write generations retain independent responsibilities.
539 src/config/sessions/transcript-tree.ts READ - Memory/archive readers already share navigation storage and path traversal; reset, invalid-leaf, and opaque-append handling are distinct contracts.
517 src/config/schema.ts READ - Fourth pass already unified metadata hint merging; schema-budget, ownership, and merged-cache paths have independent invariants.
507 src/config/validation-core.ts READ - Core validation deliberately preserves ordered first failures and authored-source migration facts; no sound larger reduction found.
481 src/config/sessions/session-transcript-reconcile.worker.ts READ - Chunk streaming, memory frames, native lifecycle grants, and independent lease release must remain separately ordered.
462 src/config/paths.ts READ — consolidated config filename candidate ordering and guarded existence selection in this PR.
446 src/config/sessions/conversation-delivery-store.ts READ - Shared updater already owns transitions; exported status operations encode permitted transitions and input normalization rather than redundant forwarding.
441 src/config/validation-plugin-config.ts READ - Distinct deferred, disabled, missing, blocked, native-catalog, and memory-slot outcomes prevent collapsing its branches without behavior changes.
436 src/config/schema.lookup.ts READ - Fourth-pass shared wildcard owner already applied; lookup and path classification retain different array/record/security contracts.
432 src/config/sessions/transcript-write-context.ts READ - Metadata publication, target matching, first-insert ownership, and inherited writer fences grant different capabilities; no safe unification identified.
429 src/config/channel-config-metadata.ts READ — schema ownership, origin priority, sensitivity merging, and DM policy projections intentionally differ; no redundant owner found.
425 src/config/sessions/transcript-payload.ts READ - Compression admission, navigation projection, encoding fallback, and decoder bounds preserve canonical bytes and remain necessary.
420 src/config/mcp-config.ts READ — shared commit owner already handles writes; argv sentinel, absent server, create-only, and expected-server rules remain distinct.
419 src/config/io.context.ts READ: Recovery validation and metadata loading already share owners; sync and worker-backed methods preserve different admission routes.
419 src/config/sessions/paths.ts READ — reused canonical agents-root recognition and directory-owner validation.
416 src/config/sessions/session-sqlite-target.ts READ — unified registry/filesystem owner inspection while preserving differing ambiguity policies.
407 src/config/sessions/conversation-registry.ts READ - Current-binding projection and historical address activity differ intentionally; recent change avoids cold snapshot reads.
406 src/config/sessions/delivery-info.ts READ — exact/alias/routable precedence and per-store batch admission are different contracts; fourth-pass simplification retained.
394 src/config/sessions/session-snapshot-merge.ts READ - Model selection, runtime facts, recovery cycles, and ownership fields require separate atomic conflict families.
391 src/config/schema.help.core.ts READ - Removed unreachable Discord Activities help; plugin metadata already owns those merged fields.
381 src/config/write-lock.ts READ: Source reservations and write locks preserve FIFO/custody distinctions and awaited child drainage; no sound simplification found.
376 src/config/schema.tiers.ts READ - Curated channel tiers are live when includePluginOwnedChannels is enabled; matcher preserves indexed wildcard specificity and authored order.
373 src/config/plugin-auto-enable.materialize.ts READ — channel versus plugin activation and restrictive allowlist repair share the materialization owner already.
372 src/config/sessions/startup-migration.ts READ — per-source receipt classification and per-stage deletion/authority checks cannot safely collapse.
367 src/config/sessions/session-delivery-generation.ts READ — revocation, temporary unavailability, incognito observation and final I/O authority are separate lifecycle outcomes.
367 src/config/sessions/session-entry-navigation.ts READ — opaque leaf controls, reset ancestry and side appends have distinct navigation semantics.
366 src/config/schema.help.automation.ts READ - Removed unreachable Mattermost help; retained kernel-owned channel defaults and automation metadata.
360 src/config/sessions/session-entry-read.worker.ts READ — list/backing/sharing/creation/replacement projections intentionally admit different data and identity checks.
358 src/config/sessions/goals-operations.ts READ — operation fingerprint, replay receipt, expiry and session/goal identity checks protect different persisted invariants.
355 src/config/zod-schema.root-support.ts READ - Existing MCP server and Talk provider owners already centralize duplicated validation; remaining fragments define independent contracts.
354 src/config/sessions/store-entry-shape.ts READ — permissive legacy key IDs and strict transcript IDs have different supported migration contracts; normalization retains exact shapes.
353 src/config/io.load.ts READ: Fresh-config sync defaults now reuse snapshot materialization owner; asynchronous metadata preparation remains separate.
352 src/config/mutate.include-io.ts READ: Shared rollback reporting; include path proof, sibling graph verification, and durable publication stay intact.
347 src/config/sessions/lifecycle.ts READ — distinct admission errors and synchronous/asynchronous callers remain necessary.
344 src/config/io.clobber-snapshot.ts READ: Removed duplicate artifact timestamp formatting; sync/async lock acquisition and stat-failure behavior differ intentionally.
342 src/config/types.discord.ts READ - Public channel/SDK types include documented transport-specific options; importing plugin-private schemas would violate the boundary.
341 src/config/sessions/metadata.ts READ — route/provider switches and explicit thread absence require different fallback handling; prior consolidation retained.
331 src/config/codex-plugin-diagnostics.ts READ — no edit or routing verdict; selected-route completeness logic is kept with its existing diagnostic owner.
330 src/config/io.health-state.ts READ: Observation scopes, continuation capture, CAS update, and post-commit refusal policies retain distinct lifecycle contracts.
327 src/config/io.plugin-metadata.ts READ: Config-wide workspace merge preserves source precedence/ambiguity; sync/async preparation and cache admission already reuse owners.
325 src/config/io.read-helpers.ts READ: Iterative include scan and env-resolution facts already canonical; config hash and include hash encode different persisted contracts.
321 src/config/sessions/session-transcript-worker-readers.ts READ - Existing generic reader already consolidates tagged result decoding; hydration framing and captured row facts need their specialized boundaries.
316 src/config/issue-location.ts READ - JSON5 source location parser preserves duplicate-key selection and redaction checks; generic object-path helpers do not share its array/literal semantics.
309 src/config/sessions/session-suggestion-store.kernel.ts READ — pending caps, dispatch claims and finalization use different transaction predicates; no safe policy collapse remains.
306 src/config/zod-schema.agent-defaults-base.ts READ - Defaults and entry variants intentionally differ in accepted options and schema representation; retained exact schema.
298 src/config/sessions/store-entry.ts READ — opaque peer IDs require proof-sensitive exact/folded precedence; prior canonicalization owner retained.
293 src/config/env-substitution.ts READ - Shared token grammar and stack-safe substitution already own parsing; fallback, escaped syntax, callback order and exact secret references retain distinct contracts.
292 src/config/sessions/session-store-target-inventory.ts READ — positive locator read failures must remain separate from native-close/revocation failures; captured paths and registry deferral retained.
291 src/config/sessions/session-transcript-reconcile-pool.ts READ - Pool generation, native phase ownership, message-port lifetime, and retained cleanup leases are independent settlement contracts.
290 src/config/sessions/session-canonical-validation.ts READ — immutable batch capture, exact comparison and writer certification protect different boundaries.
288 src/config/validation-issues.ts READ - Removed redundant issue-ranking state and cast-after-filter; chosen issue remains the sole ranking source.
284 src/config/config-journal-snapshot.ts READ — synchronous write/rollback versus asynchronous Gateway admission contracts differ; persistence and fingerprinting retained.
284 src/config/talk.ts READ — provider normalization, active selection, and public response projection have different permitted fields and fallback semantics.
282 src/config/sessions/session-sharing-store.async.ts READ — add/remove/participant publication outcomes differ; shared worker admission owner already unifies execution.
279 src/config/docs-config-examples.ts READ - Derive skipped-fence total from seen/validated counts instead of incrementing parallel state in each exit; remove unused indentation capture.
278 src/config/types.secrets.ts READ - Reuse canonical SecretsConfig defaults type and pass existing parameter objects directly to the secret-ref resolver.
274 src/config/sessions/restart-recovery-receipt.ts READ — completion/cancellation reconciliation predicates preserve different authority outcomes.
271 src/config/sessions/session-history-archive-pruning.ts READ - Canonical and legacy archive pruning differ in recovery ownership; shared page-reclamation and diagnostics are already centralized.
267 src/config/resolution-facts.ts READ — provenance-aware weak maps preserve pending/resolved references and rewrite identity; no equivalent shared helper found.
266 src/config/sessions/skill-prompt-blobs.ts READ - Legacy Doctor imports and disk-budget projections still consume content-addressed prompt persistence; no dead whole path.
265 src/config/utility-model-separation-migration.ts READ — missing versus invalid parent checks and deferred implicit-route preservation protect shipped migration inputs.
264 src/config/schema.help.models.ts READ - Removed unreachable Google Chat/Mattermost field help; retain model/auth/memory metadata exactly.
261 src/config/sessions/session-transcript-search.ts READ - Native query kernel is shared by workers and incognito state; query filtering and reconciliation scheduling remain owner-specific.
260 src/config/sessions/targets-read-availability.ts READ — consumes consolidated configured target preparation; availability distinctions retained.
259 src/config/include-write-boundary.ts READ: Deepest sole owner, shared-target refusal, and keyed roster preservation serve distinct writable-boundary contracts.
257 src/config/sessions/store-maintenance-operations.ts READ — artifact sequencing, advisory failure handling and commit boundaries remain necessary.
252 src/config/model-provider-config.ts READ — exact/canonical/legacy row matching and callback reentrancy require separate lookup phases.
250 src/config/tools-by-sender.ts READ — sender type precedence, bounded deprecation warnings, and identity cache are already consolidated.
249 src/config/sessions/session-entry-codec.ts READ — indexed/legacy/opaque/header schemas intentionally admit different historical record shapes.
248 src/config/io.write-topology.ts READ: Topology cutover combines workspace/auth/session/cron owners; inserted path provenance is necessary for authored reference preservation.
248 src/config/sessions/session-placement-evidence.ts READ — incognito/file evidence and captured absence invalidation retain distinct lifetimes.
247 src/config/schema.help.agents.ts READ - Declarative live help and command metadata; removing or rewriting it would drift generated schema/docs.
246 src/config/sessions/conversation-identity.ts READ - Ingress and persisted delivery identities have different authoritative source precedence; fourth pass already consolidated normalizers.
241 src/config/channel-alias-migration.ts READ — declarative channel migration owner already replaces per-channel copies while preserving channel-specific modes and messages.
233 src/config/schema.hints.ts READ - Removed unreachable Mattermost placeholder; core hint builder already excludes plugin-owned channel namespaces.
233 src/config/types.openclaw.ts READ - Public authored/runtime/legacy shapes are deliberate type boundaries; root schema inference alone would remove named compatibility contracts.
230 src/config/validation.ts READ - Async validation clones preserve source facts across awaits and keep strict/source and runtime defaults distinct; helpers own these boundaries.
228 src/config/sessions/goals.ts READ — create/get/update/clear differ in fallback-entry, incidental writes, errors and event behavior; transition owner is already shared.
227 src/config/sessions/plugin-host-cleanup.ts READ — unified promoted-slot collection and ownership pruning; removed forwarding decision helper.
226 src/config/backup-rotation.ts READ: Backup artifacts retain pinned identity before every mutation; pre-update snapshot has a separate published rollback contract.
223 src/config/io.runtime-write-finalization.ts READ: Shared rollback reporting; managed-env retries and canonical reread remain lifecycle-owned.
223 src/config/sessions/session-transcript-read-fence.ts READ - Captured user-turn identity is validated against current visible position and generation; question-answer custody is distinct from ambient read fencing.
222 src/config/io.observe.ts READ: Sync/async observation shares fingerprint and anomaly decisions; async freshness rechecks prohibit mechanical driver unification.
220 src/config/zod-schema.channel-messaging-common.ts READ - Existing generic factories already unify channel leaves while retaining exact enum/default types and root-only policy defaults.
217 src/config/group-policy.ts READ — fourth-pass selected-scope projection already shares policy resolution with canonical scope owner.
217 src/config/merge-patch.ts READ — merge construction, conflict detection, and application protect different null/deletion/array contracts.
216 src/config/legacy.roster.ts READ — legacy roster allocation, strict parsing, workspace pinning, and ownership provenance preserve distinct upgrade contracts.
216 src/config/sessions/session-canonical-validation-readiness.ts READ — repeated checks protect separate awaits and live worker authority.
216 src/config/validation-channel-rules.ts READ - Fourth-pass registry and DM-access ownership already applied; account inheritance and warning source text must remain distinct.
215 src/config/sessions/session-transcript-projection-writer.ts READ - Worker publication and incognito/native fallback share low-level projection kernels while preserving different live owners.
213 src/config/sessions/session-entry-provenance.ts READ — creator, owner, contributor and inherited sandbox decisions have different identity contracts.
210 src/config/sessions/targets-collision.ts READ — physical collision and logical suffix diagnostics apply different ownership rules.
207 src/config/sessions/session-history-types.ts READ - Page, delta, artifact, and transcript request/result unions describe independently consumed contracts.
206 src/config/types.telegram.ts READ - Group/topic types already share an owner; direct-message and account contracts retain distinct documented fields and legacy migration inputs.
204 src/config/sessions/group.ts READ — channel-owned legacy normalization and explicit opaque routes must keep their precedence.

@clawsweeper

clawsweeper Bot commented Sep 29, 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 September 29, 2026 08:06
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 8a0bd340769de1dd29a90e0e1dcdfde3ecd3ccd2
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/config/types.secrets.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 5:22 AM ET / 09:22 UTC (Revision 3).

ClawSweeper review

What this changes

The branch consolidates config environment publication, config reads and writes, session transcript and maintenance code, and related metadata, while updating a timezone test fixture.

Merge readiness

⛔ Blocked before merge - 4 items remain

This cleanup remains distinct from the merged fourth pass and is absent from current main. I found no concrete introduced defect, but the required published-updater check against existing config and session state is still unrecorded.

Priority: P3
Reviewed head: 8a0bd340769de1dd29a90e0e1dcdfde3ecd3ccd2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The refactor is coherent and broadly checked, but existing-state upgrade compatibility remains unverified.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This member-authored internal refactor is exempt from the external-contributor real-setup gate. Focused Testbox and fresh-install test results are reported, but no published-updater run against copied existing state establishes upgrade compatibility for the touched rollback and migration paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored internal refactor is exempt from the external-contributor real-setup gate. Focused Testbox and fresh-install test results are reported, but no published-updater run against copied existing state establishes upgrade compatibility for the touched rollback and migration paths.
Evidence reviewed 9 items Introduced environment change: The branch replaces the pending-publication chain with a collection whose membership controls rollback and commit settlement.
Current main still differs: Current main retains the earlier pending-publication chain and epoch, so the central refactor is not already implemented there.
Session reader boundary: Database-addressed transcript requests now share a retained-database custody and reply boundary; database-free requests remain separate.
Findings None None.
Security None None.

How this fits together

OpenClaw loads authored configuration into runtime settings and environment variables, then writes changes with rollback protection. Session migration, maintenance, and transcript readers consume the resulting state.

flowchart LR
A[Config file] --> B[Config loading]
B --> C[Runtime environment]
B --> D[Config writes and rollback]
D --> E[Session state]
E --> F[Transcript reader]
F --> G[Gateway responses]
Loading

Before merge

  • Resolve merge risk (P1) - A published v2026.9.6 updater-to-candidate run on copied existing config and session state is not recorded. The refactored rollback and migration paths could therefore have upgrade-only effects that the focused tests do not settle.
  • Complete next step (P2) - Record a published v2026.9.6 updater-to-candidate run on copied existing config and session state, including preservation and recovery outcomes, before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -482, Tests +25, Other -3. Total -460 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 40 727 1209 -482
Tests 2 26 1 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 1 4 -3
Total 44 754 1214 -460

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/config/sessions/legacy-main-session-migration.ts, unknown-data-model-change: src/config/sessions/legacy-main-session-migration.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete upgrade proof (recommended)
    Run the published v2026.9.6 updater against copied existing config and session state with this candidate, and record preservation and recovery outcomes.

Technical review

Best possible solution:

Keep one owner for config publication, write recovery, and session reads while verifying that an upgrade preserves existing operator state and rollback behavior.

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

Not applicable: this PR reports no product defect. Its new rollback tests exercise a specific invariant, while the existing-state upgrade path has not been shown.

Is this the best way to solve the issue?

Yes, the consolidation follows existing config and session owners without adding a public capability; upgrade evidence is still needed before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9c1b41731c1e.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or identified urgent defect.
  • merge-risk: 🚨 compatibility: Config rollback and migration code affects existing installations, and the required candidate upgrade result remains unrecorded.
  • 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. Not applicable: This member-authored internal refactor is exempt from the external-contributor real-setup gate. Focused Testbox and fresh-install test results are reported, but no published-updater run against copied existing state establishes upgrade compatibility for the touched rollback and migration paths.

Evidence

What I checked:

  • Introduced environment change: The branch replaces the pending-publication chain with a collection whose membership controls rollback and commit settlement. (src/config/config-env-vars.ts:595, 8a0bd340769d)
  • Current main still differs: Current main retains the earlier pending-publication chain and epoch, so the central refactor is not already implemented there. (src/config/config-env-vars.ts:307, 9c1b41731c1e)
  • Session reader boundary: Database-addressed transcript requests now share a retained-database custody and reply boundary; database-free requests remain separate. (src/config/sessions/session-transcript.worker.ts:575, 8a0bd340769d)
  • Persisted migration path: The branch shares the values written to migration ledger inserts and conflict updates. Source comparison shows the same columns and values, but does not exercise an existing-state upgrade. (src/config/sessions/legacy-main-session-migration.ts:274, 8a0bd340769d)
  • Upgrade proof policy: The root policy requires a published updater-to-candidate check for work touching config or state migration. (AGENTS.md:84, 8a0bd340769d)
  • Proof recorded in the reviewed body: The live PR body matched the captured body hash. It reports focused Testbox checks and fresh-install tests, while stating that published-updater compatibility proof is being completed separately; no completed result is recorded in that body. (8a0bd340769d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the published-updater-to-candidate result on copied existing config and session state; the PR already records fresh-install defaults checks.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-29T08:26:51.558Z sha 8a0bd34 :: blocked before merge. :: none
  • reviewed 2026-09-29T09:03:48.298Z sha 8a0bd34 :: blocked before merge. :: none

@steipete
steipete merged commit f5e5f75 into main Sep 29, 2026
271 of 308 checks passed
@steipete
steipete deleted the deslop/l161-config5 branch September 29, 2026 09:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
* refactor(config): deslop config fifth pass

* refactor(config): share current-entry worker dispatch

* chore(config): shrink removed assertion allowances

* test(config): bootstrap timezone subprocess source imports

* refactor(config): avoid dispatch callback shadowing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL 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