Skip to content

refactor(config): deslop config and sessions - #164645

Merged
steipete merged 3 commits into
mainfrom
deslop/l359-config-sessions2-20261003-ready
Oct 4, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l359-config-sessions2-20261003-ready

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Config and session internals contain one-caller factories, repeated projections and validation assembly, and unused internal fields.

User Impact

No user-visible change. Config keys, defaults, validation messages, generated schema/docs, public SDK contracts, persisted session shapes, and SQLite schemas stay unchanged.

Why This Change Was Made

  • Return rewritten config values directly instead of wrapping recursive results in a separate change flag. Reuse validation, roster-index, and store-identity owners.
  • Keep admission writes in the transcript recorder and assemble reclamation plans at their sole runtime callers. Preserve detached scheduling, cloneability normalization, source freshness, and write authority.
  • Remove repeated parsing of private archive plans produced by the paired typed owner. Retain database identity, snapshot/generation checks, integrity, bounds, and operation/result validation.
  • Simplify session projections and remove unused fields and forwarding functions. Preserve raw roster types, migration inputs with real callers, and typed row builders.

Evidence

Final head 5a32003e30948727e7eeae863296dab505277aca has the exact remotely verified candidate tree e97e589e4d25f63114edb6869e1d2a487523371e. AWS proof: 21 media cases passed via pnpm test src/sessions/user-turn-transcript.media.test.ts --maxWorkers=1 (35s including preparation); both cycle checks passed with zero cycles (Madge 34s, runtime 18s). Fresh independent review is scoped-clean through P2. The lease is released. Exact-head CI finished with 97 successful jobs and three proven pre-existing non-security failures plus the aggregate gate. The evidence comment records matching main/unrelated CI and the clean-main preview reproduction. Security checks passed. The coordinator-authorized, head-pinned squash merge is d0c59630c5a6eb3e63dcae17e69fa0faf20f7f7c; ancestry on main and the landed production reduction were verified.

Earlier Linux proof at b4f743426d8e231ff5d93ab163d9f0d57a20ccc9: exact HEAD/tree verified, zero cycles, and 332 tests passed across 17 files. A subsequent additive rebase retained both the upstream Doctor-drain regression and dispatch-observation helper; all 31 maintenance-kick tests passed. Config-write follow-up: 73 tests passed in 22.29s including startup.

Selected Linux test command times (pnpm test <file> --maxWorkers=1): disk-budget removal failures 44s; maintenance cadence 33s; maintenance kick 30s; maintenance worker 87s; reclamation reuse 71s; reclamation worker 40s; reclamation 47s. Includes startup and applicable worker preparation. Prior published-head CI run 37171063996 had 98 successful jobs and only the media map-spread lint failure plus aggregate gate; that rewrite is withdrawn. Aggregate non-skipped job wall time was 21,702s. No test threshold was raised.

Stored-data compatibility: migration inputs/transforms are unchanged. Removed changed and blob path fields were return-only metadata. Session entries, prompt references, hashes, blob filenames, SQL schemas, file-content assertions, and byte accounting stay unchanged.

Measured diff: 385 net production lines removed; tests/support add 35 net lines; 51 files changed. No generated or documentation changes. This uses the below-1,000 coverage exception: all 899 non-generated production TypeScript files at the discovery base were read, with all 271 files over 200 lines documented below. Current ownership, custody, migration, and persistence contracts were retained; overlap-protected files were left unchanged.

Complete size-sorted coverage log (271 production files over 200 lines)

l359 config and sessions second-pass coverage

Base: c732cad. All 899 production TypeScript files were inventoried, and the subtree was read across the lead and scoped reviewers. Tests, fixtures, test support and generated files are excluded from production counts. Every production file over 200 base lines is listed below, sorted by size. READ includes coordinated reads; protected overlap files were read but not edited.

Coverage: 271 of 271 production files over 200 lines.

Base lines File Status and disposition
1698 src/config/io.write-prepare.ts READ — Remove recursive {changed,value} result wrappers; keep no-change identity directly. Walk path presence iteratively, accept readonly paths without defensive copies, retain raw roster map types for legacy field preservation, reuse the already-parsed rename-index set. Other include/reference preservation and July roster migration/refusal paths have current contracts and remain.
1136 src/config/mutate.ts READ — Root/include mutations share write ownership; retries, deferred migrations and compensation preserve current atomic-write and SDK contracts.
884 src/config/sessions/session-accessor.types.ts READ — Overlap-protected; no edits. Storage-neutral API contracts retain lifecycle, append, projection, fork, and worker callback distinctions used by current callers.
870 src/config/sessions/types.ts READ — Persisted/public session shape declarations dominate; merge provenance, model normalization, and stale-token policy remain named contracts.
771 src/config/zod-schema.agent-runtime.ts READ — Tool/runtime schemas already share policy shapes; changing literals, refinements, or defaults would alter the protected schema/error contract.
765 src/config/schema.labels.ts READ — Direct ordered label metadata, with repeated ownership groups already factored; exact generated labels remain unchanged.
764 src/sessions/session-lifecycle-admission.ts READ — Retained global admission indexes, FIFO identity locks, pending-vs-acquired cancellation, current owner snapshots, and mutation cleanup; these protect observed concurrency/lifecycle contracts. Recent #163815 also owns this boundary.
753 src/config/sessions/session-transcript-worker.types.ts READ — Discriminated requests and responses preserve per-operation transport contracts; derived reader types already reuse request owners. No safe large simplification.
748 src/config/sessions/session-transcript-reconcile.ts READ — Three execution paths preserve disk executor versus native memory authority; pending latches, lifecycle generations, independent lease release, and deferred orphan sweep have distinct current contracts. No sound large deletion identified.
746 src/config/sessions/combined-store-gateway.ts READ — Federation preserves physical/logical owners, sentinel precedence, target generations, and captured lineage; no sound large removal.
741 src/config/zod-schema.core.ts READ — Canonical provider, secret, media, and channel schema owner; remaining branches enforce distinct accepted-input contracts.
735 src/sessions/session-state-events.ts READ — Retained worker admission, frozen notice cursors, publication ordering, best-effort error handling, and released synchronous SDK compatibility; no redundant alternate owner found.
731 src/config/sessions/session-accessor.sqlite-reset-window.ts READ — Indexed and unindexed controls, reset-vs-compaction retention, logical ordinals, byte accounting, and cache invalidation each protect distinct current contracts; no safe larger deletion found.
727 src/config/runtime-snapshot.ts READ — Publication generations, immutable hashes, async preparation and live write-owner checks have current runtime consumers.
727 src/config/sessions/disk-budget.ts READ — Retained JSON artifacts still have Doctor import and cleanup callers; projected prompt bytes, physical removals, zero-byte successes, and commit-before-unlink accounting are distinct. No sound large deletion identified.
725 src/sessions/user-turn-transcript.ts READ — Inlined the single-caller admission-write factory and receipt constructor into the recorder; exact detached scheduling and failure settlement remain. Other branches protect pending input custody, late media prefix stability, idempotence, and steering.
722 src/config/io.observe-recovery.ts READ — Sync/async recovery already shares one generator. Backup proof, superseded-owner handling, file identity rechecks, and post-commit health settlement are required. Audit publication responsibility is excluded.
720 src/config/sessions/targets.ts READ — Configured, retired, fixed, and shared target discovery have distinct admitted ownership and recovery semantics.
715 src/config/config-env-vars.ts READ — Read-time provenance and publication rollback are distinct lifecycles; Windows alias pairing and live compare-and-swap ownership checks are required.
715 src/config/sessions/session-accessor.sqlite-reclamation-worker-lifetime.ts READ — Retained native-close, pooled-task custody, commit-gate, and retry settlement states each cover a distinct failure outcome.
715 src/config/sessions/session-accessor.sqlite-transcript-write.ts READ — Public sync/async writes have different custody and entry-presence contracts; snapshot conflict and cold-restore boundaries remain necessary.
714 src/config/io.write.ts READ — Protected cron-owner closure; no edits. Publication phases, compensation ownership, and per-await authority are required.
714 src/config/sessions/session-accessor.sqlite-entry-cache-publication.ts READ — Publication provenance, placeholders, unknown-settlement custody and late-write supersession each enforce distinct current contracts.
710 src/config/sessions/session-accessor.sqlite-pending-inputs.ts READ — Pending-source promotion, consumption, worker receipts and relocation have distinct live-custody and transaction-settlement duties.
710 src/config/sessions/session-cold-storage-worker.ts READ — Removed unused per-transcript beforeMs field; batch freshness and protection thresholds remain authoritative.
709 src/config/sessions/session-accessor.sqlite-entry.ts READ — Worker/native patch preparation converges in one owner; admitted source, async callback and no-maintenance semantics are used by current callers.
707 src/config/sessions/transcript.ts READ — Assistant append serves SDK/public callers; keyed replay, mirror deduplication, before_message_write, redaction, transcript lifecycle, and legacy artifact reads are live contracts. No sound large deletion identified.
702 src/config/sessions/legacy-main-session-migration-operations.ts READ — In-place/cross-store/quarantine flows differ in ownership and durability; copy-before-delete source and destination snapshots must remain. No sound large deletion identified.
700 src/config/sessions/session-accessor.sqlite-transcript-store.ts READ — Batch inserts, exact rewrites, destructive replacements and payload repair preserve different idempotency, generation and projection contracts.
689 src/config/io.snapshot.ts READ — Missing/invalid/valid snapshots have distinct validation, recovery, observation, and environment-restoration contracts. Existing scope boundaries preserve captured preparation ownership. No sound further consolidation.
687 src/config/sessions/session-accessor.sqlite-lifecycle-state.ts READ — Projection selection and delete-time snapshot/reference checks protect concurrent lifecycles; exact-key and malformed-row paths have separate contracts.
686 src/config/sessions/session-entry-read-runtime.ts READ — Native/file readers differ in writable-open and retained source policy; ordered reads must retain FIFO admission and synchronous consumers. No safe large simplification.
685 src/config/sessions/session-accessor.sqlite-history-query.ts READ — Considered removing one-subscriber remember hook; a new page/bytes DTO and .page plumbing save only roughly 2–3 lines while spreading cache-only facts, so rejected as no real simplification.
684 src/config/sessions/session-transcript-worker-resources.ts READ — Lane-specific native custody, aliases, close failures, discovery scopes, and idle retirement remain real lifecycle contracts. No safe deletion.
672 src/config/sessions/session-history-eviction.ts READ — Applied direct history-eviction plan construction; protected IDs still snapshot before dispatch, with live write admission and exact generation checks retained.
667 src/config/sessions/session-accessor.sqlite-archive-read.ts READ — Bounded two-pass archive selection, run binding, cursor validation, and display-context windows are distinct required behavior.
664 src/config/sessions/session-transcript-worker-runtime.ts READ — Shared owner already serves single/batch reads; cost work additionally retains host writes and retryable cleanup. No safe flattening.
661 src/config/sessions/cleanup-service.ts READ — Preview and apply share planSessionEntryMaintenance; remaining differences preserve revalidation, partial failure receipts, and dry-run output. No sound large deletion identified.
658 src/config/sessions/legacy-main-session-migration.ts READ — Retained legacyAgentId input: agent creation passes it. July+ migration ledger, repair, and authority contracts remain unchanged.
653 src/config/sessions/session-accessor.sqlite-entry-store.ts READ — Canonical write owner retains creator provenance, same-node involvement, generation-bound privacy, window ownership and atomic projections.
650 src/config/schema.help.runtime.ts READ — Direct ordered metadata map; shared node/audio descriptions already delegated to canonical owners. Read in full by coverage subagent.
650 src/config/sessions/session-history-worker-runtime.ts READ — Queued coalescing ends at dispatch; capture projections intentionally strip unrelated properties, and projection restoration retains admission. No safe large simplification.
649 src/config/sessions/session-accessor.sqlite-deletion.ts READ — Native companion preparation, repository cleanup, and rollback settlement use different ownership phases; no safe flattening found.
648 src/config/zod-schema.gateway.ts READ — Closed auth, proxy, role, TLS, and ingress schema refinements; no sound simplification preserving exact validation output.
646 src/config/includes.ts READ — One include resolver owns merge order, provenance, guarded reads and bounded file-chain traversal; stack traversal supports deep document values.
642 src/config/sessions/session-accessor.sqlite-read.ts READ — Public/runtime readers are used; read-only/writable and raw/projected variants have different lifecycle/budget duties. Existing asOptionalRecord(event)?.type === "message" could replace one verbose JSON-record predicate, but left unedited.
640 src/config/redact-snapshot.ts READ — Schema-aware redaction, secret-ref identity, and array restoration prevent credential reassignment; no safe removal of ownership checks.
633 src/config/sessions/store-maintenance.ts READ — Retention policies deliberately distinguish human sessions, model probes, dashboard archiving, count capping, recent protection, and physical-budget victims. No sound large deletion identified.
625 src/config/sessions/session-transcript-projection-rebuild.ts READ — Memory and disk projection sources share visitor and builder; native snapshot, bounded append catch-up, current claim, and invalid-leaf refusal are real boundaries. prepareProjectionSource has TWO callers and should stay.
619 src/sessions/session-diff.runtime.ts READ — Combined baseline inventory and baseline assembly under collectCheckoutDiffBaseline, removing one-caller intermediate candidate DTO; preserved Git command settlement, hashing format, byte limits, and hardlink/path guards.
618 src/config/doc-baseline.ts READ — but excluded from edits: open deslop/x10-unpaid-caches-20261003 owns this file; deterministic artifact traversal and output retained.
617 src/config/sessions/session-accessor.sqlite-model-context.ts READ — Pairing-safe cuts, bounded tool-result omissions, SQL-side byte sizing, and snapshot-local hydration have concrete current consumers; no sound large simplification found.
613 src/config/zod-schema.root-shape.ts READ — Canonical root keys and per-surface refinements; declarative schemas and protected generated output must remain identical.
612 src/config/sessions/session-accessor.sqlite-lifecycle.ts READ — Applied direct entry and historical-generation reclamation plans at their sole caller. Fresh source snapshots, write authority, descendant-run basis and compensation remain unchanged.
609 src/config/sessions/session-accessor.sqlite-archive.worker.ts READ — /APPLIED — Removed three redundant typed-private-IPC plan parsers; shared one-shot payload contract is checked at producer and consumed after envelope/operation selection.
607 src/config/channel-compat-normalization.ts READ — Shared July-and-later channel alias owner; root/account delivery precedence and atomic preview seeding differ by documented channel contract.
605 src/config/sessions/session-transcript.worker.ts READ — Large branch dispatch preserves narrow lazy imports and differing read admission/output shapes; generic descriptor replacement would obscure those contracts. No sound large deletion identified.
604 src/config/sessions/session-accessor.sqlite-transcript-suffix.ts READ — Retained typed row builder: direct conditional spreads violate the map-spread lint contract. Suffix fencing, idempotency, and projection behavior remain unchanged.
600 src/config/io.write-safety.ts READ — Path proof, atomic publication receipts, hardlink checks, source-hash comparison, and compensation authority are current contracts. Small stat normalizers keep explicit diagnostic semantics.
600 src/config/sessions/session-canonical-key.ts READ — Committed reader continuation, revocation, first-admission snapshot, and canonical writer checks are real lifecycle boundaries.
599 src/config/sessions/session-cold-storage.ts READ — Captured target identity, cold queue, active admission checks, cooldowns, and bounded round-robin maintenance are current behavior. No sound large deletion identified.
599 src/config/sessions/session-transcript-index.ts READ — Forward append, bounded rebuild, suffix replacement, dirty watermark, and orphan cleanup share existing owners; no unused large branch identified.
595 src/config/validation-plugin-rules.ts READ — Lazy metadata loading and channel/plugin validation order preserve startup and exact warning behavior; no redundant owner found.
578 src/config/sessions/session-entry-read.worker.ts READ — Read workers serve distinct projections, lifecycle snapshots, retained placeholders and physical source proofs; no large safe dispatcher consolidation.
577 src/config/defaults.ts READ — Catalog inheritance and mutation identity preserve authored overrides; aliases and provider token limits remain current contracts.
577 src/config/sessions/session-accessor.sqlite-maintenance-kick.ts READ — Applied direct maintenance-plan construction. Admission, deferred scheduling, conflict budget and quiet-window behavior remain tested at the actual dispatcher.
569 src/config/io.audit.ts READ — Audit responsibility explicitly excluded; no edits.
567 src/config/sessions/session-accessor.sqlite-projection.ts READ — Open-PR overlap protected. Native and off-thread lifecycle operations converge at the commit kernel; archive recovery/cleanup ordering is observable.
564 src/config/sessions/restart-recovery-state.ts READ — Normalization parses unknown durable state and maintains bounded ordered terminal evidence; no typed-only validation to remove.
563 src/config/env-preserve.ts READ — Array identity matching distinguishes retained, edited, escaped and active references; removing matching branches changes authored-secret write behavior.
561 src/config/sessions/session-accessor.sqlite-parent-session.ts READ — Parent transcript preparation, same-store commit, cross-store copy, and entry-fork routes all have real callers and distinct atomicity constraints.
547 src/config/sessions/session-accessor.sqlite-transcript-reports.ts READ — /APPLIED. Use canonical store-candidate identity capture helper; report settlement, native fallback and worker admission remain intact.
545 src/config/io.runtime.ts READ — Facade aliases/no-op cache API are publicly re-exported through config and Plugin SDK. Captured environment publication, ownership handoff, and preflight/finalization behavior remain necessary.
545 src/config/sessions/session-accessor.entry-mutation.ts READ — Physical cohort preparation, async source custody, concurrent metadata merge and abort fallback retain distinct contracts; no sound larger deletion found.
544 src/config/sessions/session-accessor.sqlite-message-cut.ts READ — Rewind, fork, and branch switch already share one owner; identity resets and editor attachment bounds preserve user-visible contracts.
543 src/config/plugin-auto-enable.shared.ts READ — Provider/channel/harness activation candidates follow distinct owners and cold-load gates; recent consolidation already removed repeated paths.
539 src/config/sessions/transcript-tree.ts READ — Navigation storage supports memory and disposable migration spool; reset boundaries, invalid controls, opaque append ancestry, and parentless current-version rows are distinct retained contracts. No sound large deletion identified.
533 src/config/sessions/session-incognito-actor.ts READ — Actor settlement and publication enforce live authority and unknown-outcome fencing; keep all existing stages.
530 src/config/sessions/session-accessor.sqlite-entry-read.ts READ — Metadata, full and delivery projections retain exact row validation, current aliases, cohort error isolation and byte-preserving delivery behavior.
528 src/config/sessions/session-accessor.sqlite-canonical-repair.ts READ — Doctor copy preserves per-table merge/authorization rules and missing-generation recovery; no interchangeable duplicate flow found.
523 src/config/sessions/session-accessor.pending-inputs.ts READ — Queued, consumed, completed, recovered, and aggregate receipts carry distinct live custody and settlement contracts; sync native completion and async worker completion remain used.
516 src/config/sessions/session-accessor.sqlite-node-artifacts.ts READ — Artifact tables have different revision, membership, identity, and merge contracts; generic descriptor collapse would obscure them.
515 src/config/sessions/session-accessor.entry.ts READ — Canonical selectors and qualified physical-source retention preserve current persisted-key and alias ambiguity errors; no safe further flattening found.
508 src/config/sessions/session-accessor.sqlite-scope.ts READ — Common identity resolver already owns sync/prepared routing; exact FIFO admission, async discovery, incognito routing, captured environments, and profiling facts must remain distinct.
504 src/config/schema.ts READ — Bounded extension schema merging and cached base ownership preserve exact hints, ordering, and response budgets.
504 src/config/sessions/session-accessor.sqlite-replacement-worker.ts READ — Admission, commit receipt, publication, unknown-outcome refusal, and cleanup error precedence cannot be collapsed safely.
503 src/sessions/session-state-events.kernel.ts READ — Retained bounded SQL batches, aliased-key ordering, retention watermarks, and persisted cursor ownership; removing schema admission here would be a different migration/owner change.
498 src/config/sessions/session-accessor.transcript-turn.ts READ — /APPLIED. Inline one-use target wrapper and consume selectedSessionId directly; retain mirror entry locally without duplicating prepared target facts.
497 src/config/sessions/session-accessor.sqlite-reclamation-run.ts READ — Existing native handles and unopened physical sources require different admission paths; both converge at one prepared reclamation owner.
494 src/config/sessions/session-accessor.sqlite-exact-read.ts READ — Snapshot error precedence, physical source capture, settlement, read-only admission, and grouped exact reads are live. legacyKeys: [] looks vestigial but is observable in exported result/tests, so not removed without caller-wide cutover.
494 src/config/sessions/session-accessor.sqlite-transcript-parent.ts READ — Bounded prepared-assistant ancestry and visible-parent selection preserve admitted input identity, imported tree semantics and question-answer provenance; no safe simplification found.
493 src/config/sessions/session-accessor.sqlite-maintenance.ts READ — Union-find batches keep inseparable session owners in one transaction while bounding archive work; no sound algorithm deletion found.
490 src/config/sessions/session-accessor.sqlite-mutation-worker.runtime.ts READ — Native close retries, pooled task release and private parent commit admission enforce known cleanup failures; preserve state machine.
490 src/config/validation-core.ts READ — Ordered raw, schema, source-name, sandbox, and semantic admission checks have distinct error/precedence contracts.
487 src/sessions/session-upstream-monitor.ts READ — Inlined single-use provider lookup, database option projection, and whitespace normalizer. Idle/source/owner checks, missing counters, retry semantics, and scheduler lifetimes retained.
486 src/config/sessions/session-store-target-inventory.ts READ — Full locator inventory/registry mutation code read; preserves source custody versus ordinary data failures and configured/recovery/retired selection semantics.
486 src/config/sessions/session-transcript-worker-readers.ts READ — Already shares typed reader decoding; exceptional chunked and boolean outputs require distinct checks. No new descriptor machinery justified.
483 src/config/sessions/session-accessor.sqlite-reclamation.ts READ — Applied four one-caller plan-factory removals. Caller literals preserve canonical database options, protected-ID snapshots, descendant facts and the real cloneability boundary; three outside-lane-consumed constructors remain.
481 src/config/sessions/session-transcript-reconcile.worker.ts READ — Chunk protocol, shared-state lifecycle phases, source identity, and close/lease ordering must remain; input parser could only be removed with a supported typed worker input boundary, not an unchecked cast.
474 src/config/sessions/session-accessor.sqlite-lifecycle-artifacts.ts READ — Negative candidate probes preserve cold/warm admission behavior; orphan marker scan intentionally consumes every row for late read failures.
465 src/config/sessions/session-accessor.sqlite-active-events.ts READ — Delta, bounded-tail, latest, user-authority, and ordinal-page readers serve distinct callers. Full-message reader has no production caller but many external test callers, so removing it would just relocate a useful test boundary.
463 src/config/sessions/session-accessor.sqlite-entry-cache.ts READ — Exact-key cache validity retains foreign-commit and same-timestamp raw-edit detection; field-only updates avoid reloading unrelated state.
451 src/config/sessions/session-accessor.sqlite-active-context.ts READ — Imported-duplicate retention and indexed/unindexed parent resolution preserve current exact-import behavior; byte caps precede payload hydration. No sound large reduction found.
450 src/config/sessions/transcript-write-context.ts READ — Ambient writer custody, metadata publication, initial writer claims, CLI history, and concrete target comparisons are authority boundaries with different callers. No sound large deletion identified.
445 src/config/sessions/session-accessor.sqlite-replacement-projection.ts READ — Exact-key, canonical-alias, and absent-target creation modes retain separate selection and authorization invariants.
436 src/config/schema.lookup.ts READ — Lookup and classification have intentionally different wildcard/index behavior; schema stripping enforces response limits.
435 src/config/paths.ts READ — Profile identity, native-service safety, explicit config selection, and legacy location discovery are shipped path contracts.
434 src/config/validation-plugin-config.ts READ — Missing, blocked, deferred, disabled, external, and memory-slot plugins produce distinct diagnostics; no behavior-neutral large collapse.
431 src/config/mcp-config.ts READ — Common commit/update owner already consolidates persistence; wrappers retain configure/tool-filter/set/unset semantics and commit hooks.
431 src/config/sessions/session-delivery-generation.ts READ — Incognito and disk leases preserve original physical identity, committed generation facts, invalidation, and lifecycle exclusion; used by outbound delivery, memory audience, subagent control, and cron-root runners. Protected cron closure; no edit recommended in this lane.
429 src/config/channel-config-metadata.ts READ — Origin precedence, selected ownership, cross-owner sensitivity, and external-schema containment are separate required contracts.
422 src/config/sessions/transcript-payload.ts READ — JSONB/native JSON and bounded compressed payload paths preserve exact identity bytes, surrogate behavior, and non-UTF8 database handling. No sound large deletion identified.
410 src/config/sessions/session-accessor.sqlite-canonical-inventory.ts READ — Strict versus tolerant Doctor scans and inventory tokens detect different repair hazards; projection hydration is current recovery behavior.
409 src/config/sessions/paths.ts READ — Absolute-path portability helpers still serve Doctor, usage, transcript and recovery callers; Sep history confirms retained contract.
409 src/config/sessions/session-accessor.sqlite-history-interval.ts READ — Closed-reset navigation and planner-pinned SQL protect bounded history. parseStoredTranscriptEvent is a trivial JSON.parse wrapper that can be inlined in this file and history-query, but not edited under the approved handoff.
409 src/config/sessions/session-accessor.sqlite-projection-read.ts READ — Shared range selection and query compilation already centralize the hot path; snapshot admission and unavailable/cold states are necessary. Factoring repeated parameter binding would require another callback type and offers little reduction.
407 src/config/sessions/delivery-info.ts READ — Exact/folded aliases, routability ordering, lazy fallback inventory and per-store errors are distinct externally observable policies.
407 src/config/sessions/session-accessor.sqlite-archive-selection.ts READ — SQLite scratch navigation bounds memory for large archives; replacing it with simpler in-memory maps would violate resource behavior.
405 src/config/sessions/session-accessor.sqlite-history-projection.ts READ — Marker/branch/reset query choices explicitly bound cold-history work; count-only reads avoid payload projection. Binary searches maintain bounded lookup costs; no existing canonical helper found.
405 src/config/sessions/session-accessor.sqlite-lifecycle-types.ts READ — Leaf contracts keep lifecycle, maintenance, and worker imports acyclic; no dead transport variants established.
405 src/config/sessions/session-sqlite-target.ts READ — Retry catches deliberately surround registry reads/rechecks separately from worker resolution; merging them risks broadening what is retried.
399 src/config/sessions/session-accessor.sqlite-transcript-state.ts READ — Session-root initialization and watermark advancement enforce canonical ownership, monotonic timestamps and reaction retention.
392 src/config/schema.help.core.ts READ — Shared metadata spreads and Talk-default interpolation retain existing owners; no unnecessary logic. Read in full by coverage subagent.
391 src/config/source-file.ts READ — Watcher admission, replacement, scope reconciliation and joined retirement preserve current readiness and hot-reload behavior.
388 src/config/sessions/session-accessor.sqlite-import-stage.ts READ — Disk staging and branch repair remain used by post-July Doctor recovery. The suspected unused contains method is required by src/infra/session-sqlite-transcript-verification.ts and was retained.
381 src/config/sessions/session-accessor.sqlite-archive.ts READ — /APPLIED — Materialize/publish one-shot producers now satisfy the shared private payload contract; FIFO, cancellation, result settlement, and archive deduplication stay intact.
381 src/config/write-lock.ts READ — Reentrant scopes, joined writes and all-source lock admission preserve FIFO and current handoff custody.
378 src/config/sessions/session-accessor.sqlite-worker-request.ts READ — FIFO admission release and result-versus-exit settlement are distinct current lifetimes; no safe generic flattening found.
378 src/config/sessions/session-snapshot-merge.ts READ — Model/auth and restart recovery are atomic field families; general field merge cannot replace their concurrency contracts.
370 src/config/sessions/session-accessor.sqlite-parent-fork.ts READ — Token estimates distinguish compacted/reset retained context and unavailable provider usage; branch normalization and label/leaf preservation remain required.
370 src/sessions/provider-review.ts READ — Retained capability identity, live review/model fencing, single-attempt ownership and native acceptance; superficially repeated validation straddles awaited authority boundaries.
369 src/config/io.context.ts READ — Recovery and load use shared context-bound plugin metadata and environment facts. Async metadata caching prevents duplicate database work. Sync and async effects already share recovery logic.
368 src/config/schema.tiers.ts READ — Wildcard specificity/authored-order precedence and two-pass numeric tier inheritance are required for stable generated hints.
368 src/config/sessions/metadata.ts READ — Origin identity switches and explicit thread absence must clear only specific stale route fields; no safe large simplification.
367 src/config/sessions/session-entry-navigation.ts READ — Opaque/label/reset ancestry and visible branch handling preserve distinct transcript navigation semantics.
364 src/config/sessions/session-accessor.sqlite-maintenance-store.ts READ — Indexed candidate planning and final fresh-row/preservation comparisons avoid full scans without relaxing deletion authority.
361 src/config/schema.help.automation.ts READ — Literal descriptions encode distinct session, automation, hook, and channel contracts; deduplication adds indirection. Read in full by coverage subagent.
360 src/config/sessions/session-accessor.sqlite-creation.ts READ — Native incognito and worker-backed creation share provenance owner but require different header/alias commit paths; retain rollback/publication duties.
360 src/config/sessions/session-accessor.sqlite-page-reclamation.ts READ — In-process/incognito and worker-backed archive pruning have different handle custody; reader and writer paths preserve shared ordering.
353 src/config/sessions/startup-migration.ts READ — Startup readiness distinguishes retained legacy sources, deletion journals, canonical certification, and successful runtime handoff. Small follow-up candidate: test-only dependency injection, but gateway wrapper forwards its matching test seam.
348 src/config/plugin-auto-enable.materialize.ts READ — Trust, explicit disable, preference, and allowlist decisions already run through one materialization owner.
348 src/config/sessions/session-accessor.sqlite-history.ts READ — Archive discovery, physical identity checks, native incognito owner, worker ownership, and binding verification are intentional distinct boundaries; no sound larger deletion found.
347 src/config/zod-schema.root-support.ts READ — Shared entry schemas, Talk-selection refinement, and MCP key safeguards already have canonical owners.
341 src/config/mutate.include-io.ts READ — Guarded reads, durable publication and conditional rollback each retain current path/custody authority.
341 src/config/sessions/goals-operations.ts READ — Fingerprint, session-generation receipt checks, expiry, capacity and atomic goal mutations preserve idempotency.
341 src/config/types.discord.ts READ — but excluded from edits: open deslop/x02-schema-type-duplication-20261002 owns this file and the shared type cutover.
338 src/config/codex-plugin-diagnostics.ts READ — Effective inherited model/runtime selection is needed to avoid suppressing valid diagnostics; current routes and July-era source projections retained.
333 src/config/sessions/session-accessor.sqlite-generation-copy.ts READ — Whole-state and content-only fingerprints intentionally differ; UTF-16 destination copying and idempotency ownership preserve migration contracts.
333 src/config/sessions/session-accessor.sqlite-transcript-reports.kernel.ts READ — Branch navigation, header validation, response suppression and aborted-partial receipt checks protect current user-visible report behavior.
327 src/config/io.plugin-metadata.ts READ — Inline the single-call scope forwarding layer into its guarded cache owner; retain operation cache lifetimes, machine-state preparation ordering, workspace merge ambiguity diagnostics, and derived snapshot metrics.
326 src/config/sessions/session-accessor.sqlite-maintenance-age.ts READ — Age captures survive ordinary writes but invalidate backdates, restores, foreign changes, and policy changes; no safe cache removal found.
325 src/config/io.health-state.ts READ — Current observation supersession, worker admission, guarded reads, and conditional database patch behavior are substantive lifecycle contracts. No state/schema changes allowed.
325 src/config/io.read-helpers.ts READ — Remove the tilde expansion helper's unreachable non-tilde branch: the preceding regular expression admits only ~, ~/..., and ~\\..., which share direct path joining. Preserve iterative include traversal and source error behavior.
322 src/config/sessions/session-accessor.sqlite-transcript-message-append.ts READ — Current replay compatibility is September 2026; pending-input custody and post-idempotency hooks preserve accepted bytes and active-branch authority.
320 src/config/sessions/session-accessor.sqlite-deletion-plan.ts READ — Plan-versus-commit generation checks and admission fences prevent partial historical deletion and stale entry removal.
320 src/config/sessions/session-pending-input-store.ts READ — Replaced duplicated candidate identity-map preparation with the existing locator owner; retained pre-await capture and all custody checks.
319 src/sessions/session-lifecycle-diagnostics.ts READ — Retained bounded observational state, hashing, queue ownership, trace propagation, and diagnostic failure isolation; no sound material simplification found.
318 src/config/sessions/session-entry-patch.ts READ — Candidate transfer, current authority, commit receipts, and unknown-outcome publication must remain.
317 src/config/sessions/session-accessor.reset.ts READ — Open-PR overlap protected. Reply initialization preserves same-session metadata and archives after commit; no edits.
316 src/config/issue-location.ts READ — JSON5 source scanner preserves duplicate-key, comments, quoted keys, line endings, and secret-safe received-value display.
313 src/config/sessions/session-accessor.ts READ — Storage-neutral public barrel has real runtime and SDK callers; removing it would require a caller-wide public-boundary cutover.
309 src/sessions/user-turn-transcript.metadata.ts READ — Retained separate canonical write and runtime projections: they intentionally preserve different operational fields and redact rewritten attribution.
307 src/config/sessions/session-incognito-history.worker.ts READ — Typed adapters select distinct existing read kernels; preparation, disclosure and generation checks are necessary.
304 src/config/sessions/session-turn.kernel.ts READ — Removed the unused sessionFile argument from the lifecycle patch builder; turn output and persistence keep sessionFile unchanged.
300 src/config/sessions/session-pending-input-history.ts READ — Replaced duplicated candidate identity-map preparation with locator owner; retained read/write custody and stale-input reconciliation.
298 src/config/sessions/store-entry.ts READ — Canonical, trimmed, folded, and opaque peer keys deliberately have distinct precedence and delivery-proof rules. Removing fallback/alias logic would change current persisted-data lookup; no sound large deletion identified.
294 src/config/sessions/session-sharing-store.async.ts READ — Shared the duplicated member fact publication/invalidation fallback while keeping caller-specific inserted/removed guards.
291 src/config/sessions/session-accessor.transcript-range.ts READ — Closed-turn reads revalidate generation/ancestry and budgets in one snapshot. Recursive SQL already replaced the hand walk; lone-surrogate handling prevents false anchor matches.
291 src/config/sessions/session-incognito-compute.worker.ts READ — Source retention and cleanup differ from generation-bound reads and projection writes; registry paths reuse existing kernels.
291 src/config/sessions/session-transcript-reconcile-pool.ts READ — Pool tracks complete owner work and failed lease cleanup; snapshot accessor has production process-vitals caller, and scoped drain has benchmark/runtime test cleanup callers. No sound large deletion identified.
291 src/sessions/conversation-turns.ts READ — Retained outbound index, durable correlation gate, timeout cancellation and reply claim authority; these jointly prevent duplicate runs and stale claims.
289 src/config/sessions/session-native-binding.worker.ts READ — Deletion coordinates agent and shared-state transactions, reverse compensation, and acknowledged native receipts; duplicated stages have different settlement ownership.
288 src/config/sessions/session-accessor.sqlite-conversation.ts READ — APPLIED one-use preparation inlining. Association rekeying and stale-primary demotion retain timestamp/route-context behavior.
287 src/config/io.load.ts READ — Route asynchronous validation through the existing snapshot-preparation owner instead of repeating pending-migration/metadata validation assembly. Retain synchronous admission and all observation/recovery ordering.
287 src/config/sessions/session-accessor.sqlite-archive-session.ts READ — Scoped warm worker reuse preserves global heap limits, per-operation native settlement, and retirement after publication failure.
287 src/config/sessions/session-history-archive-pruning.ts READ — Removed unused maxPasses override; page budget, no-progress exit, inter-pass yield and WAL gates remain.
286 src/config/sessions/session-canonical-validation.ts READ — Bounded validation bytes, exact-row certification, typed validated batches and compiled statement cache are contract-bearing.
284 src/config/sessions/session-suggestion-store.kernel.ts READ — Removed unused claim TTL override; the same 30-second dispatch claim lifetime remains.
284 src/config/talk.ts READ — Retained normalizers unchanged: direct construction requires shrinking an assertion baseline currently touched by protected concurrent lanes. Boolean-only fast-mode filtering remains intact.
281 src/config/sessions/session-accessor.sqlite-maintenance-transaction.ts READ — Read preparation and commit application deliberately separate candidate work from writer admission; age snapshot and stale-input outcomes remain required.
280 src/config/validation-issues.ts READ — Error enrichment preserves exact Zod/union paths and secret-reference diagnostic deduplication.
279 src/config/sessions/session-accessor.sqlite-archive-store.ts READ — Publication storage abstraction has two real implementations, including worker creation recovery; retry publication and per-generation notifications must remain.
278 src/config/sessions/conversation-delivery-store.kernel.ts READ — Receipt mapping validates stored strings; begin/transition/read retain distinct atomicity and missing-record errors.
276 src/config/zod-schema.agent-defaults-base.ts READ — Declarative default-agent schema already shares model, policy, and owner-target types; no output-neutral simplification.
275 src/config/sessions/session-incognito.worker.ts READ — Domain dispatch applies differing read/write preparation, grants and fact publication; no safe uniform dispatcher without extra machinery.
274 src/config/docs-config-examples.ts READ — Markdown/MDX fence parsing and whole-config filtering protect the retired-key docs gate; external .mts caller confirmed.
272 src/config/sessions/restart-recovery-receipt.ts READ — Begin, complete and cancel have deliberately different ambiguity/terminal/stale outcomes; retain common existing classifier.
271 src/config/sessions/session-incognito-lifecycle.worker.ts READ — Fork, deletion and reclamation share current kernels while enforcing actor-local identity and no-archive policy.
269 src/config/sessions/session-turn.ts READ — Worker admission, pending-input custody, hook preparation, native receipt publication and cleanup aggregation are required.
269 src/config/sessions/targets-read-availability.ts READ — Important rejected consolidation: local dedupe keeps LAST target; targets-path-validation helper keeps FIRST, so they are not interchangeable.
269 src/config/utility-model-separation-migration.ts READ — September utility-model cutover preserves prior implicit routing and deferred dynamic refs; input remains within supported migration window.
268 src/config/sessions/session-accessor.sqlite-import.ts READ — Batch import checks shared physical store, exact source verification, historical-node ownership, and empty recovery destinations before persistent apply.
265 src/sessions/user-turn-transcript.types.ts READ — Retained public recorder and persistence contracts, including released synchronous callback; no narrowing without SDK contract changes.
264 src/config/sessions/session-accessor.sqlite-entry-availability.ts READ — Row-invalid/absent/schema-missing distinctions and ambiguous identity repair are meaningful. The hand-written five-field SessionIdentityEvidenceRow could use the existing row owner type if its exact contract matches; not edited.
264 src/config/sessions/session-accessor.sqlite-reset.ts READ — Offline reset compares exact database and artifact ownership before deletion; no guard removal would preserve authority.
264 src/config/sessions/session-transcript-search.ts READ — Search/filter/snippet/indexing behavior remains live; repeated query filters operate over different table aliases, and FTS rows permit nullable/loose storage. No sound large deletion identified.
263 src/config/io.clobber-snapshot.ts READ — Shared generator already unifies sync/async snapshot rotation. Sync lock attempts intentionally differ from asynchronous bounded retries and local queueing.
263 src/config/resolution-facts.ts READ — Recorded authored versus resolved secret facts and rewrite invalidation are required provenance, not duplicate parsing state.
262 src/config/types.secrets.ts READ — Current parser plus public SDK legacy adapter retain separate contracts; unresolved-ref handling remains explicit.
261 src/sessions/agent-harness-session-key.ts READ — Retained public namespace protection, existing unlocked-row behavior, trusted plugin precedence and durable identity checks.
260 src/config/sessions/session-history-types.ts READ — Closed worker request/result and transferred-byte response shapes have real readers and transport consumers; merging into generic descriptors would add machinery.
259 src/config/include-write-boundary.ts READ — Deepest sole ownership and canonical shared-file checks prevent include writes from mutating unrelated authored subtrees.
258 src/sessions/session-diff-baseline.ts READ — Retained durable pending capture claims, generation checks, exact capture settlement, and in-flight ownership; a promise alone cannot replace durable restart behavior.
257 src/config/sessions/lifecycle.ts READ — Inlined one-use timestamp comparison while preserving flooring, finite check and strict newer-than comparison.
257 src/config/sessions/session-native-binding.ts READ — Independent native binding and agent deletion settlement retain exact generation fencing and compensation custody.
255 src/config/sessions/session-accessor.sqlite-transcript-reports.worker.ts READ — Worker backend borrows canonical connection, retains prepare/commit version and final CLI admission; real ownership boundaries.
252 src/config/model-provider-config.ts READ — Literal versus canonical row precedence, duplicate-row merging, fallback laziness, and reentrant callbacks are documented lookup contracts.
252 src/config/schema.help.models.ts READ — Similar provider/TLS descriptions deliberately differ; exact metadata retained. Read in full by coverage subagent.
252 src/config/sessions/conversation-registry.ts READ — Scope projection intentionally strips extra sessionKey fields from structurally broader callers; passing scope directly would change target resolution.
252 src/config/sessions/session-accessor.sqlite-archive-store-kernel.ts READ — Canonical archive identity, optional schema admission, collision comparison, and pending publication normalization cover durable recovery.
252 src/config/sessions/store-entry-shape.ts READ — Unknown persisted data normalization and removal of projected fields remain storage-boundary duties; scalar migration is July+ supported.
252 src/sessions/session-initialization.ts READ — Retained source/registry authority, rollback-only capability, and native policy preparation; no removal without weakening ownership.
251 src/sessions/user-turn-transcript.message.ts READ — Retained the typed media builder: conditional map spreads violate no-map-spread. Sparse slots, property presence/order, explicit zero values, and the metadata allowlist remain unchanged.
250 src/config/sessions/session-entry-codec.ts READ — Opaque forward compatibility and legacy Doctor import have active callers; source-version recognition cannot be removed without changing retained data.
248 src/config/sessions/skill-prompt-blobs.ts READ — Removed unconsumed changed/blob-path projection fields and one-use return type; external storePath input and persisted SHA256 layout unchanged.
247 src/config/config-journal-snapshot.ts READ — Audit-adjacent closure excluded from edits; fingerprint key identity and live worker authority checks retained.
246 src/config/schema.help.agents.ts READ — Direct metadata declarations without redundant control flow or wrappers. Read in full by coverage subagent.
246 src/config/sessions/conversation-identity.ts READ — Direct-ingress and paired-origin routes have distinct identity/transport semantics; no safe unification.
246 src/config/sessions/session-store-target-runtime.ts READ — Registry discovery retries and publication followups revalidate the selected physical owner across awaited work.
244 src/config/io.write-topology.ts READ — Protected cron-owner closure; no edits. Auth, workspace, session-store, and roster ownership transitions have current contracts.
242 src/sessions/input-provenance.ts READ — Retained distinct provenance policies and byte-stable prompt decoration; sets encode different user-visible/model-facing decisions.
242 src/sessions/transcript-events.ts READ — Retained separate internal/public event projections and explicit public allowlist to prevent leaking lifecycle/store/replay fields.
241 src/config/channel-alias-migration.ts READ — Descriptor owner serves many channel plugins; option branches correspond to real channel-specific migration semantics.
240 src/config/sessions/session-placement-evidence.ts READ — Current > unknown > absent precedence, retained native continuations and incognito generations prevent unsafe retirement; no sound large removal.
239 src/config/sessions/session-accessor.sqlite-raw-delta-read.ts READ — Forward cursor validation, fence handling, byte-first exponential metadata reads, and generation frontier are used by raw/display adapters; no safe large simplification found.
237 src/config/model-input-normalization.ts READ — Whole-config and path-write normalization preserve exact object identity and canonical model references; no safe obsolete branch found.
237 src/sessions/session-worktree-lifecycle.ts READ — Retained exact owner checks, archive/restore error mapping, and cleanup under lifecycle fence.
236 src/config/sessions/session-accessor.sqlite-canonical-worker-pool.ts READ — Pool close and native task custody are separate; failed retirement retry cannot be replaced by ordinary promise cleanup.
236 src/config/sessions/session-incognito-transcript.worker.ts READ — Report preparation fences and exact transcript append guards differ; adapters correctly reuse domain owner.
235 src/config/sessions/session-accessor.sqlite-conversation-read.ts READ — APPLIED inferred query-row type. Current-binding preference and historical activity retention unchanged.
233 src/config/sessions/session-transcript-read-fence.ts READ — Repeated receipt comparisons occur at admission and consumption, separated by user interaction; live authority and exact visible-row identity cannot be removed. No sound large deletion identified.
232 src/config/sessions/session-accessor.sqlite-projection-state.ts READ — Shared native/worker commit kernel revalidates removals and upserts around hooks; retain source-row and dependent-removal checks.
231 src/config/sessions/session-history-archive-pruning.worker.ts READ — Retention, legacy unlink, and exact published-row deletion each preserve transaction/commit authority and distinct stale-row handling. Their shared transaction shell is short; abstracting it would yield little reduction and obscure mutation order.
230 src/sessions/session-key-utils.ts READ — Retained opaque peer/tail rules and exact cron/thread grammar; regex normalization changes risk persisted-key compatibility.
227 src/config/sessions/goals.ts READ — Public text/tool operations share transition owners; persisted versus display-only accounting and event emission are distinct.
227 src/config/types.openclaw.ts READ — Public/source/runtime snapshot distinctions and required per-surface types remain the canonical config contract.
226 src/config/backup-rotation.ts READ — Backup publication, filesystem identity fencing, and update snapshot coalescing are required durability/lifecycle behavior.
224 src/config/sessions/session-accessor.sqlite-contract.ts READ — Leaf contracts keep worker and accessor imports acyclic; no unused protocol/result variants established.
223 src/config/sessions/conversation-delivery-store.ts READ — Mutation wrappers retain transition-specific allowedFrom/status and error adaptation across worker boundary.
223 src/config/sessions/session-accessor.sqlite-entry-list.read.ts READ — Full/list ownership, canonical sibling validation, cron retention payloads, and participant deferral have distinct contracts; no generic consolidation would simplify them.
222 src/config/io.observe.ts READ — Async observation checks supersession after I/O while sync observation invalidates prior operations; combining these would add another effect abstraction. Audit publication responsibility is excluded.
222 src/config/schema.hints.ts READ — Ordered metadata application, explicit non-sensitive overrides, and URL sensitivity have distinct semantics.
221 src/config/sessions/session-entry-provenance.ts READ — No edits: overlaps open deslop/x02-schema-type-duplication PR. Creation policy and verified human ownership remain preserved.
221 src/sessions/session-upstream-links.ts READ — Retained exact source CAS/rollback behavior and key ambiguity rejection; SQL storage shape unchanged.
219 src/config/sessions/session-canonical-validation-readiness.ts READ — Bounded FIFO certification, live owner assertions, initial seeding and contention backoff encode lifecycle contract.
218 src/config/sessions/session-entry-current-admission.worker.ts READ — Revision-owned projections and before/after native-grant currency checks serve several independent writers; retain nested source lifetime checks.
217 src/config/group-policy.ts READ — Shared scope-tree owner already handles precedence; flat channel lookup retains documented legacy truthy and selected-map contracts.
217 src/config/sessions/session-accessor.sqlite-maintenance-candidates.ts READ — Indexed cap selection preserves database-encoding tie order and exact excluded-key behavior; generic sort replacement would lose bounded scans.
216 src/config/merge-patch.ts READ — Creation, application, and conflict detection differ intentionally; ID-keyed array and prototype-key contracts retained.
216 src/config/sessions/session-accessor.sqlite-archive-artifact.ts READ — Filename-owned and registry-owned archives have different retained-artifact identity contracts; durable publication and collision readback remain necessary.
216 src/config/validation-channel-rules.ts READ — Bundled schema and DM dependency warnings serve separate admission stages and preserve root/account message order.
215 src/config/sessions/session-accessor.lifecycle-types.ts READ — Typed lifecycle variants encode current removal, reset, alias repair and custody contracts; no dead variants established.
215 src/config/sessions/session-accessor.sqlite-entry-admission.ts READ — Native incognito and file-worker claims have different release owners; identity, generation, queue, and post-await checks are required custody.
215 src/config/sessions/session-accessor.sqlite-pending-inputs-repair.ts READ — Same-file rekey and cross-file copy differ in row identity; accepted-input conflicts and final completion preference are required current repair behavior.
215 src/sessions/model-overrides.ts READ — Retained state invalidation semantics. May-2026 repairProviderWrappedModelOverride is a removal candidate, but its two production callers are outside this lane and the lead explicitly retained it for coordination.
213 src/config/sessions/session-accessor.sqlite-compaction.ts READ — Compaction append and entry accounting share one atomic kernel with distinct native/worker initial-entry custody.
213 src/config/sessions/session-accessor.sqlite-transcript-turn.ts READ — Worker routing excludes opaque callbacks while native turn kernel retains released callback ordering and goal receipt semantics.
211 src/config/sessions/session-accessor.lifecycle.ts READ — Ordered batch projection is canonical; single projection preserves public call contract and plugin cleanup revalidates after async reads.
211 src/config/sessions/session-accessor.sqlite-history-navigation.ts READ — SQL candidate narrowing intentionally retains exact JavaScript matching for duplicated keys, NUL, lone surrogates, and SQLite overdepth; raw and active navigation select different row contracts.
211 src/config/sessions/session-accessor.sqlite-reclamation-worker.ts READ — Retained aliases select cleanup while physical identity owns execution; canonical validation scope and ordinary global FIFO each have real use.
211 src/config/source-file-roots.ts READ — Pinned filesystem roots, aliases and observation scopes enforce current path authority and Windows literal-name contracts.
210 src/config/sessions/targets-collision.ts READ — Physical versus logical collision ownership and diagnostics differ; no sound single-pass replacement found.
210 src/config/zod-schema.channel-messaging-common.ts READ — but excluded from edits: open deslop/x02-schema-type-duplication-20261002 owns this schema/type consolidation.
209 src/config/io.runtime-write-finalization.ts READ — Canonical rereads, staged environment restoration, authority checks, and post-commit compensation are required. The bounded reread loop prevents publishing mixed environment generations.
209 src/config/sessions/session-accessor.sqlite-branch-summaries.ts READ — Append-safe summaries and on-demand headline reads avoid full transcript hydration; malformed/forward-parent branches intentionally fall back.
207 src/config/sessions/provider-review-store.ts READ — Review comparison retains registry discovery, exact generation/refusal CAS, native commitment and publication settlement; no safe shortcut across authority boundaries.
207 src/config/sessions/session-accessor.sqlite-identity.ts READ — Move/reset/replace/delete/create ordering and commit-deferred publication are intentional; per-key maps disambiguate shared session IDs.
206 src/config/env-substitution.ts READ — One token grammar owns escaped/default references and stack-safe traversal with ordered callbacks.
204 src/config/sessions/session-accessor.sqlite-entry-cache.types.ts READ — APPLIED projected-key-derived sharing contract. Preserved optional properties through Pick: a real incognito reader returns full SessionEntry directly. Runtime projection is unchanged; remote types remain required.
202 src/config/sessions/session-accessor.sqlite-transcript-stats.ts READ — Prepared point queries and batched queries have measured separate costs; cold rows and missing windows remain independent diagnostics.
202 src/config/types.telegram.ts READ — but excluded from edits: open deslop/x02-schema-type-duplication-20261002 owns this file and shared channel types.

