Skip to content

Check Reusable-Workflow Calls Against the Pinned Callee's Inputs - #4354

Merged
ptr727 merged 11 commits into
developfrom
burndown/r4-workflow-contract-gate
Nov 23, 2026
Merged

ptr727 merged 11 commits into
developfrom
burndown/r4-workflow-contract-gate

Conversation

@ptr727

@ptr727 ptr727 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • New repo-gate check, workflow-inputs. It covers each job-level call of a reusable workflow under the scanned repository's owner, uses: <owner>/<repo>/.github/workflows/<file>@<40-hex>. For each one, the check reads the callee at the caller's own pin through gh api contents. It fails a with: key the callee does not declare there. It also fails an input the callee marks required: true with no default that the caller omits. Names compare case-insensitively.
    • A callee GitHub did not answer for is counted in the check's note rather than failed, as sha-pin treats an unread pin. A 404 is confirmed against the repository before it becomes a finding.
    • Local ./ calls are left to actionlint. A floating ref is counted and left to sha-pin.
    • A Dependabot bump that moves a pin past an input a caller still passes now fails its own pull request rather than the next release dispatch. This is the placement the maintainer chose on No Check Catches a Caller Passing an Input the Pinned Reusable Workflow No Longer Declares #2822.
  • gh_exists is now a thin wrapper over a new gh_read, which also returns the body. Actions and workflows are read through one load_documents, PyYAML in process or the uvx reader otherwise. sha-pin now shares the new unquoted helper.
  • WORKFLOW.md no longer says an operational repository runs no unit tests. Such a repository runs none unless it carries a .NET test project or a Python suite the validator runs, such as one in a directory named in python-directories. Then that suite's csharp or python guarantees apply, D1.6 included. The operational diagram now labels the CI "validation CI" rather than "lint CI". The section 3 edit regenerates the workflow-ci-contract skill's architecture.md include.
  • The repo-gate action's description and validate-task.yml's repo-gate-exclude-globs description now name the new check. Nothing else in either file changes.

Verification

  • 25 new cases in tests/test_repo_gate.py, with every network read replaced by a table.
  • Positive control built from the issue's reproduction: a caller passes nuget: false to build-release-task.yml at current main. The check fails it on nuget and on the required inputs the caller omits.
  • The hub's own catalog snippets hold 8 such calls, and they compare clean.
  • These all pass locally: the full unittest suite, ruff, mypy, scripts/docker_lint.py (actionlint included), scripts/build_dist.py --check, the full repo gate, and the diff-scoped prose gate.
  • A recorded local strict review pass covers each push, and its findings were fixed or are listed below.

Findings from the first push, now fixed

  • The lint job's first Setup uv step skipped callers with no Python directory and no action, leaving the new check without a YAML reader. It now also runs wherever the caller tracks a workflow, and it sets ignore-nothing-to-cache: true (011775b, c3571ee).
  • The reader-missing message named "the action". It now names YAML (fefae2a).

Declined

  • A local-pass design finding said the widened Setup uv if: is always true for a caller, so it reads as a guard that never skips. Declined by the owner's ruling. The condition names what actually triggers the step, and dropping it would be a wider edit to a fleet workflow than the fix needs.

Pre-existing findings, not filed

  • .github/workflows/build-release-task.yml $/ calls of get-version-task.yml and build-docker-task.yml (correctness, unchecked interface). .github/actionlint.yaml suppresses actionlint's error on the $/ form, so no tool compares those calls' inputs. This change leaves $/ calls out of scope.
  • scripts/README.md "repo_gate.py" sha-pin paragraph (false statement). It says the hub's resolution pass covers nothing, but catalog/snippets/workflows/ holds eight same-owner pins.

Also corrected

  • scripts/README.md gains a workflow-inputs bullet.
  • spec/project-types.json branch.operational.lintci and the branching-and-release-model skill no longer say an operational repo runs no unit tests.

Closes on promotion: #2822, #3896

🤖 Generated with Claude Code

ptr727 and others added 5 commits November 22, 2026 15:46
Add a workflow-inputs check to the repo gate. For each job-level call of a
reusable workflow under the scanned repository's owner, it reads the callee
at the caller's own pin and fails a `with:` key the callee does not declare,
and a required input with no default that the caller omits. A callee GitHub
does not answer for is counted in a note rather than failed.

Correct WORKFLOW.md where it says an operational repo runs no unit tests. It
runs none unless it carries a C# or Python test suite, and then that type's
guarantees apply, D1.6 included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Regenerate the workflow-ci-contract architecture include for the WORKFLOW.md
section 3 edit, and name workflow-inputs in the repo-gate action description
and the validate task's exclude-globs input description.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read workflows and actions through one load_documents, move sha-pin onto
unquoted, and correct the workflow-inputs docstring on which calls it reads.
Say an operational repo runs unit tests for a .NET test project or a Python
suite the validator runs, rather than for any C# or Python suite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Count a floating-ref call in the workflow-inputs note, fail a key JSON cannot
hold rather than dropping it, and say true things about $/ calls and the
repeated on: reading. Name the guarantees an operational repo's test suite
brings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 23, 2026 00:14
@ptr727

ptr727 commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head e8d55236b162b7de03969077ed00e977386dc131, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Approval is blocked by an active moderate issue because valid repositories can fail when neither PyYAML nor uvx is available, with an additional nit that reports misleading workflow-reader errors.

2 open issues
What changed in this PR

Adds a repository-gate check that validates pinned reusable-workflow calls against the callee workflow's declared inputs. It also updates operational workflow documentation and regenerates related workflow-contract skill artifacts.

Changes:

  • Adds workflow-inputs scanning, GitHub Contents API reads, YAML loading, caching, and input validation.
  • Adds comprehensive tests for reusable-workflow input behavior, reader fallbacks, pin handling, and repository coverage.
  • Clarifies operational repositories' validation and conditional test guarantees.
  • Updates repository-gate descriptions and generated workflow-contract references.
File Description
WORKFLOW.md Clarifies validation CI and conditional unit-test guarantees for operational repositories.
tests/​test_repo_gate.py Adds comprehensive cases for reusable-workflow input validation, YAML readers, pin handling, and repository coverage.
.github/​workflows/​validate-task.yml Documents the repository-gate exclusion scope including the new workflow-inputs check.
.github/​skills/​workflow-ci-contract/​references/​architecture.md Updates the generated workflow architecture reference.
.github/​actions/​repo-gate/​repo_gate.py Implements pinned reusable-workflow input comparison along with shared GitHub API and YAML-reading helpers.
.github/​actions/​repo-gate/​action.yml Updates the repository-gate action description to include reusable-workflow input validation.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​architecture.md Updates the generated Claude workflow-contract architecture reference.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Refreshes the generated workflow-contract source digest.
.agents/​skills/​workflow-ci-contract/​references/​architecture.md Updates the authored workflow-contract architecture reference.

Review effort: Lite

Comment thread .github/actions/repo-gate/repo_gate.py Resolved
Comment thread .github/actions/repo-gate/repo_gate.py Resolved
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.32%. Comparing base (b38e084) to head (364ce1e).
⚠️ Report is 295 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4354      +/-   ##
===========================================
- Coverage    81.60%   79.32%   -2.29%     
===========================================
  Files           26       45      +19     
  Lines         9070    15997    +6927     
