Skip to content

fix: ASF-wide CNA org id, never used for allocation; personal config in Subversion projects - #1779

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:fix-asf-org-id-org-level
Oct 24, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
potiuk:fix-asf-org-id-org-level

Conversation

@potiuk

@potiuk potiuk commented Oct 24, 2026

Copy link
Copy Markdown
Member

Two problems an ASF PMC hit while trying Magpie for CVE work.

The CNA org id is ASF-wide, and allocation never needs it

The project template told every ASF adopter to fill in a per-project asf_org_id.
The ASF CNA uses one UUID (f0158376-9dc2-43b6-827c-5f631a4d8d09) for every Apache project, and allocating a CVE does not use it at all.
When asked where to find "its" value, the agent made up a dashboard page.

  • The UUID now lives in organizations/ASF/organization.md (cve_authority.vulnogram.asf_org_id); the per-project row is gone from the template and the manifests.
  • The allocation docs say allocation takes only the PMC and the title, and a test pins the /allocatecve form to those fields.
  • generate-cve-json, the one consumer, still requires [cna].org_id, now with a clear message instead of a KeyError.
    It deliberately has no default, so a project outside the ASF never gets the ASF UUID by omission.
  • Setup now settles organization: before sourcing ASF values: it proposes ASF only on evidence (an apache/ GitHub remote, .asf.yaml, or a Subversion URL under svn.apache.org), and otherwise asks.

Personal config in Subversion and non-VCS projects

An unadopted project outside git had no personal layer, so Magpie refused to record or configure anything in a Subversion working copy.

  • A Subversion working copy keeps the layer in <root>/.svn/apache-magpie/: inside the admin directory, never committed, the same reasoning as <git-common-dir>/apache-magpie/.
    Only the project root's own .svn is accepted, never an ancestor's, as with .git.
  • A project with no version control keeps it in the in-tree .apache-magpie-local/.
  • The rule is applied to every copy of the shared layer resolver (the copy-match test enforces it), and the callers' "nowhere to keep it" branches are removed.

Also bumps the dev version to 0.9.0.dev202610241347.

Test plan

  • prek run --all-files --skip workspace-pytest
  • prek run workspace-pytest --from-ref <base> --to-ref HEAD

Generative AI disclosure: prepared with Claude Code (Opus 5.5) and reviewed by the author.

🤖 Generated with Claude Code

…input

The project template told every ASF adopter to fill in a per-project
`asf_org_id`, but the ASF CNA uses one UUID for every Apache project, and
nobody allocating a CVE ever needs it. Asked where to find it, the agent
made up a dashboard page. The UUID now comes from the ASF organization
manifest, and the per-project row is gone.

Allocation never reads the id: the docs say so, and a test pins the
allocate form to the PMC and title. generate-cve-json, the one consumer,
still requires `[cna].org_id` and now fails with a pointer to the right
value instead of a KeyError. It deliberately has no default, so a
project outside the ASF never gets the ASF UUID by omission.

Setup now settles `organization:` before sourcing ASF values: it
proposes ASF only on evidence (an apache/ GitHub remote, .asf.yaml, or an
svn.apache.org Subversion URL), and otherwise asks.

Generated-by: Claude Code (Opus 5.5)
An unadopted project outside git had no personal layer at all, so
recording a choice, logging, or configuring Magpie failed outright in a
Subversion working copy. A Subversion working copy now keeps the layer in
`<.svn>/apache-magpie/`, inside its admin directory, never committed, the
same reasoning as the git-directory home. A project with no version
control keeps it in the in-tree `.apache-magpie-local/`, since there is
nothing to commit it to.

The resolver change is applied to every copy of the shared layer rule,
and the callers' "nowhere to keep it" branches are removed.

Generated-by: Claude Code (Opus 5.5)
Move the dev stamp so `claude plugin update` picks up these fixes.

Generated-by: Claude Code (Opus 5.5)
@potiuk
potiuk enabled auto-merge (squash) October 24, 2026 14:38
@potiuk
potiuk merged commit 4452fde into apache:main Oct 24, 2026
19 checks passed
potiuk added a commit that referenced this pull request Oct 25, 2026
…layer, Codex hook (#1829)

* fix: correct stale docs, counts and comments left by recent changes

A spec-sync pass over the commits since 03c15a6 found places where the
docs, tables and comments no longer match the code:

- Skill tables and counts: add setup-complete-upgrade and
  setup-privacy-llm to docs/modes.md, complete-upgrade to the setup
  README, submit-to-oss-scan to the security README; fix eval step lists
  and case counts in the skill-evals READMEs.
- Adapters: Bitbucket and GitLab are `partial`, not `partial-read-only`;
  the Bitbucket capability row lists the writes the tool ships.
- `<framework>` resolves to `.apache-magpie/` on a snapshot install, not
  `.apache-magpie/apache-magpie`; fixed at the source (init_skill.py) and
  in the skills and READMEs that copied it.
- CVE record-publish: document the vendor-advisory precondition (exit 4)
  and that --allow-state replaces the REVIEW default.
- Secure setup: bubblewrap 0.13.1, PREK_HOME required only with prek,
  run the gateway hook by hand with </dev/null.
- Comments and docstrings: the gateway hook has no `if` filter any more,
  agent-guard's guard sources, the layers.py Subversion and no-VCS rule,
  the CI batch selector, and the SETUP_HOOKS fallback now matches the real
  /bin/bash -p wiring.
- permission-audit documents --organization; a nested link and a wrong
  docs/setup/marketplaces.md reference are fixed.

Generated-by: Claude Opus 5

* fix(setup): show the setup welcome guide, find the Subversion layer, re-point the Codex hook

Follow-ups to the same spec-sync pass, each a gap a recent change left:

- The setup family is exempt from the shared pre-flight, so its welcome
  guide never showed. The `setup` skill now runs a welcome-only check
  (`setup_preflight.welcome due --skill setup`) before any sub-action;
  the exemption stays. The first-run eval case moves into its own
  `welcome-first-run` suite built from that step.
- #1779 added a Subversion personal layer at `.svn/apache-magpie/`, but
  the pre-flight path was git-only, so a checker installed there was
  never found, and `setup config` stopped outside git. The path now
  includes `.svn/apache-magpie` and no longer errors outside git;
  `config` Step 0 handles git, Subversion and no-VCS working copies as
  `layers.py` does. A test runs the block's path in all three.
- The root Codex plugin wired SessionStart to a `hooks/check-upgrade.sh`
  that has not existed since #1208; it now runs the magpie-setup script
  with `/bin/bash -p`, and check-family-plugins pins that wiring.
- generate-cve-json's README documents its config file (lookup order,
  every key, an example), which its error messages already pointed at.
- tools/hook-manager's README gains Operations and Configuration
  sections.

Generated-by: Claude Opus 5
@potiuk potiuk added the family:cross-family Sweeps over the labeler limit label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:cross-family Sweeps over the labeler limit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant