Skip to content

Add safe-output identifiers and dependency failure propagation - #74376

Merged
pelikhan merged 17 commits into
mainfrom
copilot/extend-safe-outputs-identifier
Nov 4, 2026
Merged

pelikhan merged 17 commits into
mainfrom
copilot/extend-safe-outputs-identifier

Conversation

Copilot AI commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Safe-output calls need operation identifiers that subsequent calls can reference through depends-on. Dependent operations must fail without executing when a prerequisite fails.

  • Identifiers: Return a unique output_id (so_<UUID>), distinct from resource temporary_id values, and retain it through ingestion and execution outcomes.
  • Dependencies: Accept one identifier or an array; order execution by prerequisites and propagate failures transitively. Missing, ambiguous, cyclic, or unconfirmed prerequisites fail closed.
  • Boundaries: Dependencies remain within one processing pass and Claim. Separate custom jobs, upload_asset, and noop reject dependent requests; delegated effects cannot establish prerequisite success.

A subsequent add_comment call can reference a previously returned identifier:

{
  "item_number": 123,
  "body": "The prerequisite update completed.",
  "depends-on": "so_4a1f2c30-1b2c-4d5e-8f90-123456789abc"
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add safe-output identifiers and depends-on failure propagation Add safe-output identifiers and dependency failure propagation Nov 3, 2026
Copilot AI requested a review from pelikhan November 3, 2026 03:38
@pelikhan
pelikhan marked this pull request as ready for review November 3, 2026 05:24
Copilot AI auto review requested due to automatic review settings November 3, 2026 05:24
@pelikhan

pelikhan commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot make the safe output result identifier shorter

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request...

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🔬 Test Quality Sentinel is analyzing test quality on this pull request...

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✂️ Ponytail Reviewer has started processing this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical defects break deployed server startup and ordinary ledger finalization, while dependency gating can allow mutations before prerequisites succeed.

8 open issues
What changed in this PR

Adds operation-level identifiers and prerequisite checks to gh-aw’s safe-output pipeline, allowing queued operations to reference earlier calls independently of resource temporary IDs.

Changes:

  • Adds output_id generation and depends-on metadata across submission, ingestion, and outcomes.
  • Introduces dependency ordering and failure propagation alongside existing temporary-ID handling.
  • Updates tool schemas, custom-job configuration, documentation, and regression tests.
File Description
pkg/​workflow/​safe_outputs_config_generation.go Marks separate custom jobs as dependency-unsupported.
pkg/​workflow/​safe_outputs_config_generation_test.go Tests custom-job capability configuration.
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents identifiers, dependencies, and execution boundaries.
docs/​public/​schemas/​unified-session.schema.json Adds output IDs to session outcome schemas.
actions/​setup/​js/​types/​unified_session.d.ts Types output IDs in safe-output data.
actions/​setup/​js/​safe_outputs_tools_loader.cjs Integrates dependency schemas and submission tracking.
actions/​setup/​js/​safe_outputs_mcp_wrapped_arguments.test.cjs Tests dependency aliases and returned IDs.
actions/​setup/​js/​safe_outputs_mcp_arguments.cjs Preserves wrapped dependencies and rejects conflicting aliases.
actions/​setup/​js/​safe_outputs_handlers.test.cjs Updates handler assertions for generated IDs.
actions/​setup/​js/​safe_outputs_handlers.cjs Wraps handlers with submission tracking.
actions/​setup/​js/​safe_output_type_validator.test.cjs Tests metadata validation and unsupported dependencies.
actions/​setup/​js/​safe_output_type_validator.cjs Validates and preserves submission metadata.
actions/​setup/​js/​safe_output_submission.test.cjs Tests submission tracking and pipeline integration.
actions/​setup/​js/​safe_output_submission.cjs Implements identifier generation and dependency metadata handling.
actions/​setup/​js/​safe_output_routing_parity.test.cjs Updates routing assertions for output IDs.
actions/​setup/​js/​safe_output_outcomes.cjs Preserves IDs and dependency error codes in outcomes.
actions/​setup/​js/​safe_output_handler_manager.cjs Integrates dependency gating with execution and retries.
actions/​setup/​js/​safe_output_dependencies.test.cjs Tests ordering, propagation, cycles, and outcome confirmation.
actions/​setup/​js/​safe_output_dependencies.cjs Implements dependency planning and prerequisite checks.
actions/​setup/​js/​safe_output_action_handler.test.cjs Tests exclusion of protocol metadata from action inputs.
actions/​setup/​js/​safe_output_action_handler.cjs Filters identifier and dependency fields from action payloads.
actions/​setup/​js/​generate_safe_outputs_tools.test.cjs Tests generated dependency schemas.
actions/​setup/​js/​generate_safe_outputs_tools.cjs Adds dependency parameters to generated tools.
actions/​setup/​js/​collect_ndjson_output.test.cjs Tests custom-output metadata ingestion.
actions/​setup/​js/​collect_ndjson_output.cjs Preserves metadata and rejects unsupported custom-job dependencies.
.github/​workflows/​smoke-copilot.lock.yml Updates custom-job dependency capability configuration.
.github/​workflows/​smoke-copilot-arm.lock.yml Updates custom-job dependency capability configuration.
.github/​workflows/​smoke-copilot-aoai-entra.lock.yml Updates custom-job dependency capability configuration.
.github/​workflows/​smoke-copilot-aoai-apikey.lock.yml Updates custom-job dependency capability configuration.
.github/​workflows/​mcp-inspector.lock.yml Marks its Slack job as dependency-unsupported.
.github/​workflows/​daily-choice-test.lock.yml Marks its custom test job as dependency-unsupported.
.github/​workflows/​aw-issue-clustering.lock.yml Marks its publishing job as dependency-unsupported.

Review effort: Max (auto)

*/
function isConfirmedDependencySuccess(record) {
if (process.env.GH_AW_SAFE_OUTPUTS_STAGED === "true") return false;
if (!record || record.success !== true || classifySafeOutputResult(record) !== "success") return false;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already addressed in 79b9021: delegated effects cannot confirm prerequisite success, and standalone noop/upload_asset dependencies are rejected. Regression tests exercise the real handlers.

Comment on lines +99 to +100
const outputId = `so_${randomUUID()}`;
const recorded = { ...entry, output_id: outputId };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 79b9021: ledger append finalization strips output_id and dependency metadata before transaction normalization, with submission-to-finalization regression coverage.

const { clearValidationMarker, formatJSONFiles, runCustomMemoryValidation, writeValidationMarker } = require("./memory_custom_validation.cjs");
const { compileFileGlobPatterns, isMemoryFileEligible } = require("./memory_file_eligibility.cjs");
const { normalizeRuntimeMessage, readClaimScopeContext, withClaimExecution, currentClaimHandle, claimArtifactPath } = require("./work_queue_claim_scope.cjs");
const { createSubmissionTracker } = require("./safe_output_submission.cjs");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 47eb33b: safe_output_submission.cjs is included in SAFE_OUTPUTS_FILES for deployed safe-output packaging.

Comment on lines +90 to +98
const cyclic = order.length !== messages.length;
const visited = new Set(order);
messages.forEach((message, index) => {
if (!visited.has(index)) {
// Preserve the legacy cycle fallback only for messages without explicit edges.
if (message["depends-on"] !== undefined || message.depends_on !== undefined) invalid.set(index, "Cyclic safe-output dependency");
order.push(index);
}
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 79b9021: cycle detection now invalidates an explicit dependency only when its edge participates in a cycle; a downstream consumer is covered by regression tests.

} finally {
// Release newly ready producers before the next legacy temporary-ID
// retry; it may need an ID created by a previously waiting output.
await drainWaitingMessages();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 79b9021: deferred consumers are retried in bounded, progress-aware rounds when newly resolved IDs become available, without replaying completed mutations.

Comment on lines +32 to +43
function addDependencySchema(tool) {
tool.inputSchema ||= { type: "object" };
tool.inputSchema.properties ||= {};
tool.inputSchema.properties["depends-on"] = {
description: "One output_id, or a nonempty array of output_id values returned by earlier safe-output calls. Execute only after every prerequisite succeeds; otherwise this output fails. These are not temporary resource IDs.",
"x-synonyms": ["depends_on"],
oneOf: [
{ type: "string", pattern: OUTPUT_ID_PATTERN },
{ type: "array", minItems: 1, uniqueItems: true, items: { type: "string", pattern: OUTPUT_ID_PATTERN } },
],
};
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already handled in the current submission schema: reserved depends-on, depends_on, and output_id inputs are rejected, while repeated dependency-schema injection is idempotent. Regression coverage is in safe_output_submission.test.cjs.

Comment on lines +784 to +786
if ((item["depends-on"] !== undefined || item.depends_on !== undefined) && ["upload_asset", "noop"].includes(itemType)) {
return { isValid: false, error: `Line ${lineNum}: depends-on is not supported for ${itemType}, which executes outside the safe-output handler manager.` };
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 79b9021: dependencies are rejected for report_incomplete, report_missing_tool, and report_missing_data at submission, preventing their out-of-band consumers from bypassing dependency gating.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot make the safe output result identifier shorter

Shortened IDs to 22 URL-safe characters while retaining UUID entropy. Commit: 183b6813.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

pelikhan commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…utputs-identifier

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Merged the latest main and recompiled all 356 workflows successfully. Merge commit: 087ae494.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Commit pushed: f88868b

Generated by PR Finisher · copilot · auto · ~17 AIC · ⌖ ~2 AIC · ⊞ 10.7K

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR finisher

  • Merged origin/main locally (no conflicts); submitted for publication via push_to_pull_request_branch (staged, not confirmed).
  • Dispatch-delegation review feedback: DELEGATED_EFFECT_TYPES already includes dispatch_workflow/dispatch_repository at the checked-out head. Threads were not resolved because I could not read thread IDs (GraphQL read returned no data); a maintainer can resolve them.
  • Validation: make agent-report-progress could not run (Prettier unavailable; npm ci failed with a self-signed certificate error). Not validated locally.
  • CI is stale after the push and needs a maintainer re-trigger.

PR finisher dispatch requested for the following outstanding work: merge main; dispatch delegated-effects review threads.
Sous-chef head: 087ae49
Sous-chef work: fb57c8338bb008314f8f4dcc929c893e77327120eea4424eba230d27760f4f4e
Sous-chef state: 400c57637c254e167ea8b0a52531091d2818968bf00ffb910e53d619b2b8bf56

Generated by 🏁 PR Finisher · copilot · auto · ~17 AIC · ⌖ ~2 AIC · ⊞ 10.7K · ◷

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR finisher: the dispatch fix (dispatch_workflow/dispatch_repository in DELEGATED_EFFECT_TYPES) is already in the PR head, so no code change was needed. The merge of main only changed .github/workflows/cjs.yml (workflow YAML, excluded from push), so the branch update needs a maintainer to run make merge-main with workflow-write credentials. Local validation was blocked (npm ci failed on a self-signed cert), so it was not run. Maintainer re-trigger of CI is needed.

Sous-chef head: f88868b
Sous-chef work: fb57c8338bb008314f8f4dcc929c893e77327120eea4424eba230d27760f4f4e
Sous-chef state: 4f23090f971f956f6006ee4d9f9c393fd90300d5a210e6ac3640bfeb74df8984

Generated by 🏁 PR Finisher · copilot · auto · ~16 AIC · ⌖ ~1 AIC · ⊞ 10.7K · ◷

@pelikhan
pelikhan merged commit 7591cc0 into main Nov 4, 2026
61 of 63 checks passed
@pelikhan
pelikhan deleted the copilot/extend-safe-outputs-identifier branch November 4, 2026 15:18
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

github-actions Bot added a commit that referenced this pull request Nov 5, 2026
…forks flag

Document safe-output output_id/depends-on dependency gating (#74376),
the managed source-sha frontmatter field (#74948), the
dangerously-allow-pull-request-target-forks-all feature flag (#74884),
and detection report-as-issue permission requirements (#74949).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants