Skip to content

fix(sdl): add createdDate to guardian baseline result entries - #124

Merged
Evgenii (Vaiz) merged 1 commit into
mainfrom
u/vaiz/2026/09/01/guardian-baseline-created-date
Sep 1, 2026
Merged

fix(sdl): add createdDate to guardian baseline result entries#124
Evgenii (Vaiz) merged 1 commit into
mainfrom
u/vaiz/2026/09/01/guardian-baseline-created-date

Conversation

@Vaiz

@Vaiz Evgenii (Vaiz) commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🤖 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 main since 95089c5 ("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.gdnbaselines precisely to cover these three findings. The clippy half of that PR worked. The baseline half did not, and #112's own merge commit 8928c0a1 still fails on Guardian alone.

Root cause

Guardian finds and loads the file, then applies none of it:

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.

##[error]16. ESLint Error @microsoft/sdl/no-inner-html - crates/cargo-gamma-lib/src/vendor/mutation-test-elements.js. Line: 2.
##[error]17. ESLint Error @microsoft/sdl/no-inner-html - crates/cargo-gamma-lib/src/vendor/mutation-test-elements.js. Line: 4.
##[error]18. ESLint Error @microsoft/sdl/no-inner-html - crates/cargo-gamma-lib/src/vendor/mutation-test-elements.js. Line: 89.

Active results: 3
Skipped results: 16
  Baselined results: 0
  Results below minimum severity: 15
##[error]Guardian detected one or more breaking results.
##[error]Error: Guardian exited with an error exit code: 8

Baselined results: 0 against three entries whose signatures match the three active findings exactly. The three signatures Guardian rejects for an empty CreatedDate are the same three that then break the build.

createdDate is required on each result, not only on the baselines.guardian-baseline object. The file carried it in the latter place only. An existing baseline elsewhere under the same policy has it on every result, between ruleId and justification — 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 Analysis applies the three baseline entries instead of rejecting them, so the publish pipeline can go green on main again.

  • The SDL gate becomes a usable signal again rather than permanently red on a known-accepted vendored finding.

  • No expirationDate is 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 main HEAD 6054135e before branching — the blob is byte-identical (505dc913) to the one merged by #112.

This cannot be verified locally; the Guardian CLI and the .gdn result files only exist on the CI agent. Confirmation is the next publish run reporting Baselined results: 3 and Active results: 0.

/cc Pato Sandaña (@psandana) Martin Taillefer (@geeknoid)

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>
Copilot AI lite review requested due to automatic review settings September 1, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 createdDate to 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-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.7%. Comparing base (6054135) to head (a228104).

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vaiz
Evgenii (Vaiz) enabled auto-merge (squash) September 1, 2026 07:17
@Vaiz
Evgenii (Vaiz) merged commit 17f0aea into main Sep 1, 2026
45 checks passed
@Vaiz
Evgenii (Vaiz) deleted the u/vaiz/2026/09/01/guardian-baseline-created-date branch September 1, 2026 07:49
Evgenii (Vaiz) added a commit that referenced this pull request Sep 1, 2026
#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>
Evgenii (Vaiz) added a commit that referenced this pull request Sep 1, 2026
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants