Repository navigation
Add optional OIDC experiments broker - #79626
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review. Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
Caution
agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.
Details
Potential security threats were detected in the agent output. Detected threat types: prompt injection.
Review the workflow run logs for details.
No actionable correctness, regression, performance, or security findings identified in the changed lines. Independent review covered the broker client, compiler integration, job isolation, artifact flow, and validation paths; no tests were run per static-review constraints.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Overview
Reviewed PR head 3effdeb6248cb881501fa0318f49879b28b7f481 against Experiments Specification 1.2.0 (R-STORE-001, R-STORE-BROKER-001/002, R-JOB-001/004/006, R-JOB-004) and Experiments Broker Specification 1.0.0 (§§3–7, especially §4.1).
Finding
One blocking contract regression was posted inline: generated GH_AW_WORKFLOW_REF uses ${{ job.workflow_ref }}, which does not provide the required nonempty workflow reference and causes broker requests to fail validation.
Specification updates
None proposed; the contract accurately requires a nonempty runtime workflow reference.
Coverage
Static review only; tests and conformance scripts were not run per reviewer policy.
Generated by PR Specification Reviewer for #79626 · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review-specs to run again
| | `oidc_token` | Nonempty GitHub Actions OIDC JWT. | | ||
| | `job_id` | Nonempty logical job identifier from runner context. Correlation hint, not proof of the calling job. | | ||
| | `workflow_id` | Nonempty compiler/runtime workflow identifier. Correlation hint, not an authorization identity. | | ||
| | `workflow_ref` | Nonempty workflow reference from compiler/runtime context, including reusable-workflow context when applicable. Correlation hint, not signed proof of the executing revision. | |
There was a problem hiding this comment.
The new common-envelope requirement says workflow_ref MUST be nonempty and come from compiler/runtime context, but the generated broker environment uses ${{ job.workflow_ref }} (pkg/workflow/compiler_experiments_broker.go:28). workflow_ref is provided by the github context, not the job context, so this expression resolves empty and the client rejects the request before assignment/reporting. Please generate ${{ github.workflow_ref }} (or another guaranteed nonempty supported value) and add a compilation assertion covering the rendered value.
There was a problem hiding this comment.
In 3da4457, added a caller-context fallback and compilation coverage. GitHub documents job.workflow_ref for the workflow defining the current job; retaining it preserves reusable-workflow provenance, unlike github.workflow_ref alone.
Comment MemoryPeek at saved memory (review-history)History |
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (500 new lines in business-logic directories) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd, /grill-with-docs, and /codebase-design (skills selected by pr-triage). No blocking issues. Two low-severity inline notes.
📋 Key Themes & Highlights
Key Themes
- Fail-closed design: the OIDC exchange makes one attempt with no retries, redirects, or storage fallback. A single 10s deadline covers OIDC issuance, the exchange, and body reads.
- Test coverage: timeout, redirect, status, body-size, UTF-8, and report-204 paths are tested. Local file reads are size-checked before parsing.
- Job wiring:
id-token: writeis granted only where needed. The report job is compiler-owned and cannot be customized. Report env is isolated.
Notes
- [/grill-with-docs] The client-side
expcheck is advisory, since signature verification is server-side. A comment would prevent misreading it as authentication. - [/codebase-design]
parseJSONparses each input twice. This is harmless but redundant.
Positive Highlights
- ✅ Clear separation between the compiler, the client, and the spec
- ✅ Spec requirements map to named tests (for example T-EXB-007)
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~13 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| await core.setSecret(token); | ||
| if (!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(token)) throw failure("OIDC"); | ||
| const claims = JSON.parse(Buffer.from(token.split(".")[1], "base64url").toString("utf8")); | ||
| if (typeof claims?.exp !== "number" || !Number.isFinite(claims.exp) || claims.exp * 1000 <= now()) throw failure("OIDC"); |
There was a problem hiding this comment.
[/grill-with-docs] The exp check decodes the JWT payload without verifying its signature, so it is only a preflight. The broker is the authority for signature and expiry (spec broker-side requirements and T-EXB-007).
💡 Suggested change
Add a short comment here saying this check is advisory, so future readers don't mistake it for authentication.
@copilot please address this.
There was a problem hiding this comment.
Added the advisory-preflight clarification in 3da4457; broker verification remains authoritative.
| // Metadata and measurements may use finite fractional numbers. Shape validators | ||
| // below independently require safe integer counters and allowlisted observations. | ||
| try { | ||
| return parseStrictJSON(raw, { maxBytes, finiteNumbersIn: Object.keys(JSON.parse(raw) || {}) }); |
There was a problem hiding this comment.
[/codebase-design] parseJSON runs JSON.parse(raw) once only to collect keys for finiteNumbersIn, then parseStrictJSON parses the same input again. Every response up to 64 KiB is parsed twice.
💡 Suggested change
Use one strict pass that records which keys hold finite numbers, or leave a comment explaining why the second parse is needed. Low severity.
@copilot please address this.
There was a problem hiding this comment.
Removed the preliminary parse in 3da4457; strict parsing now handles finite numbers and lossless counters in one pass.
|
Hey @pelikhan 👋 — thanks for the comprehensive OIDC experiments broker implementation! This is a well-structured addition to the agentic workflows platform. What looks great:
The PR is ready for review by the team. The implementation covers all stated concerns and maintains the project's high standards for security and reliability.
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical compiler defects can invalidate generated workflows and reject existing custom jobs, alongside additional broker validation and reporting failures.
9 open issues
Reserve report_experiments only when generating the reporter · New Use valid job-scope defaults for HOME and temporary directories · New Keep broker URL configuration distinct from experiment assignments · New Validate counter number tokens without losing precision · New Accept all schema-valid Unicode experiment variants · New Reject malformed UTF-8 before parsing artifact summaries · New Publish compact reporting input for large experiment runs · New Override both experiment state paths in the broker step · New Support policy-approved self-hosted reporter runners · New
What changed in this PR
Adds an opt-in broker backend to gh-aw’s experiment system, delegating assignments and result collection to a deployment-owned, OIDC-authenticated HTTPS service.
Changes:
- Adds broker configuration, assignment steps, and an isolated reporting job, with local-only broker dry-runs.
- Implements bounded requests, response and artifact validation, and allowlisted result reporting.
- Adds protocol documentation, a TLA+ model, and compiler/runtime tests. Server implementation and broker-backed CLI analysis remain out of scope.
| File | Description |
|---|---|
specs/experiments-broker/ExperimentsBroker.tla |
Models assignment, reporting, authorization, and persistence invariants. |
specs/experiments-broker/BrokenReport.cfg |
Exercises report-overwrite counterexamples. |
specs/experiments-broker/BrokenDryRun.cfg |
Exercises prohibited dry-run mutations. |
specs/experiments-broker/BrokenAuthorization.cfg |
Exercises unauthorized-write counterexamples. |
specs/experiments-broker/BrokenAssignment.cfg |
Exercises duplicate assignment counting. |
specs/experiments-broker/Bounded.cfg |
Defines bounded invariant checks. |
pkg/workflow/workflow_data.go |
Updates the storage-mode field comment. |
pkg/workflow/jobs.go |
Includes reporting in runtime-feature environment handling. |
pkg/workflow/compiler_jobs.go |
Creates the reporter and excludes it from conclusion dependencies. |
pkg/workflow/compiler_experiments.go |
Adds broker selection and local dry-run routing. |
pkg/workflow/compiler_experiments_test.go |
Tests broker storage extraction. |
pkg/workflow/compiler_experiments_broker.go |
Generates assignment steps and the isolated reporting job. |
pkg/workflow/compiler_experiments_broker_test.go |
Tests compilation, permissions, isolation, and dry-runs. |
pkg/workflow/compiler_builtin_job_augmentation.go |
Rejects authored reporter customization. |
pkg/workflow/compiler_activation_permissions.go |
Adjusts OIDC grants for broker previews. |
pkg/parser/schemas/main_workflow_schema.json |
Declares broker storage and its configuration contract. |
pkg/parser/schema_experiments_broker_test.go |
Tests storage acceptance and authored endpoint rejection. |
pkg/constants/job_constants.go |
Adds the reporting job identifier and dependency. |
docs/src/content/docs/specs/experiments-specification.md |
Extends experiment requirements to broker storage. |
docs/src/content/docs/specs/experiments-broker-specification.md |
Defines protocol, authorization, isolation, and conformance requirements. |
docs/src/content/docs/reference/experiments.md |
Documents broker setup, behavior, and limitations. |
actions/setup/js/experiments_broker.test.cjs |
Tests assignments, reporting, transport, and validation failures. |
actions/setup/js/experiments_broker.cjs |
Implements OIDC requests, validation, artifacts, and result projection. |
actions/setup/js/experiment_helpers.test.cjs |
Tests endpoint exclusion from assignment fallback. |
actions/setup/js/experiment_helpers.cjs |
Excludes the broker endpoint from fallback assignments. |
Review effort: Max (adaptive)
| if jobName == string(constants.ReportExperimentsJobName) { | ||
| return errors.New("jobs.report_experiments is compiler-owned and cannot be customized; configure experiments.storage instead") |
There was a problem hiding this comment.
Fixed in 3da4457: reserve and exclude this job only for a live generated reporter, preserving authored custom jobs otherwise.
| } | ||
| for _, name := range []string{"HOME", "TMPDIR", "TMP", "TEMP"} { | ||
| if _, exists := env[name]; exists { | ||
| env[name] = "${{ runner.temp }}" |
There was a problem hiding this comment.
Fixed in 3da4457: job-scope defaults are literals and controlled steps resolve runner.temp; tests and specification cover isolation.
| const fromEnv = {}; | ||
| for (const [key, value] of Object.entries(process.env)) { | ||
| if (!key.startsWith("GH_AW_EXPERIMENTS_")) { | ||
| if (!key.startsWith("GH_AW_EXPERIMENTS_") || key === "GH_AW_EXPERIMENTS_BROKER_URL") { |
There was a problem hiding this comment.
Fixed in 3da4457: the managed secret binds to a separate internal endpoint variable, preserving broker_url assignment fallback.
| // Metadata and measurements may use finite fractional numbers. Shape validators | ||
| // below independently require safe integer counters and allowlisted observations. | ||
| try { | ||
| return parseStrictJSON(raw, { maxBytes, finiteNumbersIn: Object.keys(JSON.parse(raw) || {}) }); |
There was a problem hiding this comment.
Fixed in 3da4457: counter tokens are checked losslessly for exact safe integers; fractional observations remain supported.
| if (!object(spec) || !Object.keys(spec).length) throw failure("CONFIGURATION"); | ||
| for (const [name, config] of Object.entries(spec)) { | ||
| const variants = Array.isArray(config) ? config : object(config) ? config.variants : null; | ||
| if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name) || !Array.isArray(variants) || variants.length < 2 || !variants.every(text) || new Set(variants).size !== variants.length) throw failure("CONFIGURATION"); |
There was a problem hiding this comment.
Fixed in 3da4457: variant validation accepts schema-valid Unicode strings, including empty, multiline, and long values within resource limits.
| const raw = fsImpl.readFileSync(file, "utf8"); | ||
| if (Buffer.byteLength(raw) > 16 * LIMIT) throw failure("INPUT"); | ||
| return parseJSON(raw, 16 * LIMIT); |
There was a problem hiding this comment.
Fixed in 3da4457: bounded artifact bytes are decoded with fatal UTF-8 validation, with malformed-byte tests.
| const selected = assignments(readJSON(path.join(env.GH_AW_EXPERIMENT_STATE_DIR || DEFAULT_DIRECTORY, "assignments.json"), fsImpl), spec, "INPUT"); | ||
| if (!text(env.GH_AW_EXPERIMENT_RESULTS_FILE) || !text(env.GH_AW_EXPERIMENT_METADATA_FILE)) throw failure("INPUT"); | ||
| verifyProducer(readJSON(env.GH_AW_EXPERIMENT_METADATA_FILE, fsImpl), env); | ||
| const summary = readJSON(env.GH_AW_EXPERIMENT_RESULTS_FILE, fsImpl); |
There was a problem hiding this comment.
Fixed in 3da4457: the trusted summary producer publishes a compact allowlisted reporting input, uploaded with the usage artifact.
| fmt.Sprintf(" GH_AW_WORKFLOW_ID: %q\n", data.WorkflowID), | ||
| " GH_AW_WORKFLOW_REF: ${{ job.workflow_ref }}\n", | ||
| fmt.Sprintf(" GH_AW_EXPERIMENT_INVOCATION_ID: %s\n", invocationID), | ||
| fmt.Sprintf(" GH_AW_EXPERIMENT_STATE_DIR: %s\n", experimentsCacheDir), |
There was a problem hiding this comment.
Fixed in 3da4457: the broker assignment step explicitly sets both state directory and state file paths.
| perms.Set(PermissionIdToken, PermissionWrite) | ||
| job := &Job{ | ||
| Name: string(constants.ReportExperimentsJobName), | ||
| RunsOn: "runs-on: ubuntu-latest", |
There was a problem hiding this comment.
Fixed in 3da4457: the isolated reporter uses the existing framework runner selection, with coverage for CLI and repository self-hosted policies.
| } | ||
|
|
||
| /** @param {unknown} value @param {keyof typeof MESSAGES} kind */ | ||
| function httpsUrl(value, kind) { |
|
🍳 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": "a3b7d6c85319f4602d052b39baf075cf79a86d44",
"kind": "requested",
"schema_version": "1",
"state": "48a71d5f93c659dd3628ade1cffe8e4a7478592ab718671ab5a28170c96c31e1",
"work": [
"1c2a66c836e1f49f525e45f45d6ff77e97eb27efff76c99d81c6b974a29f4069",
"3e268ade07ecb83682295233eb2d1b5056fbd7daaa99b3b5dd518c0a7bd68e3c",
"6403c65b446543e787d983a962ed1fc8be17104215dabc8fd2417a6fa8aea638",
"765dede3244ae1843d2dce38c072646feb39a865514cd7db7c64922ed8d671a8",
"76733c02995cf66b9c4cbd4085b50ab335dcf374b1d922a9da68ec025621db4b",
"9fa8fef4e3f9b70b257c91c0769d7f21268f7988d710cd57048f873bc2140b0b",
"af5449802e6d9589a2cc20aeaee33e9a02fed163d780f8f217353d96278378ce",
"c58c9962ab95d6f714dd4ac14855bd965a5b027ca70aa52aa67e26405ced70a8",
"c658eb4a7df3bb4de23c4de7cf3e26c6bed16769987ca208073c0a85e877a50d",
"ead473a9399ca72da0c975c0502e5ffc754bdb5bda417c3dab20d0e4689734a7",
"f1fa56ff5206f9c75d529bc3a491a51247f74ed50f2f51f4672cf99e9cef8a6f",
"f4f0ffd068d0482805288b5c956d74e16e2d2fe796f74e9dedd72b91e66ec249"
],
"workflow": "pr-sous-chef"
}
|
…riments-broker Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest |
|
🍳 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": "81e55f8f7bb0332d63c220fda94a252dc1c3b35c",
"kind": "requested",
"schema_version": "1",
"state": "400d0b6fbf56e6664d452f2b5fc639a13218f0eb428ed9386279d1fd52d57a9d",
"work": [
"0384d253d3410c71a864e41868d2b53514a0546251850d41a7465f9d24f0c2f9",
"b855fc6fcb55b78d8a97b8924885cae846819f33bbc1dec6e0b470fbcf24991c",
"e9f0bbf86aad828b3407e5cb9efe7dcd1062159916bbe36628e73b7671c89e10"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Updated the stale JavaScript summary digest for |
|
@copilot must be able to configure broker URL in yaml and import broker setting using shared AW |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Implemented in fe8042f. |
|
🍳 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": "fe8042f5b6833905f654b5c8b4df7fb3f84bc624",
"kind": "requested",
"schema_version": "1",
"state": "0560cb3fce1eceb2bff064cb3069466cb08203870c1839721d1f4f2c698419e6",
"work": [
"0384d253d3410c71a864e41868d2b53514a0546251850d41a7465f9d24f0c2f9",
"6870fc9ca003e1f17f885d01e56e7a1bf445e05688a9745f1c243629ed05613d"
],
"workflow": "pr-sous-chef"
}
|
…riments-broker Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest |
|
@copilot experiments.broker-url should not allow secrets |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed in 1f27120: |


Add an opt-in experiments broker for querying assignments and reporting results through OIDC-authenticated APIs instead of git-backed storage.
Configuration and compilation
experiments.storage: broker; configure the endpoint through theGH_AW_EXPERIMENTS_BROKER_URLActions secret.Protocol and security
Specification and documentation