Skip to content

test: cover packaged Kysely scripts and update phase reporting - #162464

Merged
fuller-stack-dev merged 17 commits into
mainfrom
fix/lint-kysely-prerequisite
Oct 1, 2026
Merged

fuller-stack-dev merged 17 commits into
mainfrom
fix/lint-kysely-prerequisite

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Related: #162403, #162429, #162288, #162485, #162495

What Problem This Solves

Adds regression coverage for packaged Kysely entrypoints and updater phase reporting. The final diff changes four test files only.

User Impact

The tests catch missing runtime dependencies in published prepare scripts and dropped or reordered updater phases when a progress read finishes late.

Why This Change Was Made

Canonical main independently landed the production repairs while this PR was being validated. The reporter lifetime fix is 82fe5e962f72a54bc80c43cb9b2a116228bafb3b. The lint preparation owner and informational/focused bypass are 4f34af88e6dc91217568e8cf233b9ad75e135d84 in #162489. Package entries, copied fixture inventories, prepare hooks, and the CI planner fixture are also canonical.

This PR accepts those implementations and keeps four distinct test improvements:

  • The admission regression holds real private-ledger reader results until cancellation or explicit cleanup. It checks each recorded phase exactly once, in order, before the success report, while preserving the activation boundary assertion.
  • Progress unit tests use immutable reader snapshots and pass the authoritative step record explicitly.
  • The lint tests preserve malformed-SQL failure propagation through direct and striped entrypoints. Valid TypeScript source still fails with the generator diagnostic and no generated declarations.
  • The package test creates and extracts an actual npm archive using the repository file policy. It runs the source-less generator and prepare hook, then removes the direct-run helper and verifies failure.

The proposed public progress pause API and its test additions have been removed. Existing canonical stop, suspend, dispose, and final-flush coverage remains.

Evidence

On canonical 40d9ed0924dafa3ef1bf8cf604679e79aa33a3e4 with only the final three test postimages applied:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs \
  src/cli/update-cli.admission-ledger.test.ts \
  src/cli/update-cli/progress.test.ts \
  test/scripts/generate-kysely-types.test.ts

All 41 tests passed: 11 admission, 26 progress, and 4 generator cases. The native wrapper took 57.29 seconds on Node 24.20.0/macOS. The held-reader regression took 7.227 seconds. A separate run of that same regression also passed against unchanged canonical production. Service boundaries are simulated; this does not claim an installed Gateway upgrade.

After the canonical storage landing at f59b75644636e93de17dee9a4e096790b76e5ffb changed shared-state worker inputs, the same three-file command passed all 41 tests again on composition 8be9ec1c34572e667c67c0ef1208970d847cc528. The native wrapper took 75.83 seconds, including worker preparation; the held-reader case took 6.597 seconds.

The complete canonical lint prerequisite file, including both added malformed-SQL cases, passed all 5 tests on the composition against de7997edc3441e9ff9a89067c2a1d4db508a97b5 in 7.09 seconds. Independent API review of the complete four-file delta found no actionable P0-P2 defect, confidence 0.96. Formatting and scoped typed lint passed for all four files using the documented core and scripts tsconfigs. An earlier invocation without a scoped tsconfig stopped before analysis at extension declaration containment; no guard or dependency layout was changed. Every touched test file was audited in full, including helpers, imports, fixtures, setup, teardown, assertions, and skips. Private state, archive/cache paths, reader cancellation, and pending promises retain their cleanup. The one-value parameter wrapper was simplified without removing a case. Only test additions for the discarded pause API were removed. No valid assertions, retries, or timeout budgets were weakened.

The earlier package/updater acceptance lane was cancelled before its payload after production scope moved to canonical main. It does not provide updater acceptance. A new packaged build is unnecessary for this tests-only delta. Historical source-blind and red/green evidence below documents the original repairs, not a full installed update of this final head.

CI diagnosis

On published 6c6f3235a7f597db4f164e77c1b0370e7358ed78, job 110284924484 failed at update-cli.windows-lifecycle.test.ts:523 in run 36836322992. The aggregate run concluded cancelled on attempt 1. The interrupted-update fixture expected dist/index.js to be restored but received ENOENT. The original six-file group reproduced the same failure with 113 tests passing and one failing. The unchanged Windows test also fails alone against clean canonical 2ad1dd0254e7ec308f972ad0579f291ebe0c33ec, with no overlays, after the intervening Windows path-normalization fix. That run took 55.43 seconds including worker preparation. A bounded observer on canonical 726d2cb81ff1ef11f8e5dd0aa8b755bf6e9eab92 isolates the transition. BEGIN EXCLUSIVE leaves the physical generation unchanged; closing the Windows removal probe checkpoints the WAL, changes the main-file fingerprint, and causes the generation check to refuse rollback. Raw fingerprint reads ran in isolated children, and the original assertion still failed. The observer was removed afterward. The repair remains separate from this four-test change; no Windows fix or required-check waiver is claimed here.

Earlier 1ecad8365cd2e5ebeeec9d4407ad1f6ef3a22f62 failed run 36831046737, job 110267846887, on a table-header hit test. The unchanged 30-file, 146-case shard and one diagnostic replay passed on AWS. Host scheduling differed, so the hosted cause remains unresolved. Shard replay, diagnostic. No speculative UI patch or CI rerun was used.

The earlier lint fixture, progress lifetime, and planner ownership failures led to repairs that are now on canonical main. Fail-fast cancellations and passing diagnostic replays are not counted as passing hosted coverage. Final published head 7d203d1cc5db22e2aea108e358e87b7625b4d651 passed hosted run 36841348489, attempt 1. Both observed required openclaw/ci-gate contexts report success. The earlier failures above remain historical evidence; no CI rerun or required-check waiver was used. Native review and preparation are being rebound to this tested head before landing.

Historical repair recordings

The following artifacts preserve the original failing behavior and supplier proof. Their SHAs identify earlier repairs that main now supplies. They are not recordings of the final tests-only head.

Raw terminal recordings for the generated-type prerequisite:

Base, exit 1

kysely-base.mp4

Head at 32fe2be4b29894a0751f7c670e8b1628d24da3b1, exit 0

kysely-head.mp4
Generated-type artifact manifest
{
  "repository": "openclaw/openclaw",
  "base": "fb0971bd84dc3936087b2d0a63b53c82fa906eeb",
  "head": "32fe2be4b29894a0751f7c670e8b1628d24da3b1",
  "provider": "local macOS",
  "node": "24.20.0",
  "pnpm": "12.5.1",
  "artifacts": [
    {
      "label": "base",
      "url": "https://github.com/user-attachments/assets/c7d91521-dcae-469d-adfa-9d555727dfa3",
      "bytes": 37931,
      "sha256": "f3046f232468adaee2b627b8aeee98a1b954f2f991ff0de6a87026386b3926fe",
      "exit": 1,
      "raw_cast_sha256": "66a0bd3a2d0849d4b108adbd0a813370c9ec7f4f923fd995f760f86f1fb06c5b"
    },
    {
      "label": "head",
      "url": "https://github.com/user-attachments/assets/2e13f81f-e5de-43b6-933f-fc1542dbeee9",
      "bytes": 19793,
      "sha256": "af742b09435a28f65f0cf0746fb3a4ed43bf0bbd75aa55905598bd46a3901aec",
      "exit": 0,
      "raw_cast_sha256": "e9c85ddec9d0bd475b73712ba8606a3cf71643ef3e5eac5d41bc83ca7d761e7f"
    }
  ]
}

MP4 rendering adds an empty post-roll to show the final captured exit line. Raw casts preserve the original output and timestamps.

Raw terminal recordings for the updater progress repair, with declared path redaction and no reenactment:

Canonical base 8d99007436d65522a45c3b24d5782790fb9dbc67, exit 1

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/public/20261001-070327-327147000/base.mp4?X-Amz-Expires=604800&X-Amz-Date=20261001T070328Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20261001%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=96ac6c494a1f762de835a56ca8aab4a63dc2a2d9f6bac995fbeaa5170eb7ceba

Committed supplier 33976fd167ac6e2d8d7d4ed06fbce16fe0d6402a, exit 0

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/public/20261001-070327-327147000/head.mp4?X-Amz-Expires=604800&X-Amz-Date=20261001T070328Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20261001%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=57b46d0e9a539993456775bd6041dc770d36d1dc885a7b70345f256888fc2b14

Artifact manifest, proof and test audit, source-blind observations, and behavior contract.

The manifest records all seven artifact hashes and sizes, including the sanitized raw casts. Independent downloads matched every byte/hash and the remote manifest. Broker links expire on 2026-10-08 at 07:03 UTC. The same-fixture red/preliminary green and the final strengthened committed-head test are distinguished in the proof record. The recordings show actual native regression invocations/results; detailed operator output and durable ledger facts are in the source-blind observations.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Oct 1, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review October 1, 2026 06:13
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 5:47 AM ET / 09:47 UTC (Revision 7).