===========================================
+ Hits          7402    12689    +5287     
- Misses        1668     3308    +1640     
Flag Coverage Δ
python-3.13 79.32% <ø> (-2.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

ptr727 and others added 5 commits November 22, 2026 16:35
The reader-missing message and the UvxUnavailable docstring now serve the
workflow-inputs check too, so they name YAML rather than an action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… CI Assertion

The lint job now sets up uv wherever the caller tracks a workflow, since the
workflow-inputs check reads YAML for any caller of a hub workflow. The
branch.operational.lintci assertion now says an operational repo runs unit
tests where it carries a suite the validator runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…own/r4-workflow-contract-gate

# Conflicts:
#	.claude-plugin/fleet-skills/.source-digests/workflow-ci-contract
The lint job's first Setup uv step now ignores an empty cache, since a
caller with no Python directory or action now sets uv up too. Add the
workflow-inputs bullet to scripts/README.md, and correct the
branching-and-release-model sentence that said an operational repo runs no
unit tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 23, 2026
@ptr727

ptr727 commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 364ce1e2368b255d9ad70100ac5c83d52229a661, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 4336d47 into develop Nov 23, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/r4-workflow-contract-gate branch November 23, 2026 01:45
ptr727 added a commit that referenced this pull request Nov 23, 2026
…afe Commands, and Workflow Input Check (#4368)

Promotes the eleven pull requests that landed on develop since the last
promotion.

- #4348: Say where a reviewer's clean pass leaves its record.
`pr-review-conduct` "Silence is not evidence" now states that a clean
pass can leave an empty-bodied review or, for CodeRabbit, only a summary
comment line.
- #4351: Count a CodeRabbit clean pass its summary alone records.
`side_answered` and `side_rounds` read the summary comment, so `wait`
stops re-requesting a head CodeRabbit already passed.
- #4346: Detect and report a one-off rather than correct it by code, and
let a rollback carry a `Reopens on promotion:` line (operational
repositories). `add-host-tool` now reports a shadowing copy instead of
removing it.
- #4349: Declare a `publicInteraction` policy per repository in the
registry and apply and check it from `repo-config/configure.sh` (GitHub
interaction limit, Discussions off by default).
- #4352: The PowerShell install stops on a refusal, a tool with no
Microsoft feed fails alone while the run continues, and an unmanaged
`gh` or `op` in install mode says `--upgrade` moves it.
- #4353: Copy-and-run commands in Markdown are paste-safe, with a new
"Copy-and-Run Commands" rule, a generated include in
`comment-and-doc-style`, and a default `paste-safe` prose gate rule.
- #4350: Register every Claude Code hook the host-safety kit installs in
exec form on all platforms, and rewrite shell-form registrations. This
edits the agent's own guard.
- #4354: A new repo-gate check, `workflow-inputs`, compares each
reusable-workflow call's `with:` keys against the callee at the caller's
pin.
- #4357: Quote the remaining paste-safe commands in the repo-config docs
and update the stale PowerShell feed comment, the fix for the
promotion's own lint failure and Copilot thread.
- #4358: Keep the tilde outside the quotes in the base-clone
placeholders and keep the probe executable and arguments as separate
tokens, the fix for the five Copilot findings on this promotion, plus
the AUDIT.md interaction-check coverage and the repo-gate docstring
wrap.
- #4359: Keep the tilde outside the quotes in the remaining base-clone
placeholders, the sibling sweep of the same defect.

## Owed by the maintainer before rollout

From #4349:

- Run the live `repo-config/configure.sh apply` on each repository.
Until it runs, `configure.sh check` and the audit flag the public
repositories.
- Confirm that Copilot, CodeRabbit, Qodo and Dependabot still work under
the interaction limit.
- Update other repositories' README links to Discussions, since
Discussions go off by default.

From #4353: it changed carried text, so a fleet resync is owed.

## Local-pass findings

Class and disposition for the four findings the recorded local pass
raised on the earlier head:

- `host-setup/linux/install-tools.sh` removal code
(`powershell_remove_non_apt`, `remove_unowned_command`,
`op_remove_download`, docker and shadow removals) against the one-off
rule, class `introduced`: tracked by #4347, not this pull request.
- `Reopens on promotion:` exists for operational repositories only,
class `introduced`: declined under the maintainer's answer on #4175,
which places the rule in "Operational Repositories".
- `AUDIT.md` does not list the interaction-limit check, class
`introduced`: fixed in #4358.
- `repo_gate.py` `check_workflow_inputs` docstring lines over the line
length, class `introduced`: fixed in #4358.

Fixes #4170
Fixes #4175
Fixes #4329
Fixes #4172
Fixes #4124
Fixes #2596
Fixes #4040
Fixes #2822
Fixes #3896

Supersedes #4356 because of the `.github/workflows/validate-task.yml`
Dependabot conflict (the `astral-sh/setup-uv` pin bump on main beside
the `if:` condition #4354 changed on develop), resolved from develop's
side as a strict superset of main's. The merged tree equals develop's.
This also carries #4365, #4366 and #4367, the fixes for findings raised
on #4356; none of them closes an issue.

## Findings on this promotion's head

Local pass over the whole `main` diff (four findings) and the Copilot
round (two threads):

- `configure.sh` `publicInteraction` lookup matches the registry name
exactly while apply's guard matches case-insensitively, class
`introduced` (#4349): declined with evidence. A name differing only in
letter case makes `spec/resolve_description.py` exit 1 at `configure.sh`
line 331, before `cmd_apply` or any `gh api --method` call, so no limit
is written on the wrong value. Checked by running the lookup on sample
JSON, and no write is reachable.
- The ungrammatical `hook the host keeps of its own` phrase (Copilot
thread), class `introduced` (#4350): fixed in #4369 into develop.
- Copilot's README Discussions thread: declined with evidence, the
canonical-link list names a link when present and does not require it,
and #4349 turned Discussions off.
- `Reopens on promotion:` scoped to operational repositories, class
`introduced`: declined under the maintainer's answer on #4175, which
places the rule in "Operational Repositories".
- `add-host-tool` detect-and-report against the installer's removal
code, class `introduced` (#4352 and #4346): tracked by #4347, not this
pull request.
- The interaction-limit precondition is not enforced by `apply`: tracked
by #4364.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants