@adhd/backlog 0.0.2 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1 +1,66 @@
1
+ ## 0.1.1 (2026-07-27)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **backlog:** fix published tarball crashing at mount — `backlogDistDir()` resolved `client.d.ts` via `import.meta.url + '../dist'`, which escaped to the nonexistent `node_modules/@adhd/dist` once `dist-manifest` rebased the package to its root; now probes for the sibling `client.d.ts` (BUG-012). Adds `server.published-layout.spec.ts` reproducing the published rebased-to-root layout.
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - pseudosky
12
+
13
+ ## 0.0.3 (2026-07-25)
14
+
15
+
16
+ ### 🩹 Fixes
17
+
18
+ - **apigen,backlog:** killable serve, configurable namespace, flaky test + log spam
19
+
20
+ - **backlog:** match archived-item exclusion between render and its verify
21
+
22
+
23
+ ### ❤️ Thank You
24
+
25
+ - pseudosky
26
+
27
+ ## 0.0.2 (2026-07-24)
28
+
29
+
30
+ ### 🚀 Features
31
+
32
+ - **backlog:** add CLI entrypoint + bin (live apigen cli-output mount)
33
+
34
+ - **backlog:** add migration.phase signal + migrationStatus op (MIGRATION.md §4.4)
35
+
36
+ - **backlog:** Phase 1/2 apigen import + CI parity gate + durable migration.phase admin write
37
+
38
+ - **backlog:** author backlog-usage skill + install-skill CLI (MIGRATION.md sec 4.2/4.3)
39
+
40
+ - **backlog:** add `serve` CLI command so .mcp.json has a real entry to spawn (MIGRATION.md sec 4.5)
41
+
42
+ - **backlog:** rootLevel projection filter so new tool items reach root
43
+
44
+
45
+ ### 🩹 Fixes
46
+
47
+ - **backlog:** close Phase-3 migration gate — CI Node floor, content-hash collision verified, FTS content immutability, bounded busy-retry; plus import provenance/silent-drop fixes
48
+
49
+ - **backlog:** runBacklogCli no longer eagerly opens the store for --help/no-args (DEBT-BACKLOG-CLI-EAGER-STORE-OPEN-001)
50
+
51
+ - **backlog:** concurrent createItem id-collision + FTS sanitizer gap (MIGRATION.md sec 3.3 scale test)
52
+
53
+ - **backlog:** implement real transition/claim audit-log (DEBT-BACKLOG-AUDIT-TRAIL-PARTIAL-001)
54
+
55
+ - **backlog:** importFromMarkdown upserts on re-import instead of insert-only
56
+
57
+ - **backlog:** sourcepath-ownership gate for importFromMarkdown (DEBT-BACKLOG-IMPORT-SCOPE-CROSSFILE-001)
58
+
59
+ - **backlog:** re-import backfills ownership + resurrects superseded ids
60
+
61
+
62
+ ### ❤️ Thank You
63
+
64
+ - pseudosky
65
+
1
66
  ## Unreleased
@@ -8,33 +8,22 @@ import { Scope } from '@adhd/environment-base-spec';
8
8
  * `project()`'s `cli.path = [namespace, ...path].map(toKebab)` —
9
9
  * `@adhd/apigen-engine-naming`'s `naming.ts`).
10
10
  *
11
- * NOT simply `['backlog']`. `extract()` (`@adhd/apigen-core-client`'s
12
- * `extract.ts`) unconditionally builds every operation's `path` as
13
- * `[fileSegment, exportSegment]`, where `fileSegment` is derived from the
14
- * EXTRACTED SOURCE FILE's own name (`normalizeFileName('client.d.ts')` →
15
- * `'client-d'` — strips one extension, then folds remaining `.`/`_` to `-`).
16
- * `server.ts`'s `extractClientOperations()` always points extraction at the
17
- * built `client.d.ts` (see that file's DEVIATION doc comment), so EVERY
18
- * `client.ts` export's real `cli.path` is
19
- * `['backlog', 'client-d', '<kebab-export-name>']` — confirmed empirically
20
- * (not assumed) by inspecting a real built `pkg`/`operations` pair; see
21
- * `cli.spec.ts`'s "command-prefix derivation" suite. The HTTP
22
- * (`apigen-plugin-api-fastify`) and MCP (`apigen-plugin-mcp`) transports
23
- * both route by bare `fnName` and never consult `project(op)` at all, so
24
- * this `client-d` segment is INVISIBLE on those two transports — it is
25
- * cli-output-specific, and would leak into every command a user types
26
- * (`backlog client-d get-item …`) if this file naively hardcoded a
27
- * single-segment `'backlog'` prefix instead of deriving the REAL prefix from
28
- * the live `operations` list.
11
+ * Currently simply `['backlog']`: `server.ts`'s `extractClientOperations()`
12
+ * calls `extract({ …, dropFileSegment: true })`, so every `client.ts`
13
+ * export's `path` is just `[exportSegment]` (no `client.d.ts`-derived
14
+ * `'client-d'` segment — see that call site's doc comment for why it's safe
15
+ * to drop here: one source file, no cross-file names to disambiguate), and
16
+ * `project(op).cli.path` is `['backlog', '<kebab-export-name>']`.
29
17
  *