@clawsweeper

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

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 3, 2026, 11:04 PM ET / October 4, 2026, 03:04 UTC (Revision 5).

ClawSweeper review

What this changes

The branch simplifies configuration loading and writes, consolidates session projections, and moves single-caller transcript and maintenance helpers into their callers.

Merge readiness

⛔ Blocked before merge - 1 item remains

The prior lint finding is resolved, and the introduced diff has no remaining actionable correctness finding. This remains useful cleanup that current main has not absorbed.

Priority: P3
Reviewed head: 5a32003e30948727e7eeae863296dab505277aca

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, behavior-preserving cleanup with the prior finding fixed and no remaining actionable source defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository-state snapshot identifies a MEMBER-authored internal refactor, exempt from ordinary external-contributor runtime proof. Reported final-head media tests and cycle checks are supplemental validation; source inspection establishes no stored-format change and no material authority change requiring additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository-state snapshot identifies a MEMBER-authored internal refactor, exempt from ordinary external-contributor runtime proof. Reported final-head media tests and cycle checks are supplemental validation; source inspection establishes no stored-format change and no material authority change requiring additional final-effect proof.
Evidence reviewed 9 items Reviewed introduction boundary: Reviewed the pinned merge-base-to-head delta rather than endpoint drift. The introduced changes simplify existing owners; no workflow, dependency, schema, or generated-output change appears in this delta.
Prior finding resolved: The final commit restores conditional assignments on the typed media object. GitHub confirms its exact parent is the previously reviewed head, and exact-head check-lint-core-2 now succeeds. The supplied body reports 21 media cases passing on the final candidate.
Archive handoff retains invariant checks: Removed parsers validated private payload shapes rather than caller authorization. The paired archive owner still constructs typed plans, scoped requests still check the captured database owner, and the worker retains snapshot equality, publication database identity, generation selection, integrity hashes, and byte bounds.
Findings None None.
Security None None.

How this fits together

Configuration readers turn authored settings into validated runtime settings. Session storage records conversations and user turns, then coordinates worker-owned archival, maintenance, and deletion.

flowchart TD
  A[Authored settings] --> B[Configuration validation]
  B --> C[Runtime settings]
  D[User turns and session operations] --> E[Session storage owners]
  C --> E
  E --> F[Archive and reclamation workers]
  F --> G[Committed state and notifications]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -385, Tests +35. Total -350 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 43 463 848 -385
Tests 8 96 61 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 51 559 909 -350

Review metrics

Metric Value Why it matters
Production versus test delta production net −385 lines; tests/support net +35 lines The cleanup reduces production code while retaining maintenance, reclamation, and artifact behavior coverage.

Stored data model

Persistent data-model change detected: serialized state: src/config/sessions/skill-prompt-blobs.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the simplification within the existing configuration and session owners, preserving stored formats and commit-time authority checks.

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

Not applicable: this is a behavior-preserving refactor. The earlier media-builder lint failure is resolved in the exact final commit and its lint check now passes.

Is this the best way to solve the issue?

Yes: removing single-caller wrappers and reusing existing validation and identity owners is a maintainable simplification; no concrete behavior regression was found.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended change to user-visible behavior, defaults, or stored formats.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository-state snapshot identifies a MEMBER-authored internal refactor, exempt from ordinary external-contributor runtime proof. Reported final-head media tests and cycle checks are supplemental validation; source inspection establishes no stored-format change and no material authority change requiring additional final-effect proof.

