Repository navigation
Fix operational-value grader created-at acquisition and preserve grader result contract in gh aw logs
#60635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d6b67f7
Initial plan
Copilot f03c927
Bind operational-value graders to run.createdAt and preserve grader r…
Copilot 13eec1b
Use structured maps for grader observation/diagnostics and regenerate…
Copilot f8335a2
Add changeset for operational-value grader fixes
Copilot 2768b1b
Harden run created-at normalization and grader failure reporting
Copilot 1a4070c
Clarify grader created-at helper naming and retry backoff
Copilot 8bde3b0
Guard grader metadata invariant and client availability
Copilot c25ee41
Move run-created-at logic into its own module and embed graders in th…
Copilot 301b8b9
Share grader path constants and try all grader result candidates
Copilot 42b1018
Warn on malformed grader result candidates and clarify parameter name
Copilot ea8d5f3
Reuse shared file-resolution helpers for multi-location lookups
Copilot 01ead44
Add ADR for operational-value grading metadata contract
github-actions[bot] ad5eac0
Address grader review follow-up
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Harden run created-at normalization and grader failure reporting
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Loading branch information
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,31 @@ | ||
| // @ts-check | ||
|
|
||
| // ISO-8601 date-time with a UTC designator or a numeric offset. Date.parse accepts | ||
| // looser formats (for example "2026" or "2026-09-12 20:58:00"), which must not be | ||
| // promoted to a valid run creation time. | ||
| const ISO_8601_DATE_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/; | ||
|
|
||
| /** | ||
| * Normalize a workflow-run creation time into the strict UTC ISO-8601 form | ||
| * (`YYYY-MM-DDTHH:MM:SSZ`) expected by the operational-value grader contract. | ||
| * | ||
| * GitHub returns `created_at` as an ISO timestamp, but callers may also receive | ||
| * an empty string (unresolved workflow output) or an offset-bearing timestamp. | ||
| * Values that cannot be parsed are reported as an empty string so callers can | ||
| * treat the timestamp as unavailable rather than propagating an invalid value. | ||
| * Values that are not ISO-8601 date-times are reported as an empty string so | ||
| * callers can treat the timestamp as unavailable rather than propagating an | ||
| * invalid value. Sub-second precision is truncated (not rounded) because the | ||
| * grader contract records run creation times at second granularity. | ||
| * | ||
| * @param {unknown} value | ||
| * @returns {string} normalized timestamp, or "" when the value is unusable | ||
| */ | ||
| function normalizeRunCreatedAt(value) { | ||
| if (typeof value !== "string") return ""; | ||
| const trimmed = value.trim(); | ||
| if (trimmed === "") return ""; | ||
| if (!ISO_8601_DATE_TIME.test(trimmed)) return ""; | ||
| const parsed = Date.parse(trimmed); | ||
| if (!Number.isFinite(parsed)) return ""; | ||
| return new Date(parsed).toISOString().replace(/\.\d{3}Z$/, "Z"); | ||
| return new Date(Math.floor(parsed / 1000) * 1000).toISOString().replace(/\.\d{3}Z$/, "Z"); | ||
| } | ||
|
|
||
| module.exports = { normalizeRunCreatedAt }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot move run create at logic into own file, add tests
Move constants to constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All created-at logic now lives in
run_created_at.cjs(normalizeRunCreatedAt,fetchRunCreatedAt,resolveRunCreatedAtForInfo,resolveRunCreatedAtForGrading);generate_aw_info.cjsandtrace_graders.cjsjust call it. Retry constants moved toconstants.cjs, and the tests moved intorun_created_at.test.cjs. c25ee41