ClawSweeper review

What this changes

Adds tests for packaged database-type generation, lint preparation failures, and ordered update progress when ledger reads finish late.

Merge readiness

✅ Ready for maintainer review

Keep open: useful, distinct regression coverage remains after the production fixes landed on main. No actionable introduced defect was found, and MEMBER-authored work is protected from automatic closure.

Priority: P2
Reviewed head: 7d203d1cc5db22e2aea108e358e87b7625b4d651

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful boundary coverage, explicit cleanup, and reported focused validation support normal good patch quality with no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a MEMBER and the introduced delta changes tests only. Package cases exercise archive/script boundaries and updater cases use real ledger reads with simulated service boundaries; historical recordings do not claim a final-head installed upgrade. No production update or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a MEMBER and the introduced delta changes tests only. Package cases exercise archive/script boundaries and updater cases use real ledger reads with simulated service boundaries; historical recordings do not claim a final-head installed upgrade. No production update or stored-data contract changes.
Evidence reviewed 9 items Pinned introduction: The verified merge-base-to-head delta changes only the four identified test files. No production, package manifest, schema, permission, or workflow change is introduced.
Package boundary regression: The added case packs and extracts an actual npm archive under the existing publication policy, executes the source-less generator and prepare script, and verifies that removing the direct-run dependency makes execution fail. Existing generator cases cover different schema and cache contracts.
Lint failure propagation: Both direct and striped lint entrypoints receive malformed SQL and valid TypeScript, then must return the generator's syntax error without generated declarations. These negative cases complement main's existing successful cold-preparation coverage.
Findings None None.
Security None None.

How this fits together

Build tooling generates database types from SQLite schemas and prepares them before typed lint. The updater reads its durable phase history to show progress and publish a final result; these tests exercise both boundaries.

flowchart TD
  A[SQLite schemas] --> B[Type generation]
  B --> C[Typed lint]
  D[Published package files] --> E[Packaged script execution]
  F[Update phase history] --> G[Progress presentation]
  G --> H[Final update report]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +116. Total +116 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 204 88 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 204 88 +116

Review metrics

Metric Value Why it matters
Reported focused test cost 41 cases: 75.83s wrapper wall; held-reader case: 6.597s; lint file: 7.09s The body quantifies the recurring validation cost and identifies the real ledger and package boundaries exercised.

Technical review

Best possible solution:

Retain focused regression coverage around the canonical packaging, lint preparation, and progress-publication owners without restoring discarded APIs.

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

Not applicable to a remaining production defect: this head changes tests only, and the original production repairs are already on main. The reported focused runs were inspected as evidence; this review executed no tests.

Is this the best way to solve the issue?

Yes. The retained tests exercise distinct failure boundaries through existing owners, strengthen observable ordering, and preserve cleanup without adding production seams.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The tests protect bounded packaging and updater reliability contracts without changing production behavior.
  • 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 author is a MEMBER and the introduced delta changes tests only. Package cases exercise archive/script boundaries and updater cases use real ledger reads with simulated service boundaries; historical recordings do not claim a final-head installed upgrade. No production update or stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction: The verified merge-base-to-head delta changes only the four identified test files. No production, package manifest, schema, permission, or workflow change is introduced. (7d203d1cc5db)
  • Package boundary regression: The added case packs and extracts an actual npm archive under the existing publication policy, executes the source-less generator and prepare script, and verifies that removing the direct-run dependency makes execution fail. Existing generator cases cover different schema and cache contracts. (test/scripts/generate-kysely-types.test.ts:42, 7d203d1cc5db)
  • Lint failure propagation: Both direct and striped lint entrypoints receive malformed SQL and valid TypeScript, then must return the generator's syntax error without generated declarations. These negative cases complement main's existing successful cold-preparation coverage. (test/scripts/run-oxlint-kysely.test.ts:118, 7d203d1cc5db)
  • Updater boundary regression: The revised admission case delays results from the actual private-ledger progress reader until cancellation or cleanup, preserves the activation-boundary assertion, joins pending reads, and requires each phase exactly once in order before the success report. Service and installation boundaries remain simulated. (src/cli/update-cli.admission-ledger.test.ts:265, 7d203d1cc5db)
  • Current-main necessity check: The canonical progress, generator, lint runners, and package manifest are unchanged between fetched main and this head. The four test deltas remain distinct from current-main coverage. GitHub verifies fix(lint): copied runner checks fail after schema preparation #162489 merged as 4f34af8; that production repair does not supersede these additional tests. (src/cli/update-cli/progress.ts:1, 3f263ba918c5)
  • Discussion and review continuity: The supplied human comment identifies main's final-phase fix and asks that overlapping production changes be dropped; the current delta does so. The previous completed review examined this same head and retained no findings or published rank-up moves. The captured body identifies historical recordings separately from final test validation. (7d203d1cc5db)

