Skip to content

fix(state): restore dependency checks for upgrade internals - #199847

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-state-upgrade-ci-exports-20261115
Nov 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-state-upgrade-ci-exports-20261115

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the hourly dependency check failing on state-upgrade internals and dynamically loaded fixture/preload entry points.

User Impact

No user-visible behavior change, schema change, migration, or new configuration. State upgrade and Doctor retain their existing behavior.

Why This Change Was Made

The state upgrade introduced in #198389 exposed internal helpers and left historical installed-plugin entries outside Knip's graph. Keep helpers private, exercise rebuild tests through the production entry point, and give the existing Doctor subprocess boundary its own production module. The Doctor implementation is unchanged and all callers migrate together.

Declare the real historical corpus plugin roots and the heap-rig soak preload as analyzer entry points. The preload omission is a newly identified main regression introduced by #199761 (1e7f1f743c24f9b713ab78a75284c99b0ad05ca7), reproduced on the exact main parent; it is not dismissed as inherited noise. No ignores or fixture deletions are added. Production LOC is +2 from module imports; tests are -2 and analyzer configuration is +4.

The independent member-welcome export regression from #198491 is owned by #199789 and is outside this patch.

Evidence

  • On exact parent 39b066a976970b080df4b107b8ba918e250d4f4e, two export-scan controls reproduced identical findings: nine production/six full-tree state exports plus three/two member-welcome exports. The candidate removes every state finding; only the separately owned member-welcome findings remain.
  • The unused-file gate failed on all six corpus plugin entries and the heap-rig preload on the parent; the final candidate passes with zero unused files.
  • Focused Node and pinned Bun tests each pass 32/32 across the SQLite copy and state-upgrade owners.
  • Real Gateway state-upgrade E2E passes 7/7: invalid configuration refusal, four historical corpora, and two forced Doctor failures. All assertions are retained.
  • Independent Codex autoreview is scoped-clean through P2; final source verification passed.
  • pnpm check:changed --base 39b066a976970b080df4b107b8ba918e250d4f4e completed: every selected gate passes except the independently owned member-welcome dead exports, reproduced on the exact parent and introduced by feat(openclaw-id): name invited members from their email and ask who they are on first visit #198491 (cec47fd13f23df46069da1beb65ceaec6e66d04f). The final full scan reports zero state findings. The coordinator reports fix(ci): keep member welcome internals private #199789 is now merged on main; this candidate intentionally preserves its pinned base proof.

The actual failed analyzer gates provide the red/green regression proof. Export scan wall times were 183.23/209.06 seconds for the two parent controls and 148.65 seconds for the candidate; CPU was 348.72/347.27/340.42 seconds. Unused-file scan wall/CPU was 130.85/285.11 seconds before and 178.02/325.09 seconds after. These are scanner measurements under varying shared-host load, not production performance claims. Maximum RSS is not allocation totals. The unchanged production operation does not warrant generating a large production-shaped database/workspace for this visibility/entry-graph repair.

Keep state upgrade helpers private, move the unchanged Doctor subprocess boundary to its production owner, and include real dynamic plugin/preload entries in the dependency graph. Preserve upgrade and SQLite behavior; Node and Bun focused tests and real Gateway upgrade cases pass.
@clawsweeper

clawsweeper Bot commented Nov 15, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T23:43:12.671865Z 0c42217 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes state-upgrade internals private, moves the unchanged Doctor subprocess boundary into its own module, and registers dynamic analyzer entry points.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, narrowly scoped repair supported by source verification, recorded analyzer controls, and retained regression coverage.
Proof confidence 🐚 platinum hermit (4/6) This analyzer repair and behavior-preserving refactor require no new user-visible demonstration; the prepared screenshots show unrelated member-welcome behavior and were not counted as proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter failing dependency checks for state-upgrade internals and existing dynamically loaded files.
Reason: The repair restores useful checks without ignores, new configuration, or changed runtime behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR provides a focused repair for dependency-check failures, with no actionable correctness or security findings.

