fix(labels): default bootstrap to the house taxonomy and make the dry run truthful #18

Merged
dsh merged 1 commit from fix/8-label-bootstrap-house into master 2026-10-23 22:56:06 +00:00
Owner

What

gitea_label_bootstrap hard-coded the upstream project's 34-label taxonomy (type/feature, type/tech-debt, priority/critical|high|medium|low, status/*, scope/*, risk/*, signal/*) and would add ~30 foreign labels to every pvlb repo. The dry run also always said 0 label(s) planned/created because the formatter counted data.created while the plan only returned data.missing.

This PR:

  • makes the pvlb.dev house set the default: type/task, type/bug, area/host|backup|forgejo|dsh|security, priority/now|next|later, needs-operator (11 labels);
  • keeps the upstream set as an explicit opt-in: taxonomy: "house" | "upstream" (default house); an unknown value fails;
  • returns missing/missingCount from the plan and lists every missing label in the dry run;
  • reports created names and per-label failures on apply;
  • updates the tool description to say which taxonomy is used.

Verification

  • test/label-bootstrap.test.mjs: house set is exactly the 11 names (no status/scope/risk/signal), upstream is 34, dry run counts/ lists missing, zero only when complete, apply creates only missing (9 of 11 when 2 exist), upstream opt-in, unknown taxonomy fails, failed creates reported.
  • npm test 81/81, leak scan clean, node --check clean.
  • Live on ml-lab/tardits (had only type/bug):
    • dry run → 10 of 11 label(s) missing with the exact list;
    • apply → created those 10, no foreign labels;
    • dry run again → 0 label(s) missing — repository already has all 11 labels;
    • gitea_labels list → exactly the 11 house labels.

The house set was intentionally left on that lab repo.

Acceptance (from #8)

  • On a pvlb repo, apply creates exactly the house set — no status/*, scope/*, risk/*, signal/* unless requested.
  • Dry run lists every label it would create, and reports 0 only when none are missing.
  • The tool description says which taxonomy is used; AGENTS.md is updated in a follow-up docs commit.

Closes #8.

## What `gitea_label_bootstrap` hard-coded the upstream project's 34-label taxonomy (`type/feature`, `type/tech-debt`, `priority/critical|high|medium|low`, `status/*`, `scope/*`, `risk/*`, `signal/*`) and would add ~30 foreign labels to every pvlb repo. The dry run also always said `0 label(s) planned/created` because the formatter counted `data.created` while the plan only returned `data.missing`. This PR: - makes the **pvlb.dev house set the default**: `type/task`, `type/bug`, `area/host|backup|forgejo|dsh|security`, `priority/now|next|later`, `needs-operator` (11 labels); - keeps the upstream set as an explicit opt-in: `taxonomy: "house" | "upstream"` (default `house`); an unknown value fails; - returns `missing`/`missingCount` from the plan and lists **every** missing label in the dry run; - reports created names and per-label failures on apply; - updates the tool description to say which taxonomy is used. ## Verification - `test/label-bootstrap.test.mjs`: house set is exactly the 11 names (no status/scope/risk/signal), upstream is 34, dry run counts/ lists missing, zero only when complete, apply creates only missing (9 of 11 when 2 exist), upstream opt-in, unknown taxonomy fails, failed creates reported. - `npm test` 81/81, leak scan clean, `node --check` clean. - Live on `ml-lab/tardits` (had only `type/bug`): - dry run → `10 of 11 label(s) missing` with the exact list; - apply → created those 10, no foreign labels; - dry run again → `0 label(s) missing — repository already has all 11 labels`; - `gitea_labels list` → exactly the 11 house labels. The house set was intentionally left on that lab repo. ## Acceptance (from #8) - [x] On a pvlb repo, apply creates exactly the house set — no `status/*`, `scope/*`, `risk/*`, `signal/*` unless requested. - [x] Dry run lists every label it would create, and reports 0 only when none are missing. - [x] The tool description says which taxonomy is used; `AGENTS.md` is updated in a follow-up docs commit. Closes #8.
The tool shipped the upstream 34-label set as the only taxonomy, and the dry-run formatter counted data.created instead of data.missing, so it always said 0. Default to the pvlb house set, keep upstream behind taxonomy: "upstream", and list every missing label in the preview.
dsh merged commit 178a99f77c into master 2026-10-23 22:56:06 +00:00
Sign in to join this conversation.
No description provided.