Likely related people:

  • Peter Steinberger: Raw commit 6337d15 adds scripts/generate-kysely-types.mts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6337d159e391; files: scripts/generate-kysely-types.mts)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): 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 (6 earlier review cycles)
  • reviewed 2026-10-01T06:19:18.864Z sha 32fe2be :: needs changes before merge. :: none
  • reviewed 2026-10-01T06:33:55.437Z sha e8214b4 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T07:17:27.948Z sha a662d4c :: blocked before merge. :: none
  • reviewed 2026-10-01T07:40:43.817Z sha 1ecad83 :: blocked before merge. :: none
  • reviewed 2026-10-01T08:33:03.159Z sha 6c6f323 :: blocked before merge. :: none
  • reviewed 2026-10-01T09:20:52.341Z sha 7d203d1 :: needs maintainer review before merge. :: none

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the test-cost request in the Evidence section. With one Vitest worker, the lint prerequisite file passed 3 tests in 5.159 seconds end-to-end, and the generator file passed 4 tests in 3.110 seconds. Their Vitest durations were 3.61 and 1.53 seconds.

The first hosted run exposed copied-fixture inventories that omitted the newly imported generator. Both omissions reproduced locally; the two complete fixture files now pass all 56 tests after the two-line correction. That correction is committed locally and awaits the separate UI prerequisite in #162468 before publication. The independent delta review found no actionable issue. Hosted CI remains failed on the published head; no checks are waived.

fuller-stack-dev and others added 3 commits October 1, 2026 00:25
Restore the shared scope-error reader import omitted by 4293f49. The existing outside-workspace denial E2E failed with the modal stuck checking before this repair and passes afterward. UI, ui-app, and ui-e2e typechecks plus targeted lint and formatting pass.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit c0a5a64)
@fuller-stack-dev fuller-stack-dev changed the title fix: restore generated Kysely prerequisites for lint and packaging fix: unblock typed checks and package validation Oct 1, 2026
@clawsweeper clawsweeper Bot removed the proof: 🎥 video Contributor real behavior proof includes video or recording evidence. label Oct 1, 2026
@fuller-stack-dev fuller-stack-dev changed the title fix: unblock typed checks and package validation fix: restore generated type prerequisites and update progress Oct 1, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Oct 1, 2026
@fuller-stack-dev fuller-stack-dev changed the title fix: restore generated type prerequisites and update progress fix: preserve lint entrypoints and update progress Oct 1, 2026
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Heads-up: the dropped final updater phase (Phase: verifying) is now fixed on main by 82fe5e9 (the minimal fix from #162495, landed directly to clear red main). The other parts of this PR (Kysely lint prerequisite composition, fixture inventories, CI group-owner observation) are not covered by that commit; please rebase and drop the overlapping update-cli changes.

@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Oct 1, 2026
@fuller-stack-dev fuller-stack-dev changed the title fix: preserve lint entrypoints and update progress test: cover packaged Kysely scripts and update phase reporting Oct 1, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 1, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 3a3d681 into main Oct 1, 2026
122 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/lint-kysely-prerequisite branch October 1, 2026 09:59
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…law#162464)

* fix: prepare generated Kysely types for lint and package installs

* test: include Kysely generator in copied lint fixtures

* fix(ui): recover group defaults after scope denials

Restore the shared scope-error reader import omitted by ec63715. The existing outside-workspace denial E2E failed with the modal stuck checking before this repair and passes afterward. UI, ui-app, and ui-e2e typechecks plus targeted lint and formatting pass.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit c0a5a64)

* fix(update): retain progress through terminal publication

(cherry picked from commit 33976fd167ac6e2d8d7d4ed06fbce16fe0d6402a)

* test: observe CI group owners across fork workers

---------

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants