Skip to content

chore(scripts): migrate source and test analysis tools to .mts - #6935

Merged
cv merged 12 commits into
mainfrom
chore/6922-analysis-tools-mts
Jul 15, 2026
Merged

chore(scripts): migrate source and test analysis tools to .mts#6935
cv merged 12 commits into
mainfrom
chore/6922-analysis-tools-mts

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the seven source- and test-analysis tools under scripts/check-coverage-ratchet, check-dist-sourcemaps, check-test-file-size-budget, find-source-shape-tests, find-test-conditionals, list-command-helper-uses, and type-safety-hotspots — from .ts to explicit ESM .mts, making each tool's module contract explicit without adding a root "type": "module" declaration. This is the low–medium-effort analysis-tools workstream of the tool migration epic; scanner findings, coverage-ratchet output, metrics, JSON output, and exit codes are unchanged.

Related Issue

Resolves #6922

Changes

  • The seven tools are renamed to .mts. Six were already ESM (import/export with an import.meta.url main guard); only check-dist-sourcemaps carried a CommonJS require.main === module guard, which would throw under .mts. It now uses the same ESM main check as its sibling tools (fileURLToPath(import.meta.url) === path.resolve(process.argv[1] ?? "")) via a node:url import, so direct execution and helper import stay separate.
  • find-source-shape-tests, find-test-conditionals, and list-command-helper-uses now name their .mts entrypoints in the direct-invocation check and usage strings.
  • package.json: the type-safety:hotspots, source-shape:scan, source-shape:check, test-size:check, test-conditionals:scan, and coverage-ratchet/dist-sourcemap steps in test:coverage:cli and test:coverage:plugin now invoke the .mts paths.
  • CI composite actions (ci-cli-coverage-merge, ci-cli-coverage-shard, ci-plugin-coverage) and the two .pre-commit-config.yaml hook files patterns now target the .mts paths.
  • Test files that spawn a tool as a subprocess or assert on a package/hook path (coverage-ratchet, list-command-helper-uses, docker-abstraction-guard, pr-workflow-contract) now reference the .mts files, so they keep exercising the same entrypoints through tsx.
  • No live reference to the old .ts paths remains. The extensionless helper imports in the focused scanner tests resolve under tsconfig.cli.json's bundler resolution; that config already globs scripts/**/*.mts.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: internal scripts/ tool file-extension migration; no contributor-facing command example or doc page references these entrypoint paths.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification:
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added coverage threshold enforcement with clear failure reporting.
    • Added test file size budget checks, including oversized, legacy, and stale budget detection.
    • Added type-safety hotspot analysis with text and JSON reporting.
  • Bug Fixes

    • Updated analysis, validation, and coverage tooling to reliably run as ECMAScript modules.
  • Tests

    • Expanded command-line coverage for validation tools, including success, failure, and import-only scenarios.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the chore/6922-analysis-... branch remains at 80%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 7a360ef chore/6922-analysis-... 5064f4c +/-
src/lib/agent/dashboard-ui.ts 91% 85% -6%
src/lib/state/config-io.ts 94% 90% -4%
src/lib/agent/m...fest-readers.ts 97% 95% -2%
src/lib/credentials/store.ts 62% 61% -1%
src/lib/securit...ntial-filter.ts 99% 98% -1%
src/lib/adapter...tp/curl-args.ts 97% 98% +1%
src/lib/messagi.../persistence.ts 86% 89% +3%
src/lib/messagi...n-validation.ts 96% 100% +4%
src/lib/adapter...shell/client.ts 83% 88% +5%
src/lib/core/pr...mpt-activity.ts 67% 92% +25%

Updated July 15, 2026 21:05 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 1 blocker · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 1 blocker · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections match; Nemotron reported 1 fewer blocker, the same number of warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, security-posture

Blockers

