Skip to content

feat(B-0535): wire backlog ID-uniqueness lint to gate.yml#3565

Merged
AceHack merged 1 commit into
mainfrom
feat/b0535-enforce-duplicate-ids-cli-flag-gate-otto-cli-2026-05-15
May 15, 2026
Merged

feat(B-0535): wire backlog ID-uniqueness lint to gate.yml#3565
AceHack merged 1 commit into
mainfrom
feat/b0535-enforce-duplicate-ids-cli-flag-gate-otto-cli-2026-05-15

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 15, 2026

Summary

Substrate-honest correction to B-0535's original framing: the duplicate-ID detection logic ALREADY EXISTS in `audit-backlog-items.ts` (item 8, added PR #3249 2026-05-14). The actual gap was CI wiring, not implementation.

Changes

File Change
`tools/hygiene/audit-backlog-items.ts` Add `--enforce-duplicate-ids` CLI flag; exit 1 if duplicate-ID groups > 0
`.github/workflows/gate.yml` Add `lint-backlog-id-uniqueness` job (sibling of `lint-section-33-migration-xrefs`)

Catches the empirically-observed failure class

Collision Date Cost
B-0444 (Otto-CLI vs Otto-Desktop) 2026-05-13 PR #3053 renumber, ~15 min
B-0532 + B-0533 (Lior PR #3545 vs Otto-CLI) 2026-05-15 Ongoing review, ~15 min comment + coordination
B-0329 (the row that surfaced the need) 2026-05-14 PR #3247 Copilot catch + PR #3249 detection

Test plan

  • `bun tools/hygiene/audit-backlog-items.ts` runs as before (detect-only)
  • `bun tools/hygiene/audit-backlog-items.ts --enforce-duplicate-ids` exits 0 on baseline (0 groups)
  • Unknown flag rejected with stderr error + exit 1
  • CI green (including the new `lint (backlog ID uniqueness)` job itself running on this PR)
  • Auto-merge arms

🤖 Generated with Claude Code

…duplicate-ids)

