Repository navigation
Make operational value grading JavaScript-only - #78452
Conversation
Migrate the reserved operational-value evaluator to the restricted JavaScript lane while preserving ordered metric compatibility and legacy Bash deprecation support. Co-authored-by: Copilot <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Copilot <[email protected]>
|
@copilot Fix failing checks |
There was a problem hiding this comment.
🟡 Changes recommended
An invalid YAML fixture and a test that never enables JavaScript analysis undermine verification, while the verifier can reject valid evaluators by selecting a built-in result instead of the intended custom result.
5 open issues
What changed in this PR
This PR moves operational-value grading onto gh-aw’s existing restricted JavaScript runtime and removes the Bash compatibility path while preserving the ordered-metric result contract.
Changes:
- Runs operational-value JavaScript through the isolated grader worker, including replay and offline regrading.
- Removes Bash grader configuration, execution, resource discovery, and linting; legacy declarations receive migration errors.
- Updates specifications, guidance, generated references, and tests, distinguishing run-scoped grading from gh-cao longitudinal Value.
| File | Description |
|---|---|
scripts/generate-schema-docs.test.js |
Checks JavaScript-only grader documentation. |
pkg/workflow/taint/taint.go |
Removes obsolete literal-shell analyzer state. |
pkg/workflow/taint/shell.go |
Removes the grader-specific interpolation bypass. |
pkg/workflow/taint/javascript_fast_test.go |
Adds a restricted operational-grader profile test. |
pkg/workflow/taint/authored_scripts.go |
Assigns all grader scripts the JavaScript profile. |
pkg/workflow/taint/authored_scripts_test.go |
Updates the operational-grader entry-point fixture. |
pkg/workflow/step_order_validation_test.go |
Renames shell-grader-specific artifact fixtures. |
pkg/workflow/README.md |
Removes the deleted shell-preparation API. |
pkg/workflow/lint/rule_contract_test.go |
Removes shell-grader lint contracts. |
pkg/workflow/lint/README.md |
Removes the shell-write rule reference. |
pkg/workflow/lint/performance_benchmark_test.go |
Removes shell-grader benchmark setup. |
pkg/workflow/lint/lint.go |
Unregisters the shell-grader lint rule. |
pkg/workflow/lint/lint_test.go |
Updates expected rule registration. |
pkg/workflow/lint/grader_shell_file_write.go |
Deletes the shell-grader lint rule. |
pkg/workflow/lint/grader_shell_file_write_test.go |
Deletes obsolete shell-rule tests. |
pkg/workflow/gradershell/README.md |
Documents the remaining shared Bash helpers. |
pkg/workflow/gradershell/load.go |
Deletes repository Bash-grader loading. |
pkg/workflow/gradershell/load_test.go |
Deletes Bash-grader loader tests. |
pkg/workflow/gradershell/evaluation.go |
Retains shared analysis and relocates descriptor checking. |
pkg/workflow/gradershell/evaluation_input_test.go |
Preserves shared input-redirection tests. |
pkg/workflow/gradershell/commands.go |
Deletes shell-grader command-write checks. |
pkg/workflow/gradershell/check.go |
Deletes the Bash-grader write checker. |
pkg/workflow/gradershell/check_test.go |
Removes obsolete checker tests. |
pkg/workflow/graders_operational_value.go |
Deletes Bash source preparation and freezing. |
pkg/workflow/graders_operational_value_test.go |
Tests JavaScript compilation and legacy rejection. |
pkg/workflow/graders_config.go |
Removes shell fields and rejects run. |
pkg/workflow/graders_config_test.go |
Tests JavaScript configuration and import merging. |
pkg/workflow/compiler.go |
Removes shell preparation and normalizes diagnostic lines. |
pkg/workflow/compiler_yaml_graders.go |
Emits JavaScript-only custom grader manifests. |
pkg/workflow/compiler_orchestrator_workflow.go |
Removes imported shell-path bookkeeping. |
pkg/workflow/compiler_development_safety.go |
Removes Bash-specific dry-run handling. |
pkg/workflow/compiler_development_safety_test.go |
Removes the obsolete Bash dry-run fixture. |
pkg/parser/schemas/main_workflow_schema.json |
Removes run and describes JavaScript metric contracts. |
pkg/parser/schema_validation.go |
Adds explicit legacy-syntax migration errors. |
pkg/parser/schema_test.go |
Tests accepted scripts and rejected legacy paths. |
pkg/parser/import_processor.go |
Removes imported grader source-path metadata. |
pkg/parser/import_extract_engine.go |
Stops collecting shell-grader source paths. |
pkg/parser/import_accumulator.go |
Removes shell-source accumulation state. |
pkg/cli/resources.go |
Removes inferred Bash evaluator resources. |
pkg/cli/resources_test.go |
Checks that scripts do not imply resources. |
pkg/cli/resources_graders_test.go |
Deletes evaluator-download tests. |
pkg/cli/logs_harbor_test.go |
Checks primary-value reward mapping. |
pkg/cli/logs_command.go |
Updates additional-grading help text. |
pkg/cli/lint_grader_shell_file_write_test.go |
Deletes shell-rule CLI tests. |
pkg/cli/graders_run.go |
Uses restricted JavaScript for operational-value replay. |
pkg/cli/graders_run_test.go |
Tests JavaScript replay, metrics, and imports. |
pkg/cli/graders_regrade.go |
Accepts operational-value JavaScript in collections. |
pkg/cli/graders_regrade_test.go |
Updates collection-definition validation tests. |
pkg/cli/graders_regrade_offline_test.go |
Tests offline operational-value JavaScript grading. |
pkg/cli/graders_integration_test.go |
Updates expected grader help text. |
pkg/cli/graders_command.go |
Updates replay help and removes shell PATH forwarding. |
pkg/cli/experiments_grader_observations_test.go |
Tests schema-v2 primary-value extraction. |
pkg/cli/compile_development_report.go |
Removes Bash-specific dry-run wording. |
pkg/cli/audit_report_graders_test.go |
Tests operational-value audit extraction. |
pkg/cli/add_package_ownership.go |
Removes evaluator destinations and reports rollback errors. |
pkg/cli/add_package_manifest_test.go |
Tests that grader definitions imply no resources. |
pkg/cli/add_package_manifest_resources_test.go |
Rejects former evaluator resource destinations. |
pkg/cli/add_package_manifest_resolve.go |
Deletes automatic evaluator resource discovery. |
docs/src/content/docs/specs/unified-agent-session-specification.md |
Clarifies the scope of recorded output outcomes. |
docs/src/content/docs/specs/graders-specification.md |
Defines JavaScript-only grading and ownership boundaries. |
docs/src/content/docs/setup/cli.md |
Revises grading, replay, and dry-run documentation. |
docs/src/content/docs/reference/workflow-linters.md |
Removes Bash-grader lint documentation. |
docs/src/content/docs/reference/harbor.md |
Updates collection-grading support information. |
docs/src/content/docs/reference/glossary.md |
Defines JavaScript grading and longitudinal Value separately. |
docs/src/content/docs/reference/frontmatter-full.md |
Refreshes generated frontmatter reference text. |
docs/src/content/docs/reference/compilation-process.md |
Removes Bash-specific dry-run restrictions. |
docs/src/content/docs/reference/artifacts.md |
Documents JavaScript results and ordered metrics. |
docs/src/content/docs/experimental/trace-graders.md |
Replaces Bash examples with restricted JavaScript. |
docs/scripts/generate-autocomplete-data.test.js |
Checks JavaScript-only autocomplete descriptions. |
docs/public/editor/autocomplete-data.json |
Refreshes published schema completion data. |
docs/adr/73258-offline-collection-regrading-and-harbor-additional-graders.md |
Marks Bash replay decisions superseded. |
docs/adr/70851-fail-closed-dry-run-compilation-for-host-execution-effects.md |
Notes that legacy syntax is universally invalid. |
docs/adr/70130-pure-unified-session-graders-with-isolated-custom-job.md |
Marks Bash compatibility decisions historical. |
docs/adr/60682-simplify-operational-value-grading-to-one-shot-evaluators.md |
Marks the file-backed Bash design superseded. |
docs/adr/55155-operational-value-grader.md |
Marks the original Bash design superseded. |
CHANGELOG.md |
Records JavaScript grading and the breaking removal. |
AGENTS.md |
Updates the repository grading contract. |
actions/setup/session_parsers.go |
Removes embedded Bash runtime modules. |
actions/setup/js/unified_session_payload.test.cjs |
Tests ordered metric preservation without executable payloads. |
actions/setup/js/operational_value_worker.cjs |
Deletes the Bash subprocess worker. |
actions/setup/js/operational_value_grader.test.cjs |
Tests restricted JavaScript contracts and artifacts. |
actions/setup/js/operational_value_grader.cjs |
Deletes the Bash evaluator runtime. |
actions/setup/js/custom_graders.cjs |
Routes operational value through restricted JavaScript. |
actions/setup/js/custom_grader_worker.cjs |
Validates ordered operational-value metric arrays. |
actions/setup/js/child_process_timeouts.cjs |
Removes obsolete evaluator timeout entries. |
.github/skills/operational-value-designer/tests/fixtures.json |
Adds recorded-session semantic fixtures. |
.github/skills/operational-value-designer/scripts/verify-operational-value-evaluator.sh |
Verifies JavaScript metrics, identity, and determinism. |
.github/skills/operational-value-designer/scripts/verify-operational-value-contract-change.sh |
Deletes Bash-specific contract-pair verification. |
.github/skills/operational-value-designer/scripts/operational-value-evaluator-path.sh |
Deletes Bash evaluator path generation. |
.github/skills/developer-internals/SKILL.md |
Updates internal JavaScript grader guidance. |
.github/graders/daily-file-diet-operational-value.sh |
Removes the legacy file-diet Bash evaluator. |
.github/graders/daily-file-diet-operational-value.fixtures.json |
Removes its legacy request fixtures. |
.github/aw/update-agentic-workflow.md |
Updates grader migration instructions. |
.github/aw/intent.md |
Separates run-scoped grading from longitudinal Value. |
.github/aw/instructions.md |
Updates authoring contracts and CAO ownership guidance. |
.github/aw/harbor.md |
Updates supported graders and export guidance. |
.github/aw/debug-compilation.md |
Updates dry-run restrictions and reporting guidance. |
.github/aw/create-agentic-workflow.md |
Revises grader authoring guidance and prefix structure. |
.changeset/major-pure-unified-session-graders.md |
Records the JavaScript-only breaking change. |
.changeset/major-fail-closed-dry-run-host-effects.md |
Removes obsolete Bash-specific dry-run wording. |
Review effort: Max (adaptive)
| script: return trace.token; | ||
| operational-value: | ||
| script: echo "$TOKEN" | ||
| script: return [{id: "restricted", value: typeof process === "undefined" ? 1 : 0}]; |
There was a problem hiding this comment.
The fixture scalar is already quoted in e5ef8fe; the current file retains that valid YAML form. Fixed there.
| result, err := AnalyzeAuthoredScripts(t.Context(), document, SecretLeakRule()) | ||
| require.NoError(t, err) | ||
| require.Len(t, result.Findings, 1) | ||
| require.Len(t, result.Findings[0].Sources, 1) | ||
| assert.Equal(t, "github.token", result.Findings[0].Sources[0].Reference) | ||
| } | ||
|
|
||
| func TestAuthoredOperationalGraderEnvironment(t *testing.T) { | ||
| allowed := []string{"PATH", "HOME", "TMPDIR", "TEMP", "TMP", "SystemRoot", "ComSpec", "GH_HOST", "GITHUB_API_URL", "GITHUB_GRAPHQL_URL", "GITHUB_SERVER_URL"} | ||
| names := append(append([]string{}, allowed...), "GH_TOKEN", "TOKEN", "GITHUB_TOKEN", "GITHUB_WORKSPACE", "RUNNER_TEMP", "CI") | ||
| for _, name := range names { | ||
| t.Run(name, func(t *testing.T) { | ||
| document := &aw.Document{Frontmatter: map[string]any{ | ||
| "env": map[string]any{name: "${{ secrets.BINDING }}"}, | ||
| "graders": map[string]any{"operational-value": map[string]any{ | ||
| "script": `echo "$` + name + `"`, | ||
| }}, | ||
| }} | ||
| result, err := AnalyzeAuthoredScripts(t.Context(), document, SecretLeakRule()) | ||
| require.NoError(t, err) | ||
| if name != "GH_TOKEN" && !slices.Contains(allowed, name) { | ||
| assert.Empty(t, result.Findings) | ||
| return | ||
| } | ||
| require.Len(t, result.Findings, 1) | ||
| require.Len(t, result.Findings[0].Sources, 1) | ||
| expected := "secrets.binding" | ||
| if name == "GH_TOKEN" { | ||
| expected = "github.token" | ||
| } | ||
| assert.Equal(t, expected, result.Findings[0].Sources[0].Reference) | ||
| }) | ||
| } | ||
| assert.Empty(t, result.Findings) |
There was a problem hiding this comment.
The test now enables native JavaScript analysis and asserts the sole intentional grader payload-data-flow gap, rejecting parser/AST availability gaps. Fixed in 1fad726.
| 7. Reuse built-in graders. Use restricted `graders.operational-value.script` | ||
| for run-scoped outcome metrics; it returns ordered `{id,value}` metrics. | ||
| Other custom JavaScript returns one value. Both run only in the downstream | ||
| `graders` job. Deprecated Bash is compatibility-only; never translate it. |
There was a problem hiding this comment.
Authoring guidance now says graders.operational-value.run is rejected, including disabled/imported declarations, and requires manual migration to script without automatic translation. Fixed in 1fad726.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed the failing taint test: the inline JavaScript ternary needed YAML quoting, and the assertion now covers the operational grader script. Focused and final validation passed. Commit: |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "e5ef8fe5fd0162944616c32d22a077af0a728b54",
"kind": "requested",
"schema_version": "1",
"state": "e1936233938ea3bc102a0ed6a2e4d4bf51907a460c598f1a285e94f49b8078f8",
"work": [
"616fa76fbc678d57e0de1e90a18fc4f05fefae2ce84d88be85f5e5e63b9f7bea",
"72a36ff0ed7797ec1c29e11d567669bc1be28a6adf978a434c05bc589f9b46d3",
"7c89d4cdf9023c5caee29db561c4d595bf5e3c5c63c285ffced1b8ee798da05c",
"7fdcb480e7a98cc7e0f466a49ad1c7f7e8c5cfc22f8fbcc711724ed335220761",
"9f846b5456e0c072478132d4f093a093e3c9a47a415b6bae2d0c0464f9adcdd8",
"ffca1d5de720e017ed1401b80e71fe97b420661200fbe1b7f3932dbd89cb043f"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest |
|
@copilot resolve the merge conflicts on this branch. |
# Conflicts: # .github/workflows/dependabot-burner.lock.yml # docs/src/content/docs/reference/workflow-linters.md # scripts/dependabot-burner-selection.test.cjs Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest
The previously failing impacted JS test now passes all 18 cases after the conflict resolution in |
|
@copilot resolve the merge conflicts on this branch. |
# Conflicts: # .github/workflows/dependabot-burner.lock.yml Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest
Merged latest |
|
@copilot resolve the merge conflicts on this branch. |
| runner := filepath.Join(directory, "graders_run.cjs") | ||
| args := []string{permissionFlag, "--allow-fs-read=" + directory} | ||
| if grader.Source == "inline" || grader.Source == "operational-value" && grader.Script != "" { | ||
| args = append(args, "--allow-child-process") |
Merged the latest |
|
🎉 This pull request is included in a new release. Release: |


Summary
graders.operational-value.scriptthrough the restricted JavaScript grader worker while preserving ordered metrics, first-metric primary mapping, diagnostics, implementation digests, artifacts/events, replay, experiments, audit/logs, telemetry, and Harbor consumersgraders.operational-value.runnow fails explicitly with migration guidance toscript, including disabled and imported declarations--campaignis ownership-scoped aggregation only, lifecycle remains universal, and gh-aw's restricted-JS grader is optional run-scoped evidence rather than a prerequisite or substituteValidation
BASE_REF=c4e6fd0 make agent-report-progressBASE_REF=3a67478a59 make agent-report-progress