Skip to content

test(scripts): batch distribution import fixtures - #134039

Merged
steipete merged 1 commit into
mainfrom
codex/test-dist-import-fixtures
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-dist-import-fixtures

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The distribution import guard tests start a new Node process and temporary package for each equivalent import syntax or external URL probe.

Why This Change Was Made

Put all five failing ESM/CommonJS forms in one package and require an individual diagnostic for every importer. Put the four ignored URL probes in one successful scan. This also proves that scanning reports every bad edge instead of stopping at the first file. Help, argument validation, a minimal package, and template-literal exclusions remain separate.

User Impact

No runtime change. Seven fewer Node processes and temporary package roots per suite. Local timing is noisy: the first pair was 1.50/1.60 seconds, while a consecutive remeasurement was 4.57/2.83 seconds before/after; these are test-body measurements, not a CI-wide speed claim.

Evidence

  • All six consolidated tests pass, retaining the thirteen original cases and every import/probe input.
  • node scripts/check-changed.mjs -- test/scripts/check-package-dist-imports.test.ts: passes.
  • CLI, scanner owner, tarball caller, and temp-fixture helpers inspected; formatting, diff check, and structured Codex autoreview pass.
  • Production unchanged; tests +28/-42, net -14 lines.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 10:17
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 6:24 AM ET / 10:24 UTC.

ClawSweeper review

What this changes

The branch batches equivalent distribution-import fixtures into two scanner invocations while retaining a diagnostic assertion for each invalid importer.

Merge readiness

✅ Ready for maintainer review

No blocking findings. This focused test-only consolidation preserves the scanner’s distinct ESM, CommonJS, and URL-probe coverage; it remains open for ordinary maintainer review and exact-head CI.

Priority: P3
Reviewed head: 983ca7315f4a4aa469c426fd9086fc2d6b3c6ba9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test consolidation with retained per-importer assertions and no blocking defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This Member-authored PR changes only a test file and no user-visible or production behavior, so the external contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This Member-authored PR changes only a test file and no user-visible or production behavior, so the external contributor real-behavior-proof gate does not apply.
Evidence reviewed 5 items Introduced fixture consolidation: The PR creates five invalid files in one temporary distribution and asserts a missing-edge diagnostic for every file, retaining the four ESM forms and CommonJS require coverage.
Scanner contract: The production scanner parses static, dynamic, CommonJS, and import.meta URL specifiers, then emits one error for each relative edge absent from the collected distribution file set.
Downstream consumer: The Docker install/update harness invokes the same closure command before deciding whether it can reuse a built distribution, so these fixtures cover a release-artifact guard rather than an isolated helper.
Findings None None.
Security None None.

How this fits together

The package distribution guard scans built JavaScript for relative import edges and reports missing packaged files before release/install workflows use an artifact. This PR changes the fixture layer that invokes that guard, not the scanner or packaged runtime.

flowchart LR
  A[Packaged distribution files] --> B[Import closure command]
  B --> C[Import edge scanner]
  C --> D[Missing-edge diagnostics]
  E[Test fixtures] --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -14. Total -14 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 28 42 -14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 28 42 -14

Review metrics

Metric Value Why it matters
Production vs test delta production 0; tests +28/-42 (net -14) All changed lines consolidate test setup and diagnostics; the scanner and runtime behavior are unchanged.

Technical review

Best possible solution:

Keep the consolidated executable fixture coverage and merge it once the normal exact-head checks are green.

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

Not applicable; this PR refactors existing executable test fixtures rather than reporting a product failure.

Is this the best way to solve the issue?

Yes. Consolidating repeated temporary-package setup at the script boundary retains the individual importer assertions while reducing duplicate process setup.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a low-risk test-suite cleanup with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This Member-authored PR changes only a test file and no user-visible or production behavior, so the external contributor real-behavior-proof gate does not apply.

Label justifications:

  • P3: This is a low-risk test-suite cleanup with no production behavior change.
  • 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: This Member-authored PR changes only a test file and no user-visible or production behavior, so the external contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

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

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Validated head 983ca7315f4a4aa469c426fd9086fc2d6b3c6ba9: the six consolidated tests retain all thirteen original input cases, including a diagnostic for each invalid importer. The change removes seven Node processes and seven temporary roots. Focused tests, changed-file validation, formatting, and structured Codex autoreview passed; the current exact-head hosted checks are green.

CI run33381765851 initially failed an unchanged Vitest-worker cancellation test. One bounded rerun passed that shard and the final CI gate. The failure's cause is unconfirmed; a named follow-up is to reproduce the possible process-group probe race between the kernel liveness check and process-table snapshot. No timeout or assertion was weakened here.

Read the latest ClawSweeper review and checked for Rank-up moves. It reports no findings and no outstanding changes. Production is unchanged; test delta +28/-42. Proceeding with the authorized landing.

@steipete
steipete merged commit ee2ca7f into main Aug 31, 2026
310 of 312 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/test-dist-import-fixtures branch August 31, 2026 12:21
steipete added a commit that referenced this pull request Aug 31, 2026
* fix(gateway): keep Talk agent consult input out of user chat history

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes #133855

* ci: resolve OpenGrep base before fetching history (#134054)

* test(scripts): batch distribution import fixtures (#134039)

* fix(update): retain pnpm owner across launcher respawn

## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes #134037

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(parallel): check version header at request boundary (#133891)

* fix(matrix): drain monitor tasks before retiring clients (#134033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions

* fix(channels): isolate unavailable accounts from gateway diagnostics (#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture

* fix(config): preserve owners across legacy roster imports and store changes (#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model

* fix(talk): keep Browser Talk agent-consult turns out of user chat history (#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes #133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>

* fix: preserve policy owners across reviews and compaction (#133912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture

* fix(doctor): prune stale path install records shadowed by load paths (#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(secrets): collect persona-level TTS provider SecretRefs (#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of #89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>

* fix(gateway): preserve literal Talk consult questions

Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: Wynne668 <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: lsr911 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
* fix(gateway): keep Talk agent consult input out of user chat history

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes openclaw#133855

* ci: resolve OpenGrep base before fetching history (openclaw#134054)

* test(scripts): batch distribution import fixtures (openclaw#134039)

* fix(update): retain pnpm owner across launcher respawn

## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes openclaw#134037

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(parallel): check version header at request boundary (openclaw#133891)

* fix(matrix): drain monitor tasks before retiring clients (openclaw#134033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions

* fix(channels): isolate unavailable accounts from gateway diagnostics (openclaw#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture

* fix(config): preserve owners across legacy roster imports and store changes (openclaw#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model

* fix(talk): keep Browser Talk agent-consult turns out of user chat history (openclaw#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes openclaw#133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>

* fix: preserve policy owners across reviews and compaction (openclaw#133912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture

* fix(doctor): prune stale path install records shadowed by load paths (openclaw#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(secrets): collect persona-level TTS provider SecretRefs (openclaw#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of openclaw#89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>

* fix(gateway): preserve literal Talk consult questions

Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: Wynne668 <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: lsr911 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant