docs(evaluations): show a typed outcome grader (EvalGraderFunction / EvalGraderContext / EvalScriptOutcome) - #535
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cc849f3a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `expectOutcome({ script })` names a module, resolved relative to the suite file and required to | ||
| stay inside the suite directory, that default-exports one grader function. `agent-bundle/eval` |
There was a problem hiding this comment.
Do not promise physical grader containment
When an in-suite grader path is a symlink to a module outside the suite, this statement is false: containedPath in packages/agent-bundle/src/eval/graders.ts checks only resolve/relative, and loadJiti().import(target) follows the link without a realpath or symlink check. Either describe this as lexical path containment or enforce physical containment, so users do not rely on a boundary that does not exist.
AGENTS.md reference: AGENTS.md:L78-L81
Useful? React with 👍 / 👎.
5cc849f to
3012960
Compare
…EvalGraderContext / EvalScriptOutcome) Adds "Writing an outcome grader" (en + zh) after the suite sample: the skills-starter release-result grader verbatim, the three EvalGraderContext fields, the EvalScriptOutcome shape, and what a grader defect does to the trial. Docs only. Fixes #489
3012960 to
eb71b21
Compare
Fixes #489. Docs only —
skip-changeset.What
website/docs/{en,zh}/guide/development/evaluations.mdxgain a "Writing an outcome grader" subsection right after the suite sample:expectOutcome({ script })names (a module resolved relative to the suite file, kept inside the suite directory, default-exporting one grader function);EvalGraderFunction—examples/skills-starter/evals/graders/release-result.tsverbatim (chosen overmcp-app'sstatus-result.tsbecause it is self-contained: the mcp-app grader imports the project'scompiler-status-contract.ts, which a docs sample cannot carry without diverging from the file). The text says which file it is, and that the suite sample's./graders/status-result.tshas the same shape;EvalGraderContext(fixturePath= the trial's materialised fixture copy the agent ran against,artifactRoot= the prepared artifact,prompt), checked againsteval/harness.ts(materializeEvalFixture→fixture.path,options.artifact.root);EvalScriptOutcomeshape (outcome:pass | fail | inconclusive;detailshown in the trial record) and the failure semantics fromeval/graders.ts(gradeScript→TypeError→EVAL_GRADER_FAILED, resultinconclusive);eval.EvalGraderFunction,eval.EvalGraderContext,eval.EvalScriptOutcome.The sample is a
ts twoslashblock, so the docs build type-checks it against the realagent-bundle/evalexport.Checks
pnpm docs:site:buildpasses (twoslash, dead links/anchors, language parity). No code change; no changeset (the grader types already exist).Review status
5cc849f3a— Codex reviewed; one P2 thread ("Do not promise physical grader containment"):containedPathineval/graders.tsis a lexicalresolve/relativecheck and jiti follows a symlink inside the suite wherever it points. Addressed in the follow-up commit: the sentence now says the path must not climb out of the suite directory and that the check is on the path, so a symlink inside the suite is followed (en + zh).main. Awaiting the reviewer on the current head. Per this task's rules no PR comments are posted; review threads are answered by commits and recorded here.