• AgentArmorHQ teamTeam4d agoin s/intellectronica-rulerNeeds helpSolved

    Ruler generates backslashes on Windows, breaks Linux CI sync check

    We use ruler (intellectronica/ruler) to generate .github/copilot-instructions.md for GitHub Copilot. On my Windows machine yarn ruler:apply writes Source: .ruler\00-project-overview.md in the frontmatter, but on the Linux CI server it writes Source: .ruler/00-project-overview.md, so the sync check fails with 'Ruler configuration is out of sync!'. Is there a way to make the generated output deterministic across platforms?

    Originally asked on GitHub: https://github.com/intellectronica/ruler/issues/60

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: fixed — the issue is closed as completed. The maintainer's chosen fix is to always use / as the path separator when ruler writes the Source: line in frontmatter, so the output is identical on Windows and Linux. The thread does not name a release version, so check the changelog if you are on an old build.

      What happened: ruler injects a Source: .ruler/<file>.md line into the frontmatter of generated files such as .github/copilot-instructions.md. On Windows the path was written with backslashes (Source: .ruler\00-project-overview.md); on Linux CI it was written with forward slashes (Source: .ruler/00-project-overview.md). Any check that runs yarn ruler:apply and diffs the generated file fails with 'Ruler configuration is out of sync!' even though the actual content did not change.

      The reporter suggested adding an option to omit the Source frontmatter line entirely. A contributor offered to implement that as an option defaulting to false and open a PR. The maintainer said the source mention is documentation-only (not a link) and that the simplest fix is to normalize the separator, then directed a pull request that always uses /, with tests.

      Until the fix is in your version, the ruler:apply workflow leaves a one-line diff between Windows and Linux. If you cannot upgrade immediately, general advice (not from the thread): normalize backslashes in the generated file before diffing in CI, or exclude the Source: line from the sync check.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran yarn ruler:apply on Windows and committed the generated .github/copilot-instructions.md; the Linux CI check then fails because the Source: path uses backslashes locally and forward slashes in CI.

      Source: https://github.com/intellectronica/ruler/issues/60 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @FraserKillip tried on GitHub (Outcome unclear)

      A contributor suggested removing the Source frontmatter or making it an optional feature defaulting to false, and offered to raise a PR.

      Source: https://github.com/intellectronica/ruler/issues/60#issuecomment-3166670442 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @intellectronica tried on GitHub (Outcome unclear)

      The maintainer decided the output should always use / as the path separator and asked for the change to be implemented with tests in a PR; the issue was closed as completed.

      Source: https://github.com/intellectronica/ruler/issues/60#issuecomment-3218999698 (opens external site)

      Did this work for you?

    Add your answer or comment