Skip to content

feat(setup): propose a bump when an organization moves a curated pin - #2384

Merged
potiuk merged 2 commits into
feat/incubator-marketplace-offerfrom
feat/incubator-pin-notice
Nov 26, 2026
Merged

potiuk merged 2 commits into
feat/incubator-marketplace-offerfrom
feat/incubator-pin-notice

Conversation

@potiuk

@potiuk potiuk commented Nov 26, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #2383: review and merge that one first. This PR's diff is only the pin-move notice.

An organization moves a curated skill-source pin when the source tags a newer version (for the ASF, when the Incubator tags a new releasecheck), but a project's own pin in <project-config>/skill-sources.md moves only when the project bumps it, and nothing told the project.

  • setup_preflight.skill_sources pins compares the trust list with the organization's catalogue in the snapshot setup update has just put in place, so it needs no network. Per trusted id it reports:

    • moved (same skill, a higher curated version): propose the bump;
    • same; adopter-ahead; not-comparable (no <name>-<version> ref, different names, or a curated pin with no anchor to move to); not-curated (the project's own full descriptor, or an id the catalogue does not carry);
    • tag-moved (same ref, a different anchor): a warning, never a re-pin;
    • declined: moved, but the operator kept their pin over a curated version at least this new before.

    The anchor is whichever the source uses: commit for a git tag, sha512 for an archive. The parser reads every documented descriptor form (an inline # comment, an indented list item, a bare id: mapping) and scopes each entry's keys by indent. Versions are read exactly as check-skill-source-drift.py reads them, and a test keeps the two patterns in step.

  • update Step 6f, item 0, before the re-fetch: for each moved pin, it shows the change and asks.

    • On a yes it edits the trust list's ref and anchor and the source's .apache-magpie.sources.lock block, and stages both with git add, never committing. Nothing is fetched from that pin in the same run: /magpie-setup skill-sources fetches the new version and verifies it against the new anchor once the adopter has committed the bump, so the trust gate holds and a failed check never leaves a half-applied pin.
    • On a no, skill_sources decline records the curated ref under skill_source_pins in this checkout's own reconciled.json (a linked worktree inherits it), so the bump is not proposed again until the curator moves past it.
    • The catalogue is the snapshot's organizations/<org>/skill-sources.md, or, for an organization Magpie does not ship, the adopter-local one under .apache-magpie-overrides/organizations/<org>/. Both commands run with PYTHONPATH set to the installed pre-flight checker, like every other pre-flight call in update.
  • setup skill-sources names this as the one trust-list edit Magpie proposes; adding a source and committing a pin stay the adopter's acts. The organization-adapters spec describes it.

Type of change

  • Python package (plugins/magpie-setup/skills/setup/setup_preflight/skill_sources.py, new)
  • Skill change (update.md Step 6f, skill-sources.md)
  • Specs (organization-adapters.md)

Test plan

  • prek run --all-files --skip workspace-pytest and prek run workspace-pytest --from-ref origin/main --to-ref HEAD on the top of the stack
  • tools/setup-preflight/tests/test_skill_sources.py, 26 tests: every state; every documented descriptor form, and a nested block never bleeding into its entry or the next; archive pins compared by sha512; a curated pin with no anchor not proposed; commented template examples declaring nothing; no catalogue meaning not-curated; a decline holding until the curator moves past it (and covering a lower curated version), keeping every other stamp key, never overwriting an unparsable stamp, and inherited by a linked worktree; the shipped ASF catalogue parsing; the version pattern matching the drift check's; the CLI
  • New eval suite setup/step-update-source-pin, 4/4: a moved pin proposed and staged, never committed and never fetched before the commit, with a no recorded; a bump declined before staying quiet; a moved tag warned about and never re-pinned, despite an instruction planted in the catalogue to re-pin; an independent project with its own descriptor skipped
  • Adversarial review (codex, copilot, antigravity): fixed fetching a bump before it is committed, the missing PYTHONPATH, descriptor forms the parser missed, archive (sha512) pins, the adopter-local catalogue and a decline below the declined version

RFC-AI-0004 compliance

  • HITL: each bump is asked about; the edit is staged, and the commit is the adopter's.
  • Sandbox: no network; it reads the snapshot already on disk and writes only reconciled.json in the checkout's own layer.

🤖 Generated with Claude Code

@potiuk potiuk added family:setup setup-* skills capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) labels Nov 26, 2026
@potiuk
potiuk added this pull request to stack #2385 November 26, 2026 21:47
@github-actions github-actions Bot added family:tools tools/* family:docs Docs, MISSION.md, READMEs substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:setup Tool substrate: adopter-side setup state resolved at runtime (lock parsing, floors, fingerprints) family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json labels Nov 26, 2026
An organization moves a curated skill-source pin when the source tags a
newer version, but a project's own pin moves only when the project bumps
it, and nothing told the project.

- setup_preflight.skill_sources compares the trust list with the
  organization's catalogue in the snapshot setup update has just put in
  place, offline: moved, same, tag-moved, adopter-ahead, not-comparable,
  not-curated or declined. It reads versions exactly as the drift check
  does, and a test keeps the two in step.
- update Step 6f, before the re-fetch, asks about each moved pin; on a
  yes it edits the trust list and the sources lock and stages both with
  git add, never committing, and the re-fetch verifies the new tag. On a
  no it records the curated ref under skill_source_pins in this
  checkout's reconciled.json, so the same bump is not proposed again
  until the curator moves past it. A moved tag is a warning, never a
  re-pin.
- skill-sources.md names this as the one trust-list edit Magpie
  proposes; the organization-adapters spec describes it.
- A new eval suite, setup/step-update-source-pin, covers a moved pin, a
  bump declined before, a moved tag (with an instruction planted in the
  catalogue) and an independent project.

Generated-by: Claude Opus 5
From the adversarial review of the pin-move notice:

- A bump the operator accepts is staged and nothing is fetched from it
  in that run: setup skill-sources fetches and verifies the new version
  once the adopter has committed it, so the trust gate holds and a
  failed verification never leaves a half-applied pin behind.
- The parser reads every documented descriptor form: an inline
  comment, an indented list item and a bare id: mapping, and it scopes
  each entry's keys by indent so a nested block or a later entry never
  bleeds in.
- An archive (svn-zip) pin compares and bumps its sha512; a curated pin
  with no anchor to move to is not-comparable. Rows now carry
  anchor_key, anchor and curated_anchor.
- A decline also covers a curated version below the one declined.
- The catalogue falls back to an adopter-local organization's, and both
  commands run with PYTHONPATH set to the installed pre-flight checker,
  as every other pre-flight call does.
- The eval checks that nothing is fetched before the commit.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the feat/incubator-pin-notice branch from 7c29bc8 to 89820a7 Compare November 26, 2026 22:15
@potiuk
potiuk enabled stacked auto-merge (squash) November 26, 2026 22:17
@potiuk
potiuk merged commit f2e9b33 into main Nov 26, 2026
13 of 21 checks passed
@potiuk
potiuk deleted the feat/incubator-pin-notice branch November 26, 2026 22:27
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:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:setup Tool substrate: adopter-side setup state resolved at runtime (lock parsing, floors, fingerprints)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant