Repository navigation
Add initial deterministic trace grading framework #54678
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
Changes from 1 commit
ce1a3ae
de6658f
4b4de8a
9eb6028
0d6a86e
53938a6
1a1b44d
ed01ef4
ef94444
dce434c
7a02562
b0ad3c7
673bba9
1781737
2906c4a
803ce40
ba7aae8
9baed09
f377fa2
00ca65f
9fff955
096aa3e
455639f
1d3542e
4e303c5
6c61d48
1b3d870
5131cd9
782f56d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ import ( | |
| var compilerYamlGradersLog = logger.New("workflow:compiler_yaml_graders") | ||
|
|
||
| // generateGradersStep emits an always() post-agent step that runs deterministic | ||
| // trace graders. The step executes after secret redaction / summary steps and before | ||
| // graders. The step executes after secret redaction / summary steps and before | ||
| // the unified artifact upload so results are included in the agent artifact. | ||
| // | ||
| // The step is only emitted when graders are configured (graders: in frontmatter). | ||
|
|
@@ -43,7 +43,7 @@ func (c *Compiler) generateGradersStep(yaml *strings.Builder, data *WorkflowData | |
| } | ||
| execB64 := base64.StdEncoding.EncodeToString(execJSON) | ||
|
|
||
| yaml.WriteString(" - name: Run trace graders\n") | ||
| yaml.WriteString(" - name: Run graders\n") | ||
| yaml.WriteString(" if: always()\n") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| yaml.WriteString(" continue-on-error: true\n") | ||
| fmt.Fprintf(yaml, " uses: %s\n", getCachedActionPin("actions/github-script", data)) | ||
|
|
@@ -54,7 +54,7 @@ func (c *Compiler) generateGradersStep(yaml *strings.Builder, data *WorkflowData | |
| yaml.WriteString(" const { main } = require('" + SetupActionDestination + "/trace_graders.cjs');\n") | ||
| fmt.Fprintf(yaml, " await main('%s', '%s');\n", manifestB64, execB64) | ||
|
|
||
| compilerYamlGradersLog.Print("Generated trace graders step") | ||
| compilerYamlGradersLog.Print("Generated graders step") | ||
| } | ||
|
|
||
| // graderManifestEntry represents a single grader in the serialized manifest. | ||
|
|
||
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.
Correctness: manifest escaping is incomplete — backslash before single-quote breaks the JS string literal
JSON can contain
\\(an escaped backslash in a string value). After only escaping', the sequence\\'in the original JSON becomes\\\'— the JavaScript parser sees an escaped backslash (\\) followed by an unescaped single quote that terminates the string literal, causing a syntax error or silent truncation.Fix: escape backslashes first, then single quotes:
@copilot please address this.