You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let workflow frontmatter explicitly augment the needs list of any compiler-generated job (pre_activation, activation, agent, detection, safe_outputs, conclusion, and any future generated jobs).
The compiler already accepts arbitrary job definitions under jobs:. The proposal is to also honor a needs property when the job name matches a generated job, merging it (additively, de-duplicated) into that job's computed needs:
jobs:
detection:
needs: [select_model]
This gives workflow authors an explicit, per-job escape hatch instead of relying solely on the compiler's implicit scan of engine.env for needs.<job>.outputs.* references.
Motivation
The compiler decides each generated job's needs list on its own. When a workflow defines a custom job (via jobs: or an import) that a generated job must depend on, the only mechanism today is the implicit engine.env scan, and that scan has been implemented job-by-job with gaps that keep surfacing:
Including on.needs for custom jobs results in invalid workflow (#30780) covers the existing on.needs property, which is a narrow, partial version of this idea: it only augments pre_activation/activation, and it is currently buggy (the on.needs value leaks into the compiled workflow, producing invalid YAML). This proposal generalizes the concept to every generated job with a clean per-job syntax and would supersede on.needs.
Current behavior
Today, specifying a generated job name under jobs: is silently ignored. For example, with:
the compiled detection job's needs remains [activation, agent] -- the select_model entry is dropped, with no error or warning.
Suggested semantics
Additive merge: the frontmatter needs is unioned with the compiler-computed needs and de-duplicated; it never removes computed dependencies.
Validation: referenced jobs must exist (a custom job in jobs: or an imported job); otherwise emit a compile error.
Reserved names: for generated job names, honor needs augmentation and reject (or clearly define behavior for) other properties, so authors do not accidentally believe they can redefine a generated job's steps.
Proposal
Let workflow frontmatter explicitly augment the
needslist of any compiler-generated job (pre_activation,activation,agent,detection,safe_outputs,conclusion, and any future generated jobs).The compiler already accepts arbitrary job definitions under
jobs:. The proposal is to also honor aneedsproperty when the job name matches a generated job, merging it (additively, de-duplicated) into that job's computedneeds:This gives workflow authors an explicit, per-job escape hatch instead of relying solely on the compiler's implicit scan of
engine.envforneeds.<job>.outputs.*references.Motivation
The compiler decides each generated job's
needslist on its own. When a workflow defines a custom job (viajobs:or an import) that a generated job must depend on, the only mechanism today is the implicitengine.envscan, and that scan has been implemented job-by-job with gaps that keep surfacing:on.permissions: {}coercion.An explicit, author-controlled
needsaugmentation would have unblocked all three regardless of whether the implicit scan covered that particular job.How this would have provided a workaround for each
jobs.agent.needs: [custom_job]would have added the dependency directly, unblocking the workflow before the Fix agent job needs not populated from engine.env needs expressions #30239 auto-fix landed.jobs.activation.needs: [custom_job]would have added the dependency directly, avoiding the fragileon.permissions: {}coercion.jobs.detection.needs: [select_model]would have added the dependency to the threat-detection job -- the case that currently has no workaround at all.Relationship to
on.needs(#30780)Including on.needs for custom jobs results in invalid workflow (#30780) covers the existing
on.needsproperty, which is a narrow, partial version of this idea: it only augmentspre_activation/activation, and it is currently buggy (theon.needsvalue leaks into the compiled workflow, producing invalid YAML). This proposal generalizes the concept to every generated job with a clean per-job syntax and would supersedeon.needs.Current behavior
Today, specifying a generated job name under
jobs:is silently ignored. For example, with:the compiled
detectionjob'sneedsremains[activation, agent]-- theselect_modelentry is dropped, with no error or warning.Suggested semantics
needsis unioned with the compiler-computedneedsand de-duplicated; it never removes computed dependencies.jobs:or an imported job); otherwise emit a compile error.needsaugmentation and reject (or clearly define behavior for) other properties, so authors do not accidentally believe they can redefine a generated job's steps.needs.<job>.scan.