Substrate-honest correction to B-0535's framing: the duplicate-ID
detection logic ALREADY EXISTS in audit-backlog-items.ts (item 8,
added 2026-05-14 via PR #3249 after Copilot caught B-0329 collision
on PR #3247). The actual gap was CI wiring, not implementation.

This PR adds:

1. CLI flag --enforce-duplicate-ids to audit-backlog-items.ts:
   - Detect mode unchanged (default, exits 0 with findings reported)
   - --enforce-duplicate-ids: exit 1 if duplicate-ID groups > 0
   - Rejects unknown flags with stderr error + exit 1

2. New gate.yml job lint-backlog-id-uniqueness:
   - Same shape as lint-section-33-migration-xrefs + lint-archive-header-section33
   - Runs `bun tools/hygiene/audit-backlog-items.ts --enforce-duplicate-ids`
   - Baseline = 0 duplicate-ID groups on main (verified locally)

Catches the failure class empirically observed today:

- B-0444 (Otto-CLI vs Otto-Desktop, PR #3053 renumber, ~15 min)
- B-0532 + B-0533 (Lior PR #3545 vs Otto-CLI mine, ~15 min coordination)

Both went undetected by the existing detect-only audit because
nothing was wired to fail CI on duplicate-IDs. This PR closes that
gap.

Composes with:
- B-0535 (parent row; the framing was "extend B-0532" but the actual work was "wire existing logic")
- audit-section-33-migration-xrefs (PR #3555 — same catch-once-then-lint pattern)
- audit-backlog-items item 8 (PR #3249 — the existing detection logic)
- PR #3247 (the B-0329 collision that surfaced the need)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 19:39
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 15, 2026 19:39
@AceHack AceHack merged commit ff41427 into main May 15, 2026
30 checks passed
@AceHack AceHack deleted the feat/b0535-enforce-duplicate-ids-cli-flag-gate-otto-cli-2026-05-15 branch May 15, 2026 19:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR turns the existing backlog duplicate-ID audit into an enforceable CI gate for B-0535, so future duplicate B-NNNN backlog row IDs fail the main gate workflow.

Changes:

  • Adds --enforce-duplicate-ids handling to audit-backlog-items.ts.
  • Adds a lint-backlog-id-uniqueness job to .github/workflows/gate.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tools/hygiene/audit-backlog-items.ts Adds duplicate-ID enforcement mode and documents usage/exit behavior.
.github/workflows/gate.yml Runs the backlog audit in duplicate-ID enforcement mode as a CI lint job.

Comment on lines +769 to +774
# Cross-agent ID-allocation collisions (Otto-CLI vs Otto-Desktop on
# B-0444 2026-05-13; Lior vs Otto-CLI on B-0532+B-0533 2026-05-15) cost
# ~15 min coordination effort each at observed ~20% rate. The
# duplicate-ID detection logic was added to audit-backlog-items.ts
# 2026-05-14 (PR #3249, Copilot caught two files claiming B-0329 on
# PR #3247) but ran detect-only — this job is the CI gate that turns
// Exit codes:
// 0 -- survey ran (findings reported in body)
// 1 -- fatal invocation error (e.g., backlog dir missing)
// 0 -- survey ran (findings reported in body); detect-only mode
AceHack added a commit that referenced this pull request May 15, 2026
…e-ID detection (#3566)

- PR #3564 (1931Z shard) wait-CI
- PR #3565 — B-0535 mechanization shipped (40 LOC; detection logic already existed)
- Substrate-honest correction: B-0535's "extend B-0532" framing was wrong;
  the audit-backlog-items.ts item 8 logic existed (PR #3249); only CI wiring needed
- 3 of 4 §33/B-053N lints live or in-flight (lint-section-33, lint-archive-header-33,
  lint-backlog-id-uniqueness this tick; lint-backlog-graph-consistency pending B-0532 impl)
- 14-tick session arc continues

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
…gate.yml wiring (#3567)

* feat(b-0532): parent-child status-mismatch lint (hard-error slice) + gate.yml wiring

Implements the hard-error case from B-0532 acceptance criteria: parent
row with `status: closed` (or equivalent landed/superseded/merged/done)
AND any declared child still has `status: open`.

Changes:

1. tools/hygiene/audit-backlog-items.ts (item 9 audit class):
   - Extend FrontmatterFields + BacklogRow with `childrenRefs`
   - Add `isClosedStatus()` helper (reuses CLOSED_STATUSES + handles
     `superseded-by-*` prefix)
   - Add `reportParentChildStatusMismatch()` function (item 9)
   - Add `--enforce-parent-child-status` CLI flag (exit 1 on findings)
   - Update Summary section + script header docs

2. .github/workflows/gate.yml:
   - New `lint-backlog-parent-child-status` job (sibling of
     lint-backlog-id-uniqueness from PR #3565)
   - Runs `bun tools/hygiene/audit-backlog-items.ts --enforce-parent-child-status`
   - Baseline = 0 mismatches (verified locally)

Scope: hard-error case only. B-0532's full acceptance criteria also
covers soft-warning (all children closed, parent open) + bidirectional
consistency (parent.children ↔ child.parent). Those are deferred to
follow-up slices.

Empirical anchor: PR #3518 (2026-05-15) shipped a row-status flip
closing parent B-0442 without closing children B-0504 + B-0505. Took
4 review-thread cycles to fully resolve. This lint catches that class
at PR time before merge.

Composes with: PR #3565 (lint-backlog-id-uniqueness, sibling pattern),
PR #3555 (lint-section-33-migration-xrefs, sibling pattern), B-0532
(parent row).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(B-0532): extend B_REF_RE to capture dotted child IDs (B-NNNN.suffix)

Reviewer finding (Copilot P0 + chatgpt-codex-connector P2, PR #3567):
B_REF_RE = /B-\d{4}/g truncated dotted backlog IDs like B-0029.1 → B-0029,
causing the parent/child status-mismatch gate to miss mismatches on decomposed
child rows. Updated to /B-\d{4}(?:\.\d+)*/g to capture the full dotted suffix.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 16, 2026
…drift catch) (#3742)

Third drift-catch this session (paired with PR #3733 closing B-0506
and PR #3737 closing B-0530). Same pattern:

- B-0535 mechanization shipped 2026-05-15 via PR #3565
  (feat(B-0535): wire backlog ID-uniqueness lint to gate.yml)
- Duplicate-ID detection extended into existing
  tools/hygiene/audit-backlog-items.ts per row's
  skill-router-as-substrate-inventory decision
- gate.yml has lint-backlog-id-uniqueness job running
  audit-backlog-items.ts --enforce-duplicate-ids
- Row's status never flipped from open to closed

Changes:

- docs/backlog/P3/B-0535-...md: status: open → closed; +closed:
  2026-05-16; last_updated bump; Resolution section mapping 4/4
  acceptance criteria to shipped artifacts + verification anchors
- docs/BACKLOG.md: regenerated; single-line `[ ]` → `[x]` toggle

Three drift catches in three ticks (B-0506 + B-0530 + B-0535) is the
recurring pattern. Worth filing a systematic-audit follow-up row to
sweep the remaining P3 status-open rows for shipped-but-unclosed
work — but I noted at least two are MULTI-SLICE partials (B-0517
Phase 1 cleanup undone; B-0537 Slice A cleanup undone), so the
audit needs to distinguish "drift" from "partial completion."

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants