← Back to Pull requests

fix(scripts): handle Windows path separators in skill catalog discovery #2050

Merged
DeryFerd merged 1 files (2 lines) on Oct 25, 2026 19:56 UTC
View on GitHub
DeryFerd DeryFerd commented on Oct 25, 2026 18:27 UTC
Author

What a user gets

npm run test:repo and the first-run reference validation script now pass on Windows without crashing on skill catalog discovery. scripts/check-first-run-references.mjs walks the shipped skill roots to assemble an authority map of available skills before checking that first-run surfaces (getting-started.md, quickstart.md, operator guidance, and setup next-steps) name existing skills. Because walk() joins directory segments with path.join(), on Windows every walked file path uses backslashes (such as packages\daemon\assets\skills\rigs\SKILL.md), but the file filter checked p.endsWith("/SKILL.md") with a hardcoded forward slash. That filter never matched on Windows, leaving skills empty and throwing Error: empty shipped skill catalog before any references could be validated. Switching the check to path.basename(p) === "SKILL.md" allows skill files to be found regardless of OS path separator, matching the idiom already used by scripts/mirror-skills.mjs and scripts/generate-context-packs.mjs.

Nothing in the authority model, reference parsing, or validation rules changes. Shipped skill names are still keyed by their parent directory name (path.basename(path.dirname(file))), their relative repository paths are still recorded identically, and POSIX environments continue to discover the exact same catalog of 53 shipped skills.

How you verified it

Tested on a native Windows host at commit 00e2c806 with the change on top. Before the change, running node --import tsx scripts/check-first-run-references.mjs immediately failed with Error: empty shipped skill catalog (exit code 1) because zero skills matched the filter. After changing the filter to path.basename(p) === "SKILL.md", the discovery loop populated all 53 shipped skills, and the script ran to completion checking 10 scoped files, 489 concrete references, 0 failures, and 6 unchecked external bundle references.

Commands run and observed output:

# Direct reference checker run
node --import tsx scripts/check-first-run-references.mjs
# Output:
# first-project is now starter (a Claude builder and a Codex reviewer); on a Codex-only machine, ask your OpenRig operator to adapt it
# UNCHECKED packages/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md:110: "workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# UNCHECKED packages/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md:292: "orch-lead@workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# UNCHECKED docs/reference/getting-started.md:577: "orch-lead@workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# UNCHECKED docs/reference/getting-started.md:577: "workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# UNCHECKED docs/reference/quickstart.md:141: "workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# UNCHECKED packages/cli/src/commands/setup.ts:791: "workshop" — outside this repository; existence not checked; external authority https://github.com/mvschwarz/openrig-world (external bundle)
# First-run references: 10 files, 489 checked, 0 failures, 6 external references unchecked.

# Repo-level consistency guards
node scripts/check-docs-guard.mjs && node scripts/mirror-skills.mjs --check && node scripts/generate-context-packs.mjs --check
# Output: [generate-context-packs] --check OK: 57 pack(s) project + validate clean (version 0.7.1).

What I could not run: full end-to-end npm test across all workspaces on this machine, which is a native Windows host where tmux-dependent daemon suites are skipped or require Linux CI containers. The repository checks that run as part of test:repo were run directly and succeed.

Anything you were unsure about

I considered p.endsWith(path.sep + "SKILL.md") versus path.basename(p) === "SKILL.md". Both solve the separator difference on Windows, but path.basename is simpler and matches what sibling repository scripts already do: scripts/mirror-skills.mjs (lines 255, 338, 853) and scripts/generate-context-packs.mjs (lines 120, 206) both use basename equality to detect SKILL.md. I also checked the rest of scripts/check-first-run-references.mjs for other slash-filtering assumptions: line 183 was the only place filtering walk() output with a hardcoded forward slash prefix.

If this is security-related

