Repository navigation
fix(autopilot): align worker and PR body contracts - #3419
Open
Sergio Sisternes (sergio-sisternes-epam) wants to merge 3 commits into
Open
Sergio Sisternes (sergio-sisternes-epam) wants to merge 3 commits into
Sergio Sisternes (sergio-sisternes-epam) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio Sisternes (sergio-sisternes-epam)
requested a review
from Daniel Meppiel (danielmeppiel)
as a code owner
October 30, 2026 02:31
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Sergio Sisternes (sergio-sisternes-epam)
October 30, 2026 02:31
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The review worker can pass preflight but fail to load its mandatory synthesizer due to mismatched paths, while the triage template can falsely claim a human-owned label is present.
2 open issues
What changed in this PR
This PR addresses the five package-contract inconsistencies in #3418, aligning APM’s Autopilot guidance with human-owned decisions, explicit persona prerequisites, and conditional PR diagrams.
Changes:
- Removes automated deferral-label instructions and adds missing-persona preflight checks.
- Pins Mermaid CLI, makes diagram requirements conditional, and removes the stale review-schema rubric path.
- Adds regression coverage and refreshes documentation, managed skill copies, and deployment records.
| File | Description |
|---|---|
tests/unit/test_workflow_actor_contract.py |
Adds contract assertions and persona-check subprocess coverage. |
packages/pr-description-skill/SKILL.md |
Pins Mermaid validation and makes diagrams conditional. |
packages/pr-description-skill/assets/section-rubric.md |
Updates diagram acceptance criteria. |
packages/pr-description-skill/assets/pr-body-template.md |
Allows omission of optional diagrams. |
packages/pr-description-skill/apm.yml |
Updates the package description. |
packages/autopilot/README.md |
Documents human-owned deferral and persona prerequisites. |
packages/autopilot/autopilot-pr-triage-worker/.apm/skills/autopilot-pr-triage-worker/SKILL.md |
Prohibits automated deferral-label writes. |
packages/autopilot/autopilot-pr-review-worker/SKILL.md |
Declares companion personas and preflight requirements. |
packages/autopilot/autopilot-pr-review-worker/scripts/check_required_agents.py |
Reports available and missing review roles. |
packages/autopilot/autopilot-pr-review-worker/assets/panelist-return-schema.json |
Removes the stale rubric path while preserving the enum. |
packages/autopilot/autopilot-pr-review-worker/apm.yml |
Documents companion prerequisites in comments. |
packages/autopilot/autopilot-issue-triage-worker/SKILL.md |
Normalizes persona paths and requires preflight checks. |
packages/autopilot/autopilot-issue-triage-worker/scripts/check_required_agents.py |
Reports available and missing triage roles. |
packages/autopilot/autopilot-issue-triage-worker/apm.yml |
Documents companion prerequisites in comments. |
docs/src/content/docs/contributing/development-guide.md |
Explains deferral ownership and missing-persona stops. |
CHANGELOG.md |
Records the contract repairs under Unreleased. |
apm.lock.yaml |
Refreshes hashes, checker records, and deployment targets. |
.agents/skills/pr-description-skill/SKILL.md |
Refreshes deployed diagram guidance. |
.agents/skills/pr-description-skill/assets/section-rubric.md |
Refreshes deployed acceptance criteria. |
.agents/skills/pr-description-skill/assets/pr-body-template.md |
Refreshes the deployed optional-diagram template. |
.agents/skills/pr-description-skill/apm.yml |
Refreshes the deployed package description. |
.agents/skills/autopilot-pr-triage-worker/SKILL.md |
Refreshes deployed deferral-label restrictions. |
.agents/skills/autopilot-pr-review-worker/SKILL.md |
Refreshes deployed persona and preflight guidance. |
.agents/skills/autopilot-pr-review-worker/scripts/check_required_agents.py |
Deploys the review-role checker. |
.agents/skills/autopilot-pr-review-worker/assets/panelist-return-schema.json |
Refreshes deployed schema descriptions. |
.agents/skills/autopilot-pr-review-worker/apm.yml |
Refreshes prerequisite comments. |
.agents/skills/autopilot-issue-triage-worker/SKILL.md |
Refreshes deployed persona paths and preflight guidance. |
.agents/skills/autopilot-issue-triage-worker/scripts/check_required_agents.py |
Deploys the triage-role checker. |
.agents/skills/autopilot-issue-triage-worker/apm.yml |
Refreshes prerequisite comments. |
Review effort: Balanced
Address review feedback by aligning the synthesizer path with preflight, removing the false deferred-label template claim, and retaining explicit preflight helper coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