Evidence

What I checked:

Likely related people:

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

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 (4 earlier review cycles)
  • reviewed 2026-10-04T00:57:57.945Z sha b4f743426d8e231ff5d93ab163d9f0d57a20ccc9 :: blocked before merge. :: none
  • reviewed 2026-10-04T01:48:32.654Z sha 9135037 :: blocked before merge. :: [P2] Remove the obsolete migration argument from agent creation
  • reviewed 2026-10-04T02:32:07.175Z sha 691e62c :: blocked before merge. :: none
  • reviewed 2026-10-04T02:48:53.661Z sha 691e62c :: blocked before merge. :: [P3] [P3] Restore the typed media builder to satisfy the lint gate

@steipete
steipete force-pushed the deslop/l359-config-sessions2-20261003-ready branch from b4f7434 to 9135037 Compare October 4, 2026 01:40
@steipete
steipete enabled auto-merge (squash) October 4, 2026 01:45
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@steipete
steipete disabled auto-merge October 4, 2026 02:03
@steipete
steipete enabled auto-merge (squash) October 4, 2026 02:27
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@steipete
steipete disabled auto-merge October 4, 2026 02:33
@steipete
steipete enabled auto-merge (squash) October 4, 2026 02:59
@steipete
steipete disabled auto-merge October 4, 2026 03:06
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Landing evidence for exact PR head 5a32003e30948727e7eeae863296dab505277aca.

