Skip to content

fix(evals): moderation record ids drop the leading dot of .github #3132

Description

Component

Eval moderation (scripts/evals/Modules/ModerationRunner.psm1, ConvertTo-ModerationRecords)

Bug Description

Moderation record ids lose the leading dot of .github, so a flagged agent, prompt or skill is reported against a path that does not exist.

The id is built with (Resolve-Path -LiteralPath $filePath -Relative -RelativeBasePath $RepoRoot).TrimStart('.', '\', '/'). TrimStart removes every leading ., \ and /, not only the ./ prefix, so ./.github/agents/x.agent.md becomes github/agents/x.agent.md. That id is written to the moderation output (logs/moderation-artifacts.json through Invoke-ArtifactModeration.ps1), and Test-ModerationOutput uses it in ::error file=<id>::, so the annotation points at nothing. Paths outside a dot-directory, such as docs/y.md, are unaffected. The exit code is still correct.

Expected Behavior

The id keeps the real relative path, .github/agents/x.agent.md.

Steps to Reproduce

With $RepoRoot set to a folder containing .github/agents/x.agent.md and docs/y.md, the expression from line 93 returns github\agents\x.agent.md for the first and docs\y.md for the second (pwsh 7.6.6 on Windows; on Linux the separators are /).

Activity

  1. added a commit that references this issue on Oct 9, 2026
    a664a17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions