Repository navigation
fix(ci): align generated skill repair with explicit overwrite consent - #3337
Conversation
Keep ordinary reinstall user-edit protection and original receipt hashes load-bearing before requesting existing --force for deliberate model repair. Preserve the exact restoration oracle and production policy. Refs #3333. Builds on the existing lifecycle model and #3313 preservation contract; this correction does not attribute its authorship to those contributors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 337e55e8-b963-423c-a2f2-28818a17a2cf
Keep the existing prune/readd/install/repair spine. Ordinary install must refuse retained unmanaged content without changing durable state; explicit repair restores it with existing overwrite consent. Refs #3333. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 337e55e8-b963-423c-a2f2-28818a17a2cf
Require the unmanaged-file diagnostic, not an arbitrary failure, before the explicit repair transition. Refs #3333. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 337e55e8-b963-423c-a2f2-28818a17a2cf
Docs sync advisoryVerdict: no_change * Pages affected: 0 additional * LLM calls: 1/15 * Took: 0.02s for deterministic L0/schema validation The five-file diff at The classifier task lacked repository-reading tools. The orchestrator therefore executed the canonical deterministic path gate and validated its result against the classifier schema directly. The timing above excludes queue time and that attempted task; this path classification is not a second narrative or code review. Generated by docs-sync. This comment is AI-generated and may contain errors. |
There was a problem hiding this comment.
🟢 Approval recommended
The bounded test and documentation changes preserve existing production protections and restoration checks, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Corrects the generated lifecycle tests for #3333 to match existing skill-edit protection without changing production behavior or overwrite policy.
Changes:
- Verify ordinary reinstall preserves edited skill bytes and deployment hashes.
- Assert post-prune unmanaged-file refusal, and use explicit
--forceconsent for deliberate repair while retaining exact-byte restoration checks. - Correct CI documentation to distinguish skill preservation from restoration of other managed outputs.
| File | Description |
|---|---|
tests/integration/test_generated_lifecycle_state_machine.py |
Aligns reinstall, refusal, and repair transitions with existing protections. |
docs/src/content/docs/integrations/ci-cd.md |
Clarifies skill preservation alongside audit-only CI guidance. |
docs/src/content/docs/enterprise/enforce-in-ci.md |
Removes the claim that install overwrites every managed file. |
docs/src/content/docs/enterprise/drift-detection.md |
Distinguishes instruction restoration from edited-skill preservation. |
docs/src/content/docs/contributing/integration-testing.md |
Documents preservation, retained-file refusal, and explicit repair assertions. |
Review effort: Balanced
Merge Master assessment: ship_nowReviewed exact head The existing independent code-reviewer report covers the complete five-file diff. I verified its source binding, the actual test evidence and unchanged production tree/restoration invariant. Ordinary reinstall preserves edited bytes and deployment hashes; ordinary post-prune install still refuses the unmanaged file; only deliberate repair requests existing Retained exact-head evidence includes 141 passed, zero failures/skips, including all six lifecycle variants and related protection controls. Removing only repair consent produced three expected original byte-oracle failures, followed by restoration and the passing run. Current canonical lint and strict owner-v2 verification pass with terminal evidence required and zero touched owners. These are owned installed-source-CLI results on macOS ARM64, not native-client or packaged-binary qualification. Own PR CI and merge gate completed successfully at this head. The new Copilot review submitted at 21:19:36Z reports no open issues and no inline findings; its state is COMMENTED, not formal approval. Neutral checks and skipped documentation deployment are not test passes. Actual main The historical extra closing reference was corrected before release; the current sole closing relationship is #3333. The original Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
Description
TL;DR
Align the six generated lifecycle replays with APM's existing skill-edit protection: ordinary reinstall preserves edited bytes and original deployment hashes; deliberate repair requests existing
--forceconsent. Preserve the exact restored-byte oracle and the prune/readd/install/repair sequence, including refusal when the retained file is no longer managed. Production code, overwrite policy, and native-client trust are unchanged.Warning
This is a bounded CI fixture correction, not a claim that all main CI is green. The other 110 failures in the observed Linux ARM run remain outside this PR; Linux x86 was cancelled, not passed. Draft status retains independent Merge Master qualification and actual PR gates.
Problem (WHY)
# user tamper\n, ran ordinary install, and marked the skill clean. The unchanged exact-byte oracle then failed because production correctly preserved the edit.The correction follows execution evidence rather than changing the protection to satisfy a stale expectation: Agent Skills, "Read agent execution traces, not just final outputs.". The original public failure is recorded in #3333 and run 39658810082.
Approach (WHAT)
--forceonly in deliberate repair, then retain exact restoration, installed-lock, containment, ownership, frozen, prune, and audit assertions.Implementation (HOW)
tests/integration/test_generated_lifecycle_state_machine.pydocs/src/content/docs/contributing/integration-testing.mddocs/src/content/docs/enterprise/drift-detection.mddocs/src/content/docs/enterprise/enforce-in-ci.mddocs/src/content/docs/integrations/ci-cd.mdDiagram
The changed model transitions now distinguish edited managed content from a retained user file; production protection remains unchanged.
stateDiagram-v2 [*] --> ManagedClean ManagedClean --> ManagedEdited: tamper ManagedEdited --> ManagedEdited: ordinary reinstall preserves bytes and hash ManagedEdited --> ManagedClean: explicit repair with --force ManagedEdited --> RetainedUserFile: prune removes ownership RetainedUserFile --> RetainedUserFile: readd then ordinary install refuses RetainedUserFile --> ManagedClean: explicit repair with --force note right of ManagedEdited NEW model checks and explicit repair consent. Production protection is unchanged. end noteTrade-offs
Benefits
Issue and approved scope
Fixes #3333.
Human scope-approval comment: no separate public approval-comment record is claimed. The issue records the maintainer's continuing direct CI-fix mandate, bounded scope, exclusions, and review contact Daniel Meppiel (@danielmeppiel). No
status/acceptedlabel or human approval record was manufactured.This PR covers the issue's six-case model/docs correction and its local acceptance evidence. The newly exposed retained-file refusal is within the same mandatory project sequence; coordinator direction confirmed preserving that step and asserting refusal rather than skipping it or forcing ordinary install. Actual PR gates and exclusive Merge Master qualification remain outstanding at draft creation. The issue stays open until landing; the broader CI mission also requires nonpublishing validation of the actual landing SHA.
This is the sole primary corrective carrier, not a replacement for #3325 (already merged) or #3248 (already completed). Existing lifecycle/frozen work, including #2384 by Sebastian Alpers (@salpers), and skill protection in #3313 retain their attribution and ancestry; their contributors are not presented as authors of this correction.
Type of change
Testing
Validation evidence
Exact head:
5fb7f2771d5239fceb9b2b6e93aff9a65bef838e, composed with freshly fetched public main3b9a8503e0bf5978253f769f823bb84340edfc4a. Owned.venv, CPython 3.12.10, macOS ARM64. Parent import, installedapmshebang, isolated-child interpreter/import, and CLI version were checked against this checkout. The exact restoration invariant and all production source bytes are unchanged.Every pytest, mutation, quality, and diagram-validation command ran through the campaign's automatic two-slot
run-heavy.py --lane ci-skill-repair --timeout 1800 --gate. No source edits occurred while queued or running. No native runtime bootstrap or borrowed environment was used.Exact affected-suite command and result
With
APM_E2E_TESTS=1andAPM_BINARY_PATH="$PWD/.venv/bin/apm", the gated command was:Zero skipped, failed, or errored cases. This includes both generated and mandatory replay functions for project/global-canonical/global-aliased, the load-bearing
[edited]member-copy case, shared-skill user preservation, preflight controls, existing architecture mutation traps, and the quality suite.Negative proof and retained execution history
The mutation changes only
self._run((*self.fixture.install_args, "--force"), "repair")toself._run(self.fixture.install_args, "repair"). Run the same gated pytest invocation selectingtests/integration/test_generated_lifecycle_state_machine.py::test_generated_lifecycle_mandatory_replay, with--basetemp=.../consent-removal-5fb7f2771and--junitxml=.../consent-removal-5fb7f2771.xml.All three failures reached the unchanged
assert self.skill_path.read_bytes() == expectedoracle with# user tamper\n: project step 6, global step 37. Restoring consent produced the subsequent 141-pass exact-head run.3b9a8503, mandatory project baselinee5c7efaf85fb7f2771, mandatory replay before mutationOriginal 2958 source-CLI causal evidence and hosted 6da failures remain historical, not relabeled as this head's execution. Startup first failed because this new worktree had no
.venv; only then were locked dependencies restored using existing Python 3.12. An initial evidence-schema attempt incorrectly attached empty owner-decision lists to functional rows; it was rejected and corrected to zero owner-scoped rows, not invented owners. All red logs are retained.Canonical lint, quality, architecture, and independent review
Each command passed on the exact head:
The three source guards preserve the CI regexes and covered paths; Python scanning replaces unavailable macOS GNU
grep -P. Owner-v2detectagainst the exact base/head finds zero touched owners. Its architecture evidence schema passes; strictverify --completion .../owner-completion.jsonreturnsverified=true,terminal_evidence_required=true,touched_owner_count=0using the advisory terminal path, not the blocked shortcut. No owner-scoped tests or new static guards are invented for a fixture/docs-only diff; executed functional and mutation evidence is recorded separately.Independent read-only
code-reviewerreview found no high-confidence regressions or must-fix findings. This is not Merge Master qualification.mmdc -i .../repair-consent.mmd -o .../repair-consent.svg --quietpassed.Scenario Evidence
tests/integration/test_generated_lifecycle_state_machine.py::test_generated_lifecycle_mandatory_replayand::test_generated_lifecycle_sequences_preserve_reference_model(regression-trap for #3333, all three variants)tests/integration/test_shared_skill_preservation_lifecycle.py::test_shared_skill_preserves_user_content_and_reports_real_drift;tests/unit/integration/test_skill_materialization_completion.py::test_member_skip_signal_does_not_depend_on_diagnostics[edited]How to test
--force, run the three mandatory variants, and require the original exact-byte failures; restore it before the passing run.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