diff --git a/.changeset/quick-seals-parade.md b/.changeset/quick-seals-parade.md index 6e31c63fe..32e846f75 100644 --- a/.changeset/quick-seals-parade.md +++ b/.changeset/quick-seals-parade.md @@ -2,4 +2,4 @@ type: Fixed pr: 0 --- -**`roadmap get-phase` resolves project-code-prefixed headings by bare number** — a bare-number query (e.g. `29`) now resolves a drifted `### Phase AB-29:` heading, matching the internal resolver used by `init.phase-op`; previously the CLI returned empty. A bare sibling (`### Phase 29:`) still takes precedence. A project-code-prefixed query against a checklist-only roadmap now reports the same `malformed_roadmap` diagnostic a bare query always did, instead of a silent empty result. (#2114) +**`roadmap get-phase` resolves project-code-prefixed headings by bare number** — a bare-number query (e.g. `29`) now resolves a drifted `### Phase AB-29:` heading, matching the internal resolver used by `init.phase-op`; previously the CLI returned empty. A bare sibling (`### Phase 29:`) still takes precedence. A project-code-prefixed heading present only as a summary/checklist line (no matching detail section) now reports a `malformed_roadmap` diagnostic — for both prefixed and bare-number queries — instead of a silent empty result. (#2114) diff --git a/tests/roadmap.test.cjs b/tests/roadmap.test.cjs index c52cad759..d401b0c5a 100644 --- a/tests/roadmap.test.cjs +++ b/tests/roadmap.test.cjs @@ -2122,14 +2122,14 @@ describe('bug #2114: roadmap get-phase resolves drifted prefixed headings by bar assert.strictEqual(payload30.phase_name, 'Plain'); }); - test('prefixed query surfaces malformed_roadmap when only a checklist entry exists (parity with bare)', () => { - // #2121/#2114 route all three resolvers through the shared 3-source lookup, so a - // project-code-prefixed query now surfaces the SAME `malformed_roadmap` diagnostic a - // bare numeric query always did: a `**Phase PROJ-42:**` summary line with no matching - // `### Phase PROJ-42:` detail heading is malformed for BOTH query forms. Before the - // consolidation the prefixed form silently returned `{found:false}` with no diagnostic - // (the exact-prefix pass discarded its malformed candidate) — this test fails on that - // prior behavior and locks the unified, more-informative result. + test('project-code-prefixed checklist-only entry surfaces malformed_roadmap for both query forms', () => { + // #2121/#2114 route all three resolvers through the shared 3-source lookup. A + // `**Phase PROJ-42:**` summary line with no matching `### Phase PROJ-42:` detail heading + // is a malformed ROADMAP. Before the consolidation this project-code-prefixed checklist + // was reported as a silent `{found:false}` for BOTH query forms — the prefixed pass + // discarded its malformed candidate, and the bare pass could not match the `PROJ-` prefix + // at all. The unified lookup newly surfaces the malformed_roadmap diagnostic for both, so + // this test fails on the prior silent-empty behavior for the prefixed AND the bare form. fs.writeFileSync( path.join(tmpDir, '.planning', 'ROADMAP.md'), [