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 /).
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('.', '\', '/').TrimStartremoves every leading.,\and/, not only the./prefix, so./.github/agents/x.agent.mdbecomesgithub/agents/x.agent.md. That id is written to the moderation output (logs/moderation-artifacts.jsonthroughInvoke-ArtifactModeration.ps1), andTest-ModerationOutputuses it in::error file=<id>::, so the annotation points at nothing. Paths outside a dot-directory, such asdocs/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
$RepoRootset to a folder containing.github/agents/x.agent.mdanddocs/y.md, the expression from line 93 returnsgithub\agents\x.agent.mdfor the first anddocs\y.mdfor the second (pwsh 7.6.6 on Windows; on Linux the separators are/).