fix(autopilot): align worker and PR body contracts
Description
TL;DR
This PR fixes five source-backed inconsistencies in Autopilot worker packages and the PR-description skill. Human-owned deferral labels remain advisory-only, workers stop when active companion personas are missing, Mermaid validation is pinned, diagram requirements are conditional, and the review schema no longer points to an undeployed rubric path.
Problem (WHY)
The same review found a floating Mermaid CLI invocation and an unsupported rubric path in the panelist schema; the Approach and Implementation sections identify those exact surfaces.
Approach (WHAT)
status/deferredadvisory-only in PR triage.@mermaid-js/mermaid-cli@12.0.0.Implementation (HOW)
.github/agents/companions. Added a deterministic preflight script to each standalone package; missing active roles are reported before advice or fan-out. Updated both manifests, deployed skill copies, and the lockfile.tests/unit/test_workflow_actor_contract.py.Unreleasedentry for this repair PR.Diagrams
This flow shows the new preflight boundary: all active roles are checked before a worker can continue.
flowchart LR Start[Resolve active roles] --> Check{All role files exist?} Check -- Yes --> Continue[Read personas and run full panel] Check -- No --> Missing[Report every missing role] Missing --> Stop[Stop before advice or fan-out]This flow distinguishes an advisory deferral recommendation from the human-owned label decision.
flowchart LR PR[No accepted linked scope] --> Advice[Recommend needs-issue] Advice --> Comment[Explain human review is required] Comment --> Decision{Human chooses deferral?} Decision -- Yes --> Apply[Human applies status/deferred] Decision -- No --> Leave[Leave the label unchanged]Trade-offs
npxworkflow; no global installation or unrelated dependency-management system is added.Benefits
status/deferred; the human decision boundary matches the shared label contract.Validation
uv run --extra dev pytest tests/unit/test_workflow_actor_contract.py -quv run --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ && uv run --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ && uv run --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ && bash scripts/lint-auth-signals.shuv run apm audit --ciThe environment did not provide the optional
microsoft/.github-privatepolicy, so organization policy enforcement was skipped by the audit.uv run apm install --refresh --target agent-skills,copilot --forcecd docs && npm run buildScenario Evidence
status/deferredlabel.tests/unit/test_workflow_actor_contract.py::test_pr_triage_never_writes_human_deferred_label(regression-trap for #3418)tests/unit/test_workflow_actor_contract.py::test_external_persona_preflight_fails_closed_for_clean_consumers(regression-trap for #3418)tests/unit/test_workflow_actor_contract.py::test_pr_description_diagrams_are_conditional_and_cli_is_pinned(regression-trap for #3418)tests/unit/test_workflow_actor_contract.py::test_pr_review_schema_has_no_undeclared_rubric_path(regression-trap for #3418)How to test
uv run --extra dev pytest tests/unit/test_workflow_actor_contract.py -q; confirm all 18 contract tests pass.uv run apm audit --ci; confirm all 10 deployment-integrity checks pass.cd docs && npm run build; confirm the Starlight build and relative-link check pass..github/agents/<slug>.agent.md, and confirm the worker stops with the missing role named.ready: true.Issue and approved scope
Issue: Fixes #3418
Human scope-approval comment: apm-scope:v1 approval
Does this PR complete the issue, or what remains? This PR completes the five bounded repairs and their regression coverage.
Type of change
Testing
Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual in the
development guide:
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com