lib/labels.sh's new pw::-prefixed CRUD (labels_reconcile/labels_reconcile_role) is unwired: the catalogue's own label names are still unprefixed
Id: TD-PPagop-26082809 · Status: resolved · Filed: 2026-08-28 · Resolved: 2026-09-25 · Ref: #1860
Issue #840 asked for every label the pipeline itself owns to be namespaced
under a pw:: prefix, with full CRUD (create, update, delete) on that
namespace. Its own acceptance criterion 4 defers “the renaming/renamespacing
of existing labels” to a follow-on item, so this is that follow-on’s own
record — the capability landed without it.
lib/labels.sh now has labels_reconcile/labels_reconcile_role
(full CRUD scoped to label_prefix, config.schema.json, default pw::),
tested directly in test/labels.test.sh, but no call site uses them: the
catalogue’s own names (pr_label’s default autonomous-agent,
enabler_escalation_label’s enabler-escalation, needs_refinement_label’s
needs-refinement, refined_label’s refined, unvoid_label’s unvoided,
and the hardcoded blocked, blocked:needs-refinement, obsolete,
open-question, complexity:low|medium|high in labels_catalogue) are
still unprefixed, and agent-cycle.sh, review-cycle.sh,
lib/enabler.sh and lib/candidate-gather.sh still call
labels_ensure_role/labels_ensure_stamped, not the _reconcile forms.
Suggested fix, in one pull request:
- Rename the five configurable defaults and the hardcoded catalogue entries
in
labels_catalogue(lib/labels.sh) topw::-prefixed names, choosing names that do not collide with any pre-existing human label (bug,enhancement,dashboard, …). - Migrate live installations via GitHub’s label-rename endpoint (
PATCH /repos/{owner}/{repo}/labels/{name}, changing onlyname) rather than delete-then-recreate, so every issue/PR already carrying the old name keeps it under the new one. - Swap the four call sites above from
labels_ensure_role/labels_ensure_stampedontolabels_reconcile_role’s own shape (or a stamped wrapper around it, mirroringlabels_ensure_stamped), and extend thelabels-ensuredevent’screated/failedJSON shape (agent-cycle.sh’sensure_labels_for) to also carryupdated/deleted, whichlabels_reconcile’s report now emits and that event currently drops silently. - Update
docs/IMPLEMENTATION-PIPELINE-SPEC.mdrequirement 6a and the generated config-table rows (scripts/render-config-table.sh) once the defaults change.
Two hazards in labels_reconcile that are latent only for as long as nothing
calls it, raised on this PR’s own review (#846) and to be settled by whoever
does the wiring above:
- A short or broad
label_prefixsilently pulls human labels into the delete scope. The delete pass matches by barestartswith, the schema constrains the key only to^[^,]*$, andscripts/doctor.shdoes not check it — solabel_prefix: "b"wouldDELETEthis repository’s ownbuglabel (prefix-matched, uncatalogued), detaching it from every issue wearing it. Needs aminLength, a terminator constraint in the schemapattern, or adoctor.shcheck that the configured prefix matches no uncatalogued label already present in a configured repository. - An empty catalogue plus
MODE fulldeletes the whole namespace.labels_catalogueexits 0 with no output both whenconfig_defaultsfails and when its ownjqdoes, and the pipe inlabels_reconcile_rolediscards that status. The first case is safe by construction (an unreadable config also leavesprefixempty, disabling deletion); the second is not.test/labels.test.shpins empty-catalogue deletion as intended, so the fix belongs inlabels_reconcile_role— which knowstarget’s catalogue can never legitimately be empty — capturing the catalogue and skipping the delete pass when it came back empty, rather than inlabels_reconcile.
Noticed while working #840 (PR implementing labels_reconcile).
Migrated to https://github.com/Poetic-Poems/agent-ops/issues/1013.