Skip to content

fix(setup): make the pre-flight checker and upgrade work for method: local - #1414

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/preflight-local-method
Sep 27, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/preflight-local-method

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • In the framework checkout (method: local), every skill's pre-flight failed with unknown key: 'source': install.md writes source: skills/ into the lock and the checker's parser rejected it.
  • With that fixed, method: local fell through to unknown-method and was routed to the snapshot-drift section, proposing /magpie-setup upgrade — which has nothing to do for a local checkout, so the loop never closed. The checker now returns no project findings for method: local: the skills are the working tree.
  • The memoised project verdict ignored the checker's own code, so a checker refreshed by upgrade kept serving the old verdict for up to 15 minutes. The cache key now includes core.py and lockfile.py.
  • upgrade.md Step 0 gains a method: local branch: refresh the pre-flight checker from the in-repo package and stop, instead of treating the absent local lock as a snapshot to recover.

Type of change

  • Skill change (plugins/magpie-setup/skills/setup/upgrade.md) — prose branch only, no eval suite for setup
  • Python package (tools/setup-preflight)

Test plan

  • prek run --all-files passes
  • uv run pytest (75 passed, 3 new regression tests), ruff check, ruff format, mypy clean for setup-preflight
  • Live: PYTHONPATH=.apache-magpie-local python3 -m setup_preflight --skill optimize-skill … in this checkout now returns only the machine-scope isolated-setup-changed finding, where before it exited 2

RFC-AI-0004 compliance

  • HITL — no new mutation; upgrade for method: local only refreshes the gitignored checker copy

Generative AI disclosure

Prepared with Claude Code (Claude Opus 5); reviewed by the submitter.

🤖 Generated with Claude Code

…local

The framework checkout self-adopts with `method: local`, and
install.md writes `source: skills/` into its lock. The checker's lock
parser rejected that key, so every skill's pre-flight in this checkout
failed with `unknown key: 'source'`. Accepting it exposed the next
fault: `method: local` fell through to `unknown-method` and routed to
the snapshot-drift section, which proposes `/magpie-setup upgrade`,
which cannot help. The skills are the working tree, so there is nothing
to drift; the checker now returns no project findings for it.

The memoised project verdict was keyed only on the lock files and the
plugin listing, so a checker refreshed by `upgrade` kept serving the
previous code's answer for up to fifteen minutes. The key now includes
the checker's own core.py and lockfile.py.

upgrade.md Step 0 gains the `method: local` branch: refresh the
pre-flight checker from the in-repo package and stop, rather than
routing a missing local lock into a snapshot recovery.

Generated-by: Claude Opus 5
@potiuk potiuk added family:setup setup-* skills capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) labels Sep 27, 2026
@potiuk
potiuk merged commit 9a41522 into apache:main Sep 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) family:setup setup-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant