Skip to content

feat(generate): emit the opt-in reconcile companion - #478

Merged
joshua-temple merged 12 commits into
mainfrom
feat/reconcile-companion
Jul 6, 2026
Merged

joshua-temple merged 12 commits into
mainfrom
feat/reconcile-companion

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

The reconcile command exists, but a user repo had no automated way to run it when an external bump changed a governed action pin in a generated workflow. They had to invoke it by hand.

Fix

Adds an opt-in reconcile: config block and, when enabled, emits two workflow files:

  • cascade-reconcile-check.yaml: a fork-safe pull_request detector that runs cascade reconcile --check and uploads a data-only relevance artifact with a read-only token.
  • cascade-reconcile-companion.yaml: a workflow_run companion that runs against the base definition when the detector reports a governed pin changed. It resolves the PR from trusted workflow_run metadata, fetches a pinned released binary, reads the head files as data, runs reconcile, and pushes the regenerate commit.

Commit routing: append (default) pushes onto the PR head branch, with a sticky-comment fallback for forks; followup opens a separate PR from a cascade-owned branch. A fork PR is never pushed in place. The companion carries the three loop guards (idempotent apply, push-only-if-diff, fresh-tip non-fast-forward abort).

The block is additive at schema_version: 1. source selects the change source (dependabot default) and keeps the lane adapter-shaped.

Verification

  • go build ./..., go test ./... (2431 passed), golangci-lint run ./... clean; actionlint clean across all three commit modes.
  • New act-driven e2e TestReconcileCompanionAppendsOnSameRepoPR drives the emitted companion through a real Gitea PR and workflow_run event and asserts the bump is pushed and survives regeneration (runs in the CI e2e shard).
  • Docs updated in this PR: configuration.md (reconcile block), workflows.md (detector and companion), coverage-matrix.md (rows), README.md. Docs site builds.
  • Independent review passed (security, injection-safety, fork-safety, loop-termination all verified).

Closes #443. Part of #440.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
act strips the reserved $GITHUB_API_URL from run: step shells for a synthetic workflow_run event, so the mock resolve step's curl saw an empty base URL and exited 3 (malformed URL). Pass the Gitea API base as CASCADE_API_URL, the same custom-name mechanism the repo full name already uses, so it survives into the shell.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
act cannot emulate a workflow_run companion end to end: it resolves no marketplace or composite action without a real server to clone from, and it does not carry a run: step's API base for a synthetic workflow_run event, so the mock resolve step's curl exits 3. The emitted companion is covered by the generator unit tests plus actionlint, with true end-to-end proof from the fleet and cascade's own self-heal companion on real GitHub.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
… act scenario

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 8362fd4 into main Jul 6, 2026
21 checks passed
@joshua-temple
joshua-temple deleted the feat/reconcile-companion branch July 6, 2026 04:43
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.

emit a relevance-triggered reconcile job into generated pipelines

1 participant