30
- * Since every `client.ts` export shares the same namespace + same source
31
- * file, every operation's `cli.path` differs ONLY in its final (export)
32
- * segment — so the shared prefix is simply "everything but the last
33
- * segment" of any one operation's projected `cli.path`. Computed fresh from
34
- * `operations` on every call (never cached as a literal), so a future change
35
- * to the extraction source file name, or to `apigen-core-client`'s file-
36
- * segment derivation, can never silently desync this from the real command
37
- * table the way a hardcoded constant would.
18
+ * This is still derived from the live `operations` list rather than
19
+ * hardcoded, on purpose: since every `client.ts` export shares the same
20
+ * namespace + same source, every operation's `cli.path` differs ONLY in its
21
+ * final (export) segment, so the shared prefix is simply "everything but the
22
+ * last segment" of any one operation's projected `cli.path`. Computed fresh
23
+ * on every call (never cached as a literal) so a future change to the
24
+ * extraction call site (e.g. re-enabling the file segment, or adding a
25
+ * second source file) can never silently desync this from the real command
26
+ * table the way a hardcoded `['backlog']` constant would.
38
27
  */
39
28
  export declare function resolveCommandPrefix(operations: readonly Operation[]): string[];
40
29
  /**
@@ -43,7 +32,7 @@ export declare function resolveCommandPrefix(operations: readonly Operation[]):
43
32
  * user-typed argv, so `backlog get-item --repo … --human-id …` (what a
44
33
  * consumer actually types — the bin's own name is never part of `argv`)
45
34
  * resolves against the cli-output plugin's command table, which is keyed by
46
- * the FULL internal path (`['backlog', 'client-d', 'get-item']`).
35
+ * the FULL internal path (`['backlog', 'get-item']`).
47
36
  *
48
37
  * Idempotent / defensive:
49
38
  * - Empty argv is returned unchanged — `run()` treats `argv.length === 0`
@@ -26,7 +26,23 @@ export interface BacklogCtx {
26
26
  * idOverride is given.
27
27
  */
28
28
  export declare function createItem(ctx: BacklogCtx, input: CreateItemInput): Promise<CreateItemResult>;
29
- /** repo is required — humanId alone is not globally unique. */
29
+ /**
30
+ * repo is required — humanId alone is not globally unique. A genuine miss
31
+ * (humanId doesn't exist under ANY repo) still returns `null` — unchanged,
32
+ * every existing caller relying on nullable-not-throwing keeps working.
33
+ *
34
+ * BUG-BACKLOG-REPO-LOOKUP-UX-001: previously a repo/humanId MISMATCH (the
35
+ * item is live, just filed under a different `repo` string) was
36
+ * indistinguishable from a genuine miss — both silently returned `null`,
37
+ * which is worse than `appendNote`'s bare-but-at-least-thrown
38
+ * `BacklogItemNotFoundError` (and, before this fix, could surface through
39
+ * apigen's MCP layer as the unrelated broken int64/null encoding,
40
+ * BUG-APIGEN-LOGICAL-NULL-OBJECT-RESULT-INT64-001 — out of scope here, but
41
+ * this fix removes the only path that made this lookup look like that bug).
42
+ * Now: a real cross-repo match THROWS the same informative
43
+ * `BacklogItemNotFoundError` (with `foundInRepos` naming the actual repo) the
44
+ * mutating lookups already throw, instead of masquerading as "not found".
45
+ */
30
46
  export declare function getItem(ctx: BacklogCtx, repo: string, humanId: string): Promise<BacklogItem | null>;
31
47
  export declare function updateItem(ctx: BacklogCtx, repo: string, humanId: string, patch: UpdateItemInput): Promise<BacklogItem>;
32
48
  export declare function listItems(ctx: BacklogCtx, filter?: BacklogFilter): Promise<BacklogItem[]>;
@@ -77,7 +93,16 @@ export declare function setPriority(ctx: BacklogCtx, repo: string, humanId: stri
77
93
  /** MEMBER_OF edge to a plan node (auto-created if the plan slug hasn't been seen before). */
78
94
  export declare function attachToPlan(ctx: BacklogCtx, repo: string, humanId: string, planSlug: string): Promise<void>;
79
95
  export declare function importFromMarkdown(ctx: BacklogCtx, input: ImportMarkdownInput): Promise<ImportResult>;
80
- /** Excludes archived items (SPEC.md §5.4 archiveResolved) — see markdown.ts's renderItemsToMarkdown doc comment. */
96
+ /**
97
+ * Excludes archived items (SPEC.md §5.4 archiveResolved) — see markdown.ts's
98
+ * renderItemsToMarkdown doc comment. Archival exclusion goes through
99
+ * `BacklogFilter.excludeArchived` (query.ts's `applyExcludeArchivedFilter`)
100
+ * rather than a private scan here, so a caller comparing this output
101
+ * against `listItems`/`queryItemNodes` for the SAME filter (e.g.
102
+ * `render-projections.mjs`'s round-trip verify) can reproduce this exact
103
+ * item set by passing `{ ...filter, excludeArchived: true }` themselves —
104
+ * see BUG-BACKLOG-RENDER-VERIFY-ARCHIVED-MISMATCH-001.
105
+ */
81
106
  export declare function renderToMarkdown(ctx: BacklogCtx, filter?: BacklogFilter): Promise<string>;
82
107
  export declare function exportJson(ctx: BacklogCtx, filter?: BacklogFilter): Promise<BacklogItem[]>;
83
108
  /** Bi-temporal history + supersession chain. */