Priority: P3
Reviewed head: 0c42217003e00e23318328a13d9bd53c25438e0b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway startup owns state upgrades and invokes Doctor against a shadow copy; Knip separately checks source reachability and unused exports.

flowchart TD
  A[State upgrade modules] --> D[Knip analysis]
  B[Historical plugin entries] --> D
  C[Heap observer preload] --> D
  D --> E[Dependency checks]
  F[Gateway startup] --> A
  A --> G[Shadow Doctor subprocess]
Loading

Technical review

Best possible solution:

Keep internal helpers private, share the unchanged Doctor subprocess boundary through its production module, and register the actual dynamic analyzer roots.

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

Source inspection confirms the unnecessary exports and dynamically loaded roots described by the recorded analyzer failures; no target code or tests were executed during this review.

Is this the best way to solve the issue?

The patch uses existing production owners, removes unnecessary exports without suppressing findings, and preserves all changed test assertions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • State-upgrade internals, Doctor subprocess, and preserved-file naming keeps the original intent (ef930eb: Upgrade prior-release state through a private shadow copy, validate it, and preserve the previous generation during publication.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change preserves runtime logic: The introduced diff changes internal visibility and imports, moves the Doctor implementation unchanged, and inlines the existing preserved-file naming expression. (src/state/state-upgrade-doctor.ts:18, 0c42217003e0)
  • Analyzer roots have real consumers: All six historical corpus plugin manifests declare ./index.js, and the heap rig loads its soak observer through --import; the additions model these existing consumers without adding ignores. (config/knip.config.ts:455, 0c42217003e0)
  • Behavioral assertions retained: Rebuild tests now call buildSqliteWithFoldIns, which production already uses, while preserving row-conservation, collision, and foreign-key assertions; Gateway upgrade tests retain their data and preserved-byte checks. (src/state/sqlite-copy-swap.test.ts:129, 0c42217003e0)
  • Current main still needs this repair: The affected state modules, analyzer configurations, and Gateway upgrade test match the pinned parent on fetched main; the separate member-welcome repair is merged at fix(ci): keep member welcome internals private #199789. (ea8cc3372de4)
  • Original upgrade intent preserved: feat(state): upgrade state by copy and swap at Gateway startup #198389 introduced shadow-copy upgrades to protect live state; this PR preserves that implementation and its subprocess isolation. (src/state/state-upgrade.ts:350, ef930ebbad77)
  • Validation and exact-head CI: The PR records parent-versus-candidate analyzer results, 32/32 focused tests on Node and Bun, and 7/7 Gateway upgrade cases; live exact-head checks report no failures, with PostgreSQL conformance still pending or running. (0c42217003e0)

Likely related people:

  • Ayaan Zaidi: Raw commit ef930eb adds src/state/state-upgrade.ts:415 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ef930ebbad77; files: src/state/state-upgrade.ts)
  • Peter Steinberger: Raw commit 05ce3c3 adds config/knip.config.ts:180 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 05ce3c3a1ad5; files: config/knip.config.ts)

PR surface

Source +2, Tests -2, Other +4. Total +4 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 80 78 +2
Tests 3 12 14 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 11 96 92 +4

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This restores repository dependency hygiene without changing shipped user behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This restores repository dependency hygiene without changing shipped user behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 15, 2026, 6:55 PM ET / 23:55 UTC.

@steipete
steipete enabled auto-merge (squash) November 16, 2026 00:05
@steipete
steipete merged commit f905d3f into main Nov 16, 2026
153 checks passed
@steipete
steipete deleted the steipete/fix-state-upgrade-ci-exports-20261115 branch November 16, 2026 00:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…#199847)

Keep state upgrade helpers private, move the unchanged Doctor subprocess boundary to its production owner, and include real dynamic plugin/preload entries in the dependency graph. Preserve upgrade and SQLite behavior; Node and Bun focused tests and real Gateway upgrade cases pass.
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: S 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