Repository navigation
fix(autopilot): align worker and PR body contracts - #3419
Daniel Meppiel (danielmeppiel) merged 15 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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 <[email protected]>
Advisory review: PR #3419 (fix(autopilot): align worker and PR body contracts)panel-mode=lean; personas=doc-writer lens, test-coverage lens, apm-ceo lens (applied inline by the orchestrator; no subagent fan-out). Headline: The change is bounded to the five repairs in #3418 ( Findings checked against the diff
Recommended follow-ups (non-blocking)
Ship recommendation: CODEOWNERS (
|
Resolve apm.lock.yaml conflicts surgically: keep main's lock and refresh only the records for packages this PR changes (autopilot-issue-triage-worker, autopilot-pr-review-worker, autopilot-pr-triage-worker, pr-description-skill), including the two new check_required_agents.py deployments. apm audit --ci passes with no drift. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Doc Writer | 0 | 3 | 0 | All five repairs are documented. Gaps: preflight missing from both execution checklists, diagram rules use three strengths, CHANGELOG omits the schema fix. |
| Test Coverage Expert | 0 | 1 | 0 | All five #3418 done-when clauses map to regression traps; one cross-package identity assertion for the shared preflight script is missing. |
| Supply Chain Security Expert | 0 | 1 | 0 | No blocking supply-chain risks. Mermaid pin adequate for validation-only scope; checker is input-safe; lockfile diff clean. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [Test Coverage Expert] Add a byte-identity assertion between the two
check_required_agents.pysource copies (issue-triage and pr-review). -- Divergence would silently break fail-closed consistency. In scope. - [Doc Writer] Add the persona preflight as an explicit numbered step in both workers' ordered execution checklists. -- An agent following only the checklist never runs the preflight. In scope.
- [Doc Writer] Unify the diagram requirement to one canonical rule: required when structure is non-trivial, optional otherwise. -- SHOULD / requires / only-when still compete across pr-description-skill. In scope.
- [Doc Writer] CHANGELOG: name PR triage specifically and mention the schema rubric-path removal. -- Fold with the duplicate
### Fixedheading fix. In scope. - [Supply Chain Security Expert] Vendor mermaid-cli behind a package.json + package-lock.json or a frozen image to pin transitive deps. -- Defer: new npm infrastructure outside [BUG] Align five Autopilot and PR-description package contracts #3418 scope.
Recommendation
All five #3418 repairs land with passing regressions and no blocking findings. Fold the first four follow-ups into this PR before merge -- they are in-scope completions, not new work. Defer the mermaid-cli transitive-dependency lockfile to a separate issue since it introduces npm infrastructure outside the #3418 boundary.
Full per-persona findings
Doc Writer
- [recommended] The persona preflight (
check_required_agents.py) is not a step in either worker's ordered execution checklist. atpackages/autopilot/autopilot-issue-triage-worker/SKILL.md:381
Both workers describe the preflight only in reference sections; an agent following only the checklist never runs it.
Suggested: Add an explicit preflight step after roster/persona selection and before persona reads or fan-out. - [recommended] pr-description-skill gives three different strengths for diagrams: SHOULD, requires, and "only when". at
packages/pr-description-skill/assets/section-rubric.md:152
The rubric final pass reads as a ban on diagrams for simple PRs.
Suggested: One canonical rule: required when non-trivial; optional for simple, docs-only, and mechanical PRs. - [recommended] The CHANGELOG entry omits repair 5 and attributes the old
status/deferredwrites to all workers. atCHANGELOG.md:12
Only autopilot-pr-triage-worker wrotestatus/deferred.
Suggested: Name PR triage and the schema fix when moving the bullet into the existing Fixed block.
Test Coverage Expert
- [recommended] No byte-identity assertion between the two
check_required_agents.pysource copies. attests/unit/test_triage_fetch_queue.py:286
Per-package deployed-vs-source checks would not catch divergence between packages.
Suggested: Assert the two source copies are byte-identical.
Proof (missing at):tests/unit/test_triage_fetch_queue.py::test_queue_helpers_match_across_schedulers_and_worker_contract-- proves: Both workers use identical preflight logic so the fail-closed mechanism behaves consistently. [governed-by-policy,multi-harness-support]
Supply Chain Security Expert
- [recommended]
npx --yes -p @mermaid-js/[email protected]pins the direct package but transitive deps resolve at run time. atpackages/pr-description-skill/SKILL.md:259
12.0.0 is published and satisfies "pinned"; low practical risk for a validation-only dev tool.
Suggested: Track as a follow-up: package.json + package-lock.json or a frozen container image.
The CODEOWNERS review request (Daniel Meppiel (@danielmeppiel)) is unchanged.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Move the entry into the existing Unreleased Fixed block (the PR had added a second Fixed heading with no blank line before Added), name PR triage as the only former status/deferred writer, and mention the panelist schema rubric-path fix. Addresses panel follow-up FU-4 (doc-writer). Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
The issue-triage and PR-review workers ship byte-identical copies of check_required_agents.py, but nothing cross-checked the two sources, so one could drift while each deployed copy still matched its own source. Mutation-break: appending a line to one copy fails the test. Addresses panel follow-up FU-1 (test-coverage-expert). Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Both workers described the persona preflight only in reference prose, so an agent following the ordered execution checklist could skip it. Add an explicit step 2b before persona reads / fan-out. In pr-description-skill, state one rule (diagrams required when structure or control flow is non-trivial, optional otherwise) across the principle, ceilings table and rubric, and restore the dropped 'verbatim quote from' in the skill description. Redeploy managed copies; lock records change only for the three touched packages. Mutation-break: removing either 2b step or reverting the rubric wording fails the contract tests. Addresses panel follow-ups FU-2 and FU-3 (doc-writer). Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Keep #3636's theme/* -> pillar/* migration and this PR's contract repairs. apm.lock.yaml: main's lock with only the four touched packages' records and the two check_required_agents.py deployments refreshed; apm audit --ci passes with no drift. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Clean merge of #3644 and #2030; no lockfile or autopilot package changes. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Doc Writer | 0 | 0 | 0 | FU-2, FU-3 and FU-4 are resolved. The folds introduce no new contradictions or broken step references. |
| Test Coverage Expert | 0 | 0 | 0 | FU-1, FU-2 and FU-3 are resolved with mutation-tight assertions; the pillar-label rename is covered by test_triage_advisory.py. |
| Supply Chain Security Expert | 0 | 0 | 0 | Lockfile delta vs main is limited to the four touched packages plus two checker deployments with identical hashes; no owner/license/source/target changes. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 1 follow-ups
- [Supply Chain Security Expert] Vendor mermaid-cli behind a package.json + package-lock.json or a frozen container image to pin transitive deps. -- Transitive dependencies still resolve at npx time; low practical risk for a validation-only tool. Deferred: new npm lockfile infrastructure is outside the [BUG] Align five Autopilot and PR-description package contracts #3418 scope.
Recommendation
Every in-scope follow-up from the prior advisory is folded, mutation-tested, and verified by the persona that raised it. The one remaining item (mermaid-cli transitive-dependency lockfile) is outside the #3418 boundary and needs its own follow-up issue. It is not a reason to hold this PR.
Folded in this run
- FU-4 CHANGELOG under existing Unreleased Fixed, names PR triage and the schema fix -- resolved in 70f0408
- FU-1 byte-identity test for both
check_required_agents.pysources -- resolved in ed5572a - FU-2 explicit step 2b persona preflight in both execution checklists; FU-3 one conditional diagram rule plus restored skill description -- resolved in 7f6a2a7
- Lockfile conflicts with main resolved surgically (e8f3c57, 9737076);
apm audit --cipasses with no drift
Copilot signals reviewed
- r4419928873 (CEO load path vs preflight path): LEGIT, resolved in f08430d by the author
- r4419928897 (template claimed
status/deferred): LEGIT, resolved in f08430d by the author
Lint evidence: ruff 0.15.12 check + format, pylint R0801 (10.00/10), lint-auth-signals, lint-architecture-boundaries all clean at 100aca5; 74 targeted tests pass.
CI evidence: all checks green at 9737076 (25 checks); CI on 100aca5 (clean main merge only) is in progress.
| PR | head | stance | iterations | folds | deferrals | copilot rounds | ci | mergeable | merge state | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #3419 | 100aca5 | ship_now | 1 | 4 | 1 | 2 | yellow | MERGEABLE | BLOCKED | pending required review |
Full per-persona findings
Doc Writer
No findings.
Test Coverage Expert
No findings.
Supply Chain Security Expert
No findings.
The CODEOWNERS review request (Daniel Meppiel (@danielmeppiel)) is unchanged.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Resolve packages/autopilot/README.md by keeping both intents: status/deferred stays human-owned (PR triage only recommends it), and #3105's autopilot-issue-accept exception for adding status/accepted after a roster human approves is preserved. Lockfile auto-merged; apm audit --ci passes with no drift. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Clean merge of eight main commits (#3408, #2231, #2602, #3640, #3611, #3645, #3602, #3646); no lockfile or autopilot package conflicts and apm audit --ci passes with no drift. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Pick up the main hotfix for the root-help truncation failure; clean merge, no lockfile or autopilot package changes. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
Clean merge of #3599, #3647, #3650, #2933; no lockfile or autopilot package conflicts. Co-authored-by: sergio-sisternes-epam <[email protected]> Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Doc Writer | 0 | 0 | 0 | Merge resolution is clean: README keeps status/deferred human-owned with advisory-only deferral and keeps the issue-accept exception; dev guide and CHANGELOG agree. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 1 follow-ups
- [Supply Chain Security Expert] Vendor mermaid-cli behind a package.json + package-lock.json or a frozen container image to pin transitive deps. -- Deferred: new npm lockfile infrastructure is outside the [BUG] Align five Autopilot and PR-description package contracts #3418 scope.
Recommendation
The merge-main resolution is clean, and the delta panelist confirmed it. All earlier in-scope follow-ups (FU-1 to FU-4) remain folded and tested. The only deferred item (FU-5, the mermaid-cli transitive-dependency lockfile) is unchanged and needs its own follow-up issue. It is not a reason to hold this PR.
Lint evidence: ruff 0.15.12 check + format, pylint R0801 (10.00/10), lint-auth-signals, lint-architecture-boundaries clean at 04151d7; 91 targeted tests pass; apm audit --ci no drift.
CI evidence: all checks green at 04151d7 (25 checks); license/cla SUCCESS; 0 unresolved review threads.
| PR | head | stance | iterations | folds | deferrals | copilot rounds | ci | mergeable | merge state | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #3419 | 04151d7 | ship_now | 2 | 4 | 1 | 2 | green | MERGEABLE | BLOCKED | pending required review |
Full per-persona findings
Doc Writer
No findings.
The CODEOWNERS review request (Daniel Meppiel (@danielmeppiel)) is unchanged.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
…ew-fixes Co-authored-by: Copilot App <[email protected]>
Avoids landing-order conflicts with other queued PRs. Co-authored-by: Copilot App <[email protected]>
Lane L: main merged for landing
This comment was generated by an AI agent (Lane L landing desk) on behalf of Daniel Meppiel (@danielmeppiel). |
Bring in #3626, #3419 and #3641. Move this PR's CODEX_HOME CHANGELOG bullet off the Fixed section tail, where new entries land, to avoid repeat append conflicts. Co-authored-by: Copilot App <[email protected]>


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/[email protected].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 [email protected]