Not security-related. The change is restricted to developer verification tooling in scripts/ and touches no daemon routes, credentials, runtime permissions, or delivery boundaries.

  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Improved detection of shipped skill files, including files specified without a directory path.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 2 lines (+1 / -1) across 1 files Reviewer: openrig-review Review duration: 89m
    All Vouch review confidence checks passed
    Residual risk 0.02 = Change Risk (0.10) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.10 · 2 lines diff across 1 files
    0.10
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 4 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.066
    Real PR Conversation Timeline
    6 items
    coderabbitai[bot] coderabbitai[bot] commented on Oct 25, 2026 18:27 UTC
    Bot

    <!-- coderabbit-ai-generated:v1 -->

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/mvschwarz/openrig/pull/2050?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a>

    <!-- review_stack_entry_end -->
    <!-- recent_review_start -->

    No actionable comments were generated in the recent review.

    <details>
    <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
    <dl>
    <dd>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
    <dl>
    <dd>

  • Source mode: Auto

  • Repository: Unavailable

  • Branch: Unavailable

  • File: No configuration file from this repository applied

  • Commit: Unavailable

  • Layers: defaults

  • Review profile: CHILL

  • Plan: Advanced

  • Run ID: 14fe1f7c-2ea5-476b-ac5e-2a32613f7fb2
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between 5ef718c4d5e7c161cc06f4fded80f32edc1f9880 and 1c91a8b5ccfc4635ad99ce617c709fd4aacc5c36.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</strong></summary>
    <dl>
    <dd>

  • scripts/check-first-run-references.mjs
  • </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- recent_review_end -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>Walkthrough</strong></summary>
    <dl>
    <dd>

    The shipped-skill scan now identifies SKILL.md files by basename instead of requiring the path to end in /SKILL.md.

    Changes: Shipped-skill scan

    |Layer / File(s)|Summary|
    |:---|:---|
    |Match skill files by basename <br> scripts/check-first-run-references.mjs|The skill scan now matches files whose basename is SKILL.md.|

    <!-- change_assessment_start -->
    <strong>Priority: <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/priority-low-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Low</strong>

    Estimated code review effort: 2 (Simple) | ~5 minutes

    <!-- change_assessment_commit:"1c91a8b5ccfc4635ad99ce617c709fd4aacc5c36" -->
    Change: Bug fix
    <!-- change_assessment_end -->

    Suggested reviewers: mvschwarz

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>1c91a</code></summary>
    <dl>
    <dd>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to 1c91a
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"1c91a8b5ccfc4635ad99ce617c709fd4aacc5c36","coveredCommitId":"1c91a8b5ccfc4635ad99ce617c709fd4aacc5c36","kind":"reviewed"} -->

    The focused cross-platform discovery change is mergeable.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary>
    <dl>
    <dd>

    <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong>

    | Check name | Status | Explanation | Resolution |
    | :---------------- | :----------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
    | Docstring Coverage | !Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |

    <details>
    <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary>
    <dl>
    <dd>

    | Check name | Status | Explanation |
    | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------- |
    | Description Check | !Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
    | Title check | !Passed | The title clearly and concisely describes the main change: handling Windows path separators during skill catalog discovery. |
    | Linked Issues check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | !Passed | Check skipped because no linked issues were found for this pull request. |

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- finishing_touch_checkbox_start -->

    <details>
    <summary><strong>Finishing Touches</strong></summary>
    <dl>
    <dd>

    <details open>
    <summary><strong>🧪 Generate unit tests (beta)</strong></summary>
    <dl>
    <dd>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create a new PR
  • </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- finishing_touch_checkbox_end -->

    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    <details>
    <summary><strong>❤️ Share</strong></summary>
    <dl>
    <dd>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </dd>
    </dl>
    </details>

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    openrig-review openrig-review approved these changes on Oct 25, 2026 19:56 UTC
    Approved Reviewer

    Admitted at 1c91a8b5ccfc4635ad99ce617c709fd4aacc5c36. The native path.basename check fixes Windows skill-file discovery without changing reference parsing or validation. I read both independent source-review returns and the complete one-line diff, verified all eight required checks on this exact head, and checked its unchanged target file against current main. The contributor's native Windows run remains attributed, not a run of my own.

    — orch-lead@v-openrig-build

    mvschwarz mvschwarz commented on Oct 25, 2026 20:01 UTC
    Contributor

    Thanks, @DeryFerd, for #2050. It's merged into main as 9166d061, and it isn't in a release yet. With it, scripts/check-first-run-references.mjs matches the shipped SKILL.md files with path.basename(p) === "SKILL.md" instead of a hard-coded /SKILL.md suffix, so it finds them with Windows path separators too, and nothing changes on other platforms. Thanks too for the native Windows before-and-after run, which shows it no longer stops with an empty skill catalog there.

    DeryFerd DeryFerd commented on Oct 25, 2026 20:03 UTC
    Author

    @mvschwarz you are welcome

    mvschwarz mvschwarz commented on Oct 27, 2026 05:28 UTC
    Contributor

    Released in 0.7.3, @DeryFerd: #2050 is in it, so the skill-catalog discovery script handles Windows path separators. Thanks again.

    Assignees
    DeryFerd DeryFerd
    Labels
    risk: low confidence: 90% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 9.6% (LOW) · Higher = larger blast radius
    9.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90% · Lower = rushed or shallow review
    90%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2% · Safe to merge
    2%