Repository navigation
Description
This issue was posted by Codex Desktop on behalf of David.
A leaf failure reporter may need a PR number or head SHA resolved before the agent. The status-only contract rejects those custom-job outputs even when the producer is a strict ancestor of the agent. Removing the opt-in would prevent reporting when threat detection fails.
Reproduction and root cause
Reproduced on v1.0.1 and main afef7e2 using this standalone fixture. Copy it to reporter.md in an otherwise empty directory, then run:
gh aw compile reporter.md --no-emit --no-check-updatejobs.flag_failed_review.steps[0].env.HEAD_SHA: status-only jobs cannot read needs.eligibility.outputs; only outputs of detection-gated compiler-owned jobs are permitted
guardCustomJobDetection in pkg/workflow/compiler_custom_job_detection.go derives allowedOutputJobs only from detection-gated compiler-owned jobs. customJobDetectionAllowedOutputs in pkg/workflow/lint/custom_job_detection.go repeats that restriction. ValidateStatusOnlyJob in pkg/workflow/aw/status_only_job.go rejects the explicit needs.eligibility.outputs references. The producer has no dependency path through agent or detection; rejecting its metadata is unnecessary for the post-agent data boundary.
Bounded implementation plan
- Add a shared graph predicate in pkg/workflow/aw/job_dependencies.go: a qualifying custom producer must be an ancestor of agent and must not depend directly or transitively on agent or detection. Exclude compiler-owned job IDs.
- In guardCustomJobDetection, also require the producer to exist in authored custom jobs. Do not admit generated jobs solely because their IDs are unfamiliar. Retain the existing detection-gated compiler-owned output allowance.
- Apply the same predicate and authored-source requirement in customJobDetectionAllowedOutputs. Use the actual lowered graph when compiled Actions are supplied; infer the compiler ordering only for AW-only analysis.
- Add compiler, graph, and linter regressions for direct/transitive pre-agent metadata, metadata before activation, mixed downstream paths, parallel jobs, and generated jobs without authored provenance. Keep existing leaf, artifact/file, agent/detection-output, and ordinary detection-gate tests passing.
- Update the status-only contract in steps-jobs.md and workflow-linters.md. No new frontmatter option or runtime changes are needed.
Acceptance: the fixture compiles while preserving the reporter condition, including after failed detection. Custom outputs with any agent/detection dependency remain rejected. Status-only jobs remain leaves. Compiler-owned pre-agent outputs remain excluded. Metadata used by shell commands continues to pass through env as data.
Tested implementation
The complete implementation, tests, and docs are available in commit 4bffded947f776546cc1a8410aaeca917b20708f. An independent pre-push review found no actionable issues. Please adopt the fix through a core-team PR under the community contribution process.
- Focused compiler, graph, and linter tests pass: go test ./pkg/workflow ./pkg/workflow/aw ./pkg/workflow/lint -run 'TestCustomJobDetection|TestAuthoredJobDependencies|TestIsPreAgentCustomJob|TestStatusOnly' -count=1.
- make agent-report-progress: impacted tests, custom linters, and schema freshness pass. Its Go lint step reaches the local five-minute timeout; the same linters pass separately with --timeout 10m and report zero issues.
- make check-workflow-drift passes; existing lock files remain in sync.
- GOOS=js GOARCH=wasm go build ./pkg/workflow passes.
- Go formatting passes. The local npx shim prevents make fmt from completing; equivalent formatting through the pinned local Prettier binary passes without unrelated changes.
- The standalone fixture is rejected on v1.0.1 and unmodified main, and accepted by the patched compiler with zero warnings.
Activity