The final correction passed 21 media tests, both import-cycle checks (zero cycles), and independent review through P2. The committed tree matches the remotely verified tree e97e589e4d25f63114edb6869e1d2a487523371e.

CI run 37172654394 tested merge a4d593b63080c5db7efd6aa8e7b63ea7f0515058 of this head into main cc740dfaf528fa92d36af5eba2e97c15708c3c4f. Its three non-aggregate failures are:

  1. Test-mock ratchet tooling: spawnSync git ENOBUFS. The same failure occurs on that exact main and in an unrelated PR run. Main's 1,675,312-byte config/test-mock-exports-baseline.txt exceeds the default output buffer in scripts/lib/shrink-ratchet.mts's readGitText. The failure precedes inspection of this PR's sources. This is a test-tooling failure, not a failed security assertion.
  2. Suppression inventory: expected 16 entries, received 18. The unrelated run has the same two extra entries from src/plugin-sdk/plugin-config-runtime.test.ts, introduced on main in f3698fa2a9f. This PR changes neither that test nor the inventory/scanner and adds no suppression comments.
  3. Gateway preview: server.sessions.preview-resolve.test.ts returns the correct work owner and title but omits lastMessagePreview. A clean Linux checkout of exact main cc740dfaf528fa92d36af5eba2e97c15708c3c4f (tree 9bd2201fcb813a34fa537a990ebc78affb3b65bb), Node 24.19.0 matching CI, reproduced the identical failure at line 116 with pnpm test src/gateway/server.sessions.preview-resolve.test.ts --maxWorkers=1: 1 failed, 6 passed, 108s including preparation. The PR patch was absent. Main commit 12c5644ad78 switched preview to resident projection; canonical readiness does not await optional transcript backfill, and the fixture observer accepts any publication for the key. Actual backfill remains bound to the selected row/store/agent and current-generation checks.

The PR's security-fast, all seven Security High checks, dependency review, and security-sensitive review passed. No authority or security failure is being bypassed. The missing preview concerns optional transcript enrichment; owner selection and visibility/authority checks are retained.

Using the coordinator-authorized non-security main-red exception, with the squash merge pinned to the API-reported head above. No test was weakened, no baseline expanded, and no main repair is included in this PR.

@steipete
steipete merged commit d0c5963 into main Oct 4, 2026
175 of 180 checks passed
@steipete
steipete deleted the deslop/l359-config-sessions2-20261003-ready branch October 4, 2026 03:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Simplify config write preparation, session projections, and private archive/maintenance plumbing. Inline one-caller factories and remove unused internal fields while retaining public config, SDK, storage, and authority contracts.

Removes 385 net production lines. Full subsystem coverage and validation evidence are recorded in the PR. No persisted session format or SQLite schema change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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