PRA-1 Blocker — Remove live fallbacks to deleted analysis-tool paths

  • Location: .github/actions/ci-plugin-coverage/action.yaml:36
  • Category: acceptance
  • Problem: The migration deletes `scripts/check-coverage-ratchet.ts` and `scripts/check-dist-sourcemaps.ts`, but trusted CI action fallbacks still execute those old paths when their `.mts` counterpart is absent. This violates the binding migration acceptance criterion that no live reference to old `.ts` paths remains and turns a missing new script into a lookup of another missing script.
  • Impact: A mispackaged or absent migrated script takes the fallback branch and fails at a deleted path; the repository also retains executable references that contradict the completed-migration contract.
  • Fix: Delete the old-path fallback branches and invoke the migrated `.mts` paths directly in the affected composite actions.
  • Verification: Read `.github/actions/ci-plugin-coverage/action.yaml`, `.github/actions/ci-cli-coverage-shard/action.yaml`, and `.github/actions/ci-cli-coverage-merge/action.yaml`; confirm no executable `scripts/check-coverage-ratchet.ts` or `scripts/check-dist-sourcemaps.ts` reference remains.
  • Test coverage: Extend the existing workflow/action contract coverage to assert the coverage and sourcemap composite action run blocks reference only the `.mts` script paths and contain no `.ts` fallback.
  • Simplification (delete): Remove The `if [ ! -f ... ]; then ...=.ts; fi` compatibility branches for coverage-ratchet and dist-sourcemap scripts.; use Directly invoke the corresponding `.mts` script.. Net: -9 lines.
  • Keep: Preserves the migrated script invocation and removes only fallbacks whose targets are deleted by this PR.
  • Evidence: Issue Migrate source and test analysis tools to .mts #6922 acceptance criteria require: “No live reference to the old `.ts` paths remains.” `.github/actions/ci-plugin-coverage/action.yaml:34-37` falls back from `scripts/check-coverage-ratchet.mts` to `scripts/check-coverage-ratchet.ts`. `.github/actions/ci-cli-coverage-shard/action.yaml:105-108` and `.github/actions/ci-cli-coverage-merge/action.yaml:54-57` fall back from `scripts/check-dist-sourcemaps.mts` to `scripts/check-dist-sourcemaps.ts`; `.github/actions/ci-cli-coverage-merge/action.yaml:102-105` also falls back to `scripts/check-coverage-ratchet.ts`. The diff renames those `.ts` files to `.mts`, so none of the fallback targets remain.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@laitingsheng laitingsheng added the chore Build, CI, dependency, or tooling maintenance label Jul 15, 2026
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…e-shape checks

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request migrates analysis and coverage tooling to explicit .mts entrypoints, adds coverage and test-file budget CLIs, introduces type-safety hotspot analysis, updates command wiring, and expands CLI/import behavior tests.

Changes

ESM tooling migration

Layer / File(s) Summary
Tool implementations and ESM entrypoints
scripts/check-coverage-ratchet.mts, scripts/check-test-file-size-budget.mts, scripts/check-dist-sourcemaps.mts, scripts/find-*.mts, scripts/list-command-helper-uses.mts
Coverage ratcheting, test-file size validation, and analysis utilities use .mts entrypoints with validated CLI behavior and ESM-safe execution guards.
Type-safety hotspot analysis
scripts/type-safety-hotspots.mts
Adds AST-based weakness detection, nullable-union aggregation, scoring, report rendering, and CLI argument handling.
Commands and CI wiring
package.json, .pre-commit-config.yaml
Package scripts and pre-commit hooks now reference the .mts tool paths.
Import, CLI, and workflow validation
test/*.test.ts
Tests update imports and spawned commands, and cover direct execution, import-only behavior, output, exit codes, and workflow contracts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant PackageScripts
  participant AnalysisCLI
  participant Filesystem
  participant TestSuite
  Developer->>PackageScripts: invoke .mts analysis command
  PackageScripts->>AnalysisCLI: execute selected tool
  AnalysisCLI->>Filesystem: scan source, test, coverage, or dist files
  Filesystem-->>AnalysisCLI: return inputs and findings
  AnalysisCLI-->>TestSuite: produce output and exit status
  TestSuite-->>Developer: validate CLI and import behavior
Loading

Possibly related issues

  • Issue 6918 — The PR migrates repository scripts to explicit .mts ESM boundaries and updates related paths, imports, and entrypoint handling.

Suggested labels: area: ci

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the script migration to .mts and matches the main change.
Linked Issues check ✅ Passed The PR covers all seven tools, updates references, and adds the ESM-safe main check requested in #6922.
Out of Scope Changes check ✅ Passed The changes stay focused on the requested script migration and test/reference updates, with no obvious unrelated additions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/6922-analysis-tools-mts

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-coverage-ratchet.mts`:
- Around line 71-73: Update the usage error message in the coverage-ratchet CLI
to advertise the current `.mts` entrypoint instead of the obsolete `.ts` path,
leaving the argument documentation unchanged.

In `@test/dist-sourcemaps.test.ts`:
- Line 36: Update the parent dist sourcemap test suite title in describe to
append the migration issue reference as a final (`#1234`)-style suffix, leaving
the nested it titles unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 42857500-9ae5-4b64-95bf-dfea712b2819

📥 Commits

Reviewing files that changed from the base of the PR and between 55fdc3f and 1108ee6.

📒 Files selected for processing (22)
  • .github/actions/ci-cli-coverage-merge/action.yaml
  • .github/actions/ci-cli-coverage-shard/action.yaml
  • .github/actions/ci-plugin-coverage/action.yaml
  • .pre-commit-config.yaml
  • package.json
  • scripts/check-coverage-ratchet.mts
  • scripts/check-dist-sourcemaps.mts
  • scripts/check-test-file-size-budget.mts
  • scripts/find-source-shape-tests.mts
  • scripts/find-test-conditionals.mts
  • scripts/list-command-helper-uses.mts
  • scripts/type-safety-hotspots.mts
  • test/codebase-growth-guardrails-conditionals.test.ts
  • test/coverage-ratchet.test.ts
  • test/dist-sourcemaps.test.ts
  • test/docker-abstraction-guard.test.ts
  • test/list-command-helper-uses.test.ts
  • test/pr-workflow-contract.test.ts
  • test/source-shape-scanner.test.ts
  • test/test-conditionals-scanner.test.ts
  • test/test-file-size-budget.test.ts
  • test/type-safety-hotspots.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-coverage-ratchet.mts`:
- Around line 71-73: Update the usage error message in the coverage-ratchet CLI
to advertise the current `.mts` entrypoint instead of the obsolete `.ts` path,
leaving the argument documentation unchanged.

In `@test/dist-sourcemaps.test.ts`:
- Line 36: Update the parent dist sourcemap test suite title in describe to
append the migration issue reference as a final (`#1234`)-style suffix, leaving
the nested it titles unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 42857500-9ae5-4b64-95bf-dfea712b2819

📥 Commits

Reviewing files that changed from the base of the PR and between 55fdc3f and 1108ee6.

📒 Files selected for processing (22)
  • .github/actions/ci-cli-coverage-merge/action.yaml
  • .github/actions/ci-cli-coverage-shard/action.yaml
  • .github/actions/ci-plugin-coverage/action.yaml
  • .pre-commit-config.yaml
  • package.json
  • scripts/check-coverage-ratchet.mts
  • scripts/check-dist-sourcemaps.mts
  • scripts/check-test-file-size-budget.mts
  • scripts/find-source-shape-tests.mts
  • scripts/find-test-conditionals.mts
  • scripts/list-command-helper-uses.mts
  • scripts/type-safety-hotspots.mts
  • test/codebase-growth-guardrails-conditionals.test.ts
  • test/coverage-ratchet.test.ts
  • test/dist-sourcemaps.test.ts
  • test/docker-abstraction-guard.test.ts
  • test/list-command-helper-uses.test.ts
  • test/pr-workflow-contract.test.ts
  • test/source-shape-scanner.test.ts
  • test/test-conditionals-scanner.test.ts
  • test/test-file-size-budget.test.ts
  • test/type-safety-hotspots.test.ts
🛑 Comments failed to post (2)
scripts/check-coverage-ratchet.mts (1)

71-73: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the usage path to .mts.

The CLI advertises coverage-ratchet.ts, leaving a live old-path reference and directing users to a removed entrypoint.

Proposed fix
-      "Usage: coverage-ratchet.ts <coverage-summary.json> <coverage-threshold.json> [label]",
+      "Usage: check-coverage-ratchet.mts <coverage-summary.json> <coverage-threshold.json> [label]",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    throw new Error(
      "Usage: check-coverage-ratchet.mts <coverage-summary.json> <coverage-threshold.json> [label]",
    );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-coverage-ratchet.mts` around lines 71 - 73, Update the usage
error message in the coverage-ratchet CLI to advertise the current `.mts`
entrypoint instead of the obsolete `.ts` path, leaving the argument
documentation unchanged.
test/dist-sourcemaps.test.ts (1)

36-36: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the issue suffix to the suite title.

Append the migration issue reference to the parent describe; its suffix covers the nested it titles.

Proposed fix
-describe("dist sourcemap checks", () => {
+describe("dist sourcemap checks (`#6922`)", () => {

As per coding guidelines, “Use behavior-oriented test titles and place local issue references in a final (#1234) suffix.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

describe("dist sourcemap checks (`#6922`)", () => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/dist-sourcemaps.test.ts` at line 36, Update the parent dist sourcemap
test suite title in describe to append the migration issue reference as a final
(`#1234`)-style suffix, leaving the nested it titles unchanged.

Source: Coding guidelines

cv and others added 2 commits July 15, 2026 08:36
cv
cv previously requested changes Jul 15, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked by the trusted coverage actions on current : they still invoke and , which this PR deletes. Land a small compatibility prerequisite that selects the available or entrypoint, then rebase this PR, remove the transitional files, resolve the overlap with #6940, and rerun the full gate. Until that base compatibility exists, the PR cannot produce valid required-check evidence.

cv
cv previously requested changes Jul 15, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction with the affected paths: trusted coverage actions on current main still invoke scripts/check-dist-sourcemaps.ts and scripts/check-coverage-ratchet.ts, which this PR deletes. Land a small compatibility prerequisite that selects the available .mts or .ts entrypoint, then rebase this PR, remove the transitional .ts files, resolve the overlap with #6940, and rerun the full gate. Until that base compatibility exists, the PR cannot produce valid required-check evidence.

@cv
cv dismissed their stale review July 15, 2026 17:18

Superseded by the immediately following corrected review with complete path and contract names.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-coverage-ratchet.ts`:
- Around line 4-21: Remove the legacy wrapper files
scripts/check-coverage-ratchet.ts and scripts/check-dist-sourcemaps.ts, since
package scripts and CI use their .mts entrypoints. Only retain either shim if a
documented external consumer requires it; in that case, add a regression test
covering the compatibility path.

In `@scripts/check-dist-sourcemaps.ts`:
- Line 18: Update the command options in the check-dist-sourcemaps flow to stop
forcing cwd to REPO_ROOT, so relative distDir arguments continue resolving from
the caller’s working directory. Preserve REPO_ROOT usage for repository-specific
paths or setup that requires it, but leave subprocess path resolution relative
to the invocation directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e54a10f3-acd2-458e-a055-c83343226bb3

📥 Commits

Reviewing files that changed from the base of the PR and between 7dff405 and 042e944.

📒 Files selected for processing (2)
  • scripts/check-coverage-ratchet.ts
  • scripts/check-dist-sourcemaps.ts

Comment thread scripts/check-coverage-ratchet.ts Outdated
Comment thread scripts/check-dist-sourcemaps.ts Outdated
@cv

cv commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Post-prerequisite reconciliation plan: after #6969 merges, merge current main and resolve the four coverage-action hunks by keeping the .mts-first/.ts-fallback blocks from main. Delete the two transitional wrapper files in this PR, but do not replace those action blocks with direct .mts-only commands yet; #6969 intentionally keeps the fallback for trusted-CI compatibility during the migration window. Retain the compatibility regression from main, then run the focused coverage/sourcemap/scanner/action-contract tests and the normal repo checks.

cv added a commit that referenced this pull request Jul 15, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Unblocks the v0.0.84 TypeScript migration PRs whose required evidence
depends on trusted workflow code from `main`. Coverage actions now
select the available TypeScript entrypoint, and the Bedrock matrix
reports the agent-specific shard expected by the E2E controller.

## Changes

- Make the base-trusted CLI and plugin coverage actions prefer the
migrated `.mts` entrypoints and fall back to `.ts` for older branches.
This compatibility window is required because #6935 deletes the old
entrypoints in the PR checkout while the action implementation still
comes from `main`; the action-contract test executes `.mts`-only,
`.ts`-only, and missing-entrypoint fixtures across all four consumers.
Remove the `.ts` fallback after #6935 lands and no open migration branch
depends on the old entrypoints.
- Set `NEMOCLAW_E2E_SHARD` from the Bedrock job's `matrix.agent` so
#6938 produces distinct OpenClaw and Hermes evidence. Workflow-boundary
and controller tests protect the mapping and reject drift.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: internal CI compatibility and
evidence routing only; the documentation-writer review found no
user-facing command, default, configuration, API, policy, or supported
workflow change.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: maintainer and
independent review found no secret, permission, dependency, or
untrusted-input expansion; fixed paths are quoted and missing
entrypoints fail closed.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `npx vitest run
test/pr-workflow-contract.test.ts test/pr-e2e-gate-shards.test.ts
--project integration` (22 passed); `npx vitest run
test/e2e/support/e2e-workflow.test.ts --project e2e-support` (36
passed); workflow validator, `npm run source-shape:check`, and `npm run
checks` passed.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **CI & Build Improvements**
- Updated CLI coverage and sourcemap verification to automatically run
the correct `.mts` vs `.ts` script variant when present.

- **Bug Fixes**
- Fixed Bedrock-compatible Anthropic E2E shard propagation by requiring
the runtime shard to match the matrix agent and failing fast on
drift/mismatch.

- **Tests**
- Added/expanded E2E and PR workflow contract tests for shard
expectations and boundary validation.
- Enhanced workflow step execution coverage with optional
working-directory support and `.ts`/`.mts` entrypoint compatibility
checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv dismissed their stale review July 15, 2026 20:40

Prerequisite #6969 is merged and this branch is reconciled. The final diff removes the obsolete wrappers, retains current main coverage-action compatibility, preserves the intended .mts migrations, and passes focused plus full coverage validation. Re-review is clean.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after #6969 and reconciliation. The final branch cleanly migrates the internal analysis tools to .mts, retains trusted coverage-action compatibility, removes obsolete wrappers, and adds entrypoint regressions. Focused tests, full CLI/plugin coverage, commit hooks, and pre-push all pass.

@cv
cv merged commit 819e6ff into main Jul 15, 2026
54 checks passed
@cv
cv deleted the chore/6922-analysis-tools-mts branch July 15, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate source and test analysis tools to .mts

2 participants