feat(manifest): add fork-identity fields for Phase C / P4 (no forks yet)

Merged
TO
3mo ago
+285-9

Summary

Tooling-only groundwork for the selective fork policy (P4). Does not fork anything β€” see numan-registry PR (companion to this one) and docs/adr/0001-... in numan for why real forks are explicitly out of scope here.

  • validate_manifest.py: optional upstream_repo field (owner/name of the original upstream). Requires owner == "numan-maintained" on any entry that sets it β€” a fork manifest entry can't claim the original author's identity.
  • gen_spec.py: when upstream_repo is present, emits source.upstream in the generated spec (consumed by numan-registry's add-package.py, which now requires it for owner: "numan-maintained") and appends a fork-attribution note to the description.
  • manifest.json: schema_notes.upstream_repo documents the field and points at ADR 0001 for the eligibility/stewardship requirements this field doesn't itself enforce.

Test plan

  • python -m pytest scripts/ β€” 47 passed
  • python scripts/validate_manifest.py --manifest manifest.json β€” OK, 22 active plugins, unaffected
  • New tests: upstream_repo requires numan-maintained owner / accepted with it / rejects blank, gen_spec.py emits source.upstream + description note for fork entries, omits both for normal entries

Ref: numan/docs/plans/2026-08-09-intake-process-reform.md (P4), numan PR #113.

πŸ€– Generated with Claude Code


Summary by cubic

Adds fork identity support for P4 selective forks and hardens manifest/spec validation, including source.upstream and a fork note for valid numan-maintained forks. Tooling-only; no forks created.

  • New Features

    • validate_manifest.py: require upstream_repo for owner numan-maintained; enforce non-empty owner/name; reject values equal to repo.
    • gen_spec.py: for fork entries, emit source.upstream and append a fork-attribution note; omit both for non-forks (needed by numan-registry).
    • manifest.json: add schema_notes.upstream_repo with ADR link.
  • Bug Fixes

    • gen_spec.py: build_spec validates upstream_repo via the shared helper, rejecting blank, malformed, wrong-owner, or self-referential values before emitting provenance.