Skip to content

feat(pm-stack): primary-parent validation + audit output + label family sync (#9066) - #13700

Open
dezren39 wants to merge 2 commits into
mainfrom
queue/20430-9066-primary-parent-impl
Open

dezren39 wants to merge 2 commits into
mainfrom
queue/20430-9066-primary-parent-impl

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Implements the collector-side half of #9066 (design §3 + §11 semantics), from doc/2026-11-12T22-50-00Z_design_pm-board-hierarchy-genealogy/note.md.

What lands here

  1. Primary-parent invariants are now checked, not silently resolved (pm-stack/aggregator/src/metadata-ingestion.ts):

    • at most one primary-parent/* label per issue;
    • when a native sub-issue parent exists, the label must agree with it or name one of its ancestors (program-level parent);
    • a primary-parent/<slug> naming no known epic is reported.

    collectPrimaryParentViolations only reports — resolution stays a reconcile/human decision, per the design's "violations are reported, never silently resolved".

  2. The sweeper surfaces those findings in its audit output (scripts/metadata-sweeper.ts): every repo row in the JSON summary now carries primaryParentViolations and the violations[] list. The native-parent ancestor chain is fetched only when a primary-parent/* label is present; an unreadable chain is logged and never manufactures a finding.

  3. scripts/sync-primary-parent-labels.ts creates the primary-parent/<slug> family from today's epic/<slug> family (idempotent, --dry-run, strict argv contract Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352). Slug-too-long-for-50-chars are skipped and reported, never truncated.

  4. Tests: test/primary-parent-validation.test.ts pins each invariant and the label planner (13 tests). Existing metadata tests still pass.

Not in this slice (remaining #9066 acceptance)

Refs #9066

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T20:53:19Z",
    "session_id": "ses_e5df613d66effe3gUy3c1n1m5g",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/fleet/20430-9066-primary-parent-impl",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/fleet/20430-9066-primary-parent-impl",
      "repo": "developing-today/code",
      "branch": "queue/20430-9066-primary-parent-impl",
      "sha": "fa271715267979280c1d4cda74d7a1c6a557c25f"
    },
    "auth_subject": "oc-code-05",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… sync (#9066)

- metadata-ingestion: collectPrimaryParentViolations enforces at-most-one
  primary-parent/* label, label/native agreement or ancestor rule, and
  reports unresolved labels; never resolves them.
- metadata-sweeper: runs the validator per item, reads the native parent
  ancestor chain when a label is present, and reports violations in the
  JSON audit output.
- scripts/sync-primary-parent-labels: idempotently creates
  primary-parent/<slug> for each epic/<slug> (strict argv, --dry-run).

Refs #9066
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2b932fd-6e11-42bc-aad0-f2342c86e0fe
Commits

Reviewing files that changed from the base of the PR and between 7e7af3f and 83ed1ee.

Files selected for processing: 4

  • pm-stack/aggregator/scripts/metadata-sweeper.ts
  • pm-stack/aggregator/scripts/sync-primary-parent-labels.ts
  • pm-stack/aggregator/src/metadata-ingestion.ts
  • pm-stack/aggregator/test/primary-parent-validation.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant