Repository navigation
Bind executor temporary-ID resolutions to the authorized snapshot - #79482
Conversation
The manager passed handlers a shallow-frozen copy of resolvedTemporaryIds whose entries were shared with live temporaryIdMap values. Temporary-ID spellings resolved by the handler (case or quote variants) could therefore execute against a target changed during the authority wait. Pass the same deep-frozen snapshot that input_digest binds. Add remove_labels consistency regressions (targets, aliases, defaults, filtering, deferral, no-op, denial, staging) and document the guarantee. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Normalize undefined values with JSON semantics so the snapshot remains digestable: undefined object fields are dropped, undefined array entries become null, and null values are preserved. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ 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 Code Quality Reviewer completed the code quality review. 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.
|
|
✅ Ponytail Reviewer completed successfully!
|
There was a problem hiding this comment.
What this change does: It binds temporary-ID resolutions to the snapshot used for authorization. It also adds regression tests and documents the boundary.
Should fix: 1. Reuse the existing JSON clone to avoid a separate recursive normalization helper (see inline comment).
Verdict: fix 1 first.
Lean: -19 lines possible.
Generated by ✂️ Ponytail Reviewer for #79482 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one authorization-boundary issue: execution uses preparedMessage instead of the exact cloned/undefined-normalized message covered by input_digest, allowing handler semantics to diverge from the reviewed inputs. Please pass the bound snapshot to the handler and add a regression for this equivalence.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Overview
Reviewed PR head 693c9aba31e82843079ed8f41bb931d8e331a151 against base ab34b92385802c8f705134cc2fea1bc44f679e23. The protected manager snapshot change is directionally aligned with the Safe Outputs specification (v1.31.0), but one execution path still violates the added semantic-consistency contract.
Blocking issue
The manager passes the frozen temporary-ID snapshot as the second handler argument, while still passing the live temporaryIdMap as the third argument. safe_output_action_handler.cjs consumes that live map for temporary-ID substitution, so a mutation during the authority wait can redirect a protected custom action. The normative requirement at safe-outputs-specification.md:1754 therefore overclaims the implementation. Please bind/pass a frozen map for all protected executor paths with regression coverage, or narrow the specification scope so custom executors and live-map consumers are not covered by the MUST.
An inline comment was posted on the changed specification line. No specification edit or branch update was made.
References:
Coverage limits
This was a static contract review; tests were not run.
Generated by PR Specification Reviewer for #79482 · copilot · gpt50 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (review-history)History |
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd and /codebase-design. Requesting changes on one correctness gap.
The snapshot binding closes the demonstrated mutation gap, and the mutation-during-wait tests are strong. However, the spec's guarantee that unresolved temporary targets defer before consuming a decision does not hold for uppercase or quoted spellings.
📋 Key Themes & Highlights
Key Themes
- Deferral gap: case-sensitive guard lets
AW_laterand"aw_later"consume a decision, then fail - Binding drift: the handler receives
preparedMessage, not the digestedboundInputs.message - Clone semantics:
structuredClonediffers from the JSON round-trip it replaces
Positive Highlights
- ✅ Deep-frozen snapshot is the right binding for the
resolvedTemporaryIdsargument - ✅ Regression tests cover mutation of message, config, env and entries during the authority wait
Not Assessed
- The live
temporaryIdMapthird argument and custom executors remain unverified, as the PR notes. I did not run the test suite; these findings come from code reading and direct resolver checks.
@copilot please address the review comments above.
Comments that could not be inline-anchored
actions/setup/js/safe_output_handler_manager.cjs:1234
**[/diagnosing-bugs]** The deferral guard is case-sensitive, so an unresolved `AW_later` or quoted `"aw_later"` skips deferral. The resolver accepts both spellings, so the handler returns `deferred: true` after the authority decision is already consumed, and the post-execution check then throws. This breaks the invariant the spec now states (defer before any decision is consumed). <details> <summary>💡 Suggested fix</summary> Use the resolver's predicate here: strip surrounding quotes, then ap...
actions/setup/js/safe_output_handler_manager.cjs:1325
**[/codebase-design]** The digest covers `boundInputs.message`, but the handler still receives `preparedMessage`, a separate object. The contents match today, but the comment at line 1289 and the spec say the executor consumes the snapshot. Pass `boundInputs.message` so the authorized object is the executed object, keeping the code aligned with the documented invariant. @copilot please address this.
actions/setup/js/safe_output_handler_manager.cjs:1290
**[/diagnosing-bugs]** `structuredClone` is not a drop-in for the JSON round-trip it replaces. Dates stay `Date` objects, which `canonical()` rejects through its plain-prototype check, so the digest fails with `invalid_preparation`. Functions now throw `DataCloneError`, and that call sits outside the `try` at line 1314, so the failure bypasses that block's error handling. Use a JSON-compatible clone, or move this inside the `try` with an explicit `invalid_preparation` result. @copilot please ad...
actions/setup/js/safe_output_handler_manager_authorization.test.cjs:504
**[/tdd]** This case covers only lowercase `aw_later`. Add `it.each` rows for `AW_later` and `"aw_later"` asserting that `authorize` is not called and the result defers. These should fail on the current code, which gives the red step for the fix above. @copilot please address this.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Protected actions can still target the wrong resource because reused handlers retain stale resolutions and some consumers read the mutable live map rather than the bound snapshot.
3 open issues
What changed in this PR
This PR strengthens gh-aw’s safe-output authorization boundary by passing protected handlers the temporary-ID resolution snapshot used to compute input_digest.
Changes:
- Creates a detached, deep-frozen authorization-input snapshot.
- Adds
remove_labelsregressions for target resolution, mutation during authorization, deferral, denial, and staging. - Documents semantic consistency guarantees and assessment limits.
| File | Description |
|---|---|
docs/src/content/docs/specs/safe-outputs-specification.md |
Defines semantic consistency requirements and documents coverage limits. |
actions/setup/js/safe_output_handler_manager.cjs |
Builds the frozen input snapshot and passes its temporary-ID resolutions to handlers. |
actions/setup/js/safe_output_handler_manager_authorization.test.cjs |
Adds authorization-to-execution consistency regressions for remove_labels. |
Review effort: Max (adaptive)
- Project inputs to plain JSON data before structuredClone so provider temporary-ID entries with methods or Dates stay digestable. - Execute a writable copy of the bound message. - Pass protected handlers a temporary-ID map view backed by the bound snapshot that writes new IDs through to the shared map. - Refresh handler-local temporary-ID caches from each invocation. - Update the semantic consistency spec paragraph. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
Thanks to the review bots (comments 7035525351, 7035532741, 7035534177, 7035546730, 7035551780, 7035764109, 7035803848, 7035825846). Those are status and memory updates with no separate action items; the inline findings they raised (snapshot/executor consistency and the spec regression) are addressed in 5f3d8df. |
ok
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Add JSDoc types for the keymap, keyboard layout and nearest-pair search so tsc -p tsconfig.cracktro.json passes again after #79486. Co-authored-by: copilot-swe-agent[bot] <[email protected]>


Safe-output authorization should guarantee that native execution stays within the semantics bound by the authority request (workflow hash,
input_digest,policy_digest). Tracing the handler-manager path withremove_labelsas the concrete case found one demonstrated gap; everything else was already covered and now has focused regressions.The gap
The manager passed handlers
Object.freeze({ ...resolvedTemporaryIds }): a shallow copy whose entries were shared with livetemporaryIdMapvalues (providertemporaryIdEntryobjects are stored by reference). Canonicalaw_xtargets are rewritten to numbers before the digest, but temp-ID spellings only the handler recognizes (AW_x,"aw_x") are resolved from that map at execution time. A test reproduced the request bindingaw_target -> #42while execution removed labels from#99after an in-place entry change during the authority wait.Fix
executeInvocationnow builds one deep-frozenboundInputssnapshot, uses it asnormalizedInputsfor the digest, and passesboundInputs.resolvedTemporaryIdsto the handler. No new hash, protocol field, or authorization feature.Trace summary
allowed_repos, input/policy digest*fallbackinput_digestrequired-labels/ title prefixupload_artifact)Tests and docs
remove_labelscases insafe_output_handler_manager_authorization.test.cjsverify the authorityinput_digestequals the digest of captured canonical inputs and record actual mutations: targets/aliases/defaults, mutation of message/config/env during the wait, temp-ID variants, single-decision deferral, no-op/invalid input, denial, global and per-output staging.Notes for reviewers
/dev/nullwith a regular file locally.