Commit graph

29 commits

Author SHA1 Message Date
Vincent Koc
9651d6347b
fix(test): enable native byte APIs in Node UI workers
Enable Node's native byte codecs only for Vitest, including standalone UI tests. Keep production CLI fixtures on their existing compiler flags, and correct Node 24's offset-view encoding through the existing test host.

Validated root and standalone UI in thread and fork pools, Gateway and identity flows, installed Vitest and Bun fixtures, CLI isolation, eight focused type projects, typed lint, and formatter parity.

Allocate the exact 22 added test lines; the current parent's inherited 52-line debt remains unchanged. The compiled-CLI replay stopped before tests at an unrelated plugin asset build that cannot resolve browser/client.js.
2026-11-07 03:46:41 +08:00
Vincent Koc
6869e37c69
fix(ci): preserve Markdown skipping across unrelated test changes (#193618)
* fix(ci): keep Markdown qualification independent of other test inventories

Separate Node execution flags from watchdog and test-inventory policy, migrate callers, and cover the fingerprint boundary. Qualification renewal follows the native Node/Bun proof.

* fix(ci): retain Node flag policy in archived tooling and scope guards

* fix(ci): renew qualified Markdown test skipping
2026-11-05 17:59:10 +00:00
Peter Steinberger
94bea34ae9
test: derive package-root launcher fixtures from their import closure (#188338)
Fixtures that staged package-root launcher modules kept about ten hand-maintained copy lists, so a new sibling import (#182306, #182856) broke integration shards instead of a fast test. Fixtures now name only their entry modules, and collectPackageRootModules computes the closure. vitestWorkerRuntimeAssets moved out of vitest-worker-declarations into the new module, so the trusted PR-wrapper inventory is unchanged. A unit test checks the scanner against an acorn parse and checks that package.json files includes every sibling import of each packaged root module. The docker harness also stages release-context.mjs (#192806). The test-line ceiling is raised by the exact measured gap: +25 lines for this coverage plus 49 lines of inherited debt.
2026-11-04 21:35:03 -08:00
Tideclaw Bot
300b0209ee
fix(test): isolate release fixtures from enclosing checkout state (#192487)
* fix(test): isolate fixture package and Git scopes

Bound runner fixtures with a neutral package scope and require exact worktree roots before trusting Git inventory and grep results. Preserve filesystem archive discovery and authoritative empty indexes.

Co-authored-by: RomneyDa <6581799+RomneyDa@users.noreply.github.com>
(cherry picked from commit 98ab00607a9285f2fcac9191e59f08abe43942ae)

* test(tooling): isolate standalone checkout artifact ownership

Mark synthetic updater and source-runner checkouts as independent repositories so temporary roots nested in another checkout cannot acquire its retained artifact lock. Cover the actual updater transaction against a retained enclosing owner while preserving production discovery and fail-closed cleanup.

Co-authored-by: RomneyDa <6581799+RomneyDa@users.noreply.github.com>
(cherry picked from commit a4ff53a34437ba3fde81a03d59992b892c13c1c1)

---------

Co-authored-by: RomneyDa <6581799+RomneyDa@users.noreply.github.com>
2026-11-04 11:03:44 +08:00
Vincent Koc
767e1761de
fix(test): preserve fixture cleanup custody and runtime ownership (#189948)
* fix(test): preserve fixture cleanup custody and runtime ownership

* fix(test): keep receiver Node and pnpm in the same private bin
2026-11-01 12:39:47 +08:00
Peter Steinberger
fe0be1ae74
fix: retain local helper programs in standalone builds (#183120)
* fix: retain local helper programs in standalone builds

* fix: retain runtime probe assets across packaged layouts

* fix: keep bundled runtime probes self-contained
2026-10-24 23:29:02 -07:00
Peter Steinberger
51403439b2
test(scripts,ui): remove low-value tests (batch d454) (#182358)
* test(scripts): consolidate q0005 branch proof

Port q0005 commits 2ea2ac85cf847, cf1e88e2056c9, and 146f8c07ebfda onto the campaign lane as one commit. Preserve the newer release-evidence fixtures, authority and rename cases, hosted-gate cohorts and CLI checks, and diagnostics redaction coverage. Consolidate remaining duplicate proof without changing production code.

CI-only validation: oxlint, oxfmt --check, and git diff --check exited 0. No tests, coverage, Testbox, or check-changed were run; affected tests are deferred to landing PR CI. Independent review staging findings are resolved. The removed broad immutable-ref grep is covered by the structured resolve_target checkout assertion in full-release-validation-continuation-workflow.test.ts.

* test(tooling): consolidate q0010 owner-boundary coverage

Port q0010 commits 4e577f0f5b25, f3482965e48e, and 15e71d71d935 as one commit on the campaign lane. Preserve the newer release-state script fixture and all newer model-catalog cases and assertions while retaining compatible fixture consolidations.

CI-only proof: plain oxlint, oxfmt --check, and git diff --check passed. No tests, coverage, Testbox, or check-changed run. Independent static review found only an index-only unused helper; staged its already-reviewed deletion before committing.

* test(scripts): deslop q0024 tests

Remove direct-run source-spelling checks and the copied Crabbox sync inventory. Keep the isolation, credential, and artifact-integrity assertions.

The ordinary-writer REST squash test retains no-classic-policy discovery, pinned head, and no-bypass proof. The published updater full-lint test retains constrained-CI serialization; keep a separate throttled-mode case. Consolidate boundary-preparation inputs by distinct parser/policy path.

CI-only: plain oxlint, oxfmt, and diff checks passed. Tests and coverage intentionally not run. Retained platform, lifecycle, authority, and release-witness proofs prevent reaching the 40 percent line target safely.

* test(scripts): consolidate q0024 tooling proof layers

Reuse the existing full-release-validation-at-sha.repository fixture instead of maintaining a second repository builder. Preserve its former argument set and compatibility exports.

Keep oxlint timeout/status and parent-signal integration while removing generic drain/escalation replays. Their owners are managed-child-process.test.ts: joins descendants after runner exit; joins escaped output or fails closed; kills managed child process group descendants when the runner is terminated.

Reduce the rejected-shim fixture to its Promise.all-before-removal contract. Descendant/output behavior remains in managed-child-process and test/helpers/run-node-script.test.ts. Keep one runNodeCliShim and runTsxCliShim grace case. Remove duplicate Crabbox identity instrumentation covered by windows-process-start.native.test.ts and managed-child-process.windows.test.ts, retaining the real source-wrapper launch.

Native-declaration-boundary.test.ts retains real Windows namespaced compilation and outside symlink rejection. The cross-OS summary test retains updater fallback rendering. Replace the performance command inventory with generic trusted-Git checks and direct clean-environment assertions.

CI-only validation: plain oxlint, oxfmt, git diff --check. No tests or coverage run. This pass removes 511 lines; cumulative shard reduction is 558 of 5744 lines (9.71 percent), below the 40 percent target.

* test(scripts): trim q0024 duplicate adapter proofs

Keep real oxlint timeout and signal adapters with direct children; managed-child-process owner tests retain nested supervision. Keep fixture PID rescue. Missing-worktree hydration remains covered by local-check-runtime and tooling-dependencies tests; inline the sole remaining configured-loader fixture.

Replace duplicate low-level alias compilation with the existing real SDK writer, preserving local input receipts, ancestor immunity, warm reuse and staging cleanup. Native-declaration-boundary and canonical SDK/unified writer tests retain their owner contracts.

Consolidate REST credit reconstruction into the transport fallback test and remove repeated invalid-receipt/UNKNOWN inputs. Reduce Kova fixture metadata and duplicate empty-record evidence; retain custom-gate authority and strict-instrumentation forwarding. Reuse executable fixture setup with unchanged modes.

CI-only static proof: plain oxlint, oxfmt and diff checks pass; no tests or coverage run. Additional reduction: 241 lines. Original shard 5744 to 4945 lines, 13.91 percent; the 40 percent target remains unmet.

* test(scripts): name minimal provenance fixture accurately

* test(ui): deslop q0022 tests

Remove the modifier-enter and session-override E2E replays covered by chat-composer-actions.test.ts (ordinary send semantics), follow-up-mode.test.ts (session/config precedence), and chat-send-readiness.test.ts (selected policy admission and dispatch). Keep live steer consumption and reconnect ordering scenarios.

Retain narrow and wide portrait, landscape, and safe-area identity cases while dropping repeated widths in the same CSS branch. Remove the assertion-free table expansion diagnostic layer; shared suite failure capture and every table behavior assertion remain.

CI-only validation: plain oxlint, oxfmt, and git diff --check passed. Static declarations 41 to 39; expanded cases 67 to 61; shard lines 5273 to 5149 (2.35 percent). The 40 percent target is not met: remaining scenarios protect distinct browser geometry, transport authority, or lifecycle ordering. No runtime or coverage claims.

* test(ui): consolidate q0022 e2e ownership

Reduce the seven shard files from 5273 to 3163 lines (40.0%). Keep browser geometry, native observer reconnection, sandbox navigation, real desktop authority, and delivery lifecycle proof.

Retire duplicate layers in favor of chat-steer-order.test.ts, chat-state.test.ts, chat-queue-steer-lifecycle.test.ts, chat-send.test.ts (accepted /steer regression from 6ae895d356), view-chat-preferences.browser.test.ts, chat-content-column.browser.test.tsx, chat-responsive.browser.test.ts, chat-avatar.test.tsx, tooltip.test.ts, modal-dialog.browser.test.ts, markdown-tables.test.ts, Workboard session-accessory.test.ts, and control-ui-runtime.test.ts. Talk transport contracts remain in webrtc.test.ts, webrtc-video.test.ts, google-live.test.ts and input.test.ts; desktop control inventory remains in desktop-panel-sizing.test.ts. Full-message read caching remains in chat-pane-full-message-loader.test.ts.

Remove unused dashboard presentation recording support. Consolidate repeated fixtures and footer assertions; keep error, authorization and ordering paths. CI-only validation: oxfmt, plain oxlint and git diff --check passed; no tests or coverage were run.

* test(ui): deslop q0006 tests

Port 802f73b485e5dd869fe7ce0475f9875b19116ed5 onto the campaign lane. Preserve all lane-added or modified test cases and assertions, including newer catalog selectors, publication behavior, and shared Gateway seeding. Retain four lane-modified cases that the original shard deleted; apply its other deletions, fixture reuse, and capture cleanup.

CI-only proof: oxlint, oxfmt --check, and git diff --check passed. Tests, coverage, Testbox, and check-changed were not run; affected runtime tests are deferred to landing PR CI.

* test(e2e): deslop q0026 tests

Remove CLI replays covered by telemetry-cli.test.ts (reports the same request in JSON and text), telemetry.test.ts (CI suppression and endpoint override), channels/capabilities.test.ts (rejects before account resolution), qr-cli.test.ts (conflicting options), and program/error-output.test.ts (lazy command and parse guidance).

Document steering regression cb4c06ee78 remains covered by chat.directive-tags.test.ts (steers document context with render failure) and chat-send-message-injection.test.ts (retains marker and document text). Keep distinct FIFO, cancellation, restart, requester ownership, OAuth revocation, native dispatch, and runtime security boundaries. Consolidate resume fixtures and redundant launcher help table rows; compare OAuth fixture tokens directly.

CI-only proof: plain oxlint, oxfmt and diff-check pass; no tests or coverage run. LOC 5176 to 4803 (7.2 percent); below 40 percent because remaining scenarios have distinct lifecycle and authority behavior. No production or support changes.

* test(e2e): remove duplicate owner-boundary layers in q0026

Retire OAuth E2E scaffolding: oauth.peer-settlement.test.ts covers removal during provider I/O; oauth.concurrent-agents.test.ts and oauth-manager.settlement-validation.test.ts cover durable peer/shared authority; provider-refresh-lifecycle, models-auth-refresh.integration and auth-cli-offline.integration retain provider and logout boundaries.

Steering keepers: agent-loop.steering.test.ts keeps the first executable call and deferred steering; attempt.queue-message.test.ts, agent-session-loop-next-turn.test.ts and server.chat-abort-settlement.test.ts retain cancellation. session-send-recovery.test.ts preserves returned-result custody; gateway.sessions-send-recovery.test.ts retains cold-process FIFO/cancellation recovery. Keep the mixed FIFO and managed/SIGTERM/SIGKILL resume scenarios.

Requester status is covered by dispatch-from-config.active-command, server.chat-command-context, session-manager and subagent-announce.requester-settle-ownership tests. CLI secrets and timeout errors remain at registered command owners. Launcher classification remains in runtime-guard, node-runtime-recovery and node-runtime-update tests; config reader isolation remains in update-config-runtime-compat.test.ts; inherited cache flattening remains in node-compile-cache.test.ts and lexical symlink selection in the retained source-launcher scenario. Replace the whole-program mjs fixture with its minimal entry; profile argument rejection remains in profile.test.ts.

CI-only: formatting, plain oxlint and diff-check pass. No tests, coverage or builds run. Original shard 5176 lines to 3105 (40.01 percent); no production/shared-support changes.

* test(ui): consolidate q0011 owner-boundary coverage

Port q0011 commits 4a8ad436cf2664b6dfab5aaffd59e9fff13d4785 and bf50bada9d19275e9ac71a5170958100a4789f18 onto the campaign lane. Retain the shard cleanup and consolidations while preserving newer lane coverage: partial provider inventory, catalog publication, provider usage, device-code sign-in labels, and all Usage owner-attribution/recreation tests.

Validation: plain oxlint exited 0 for all six touched files; oxfmt --check and git diff --check passed. Independent review found no actionable issues. CI-only mode: no tests, coverage, Testbox, builds, or check-changed were run.

* test(scripts): deslop q0025 tests

Replace focused-release wiring inventories with retained attestation, producer identity, trusted-checkout and approval-order invariants. Executable candidate validation and protected producer rejection tests remain unchanged.

Remove repeated REST author rows covered by batches published author reads while preserving human credit in source order; retain the distinct empty-commit case. Keep exact-address and GitHub App machine-credit branches, folding syntax, human lookalikes, and explicit-body rejection while removing provider catalog replays. Default-preview machine removal remains covered by drops machine credit replayed in commit bullets and keeps human source credit.

CI-only shard: oxfmt, direct oxlint and diff-check passed; no tests or coverage run. Cut 130 of 5271 lines (2.47%), below the 40% target: signing mutation fences, artifact child-process ownership, and registry lifecycle/error paths have no equivalent retained owner-boundary proof. No production or support files changed.

* test(scripts): consolidate q0025 owner-boundary proof

Replace repeated Git attribution setup with direct merge-body CLI cases and one signed-history handoff fixture for GraphQL, REST, and preparation failures. Keep published/prepared/unprepared scope, folded UTF-8 credit, merge credit, stale previews, queue refusal, and write/read failure guards.

Author API ordering and malformed pages remain owned by pr-metadata.test.ts: bounds reads for ordered authors and rejects invalid authors. Native format and object classification remain covered by mac-runtime.test.ts: audits supported thin and fat formats through real otool, and preserves resources without treating them as loadable images. Keep signing entitlement policy, mixed-container errors, scanner batching, and all mutation fences here. Registry tarball bytes and content length remain in serves scoped tarballs through shrinkwrap paths; remove their replay from atomic port publication.

Static-only validation: oxfmt, direct oxlint, and git diff --check passed. No tests, builds, or coverage commands run. Cumulative q0025 reduction: 5271 to 4509 lines (14.46%); the 40% target remains unmet. No production or support files changed.

* test(scripts): deslop q0025 fixture and replay layers

Reuse the existing Mac lifetime, HTTP lifecycle, and process receipt helpers while preserving signing and process ownership boundaries. Remove redundant mixed-object classification and merge-body input replays.

Coverage keepers: codesign native executable/library and archive/image cases retain mixed-slice rejection; beta legacy log validation now includes skipped historical children; PR commit bullets, trailing whitespace, source deduplication and linked-author cases retain the removed same-path variants. Keep all independent publication, SSRF, signing and orphan-join guards.

CI-only: oxfmt, direct oxlint and git diff --check passed. No tests run. Original shard 5271 lines; final 4292 (18.6% reduction); 40% target remains unmet under the distinct-behavior retention rule.

* test(scripts): deslop q0028 tests

Move base-fetch ordering and protocol assertions into the real-repository recovery cases; remove the mocked order replay. Retain exact-fetch success and timeout proof in the drained-outcome and timeout tests.

Deduplicate shared fetch_pr_head caller and identity matrices while preserving review-init, prepare-init and merge-verify boundary cases. Remove API-call inventories, retaining preparation receipts, exact lock release, no-publication and fresh-checkpoint ordering assertions. Compact Windows timeout classification without dropping inputs.

CI-only campaign: plain oxlint, oxfmt and diff-check pass; runtime tests and coverage deferred to hosted CI. Reduction is below target because the remaining release, authority and process-lifecycle cases cover distinct behavior.

* test(scripts): remove duplicate q0028 proof layers

Retain cross-OS startup recovery in cross-os-release-gateway-startup.test.ts and port ownership in openclaw-cross-os-release-checks-upgrade-lane.test.ts. Keep focused live-handle and log-drain tests here. Remove generated-source and summary inventories, minimize identity setup, and share the artifact/log-flush scenario.

Retain merge completion in pr-merge-outcome.test.ts, gate reruns in pr-prepare-gates.test.ts, and foreign-state refusal in pr-worktree-containment.test.ts. Keep unique cold interruption and identity receipts; reduce repeated canonical-filter phases and run locale checks at the drift evaluator.

Remove repeated CI status and call-site matrices while keeping distinct ordinary, fatal, cancel and publication outcomes. Delete unreachable ancestry fault proxies and carry named-source coverage into the real shallow-history case.

CI-only: oxfmt, plain oxlint and diff-check pass. No tests or coverage run. This additional commit leaves the cumulative line reduction below 40 percent; remaining owner-boundary proofs were retained.

* test(scripts): consolidate q0028 harness proof

Remove duplicate preflight and additional-check harness composition tests. ci-platform-checkout retains trusted materialization across revisions and platforms; ci-workflow-guards executes the owner-exported dependency-free manifest; ci-architecture-go-env executes the architecture command.

Remove the repeated receipt-provenance scenario covered by pr-publication and pr-operation-lock. Minimize packaged-upgrade diagnostic fixtures to the fields and text the guards consume while retaining both platform decisions and the nonzero-exit regression.

CI-only validation: oxfmt, plain oxlint and diff-check pass; no tests or coverage run. Existing commits are unchanged. The cumulative reduction remains below the requested 40 percent because unique owner-boundary scenarios remain.

* test(scripts): deslop q0027 tests

Share the cold frozen-target fixture closure and Git setup. Remove copied schema inventories and workflow projection assertions, retaining generated SQL/omission proof, artifact provenance gates, and source preflight execution. Keep Linux metadata coverage in the reset and section/case fixtures.

Owner proof retained in generate-postgres-schema.test.ts (mapping/refusal and emitted SQL), sqlite-schema-catalog-equivalence.test.ts (native catalog facts), package-acceptance-workflow.test.ts (candidate identity and Package Acceptance projection), and live-gateway-dist-fence.test.ts (native binding and overlap).

CI-only campaign: formatting, plain oxlint and diff checks passed; tests and coverage intentionally not run. Reduction is below the 40% target because remaining process-lifecycle, publication, source-trust and main-drift authority cases protect distinct boundaries.

* test(scripts): trim q0027 duplicate proof layers

Remove copied schema and workflow inventories, release CLI command and diagnostic inventories, and redundant native binding assertions. Keep trust, publication, mutation, and lifecycle invariants at their boundaries.

Remove the fake package-build replay: release-no-push-workflow.test.ts validates package identity without repeating local pack checks. Keep whitespace tuple normalization and report serialization as independent tests. managed-gateway-bindings.test.ts keeps invoking native selection first; schtasks-runtime.test.ts owns runtime projection.

Retain final known status in the prior-CI suite: BLOCKED to CLEAN without UNKNOWN uniquely forces requalification. Drop the earlier same-branch variant and the repeated head-reread case, retaining rechecks after a known hint and GraphQL recalculation. run-node-cancellation.test.ts covers SIGHUP registration; keep the real resistant-child join under SIGTERM.

CI-only: plain oxlint, formatting and diff-check passed. No tests, coverage or builds run. The 40 percent line target remains unmet; remaining fixtures exercise distinct process custody, source trust and live-authority branches.

* test(scripts): remove q0027 duplicate owner-boundary proof

Keep planner admission coverage in docker-e2e-plan.test.ts and transitive tooling verification in package-acceptance-workflow.test.ts. Keep profile discovery coverage in src/daemon/inspect.startup.test.ts.

Remove SQLite-only fixture checks while preserving generated SQL and catalog contracts. CI-only: no test runs. The requested 40% reduction remains unmet because remaining cases protect distinct behavior.

* test(ui): deslop q0008 tests

Port q0008 from c4294ee181331cae7b50298af1ca8947706c2f42 onto the campaign lane, preserving its newer custodian coverage and mobile Details flow. Keep the shard's intended test consolidations and reporting cleanup.

CI-only validation: plain oxlint and oxfmt --check passed for all four touched files; git diff --check passed. Isolated review found no actionable findings. No tests or coverage run.

* test(ui): deslop q0029 tests

Remove the duplicate cron trigger-filter scenario; cron-trigger-filter.e2e.test.ts retains the same request, rendering, and history assertions. Use the existing Gateway request waiter instead of a bespoke polling loop.

Keep GitHub project admission focused on selection, worktree routing, permission and attachment submission, deferred navigation, and success/error recovery. Initial-image hydration and canonical promotion remain covered by new-session-page.prompt-attachments.e2e.test.ts and chat-pane-snapshot-hydration.test.ts. Retain one row per preparation branch instead of replaying success and failure for both checkout forms.

Remove the auxiliary reconnect diagnostic sampler without changing the cold offline Blob scenario or its delivery assertions. Preserve the distinct authority, lifecycle, native storage, and rendered geometry cases; the shard does not safely meet the 40 percent line target under CI-only inspection.

* test(ui): consolidate q0029 owner-boundary proof

Remove the full-stack PR reader replay. control-ui-session-pr-access.test.ts retains real profile changes, canonical replacement, surviving-reader delivery, and pending check authority. control-ui-session-pr-subscriptions.lifetimes.test.ts retains publication ordering; chat-pull-requests.e2e.test.ts retains the rendered Details path. Shrink only the deleted file entries in routing and timing inventories.

Keep outbox idle/global draining in chat-send.test.ts, receipt retirement and explicit review in chat-outbox-recovery-owner.test.ts, legacy migration/retry in chat-outbox-migration.e2e.test.ts, and target identity in outbox-identity.test.ts. Retain the native Blob ownership races and synchronous durable-before-wire capacity assertion.

Keep pairing lifecycle transitions in device-pair-setup.test.ts and view-pairing.test.tsx while retaining browser auth gating, command dispatch, clipboard, and responsive geometry. Keep catalog adoption in external-session-catalogs.e2e.test.ts and progressive host settlement in app-sidebar-session-catalog-live.test.ts. Drop copied CSS values while retaining rendered row geometry.

Consolidate filter selection and clear assertions in the localized keyboard scenario. Cron stale query and selected scope protection remain in lib/cron/refresh.test.ts and lib/cron/read-retirement.test.ts. CI-only: plain oxlint, oxfmt, and diff-check; no test or coverage execution.

* test(ui): preserve q0029 independent and historical proof

Preserve the Knot-dark project-label contrast assertion while removing only internal theme-state inventories. Keep frozen historical CI routing independent of current file deletion.

Remove the extra native offline reload replay: chat-outbox-migration.e2e.test.ts retains native reload, explicit retry, exact bytes, and retirement, while the retained plain-HTTP scenario covers fallback adoption and lost ACK review. Keep cold-import reconnect and native lock/admission races here.

Capacity proof still checks decoded composer images, exact wire bytes, durable storage at dispatch, and exact delivered image bytes. Remove the intermediate byte-length recheck already implied by those stronger assertions. CI-only static lint, formatting, and diff-check pass.

* test(scripts): preserve first packaging-call ordering guard

Port q0009 commits f3f092a2e88e50fc56471ffcf776f406455f562f, b1162b68eedfb31914dad9950a1bd9071bc777a8, 4b2ae7abcb9bb4ec20aef7bdfefa630538071ef5, and 4ca77f69bdfa049742acc48e8fa16ba9e74ef705 onto the campaign lane as one commit. Preserve all eleven newer failed-template cleanup cases using the consolidated fixture and retain the updated ACP gateway-other ownership assertion.

CI-only validation: oxlint exited 0 for all seven touched files; oxfmt --check and git diff --check passed. Independent review found only the already-fixed duplicate fixture setup in the index; stage the reviewed working-tree correction. No tests, coverage, Testbox, or check-changed were run.

* test(scripts): deslop q0030 tests

Remove repeated missing-value and failure-classification variants, reuse existing fixture setup, and retain distinct security and lifecycle coverage.

Generic ancestry validation remains covered by pr-crabbox-gate-publisher.test.ts (validates protected main comparison). Codex chunk bounds and complete owner routing remain covered by extension-test-plan.test.ts (bounds files with their actual ordinary and database owners); batch exclusion and retry forwarding remain here.

CI-only audit: plain oxlint, oxfmt and diff-check passed. No tests or coverage run. Reduction is 5182 to 5106 lines; the larger target would require dropping distinct signing, authority, process lifecycle, or publication behavior.

* test(scripts): remove redundant q0030 proof layers

Remove the synthetic UI validator replay; real staged validator and publication tests remain in ui.test.ts, with cache behavior covered by direct-run-entrypoints.test.ts.

Remove the native batch replay from test-extension.test.ts; native execution, result union, runtime policy and home ownership remain in vitest-worker-artifacts.batch.test.ts, vitest-report-owner.test.ts, run-vitest.test.ts and run-vitest-state-cleanup.test.ts. Keep explicit default Node flags.

Consolidate successful native artifact resources into one preserved archive, retaining negative signature, receipt and filesystem boundaries. CUA refusal remains in mac-elevation-host.test.ts. Fold duplicate merge success/revocation into materialization and settlement cases, preserving exact-head binding.

CI-only static validation: oxlint, oxfmt and diff-check passed; no test or coverage runs. Original shard 5182 lines to 4710; remaining independent boundaries prevent the requested 40 percent cut.

* test(scripts): trim q0030 fixture and inventory layers

Replace the artifact preservation path inventory with a complete fixture snapshot, and stop asserting synthetic Mach header facts. Reuse the existing shared waitForDead owner instead of duplicating its loop in report tests.

Drop copied report-default and planner-cost inventories while retaining area/RSS defaults, exact comparison errors, assignment/balancing invariants, and the estimator owner tests in extension-test-plan.test.ts. Remove lint evidence replays covered by ci-static-check-evidence.test.ts and retained matching-diagnostic guards.

CI-only validation: plain oxlint, oxfmt and diff-check passed. No tests, builds or coverage run. Additional 114 lines removed, original shard 5182 to 4596 lines. Distinct authority, native-format and process-lifecycle proof retained; the requested 40 percent target remains unmet.

* test: preserve independent coverage in d454 reductions

* test: drop d454 reductions rejected by CI

* test: retain d454 fixtures and shrink timeout ratchet
2026-10-24 09:39:26 +00:00
Peter Steinberger
f6427568d9
fix(update): name the failure cause in generated reports without exposing private data (#178301)
Refs #178094, #178244, #145390. Generated update-failure reports collapsed candidate-startup failures to [redacted-diagnostic] and config paths to agents.*, leaving them untriageable. The candidate canary now emits fixed producer-owned cause templates and invalid-config reports keep schema-owned path segments with <id> for dynamic map keys; existing allowlisted facts are preserved. The #145390 public allowlist is unchanged: no free-text diagnostics, paths, hosts or user values reach the public report.
2026-10-20 04:33:26 -07:00
Peter Steinberger
7c112970cd
fix: include launcher parent lifetime in reduced runtime packages (#174480)
node-runtime-recovery.mjs imports cli-parent-lifetime.mjs after #174268.
Ship that dependency in both Docker launcher stages, cleanup smoke, and
the remote-node bootstrap artifact, and keep copied runtime fixtures in
sync. Require the module in the bootstrap archive regression.

Preserve existing launcher and detached update lifetimes. No new closure
framework, dependency, configuration, or timeout changes.
2026-10-16 10:39:48 -07:00
Peter Steinberger
3bfccdb9bd
fix: preserve standalone CLI profiles and settle Doctor shutdown (#173154)
Preserve explicit profiles across standalone CLI respawns through one bootstrap-safe invocation owner. Select loose runtime/script arguments or direct compiled arguments from the embedded builder fact or adjacent manifest. Include the owner and compile-cache workers in packaged launchers and standalone builds.

Settle worker execution and native resource closure independently after snapshot failure. Release startup-refused broker claims only after native process and pipe closure, retain cleanup transport on operation failure, propagate Doctor snapshot errors, and cancel further inspections without losing maintenance restoration.

Document the private Unix-domain bind/connect allowance required by both loose and standalone snapshot workers. Keep network, home, Keychain, launchctl, and host-SQLite denials in the relocated verifier.

Validation: signed production-pinned JIT and bytecode artifacts at 4aa64f9ddc294 passed explicit-profile Doctor, Gateway/agent/restart campaigns, denied-IPC failure, and SIGTERM settlement in 364/375 ms with unchanged deadlines. Later source repairs passed owning-boundary regressions, scoped checks, and independent review. Signed artifact identity is preserved separately from the final CI head.

Exact-head CI for 9617855492767: 172 successful jobs, 19 skipped, zero failures (run 38833042547). Tested merge 58c3b87a8594 has the same tree as the prepared PR head. No CI exception, rerun, or timeout increase.
2026-10-15 18:24:34 -07:00
Peter Steinberger
c9fc997e9a
fix(gateway): avoid main-thread compile cache flush stalls (#171358)
Leave Node compile caching disabled on the Gateway main thread while preserving the shared build-scoped worker cache and existing worker flush boundaries. Remove the two synchronous Gateway flush calls that can stall cold startup.

Reuse the existing inherited-cache respawn handoff, preserving the supervised PID on supported platforms and the child bridge on Windows. Ordinary CLI caching and caller-authored disable settings remain unchanged. Permission-mode callers retain an already-active cache when process replacement may be forbidden.

Four alternating cold/warm runs retained worker caching, eliminated main-thread cache flushes, and passed the warm CPU regression gate. Focused regression proof covers main/worker cache state, Windows handoff, and POSIX signal propagation.
2026-10-13 14:34:55 -07:00
Peter Steinberger
a9d10dc7df
fix(tooling): retain cleanup custody through runner shutdown
Keep the source runner alive until its detached work is joined and cleanup custody is released. Preserve native child signal exits in the managed shim, while honoring interruptions that arrive during release acknowledgement.

Cover both acknowledgement windows through the real cleanup channel. Linux focused and negative-control proof passed; independent P2 review is clean.
2026-10-10 10:11:27 -07:00
Peter Steinberger
070b7479dc
fix(update): hand the private Node runtime to npm lifecycle children (#164677)
When the updater or recovery selected the compatible private Node runtime and ran npm's JavaScript CLI with it, npm lifecycle children (preinstall and friends) resolved plain node from PATH and picked the unsupported system Node, so the install rejected itself. One shared PATH handoff now prepends the selected runtime's bin directory for every package-manager spawn in recovery, update environments, and explicit npm/pnpm execution, preserving npm_config_node and the explicit executable, scoped to the child only. Real-npm regression: lifecycle child reported v22.22.3 before, the private runtime after. Closes #164525.
2026-10-03 19:05:29 -07:00
Peter Steinberger
4d79288452
refactor(testing): deslop test-only production seams (#164320)
* refactor(testing): remove test-only production seams

Use native module boundaries, fake clocks, and temporary filesystem fixtures instead of production dependency bags and test setters. Remove retired agent-exec repair options while retaining public SDK and real lifecycle contracts.

* test: classify browser fixtures and prune retired assertions

* test: finish module-boundary fixture migration

* refactor(testing): remove CLI and readiness injection tables

* test: complete native process fixture contracts

* test: preserve the logger write gate and strengthen queue proof

* test(browser): exercise delegated Windows installation fixtures

* test: bind mock cleanup callbacks to their owners

* refactor(testing): preserve required fixture lifecycle boundaries

* refactor(testing): preserve asynchronous writer typing

* refactor(scripts): keep formatter batch budget private

* test: preserve native worker ownership in fixtures
2026-10-03 16:46:36 -07:00
Peter Steinberger
e7dc869d15
fix(test): tsgo, tsdown, run-with-env, and lifecycle tooling tests fail on loaded hosts when fixture children outlast polling deadlines (#162738)
Script-tooling tests for dist artifact ownership, the prepublish plugin registry shell, the Node lifecycle runner, tsgo runner, run-with-env, test-extension, and tsdown-build polled PID and readiness files or raced owned child completions against fixed timers, so a fixture child that outlasted the bound on a loaded host failed the test.

Waits now await child IPC readiness (the e2e npm registry fixture server also reports its port over process.send when a Node caller owns IPC; shell callers keep the atomic port file), fixture receipts from the native-runner signal fixture, an inherited readiness FIFO where the spawn interceptor must block synchronously before delivering SIGTERM, ordered direct reads after awaited operations, and completion promises bound to the Vitest signal via withinTest so a timeout still reaches finally cleanup. One deadline-free, signal-bound foreign-process observer remains per file where the test deliberately destroys the owner or rescues orphan groups whose handles are private to product code. Three retired sites drop out of the timeout-race baseline. No product source, test timeout, product grace, or assertion meaning changed.

Part of the polling audit from #162274. Proof on Blacksmith Testbox: delay faults fail the original bytes and pass these bytes, forced-abort probes reach cleanup, 140/140 standalone runs (20 per file), 3/3 replays of each owning shard (core-tooling-12 and core-tooling-16 on the rebased head), root-test typecheck, type-aware lint, base-aware timeout-race ratchet; Codex autoreview and ClawSweeper clean.
2026-10-01 07:28:59 -07:00
Peter Steinberger
c62fea19bb
test: isolate source runner fixtures from host services (#161320)
Keep the no-Gateway compiler and lifecycle fixtures on their shared service boundary, including the live artifact fence in source and prepared JavaScript form. Make the existing native signal cases reject incidental service spawns while preserving their signal, private-pipe, and cleanup contracts.

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-09-29 13:26:00 -07:00
Donnie Fiander
d09ffd2228
fix(build): refuse dist rebuild under a live managed Gateway (#152875)
* fix(build): refuse dist rebuild under a live managed Gateway

Stop pnpm build and run-node auto-build from deleting hashed dist modules
while a managed Gateway ExecStart still points at this checkout.

* chore(build): drop unused fence message field

* fix(build): also fence direct tsdown and run-node rebuilds

Cover the cleanTsdownOutputRoots path and refuse early in run-node so
live managed Gateway dist cannot be wiped outside build-all.

* fix(build): keep live Gateway stop off the rebuild path

Dispatch gateway stop/restart from existing dist, apply --profile
before service inspection, and fence only physically overlapping
checkouts.

* fix(build): keep live dist fence off tsdown declaration graph

Load daemon inspection lazily so tsdown fixtures and plugin-sdk dts
generation do not import service-layout. Move run-node recovery tests
to a sibling file so the line-cap ratchet does not grow.

* fix(build): use import type for SpawnOptions in live-dist tests

* fix(build): dispatch source-only QA reports before the live dist fence

qa parity-report and qa coverage already run from source without
rebuilding private QA dist. Check that path before refusing a live
managed Gateway rebuild.

* fix(daemon): discover managed Gateway bindings across profiles

The live-dist fence needs every installed managed selector, not only the
current OPENCLAW_PROFILE. Reuse includeManagedOpenClaw scans and leave
findExtraGatewayServices semantics unchanged.

* fix(build): refuse live dist rebuild for every overlapping Gateway profile

A default-env build could still replace dist under a sibling profile
Gateway. Inspect all managed bindings, name offenders, and point operators
at stop or openclaw update.

* fix(daemon): keep managed Gateway binding discovery under lint limits

Move profile binding mapping out of inspect.ts, list managed services via
listManagedOpenClawGatewayServices, and use toSorted for profile naming.

* fix(build): keep live-dist refusal out of updater restore and system census

Propagate admissionRefused so update-gateway-build does not rm live output
roots after a pre-mutation fence refuse. Enumerate system-scope managed
units with explicit systemdReadTarget so user and system siblings both reach
the fence.

* test(build): pass a compare function to toSorted in the fence fixture

* fix(build): satisfy live-dist fence CI type, knip, and assertion gates

Treat toSorted comparators as possibly undefined, stop re-exporting the
unused binding type, and read launchd profile env through the record
owner instead of a type assertion.

* fix(daemon): inspect systemd template instances in the live-dist census

Discovered `openclaw@.service` files were forwarded as unit names, so the
fence queried a non-runnable template and fail-opened past a live instance
when a separate user Gateway was installed. Reuse the existing instance
resolution owner and cover user+system template inspection through the
service reader.

* fix(tooling): pin foreign-cwd tsconfig and clear CI gates

- pin TSX_TSCONFIG_PATH in the CLI shim only when the cwd lacks one, so
  fixture-spawned run-node.mts resolves workspace profile imports
- pass --import scripts/tsx.mjs to live-updater spawns and pin the
  tsconfig in run-node-lifecycle fixture envs (production loader parity)
- drop the unused systemd re-export for knip and move the template-
  instance test to service.systemd-scope.test.ts for the line cap

* fix(daemon): inspect registered Gateway services accurately

Read strict Windows service commands from registered actions and preserve
supported launcher encodings without treating dynamic CMD expansion as a
verified command. Retain exact task identity and bound systemd selection.

Use one platform inventory collector for the existing full and diagnostic
projections. Report incomplete inspection through Doctor while preserving
status JSON and the existing managed-service filters. Keep load-state
inspection behind a leaf capability instead of reverse facade imports.

Refs #151608, #151463.

* fix(daemon): classify service commands by position

Share runtime and root-option parsing so Node display names and profile values
cannot classify a Node service as a Gateway. Preserve literal shell, env and
generated launchd wrappers, and honor the executable selected by launchd.

Read systemd's single-quoted arguments through the existing parser and preserve
literal apostrophes when rendering. Keep strict Windows command rejection
separate from lenient diagnostics, and align the native-boundary fixtures with
that contract without weakening ownership or source-preservation assertions.

* fix(daemon): inspect direct registered task actions

Read literal executable actions from their registered Scheduled Task and
revalidate the action before returning command facts. Strict runtime inspection
uses the same registered command instead of a default launcher.

Keep executable paths out of managed launcher provenance. Direct actions remain
outside automatic update service management when no restorable CMD/VBS launcher
exists, preserving the prior stop and definition ownership boundary.

* test(windows): prove installed service upgrade paths

Extend the existing native Scheduled Task proof with verified immutable package
handoff and fixed fresh, published 2026.9.3, and published 2026.9.4 CLI cells.
Require live version/build identity, selected PID replacement, peer continuity,
strict registered-action inspection, and settled cleanup before evidence
publication and disposable installation retirement.

Keep source-only and repair modes, permissions, deadlines, and native lifecycle
owners intact. Direct executable fixtures remain disabled and preserve the
updater's unsupported-mutation boundary. Native execution remains pending.

* test(doctor): retain managed Windows launcher provenance

Keep the generated CMD path on the existing managed-service fixture before
and after reinstall so Doctor admission sees the installation it models.
Preserve all stop, install, restart, rollback, and direct-action refusal
expectations without changing production behavior.

* test(windows): exercise native autostart ownership boundaries

Extend the existing published-updater cell with its stopped, task-owned
Scheduled Task. Capture real admission, exercise native enable/disable,
and preserve the definition and files after foreign-owner refusal.

Test retained admission separately from restoration so legitimate same-root
refresh remains supported. Restore the original XML through the existing
fixture lifetime; do not broaden product control or workflow permissions.

Modeled owner tests, selected source checks, and independent review pass.
Actual Windows execution remains required before a native proof claim.

* test(windows): retain sanitized installed command failures

Keep unexpected command stdout and stderr in bounded failure diagnostics so
JSON-mode CLI errors survive native proof failures. Reuse the existing
terminal and support redaction owners before clipping; withhold incomplete
captures while preserving the existing truncation failure.

Move the existing command runner into its own test-support module and update
both consumers without changing timeout, exit, signal, or cleanup semantics.
Real-child regressions reproduce both privacy defects and pass with the
correction. The original installed Gateway failure remains undiagnosed.

* fix(daemon): preserve Windows probe budgets and Doctor cleanup eligibility

Use the existing cold PowerShell startup budget for Task Scheduler queries
without an explicit deadline. Keep periodic activation checks bounded and
preserve unknown results rather than treating timeouts as task absence.
The native probe test now exercises the production default.

Share Doctor's existing legacy cleanup classification with its registered
preview. Keep unsupported platforms, scopes and unrecognized Linux unit
names as findings without advertising removal or invoking unrelated cleanup.
Extract the classifier and complete cleanup test group without dropping
assertions or changing native mutation ownership.

Retain the failed installed Windows runs and their source identities;
new package and native upgrade qualification remain separate requirements.

* chore(daemon): retire stale Doctor size baseline

The split Doctor service module no longer needs a max-lines suppression.
Remove only its stale baseline entry so the shrink-only ratchet matches
actual source. Product, dependency, workflow and fixture bytes are unchanged.

* fix(build): keep native fixture import closures complete

Keep the legacy source-update transaction at its existing direct CLI call
site so native declaration-library consumers do not load its CLI-only source
resolver closure. Copy the exact PID helper inputs into the runtime fixture.

Use the real legacy-loader file URL in its existing subprocess invocation,
so execution and unused-file analysis share the same dependency reference.
Preserve all assertions, lifecycle guards and package runtime behavior.

Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>

* test(windows): retain sanitized service proof observations

Record bounded install and status facts before semantic assertions so a
successful CLI exit cannot hide the native inspection reason. Exclude
free-form stderr and private response fields, and preserve existing
execution, deadline, and cleanup assertions.

* test(windows): retain safe installed-service observations

Retain allowlisted install/status JSON before strict semantic assertions,
without copying private response fields or opaque successful stderr.
Compose service observation and exact sibling-refusal checks through one
internal options record and migrate every test/support caller together.

Preserve native process cleanup, readiness assertions and command budgets.

Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>

* test(update): isolate source updater fixture inputs

Give the synthetic compiler declared memory capacity through the existing
memory owner instead of inheriting competing CI workers. Keep real build
heap admission and all lifecycle assertions unchanged.

Use the established TypeScript loader for the Linux-only live-updater CLI
case so it reaches the platform refusal rather than failing during import.

Refs #152875. Retains the exact failing Linux CI evidence and contributor work.

Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>

* fix(windows): preserve native status inspection defaults

Keep the CLI RPC default distinct from an explicit timeout so Windows
service inspection can use its existing cold-start budget. Forward
explicit load-query deadlines through the Task Scheduler owner while
preserving lifecycle defaults and timeout diagnostics.

* fix(models): retain discovered models after refresh failures

Record successful legacy catalog results at the producer boundary so unavailable refreshes retain the accepted inventory. Preserve explicit outcomes, advisory SDK fallback behavior, and first-discovery starter policy.

* fix(models): preserve skipped catalog outcome semantics

Mark bundled static, configured, and advisory catalog projections with
explicit empty outcomes so legacy success inference cannot promote them
to observed account inventory. Preserve live outcomes and helper types.

Keep exact auth provenance histories and move existing fixture/policy
code into focused owners where required by the line-cap ratchet.

Validation: 447 producer and sibling cases, 56 shared self-hosted cases,
95 auth/policy cases, causal missing-outcome failures, maintained checks,
and independent review.

* test(plugin-sdk): keep discovery loader types acyclic

Move the shared loader type into a leaf consumed by both discovery
contract helpers. Preserve its public provider-test-contracts export
without a child-to-parent type import cycle.

Validation: maintained Madge check reports zero cycles; core, all core
test graphs, extension test types, lint, formatting and independent
review pass. Runtime behavior and previous catalog proof are unchanged.

* fix(plugin-sdk): mark generated static catalogs explicitly

Keep the generated non-live, non-strict catalog adapter from claiming
successful acquisition for manifest or configured rows. Preserve null,
errors, strict and custom callbacks, static catalogs, and public types.

Validation: three existing controls fail before the correction; all49
owner and sibling cases pass afterward, with types, lint, line caps and
fresh independent review clean.

* test(windows): honor omitted task XML defaults

Use the existing task XML setter for disabled installed fixtures and
normalize only the task-level Enabled setting in the enable roundtrip.
Keep all other definition, native state, cleanup, and sibling build
refusal assertions intact.

Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>

* test: preserve native and npm fixture environment

Use the canonical native service environment projection for installed Windows
fixtures, retaining private application and npm paths with case-aware overrides.
Keep credentials and Node options outside the projection.

Apply the exact isolated npm global-config fixture correction from #158197 so
version-selection tests reach their existing assertions after config discovery.

Validation: 16 focused cases, all selected changed checks, and independent P2
review passed. Product and dependency inputs are unchanged; Windows installed
upgrade and sibling-build qualification remains outstanding.

* test(windows): await installed readiness before status checks

Use the existing HTTP startup-readiness owner after install and update, while
retaining strict one-shot status, build identity, and sibling continuity checks.

Stop registered fixture services through the guarded owner before deleting Task
definitions. Proven absence skips only stop; unknown inspection or stop failure
retains the error and cleanup authority instead of bypassing the guard.

Validation: source-identical readiness/stop owner proof (71 cases), affected
services types, lint, formatting and ratchets passed. Fresh P2 review's request
to delete after failed stop was rejected against the retained-authority contract.
Native Windows completion remains unqualified; no deadline or assertion changed.

* fix(tests): wait for queued RPC admission before restart

Await the exact terminal chat event after deferred registration before
releasing the held first response. Preserve the actual queue assertion,
all delivery and restart checks, and the overall test deadline.

Refs #150153
Refs #152875

Source-equivalent carry of #158347 (471321034e6701350d61f1e12eb45388f7c1a7e1).

* test(windows): stop installed fixtures in their own profile

Invoke the guarded installed CLI through the existing managed command owner,
using the admitted Task entry, profile and environment. Vitest's synthetic
ambient state must not decide whether that Task can be stopped.

Keep the existing 180-second command lifetime and child join, without inheriting
an already-aborted test-body signal during cleanup. Unknown registration and
failed stop still retain authority; proven absence skips only stop.

Validation: affected services types, lint, formatting and independent P2 review
passed. Shared command-owner proof remains retained. Native completion is still
pending; no service guard, process assertion or test deadline was weakened.

* fix(update): retain native custody during partial-stop recovery

Compensate a failed native stop through the existing guarded service restart,
revalidating the original binding inside its operation lock. Require completed
recovery and preserve the original failure without starting a build or custom
shell command. Successful and failed-build custom restart contracts stay intact.

Four published-shell regressions fail on the former path and pass after this
repair; 21 unchanged controls, selected checks, and independent review pass.

Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>

* test: preserve threaded SQLite cleanup fixture metadata

Carry the exact qualified d103e239/#158407 fixture correction for incoming
compile-cache initialization. The non-isolated harness runs in threads;
retain its false/null metadata and forbidden Worker constructor without
changing assertions, order, or timeouts.

* test: align SQLite lifecycle proof with canonical host contract

Replace the provisional physical-thread metadata with the logical-host
fixture contract from merged #158209. Preserve every cleanup assertion and
the forbidden Worker constructor.

Carry merged #158409's literal dependency resolvers, caller update and
selection regression. Exact canonical postimages, the ordered cleanup case,
dependency-selection case, selected checks and independent review pass.

* test(windows): preserve installed command budgets and progress

The aggregate 240-second fixture deadline cut the published updater short
before its existing 180-second command budget. Allocate installed cells
360/900/900 seconds and matching 10/19/19-minute Actions envelopes, including
the existing teardown and runner margin. Source-native and command limits,
assertions, and the quiet watchdog stay unchanged.

Reuse the existing durable recorder for real phase progress, preserving
original failures and emitting only fixed labels. The Task-only 9.4 cell
needs one sibling fence, with no Startup fingerprint allowance.

The 32 focused cases, selected types and export scans, workflow validation,
owned lint, and independent review pass. Retain the unchanged main replay
lint-cap failure separately. Production and dependency inputs are unchanged.

* test(windows): retain installed updater failure progress

Read the isolated selected service update ledger before native fixture cleanup and retain only phase and step metadata. Preserve the original updater error and all existing execution budgets.\n\nValidation: 15 focused tests, incremental changed-file checks, and independent review passed. The moving-main ratchet failure on three untouched older files is retained separately.

* test(daemon): complete system template runtime fixture

Provide the loaded-runtime reader's required ControlGroup metadata. The missing
native response correctly made inspection unavailable and broke the template
regression after main integration; production behavior is unchanged.

Validation: the original fixture fails locally for the CI assertion, then all
76 service-scope and loaded-runtime cases pass after correction. Independent
P2 review is clean. No assertion, timeout, or package source changed.

* fix(daemon): ignore unrelated registered task profiles

Read-only Scheduled Task discovery can inspect a static unrelated command
without requiring an OpenClaw profile. Keep selected-service profile checks
strict, and preserve launcher, registration and deadline revalidation.

The installed Windows fixture exposed a false Doctor finding for a Helper
that only runs node.exe --version. Add its causal collector regression and
retain the selected-service rejection assertion. Receive the canonical
2b2ae319 SDK fixture fix so mutation occurs after real declaration emission.

Receiving tests and core/services/SDK types pass; focused lint and P2 review
are clean. The full changed gate still encounters the inherited OpenRouter
suppression defect already repaired on main. The production change requires
new package acceptance and native Windows proof before landing.

* fix(build): give external recovery steps for stale dist

The live-build refusal now names an external stop, successful rebuild, and
start sequence for every matching service. Explain that an already-current
update does not rebuild stale output, and document the default-profile
commands with failure-short-circuiting in the source update guide.

This changes guidance only, without altering admission or lifecycle policy.
The existing fence suite passes 37 cases with one platform skip; focused
lint, formatting and independent P2 review are clean.

* test(daemon): observe published updater settlement

Record launcher, command, and output lifecycle timestamps for the published
update command. After its current ledger run becomes terminal, retain at
most two bounded and sanitized process snapshots with creation and CPU/I/O
facts. Fence progress and snapshots to that same run; observations neither
refresh progress nor change command, cleanup, or watchdog budgets.

This diagnoses a published 9.3 command that timed out after its candidate
reported successful activation and verification. Preserve the failure and
avoid inferring early process exit from post-timeout cleanup observations.

34 focused cases, services types, scoped lint, formatting, and independent
P2 review pass. Native diagnostic execution remains required.

* fix(daemon): recognize the released waiting task launcher

Accept the exact waiting VBS form generated by the published 2026.9.3
installer during an owned service-definition audit. Keep custom launcher
behavior classified as an unknown edit and preserve all selector, command,
root, and native authority checks.

Receive the three reviewed postimages from ec742584. The actual audit
regression fails on the original implementation; 55 receiving cases pass.
The shared owner also verified 140 backup/rewrite cases, core/services types,
scoped lint and P2 review. This repairs the observed reconciliation warning;
it does not claim to explain the independent updater settlement timeout.

* test(daemon): sample unsettled updates before the command deadline

Keep the same two-snapshot cap, current-run binding and progress behavior. Capture an unfinished run at 300 seconds so a slower installation cannot prevent all process observations. Rename the diagnostic field to reflect both active and terminal observations. The original observer regression fails; 25 cases, scoped lint/types and independent P2 review pass. Command and cleanup budgets are unchanged.

* test(daemon): preserve CRCRLF task export comparisons

* fix(windows): enable a verified disabled task on explicit start

Receive the shared selected-service start repair, preserving published command fingerprints and optional Enabled metadata behavior. Keep the finalization process fixture's real entrypoint exports available. Source-build recovery ownership remains unchanged.

* docs(windows): clarify explicit start partial effects

Document that successful enablement remains an audited effect when the later launch fails. Preserve the existing explicit-start contract and require inspection before retrying; do not imply rollback after authority loss.

* docs: clarify source CLI recovery uses the existing build

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Donnie Fiander <44792682+DonnieFi@users.noreply.github.com>
2026-09-28 00:39:49 -07:00
Peter Steinberger
3fadd8c3f7
perf(plugins): reuse and bound CLI compile caches (#157528)
Share build-scoped compile-cache ownership between the launcher and runtime. Reuse inherited namespaces, avoid redundant respawns, and retire superseded builds with best-effort seven-day and 512 MiB maintenance.

Testbox: 304 focused tests passed with one Bun-only skip; pinned changed-file checks passed. Thirty child launches used 41,544 bytes instead of 1,185,000 bytes, and same-build launch time fell from 2.46 s to 1.22 s. Persistent external-plugin source capture reuse remains outside this scoped change.
2026-09-24 20:18:39 +00:00
Peter Steinberger
1bbd578b46
test: prebuild run-node signal fixture (#157478)
Use the compatibility-owned runtime artifacts before starting the readiness deadline so the lifecycle test reaches the real launcher and compile-cache respawn path without forced build publication. Preserve the existing signal assertions and surface bounded subprocess output on an early exit.
2026-09-24 11:38:31 -07:00
Peter Steinberger
3e9e4cdde3
test(runner): isolate lifecycle fixtures from services
Use the existing no-service fixture in the three generated runners that previously entered native Gateway publication custody. Include the joined command result in first-case failures while preserving unjoined-work markers, all signal assertions, and both existing deadlines.
2026-09-24 11:12:27 -07:00
RoboClaw
9f9b4de951
fix(ci): stop pasted-text handoff tests racing excerpt loading (#157375)
* fix(ci): stop pasted-text handoff tests racing excerpt loading

Await the real attachment reader, lazy parser import, and Lit update while retaining all handoff, excerpt, draft, and payload assertions. Restore the call-through spy in finally.

Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>

* fix(test): record late-start child before fixture release

Publish the fixture child arguments and PID before honoring a release
marker so cleanup can observe late startup without repeated build and
launcher work. Preserve the existing signal assertions and deadlines.

Controlled release-present proof reduced build/launcher work from three
to one. The normal signal case passed in 9.982 seconds. The initial PID
readiness delay in CI run 36022803218 remains unexplained; this repairs
the independently reproduced cleanup defect.

---------

Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-09-24 17:01:50 +00:00
Peter Steinberger
bae12326a6
fix(update): rebuild stale Git runtimes when source is already current (#156996)
* fix(update): rebuild stale git runtimes through managed handoff

* fix(update): decide Git no-ops from build provenance

* fix(update): rebuild Git runtimes without provenance
2026-09-24 15:38:14 +00:00
Peter Steinberger
2a911a7ccb
fix: keep cold child compilation outside CI test deadlines (#156011)
* test: prepare bounded TypeScript child probes

Prepare native test children through the invocation-owned compiler before their existing deadlines. Preserve module boundaries for import guards and script entry detection, and keep source-loader contracts explicit.

Retain native process isolation, worker lifetimes, assertions, and deadlines. Cover MTS declaration selection in the existing compiler fixture. Also declare the generated fallback plugin fixture as ESM and remove one unused internal script export.

* test: prepare remaining worker and tooling fixtures

Keep installed tooling at its native package location so prepared probes retain native bindings and relative assets. Preserve existing child deadlines, assertions, and source-layout contracts.

* test: assert native CLI delegation before option rejection

* test: preserve sparse prepared fixture entry contracts

* test: mark prepared budget fixtures as ES modules

* test: preserve serialized fixture inputs under type-aware lint

* test: prepare sparse wrapper and report fixtures

* test: prepare remaining CLI wrapper children

* test: complete bounded child fixture preparation
2026-09-22 17:41:19 -07:00
Peter Steinberger
aa6827f402
perf(sessions): batch watcher cursor reads (#154714)
* perf(sessions): batch watcher cursor reads

* test(plugins): stabilize cross-process cache handoff clock

* test(infra): distinguish task names from restart log paths

* fix(test): retain compiler policy in launcher lifecycle proof
2026-09-21 05:37:24 -07:00
Peter Steinberger
2ce0573b02
fix(gateway): preserve active work during recovered Node restarts (#153435)
* fix(gateway): preserve work during recovered Node restarts

Let Unix Node recovery wrappers respect the existing Gateway stop budget.
Share startup-safe command classification and deadline facts, and resolve
managed restart intent against the live serving owner in its write
transaction with current update authority.

Preserve the existing public PID intent API, record format, and Windows
behavior. Keep cold lifecycle test preparation outside timed hooks.

Inspired by @ly85206559's wrapper-grace approach in #147054; this repair
is independently authored from main. Related: #146956. Windows cooperative
shutdown remains a follow-up.

* refactor(gateway): stabilize restart callback and test setup

Declare receiver-independent restart intent callbacks as arrows and retain typed signal spy handles for lint-safe assertions. Move cold lifecycle imports into test collection so worker preparation cannot consume timed setup hooks.
2026-09-19 22:41:17 -07:00
Peter Steinberger
3c4c111b0f
feat: automatically update idle headless nodes (#151545)
* feat(node): update headless runtimes automatically when idle

Stage private packaged node runtimes and activate only after all owned work
and cleanup settle. Preserve pairing and launch options, keep automatic
activations at least 12 hours apart, and leave shared-state migration and
Gateway installation ownership with the normal updater.

Document defaults, opt-outs, runtime version discovery, and recovery.
Support recoverable Windows selector replacement across service restarts.

Refs #151462

* fix(node): complete auto-update integration and settings defaults

Capture the launcher in compiled test runtimes and trusted wrapper inventories, register the package update proof, and use the canonical Kysely read path. Preserve the inherited enabled state in the config UI and align caller tests with the node shutdown lifecycle.

* fix(node): preserve retained plugin work during automatic updates

Require an explicit idle result from plugin commands, preserve older-plugin work, and connect bundled lifetime owners to automatic node updates. Join canceled inference and failed terminal cleanup before command settlement; keep historical state repair with Doctor. Document compatibility and extend installed-package proof for retained legacy plugin work.

* test(browser): align idle-work fixtures with runtime exports

* test(browser): extract proxy request fixtures

* test(node): retain idle assertions across native cleanup
2026-09-18 06:20:27 -07:00
Shakker
53200287f8
fix: preserve child signal termination during CLI respawn (#144838)
Preserve actual Unix child termination signals through startup respawns so supervisors stop interrupted runtimes without entering watcher recovery. Keep explicit numeric exits and Windows termination behavior intact.

Fixes #144200.
2026-09-11 12:05:59 +01:00
Shakker
61f7614641
fix: distinguish interrupted dev runners from completed shutdowns (#143676)
Preserve Unix signal termination through the native runner and watcher, and distinguish acknowledged UI shutdown from interrupted or unverified cleanup.
2026-09-10 06:04:23 +01:00
Peter Steinberger
7a8dc4be23
fix(cli): let the dev runner own child shutdown (#138239)
* fix(cli): let the dev runner own child shutdown

The JavaScript shim and dev runner both escalated after five seconds. The
shim could kill the runner first, leaving its separately detached child
alive. Delegate termination to the runner and handle SIGHUP through its
existing signal and build-lock lifecycle. Preserve Node execution under Bun
and other shim callers' termination behavior.

Real process regressions fail before the fix and pass for SIGTERM/SIGHUP.
Runner and entrypoint tests, changed-file checks, and independent review
pass. A fresh Linux Node 24.19.0 build passes the original Gateway worker
restart scenario (Actions 33868737194).

Release-note context: source-checkout Gateway shutdown no longer abandons a
slow child when the development launcher's shutdown timers race.

* test(agents): align attempt fixtures with session contracts

Adopt the two relevant test-only corrections already landed in #138238
(e7fffcf7a0). Supply the session methods consumed by nested tool
observation and classify structured tool failures as AgentSession does.
Keep policy-denial and never-entered action/preparer assertions intact.

The original file reproduces three failures. All 112 files and 1,666 tests
pass after this correction, with complete changed-file gates and independent
review. Launcher implementation and release candidate are unchanged.
2026-09-04 06:08:03 -07:00