Other repositories call the propose and apply workflows
accepted ADR-0004 local/ADR-0004-other-repositories-call-the-propose-and-apply-workflows
Status
Section titled “Status”Accepted
Context
Section titled “Context”ADR-0002 and ADR-0003 gave this repository two labels: one gets a change proposal drafted from an issue, the other starts an apply session on an approved pull request. The experiment worked. Other repositories of the same maintainer want the same path: the governance source, the pilot repositories and several open source projects. They do not all use the same change framework.
Most of the two workflows is security posture: the agent never holds a write token, the command line it runs belongs to root, and the job that writes accepts only new planning files. Copied into each repository, that posture drifts copy by copy.
Decision
Section titled “Decision”propose.ymlandapply.ymlstay in this repository and gain aworkflow_calltrigger. Other repositories call them by commit SHA. This repository keeps running them on its own issues and pull requests.- The frameworks the agent may write for form a closed catalog written in
propose.yml. A caller enables entries by name. It never passes a path, a pattern or a tool rule. Each entry fixes the agent’s tool rules, the command line installed and what the job that writes accepts. A new framework joins the catalog through a pull request to this repository. - A run fails before the agent starts when the caller’s
changestrait names a framework the caller did not enable. - The labels are inputs, with
ontrack:proposeandontrack:applyas defaults. The apply routine and the token that fires it are passed explicitly, never withsecrets: inherit. - ADRs are added in
docs/adr, the directory ADR-0001 of the governance source names. A caller cannot choose another one.
Consequences
Section titled “Consequences”Positive
Section titled “Positive”- The security posture is maintained once. A fix reaches every caller as a Dependabot pull request.
- No caller can widen what the agent may write.
- No new repository and no new dependency: every caller already uses
ontrack, whose
AGENTS.mdthe workflows read.
Negative
Section titled “Negative”- Callers bump the workflows with each release of ontrack, including releases that only change the command line.
- A change to the catalog or to the inputs that breaks callers is a major version of ontrack.
- A caller grants the union of the jobs’ permissions. The separation that makes this safe is only visible in this repository.
- Each caller needs its own federation rule with the model provider.
Neutral
Section titled “Neutral”- Spec Kit and home-grown frameworks are not in the first catalog. Each one joins when a calling repository needs it.
Alternatives Considered
Section titled “Alternatives Considered”- A dedicated repository. Independent versions, but a second dependency for every caller and the history split in two. It becomes worth it the day a caller wants the workflows without ontrack.
- The governance source. It keeps rules and their implementation
together, but the workflows depend on ontrack’s
AGENTS.mdand onontrack check, not on the rules. - A composite action. A composite action runs inside one job, and the separation between the job that runs the agent and the job that writes needs two.
- Paths or patterns passed by the caller. Rejected: the filter is the only barrier between an issue written by anyone and the branch. A filter supplied by each caller is reviewed by nobody.
References
Section titled “References”- ADR-0002
- ADR-0003
- Forge and continuous integration
- Changes
openspec/changes/reusable-propose-apply-workflows/- trivoallan/ontrack#152
