fix(sdl): add createdDate to guardian baseline result entries - #124
Conversation
Guardian rejects every entry under `results` whose `createdDate` is empty, so the baseline added in #112 was loaded but applied to nothing: Baselines: guardian-baseline ##[error]The CreatedDate of the result with signature <76fd7a25...> is empty. ##[error]The CreatedDate of the result with signature <6c2296c1...> is empty. ##[error]The CreatedDate of the result with signature <c4f9dd26...> is empty. ... Active results: 3 Baselined results: 0 ##[error]Error: Guardian exited with an error exit code: 8 The three rejected signatures are exactly the three @microsoft/sdl/no-inner-html findings in the vendored mutation-testing-elements bundle that the baseline was meant to cover, so `Guardian: Post Analysis` has broken every OxidizerOxToolsGitHub.PublishEachCommit run on main since 95089c5. `createdDate` is a required property on each result, not just on the baseline object. The ox-sdk baseline this file mirrors carries it on every result, between `ruleId` and `justification`; that field was dropped when this file was hand-authored rather than emitted by the Guardian CLI. Add it, using the same timestamp as the baseline itself. No `expirationDate` is set: these findings are in a vendored, minified third-party bundle that changes only by re-vendoring, so the baseline should not silently lapse and re-break the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the repository’s Guardian baseline file so SDL/Guardian can successfully apply existing baselines for the vendored mutation-test-elements.js ESLint findings and unblock the PublishEachCommit pipeline on main.
Changes:
- Add
createdDateto each individual baseline result entry (not just the baseline object), matching Guardian’s required schema. - Keep the timestamps consistent with the existing baseline metadata (
baselines.guardian-baseline.createdDate/lastUpdatedDate).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (97.7%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
=====================================
Coverage 97.7% 97.7%
=====================================
Files 286 286
Lines 62460 62460
=====================================
+ Hits 61030 61031 +1
+ Misses 1430 1429 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
#124 added the missing `createdDate` and cleared that error, but left `expirationDate` off on purpose. The SDL policy rejects the entries for exactly that: ##[error]Result with signature <76fd7a25...> on file <guardian_baselines.gdnbaselines> is not compliant with the provided policy. Reason: undefined. -- Additional arguments:You must provide a valid expiration date for @microsoft/sdl/no-inner-html `Baselined results: 0` and Guardian still exits 8, so the next publish run on main failed the same way. Both fields are required for this rule, not just `createdDate`. The reasoning in #124 for omitting the expiry -- that a vendored bundle should not need renewing -- is not available under this policy. Other repositories under the same policy all carry an expiry, with windows of 90, 180 and 200 days. Use 90 days, the shortest and most conservative of those. This does mean the baseline lapses on 2026-11-27. Say so in the justification so whoever hits it next has the context, and prefer an ESLint path exclusion for `crates/cargo-gamma-lib/src/vendor/` as the durable fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
#124 added the missing `createdDate` and cleared that error, but left `expirationDate` off on purpose. The M365 policy rejects the entries for exactly that: ##[error]Result with signature <76fd7a25...> on file <guardian_baselines.gdnbaselines> is not compliant with the provided policy. Reason: undefined. -- Additional arguments:You must provide a valid expiration date for @microsoft/sdl/no-inner-html `Baselined results: 0` and Guardian still exits 8, so build 40404239 on main failed the same way. Both fields are required for this rule, not just `createdDate`. The reasoning in #124 for omitting the expiry -- that a vendored bundle should not need renewing -- is not available under this policy; other repos in the org that pass the same gate all carry one: SubstrateSPEAR 2026-08-20 -> 2026-11-18 (90 days) SignalCore 2026-06-25 -> 2026-12-22 (180 days) Use 90 days, matching the most recent of those. This does mean the baseline lapses on 2026-11-27. Say so in the justification so whoever hits it next has the context, and prefer an ESLint path exclusion for `crates/cargo-gamma-lib/src/vendor/` as the durable fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 Clawpilot here! Posted automatically by Clawpilot (an AI agent), not by a human. Please verify before acting.
What broke
The publish pipeline has failed on every run against
mainsince95089c5("Introduce cargo-gamma (#93)"). The last green run predates the vendored JS bundle.The sole failing task is
Guardian: Post Analysis; the other failed timeline records are just its ancestor stage, phase and job.#112 added the repo-root
guardian_baselines.gdnbaselinesprecisely to cover these three findings. The clippy half of that PR worked. The baseline half did not, and #112's own merge commit8928c0a1still fails on Guardian alone.Root cause
Guardian finds and loads the file, then applies none of it:
Baselined results: 0against three entries whose signatures match the three active findings exactly. The three signatures Guardian rejects for an emptyCreatedDateare the same three that then break the build.createdDateis required on each result, not only on thebaselines.guardian-baselineobject. The file carried it in the latter place only. An existing baseline elsewhere under the same policy has it on every result, betweenruleIdandjustification— it was dropped here because the file was hand-authored rather than emitted by the Guardian CLI.The fix
Three added lines, one per result entry, in the position a CLI-generated baseline uses, with the same timestamp as the baseline object itself.
Effects
Guardian: Post Analysisapplies the three baseline entries instead of rejecting them, so the publish pipeline can go green onmainagain.The SDL gate becomes a usable signal again rather than permanently red on a known-accepted vendored finding.
No
expirationDateis set. These findings live in a vendored, minified third-party bundle (mutation-testing-elements 3.9.0) that changes only by re-vendoring, so a dated baseline would silently lapse and re-break the build.This reasoning was wrong — see fix(sdl): add expirationDate to guardian baseline result entries #126. The SDL policy requires an expiration date for this rule and rejects entries without one, so this PR left the build broken in a second way.
Nothing outside the SDL gate is touched: no Rust source, no manifest, no pipeline YAML.
Verification
JSON validated after the edit. The defect was confirmed still present on
mainHEAD6054135ebefore branching — the blob is byte-identical (505dc913) to the one merged by #112.This cannot be verified locally; the Guardian CLI and the
.gdnresult files only exist on the CI agent. Confirmation is the next publish run reportingBaselined results: 3andActive results: 0./cc Pato Sandaña (@psandana) Martin Taillefer (@geeknoid)