@adhd/backlog 0.1.0 → 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/model.d.ts CHANGED
@@ -61,8 +61,19 @@ export interface BacklogItem {
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
63
  }
64
+ /**
65
+ * BUG-BACKLOG-REPO-LOOKUP-UX-001: a `(repo, humanId)` miss is frequently NOT
66
+ * "this item doesn't exist" but "this item exists under a DIFFERENT `repo`
67
+ * string" (e.g. `"adhd"` vs `"PseudoSky/adhd"` both live in the same store
68
+ * for what is logically one project). `foundInRepos` — populated by
69
+ * `store/query.ts`'s `buildNotFoundError` helper, which every throw site now
70
+ * calls instead of constructing this directly — carries the OTHER repo
71
+ * value(s) the humanId actually lives under, so the thrown message names the
72
+ * fix instead of leaving the caller to guess.
73
+ */
64
74
  export declare class BacklogItemNotFoundError extends Error {
65
- constructor(repo: string, humanId: string);
75
+ readonly foundInRepos: string[];
76
+ constructor(repo: string, humanId: string, foundInRepos?: string[]);
66
77
  }
67
78
  export declare class CitationRequiredError extends Error {
68
79
  constructor(status: BacklogStatus);
@@ -104,6 +115,14 @@ export interface CreateItemResult {
104
115
  item: BacklogItem;
105
116
  created: boolean;
106
117
  duplicateCandidates: BacklogItem[];
118
+ /**
119
+ * BUG-BACKLOG-REPO-LOOKUP-UX-001: set (soft warning, never blocks the
120
+ * write) when `input.repo` doesn't match any repo value already known to
121
+ * this store — a likely typo/inconsistent-repo-string drift (e.g. filing
122
+ * under `"adhd"` when every existing item uses `"PseudoSky/adhd"`) rather
123
+ * than a genuine first-time-use of a new repo, which is always allowed.
124
+ */
125
+ repoWarning?: string;
107
126
  }
108
127
  export interface UpdateItemInput {
109
128
  title?: string;
@@ -282,6 +301,8 @@ export interface ImportResult {
282
301
  }>;
283
302
  /** Headers that look like a corrupted/typo'd id and were dropped instead of parsed — never silent (DEBT-BACKLOG-IMPORT-SILENT-DROP-001). */
284
303
  malformedHeaders: MalformedHeaderInfo[];
304
+ /** See `CreateItemResult.repoWarning` (BUG-BACKLOG-REPO-LOOKUP-UX-001) — computed once for `input.repo`, not per item. */
305
+ repoWarning?: string;
285
306
  }
286
307
  export interface AuditTrailEntry {
287
308
  at: string;
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@adhd/backlog",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "bin": {
5
5
  "backlog": "index.js"
6
6
  },
7
7
  "dependencies": {
8
8
  "@adhd/sox-graph-store": "^0.3.0",
9
9
  "better-sqlite3": "^12.10.0",
10
- "@adhd/environment": "^0.1.0",
10
+ "@adhd/environment": "^0.1.1",
11
11
  "@adhd/environment-base-spec": "^0.1.0",
12
- "@adhd/apigen-core-client": "^0.2.0",
13
- "@adhd/apigen-plugin-api-fastify": "^0.2.0",
14
- "@adhd/apigen-plugin-openapi": "^0.2.0",
15
- "@adhd/apigen-plugin-mcp": "^0.2.0",
16
- "@adhd/apigen-plugin-cli-output": "^0.2.0",
17
- "@adhd/apigen-engine-naming": "^0.2.0",
12
+ "@adhd/apigen-core-client": "^0.2.1",
13
+ "@adhd/apigen-plugin-api-fastify": "^0.2.1",
14
+ "@adhd/apigen-plugin-openapi": "^0.2.1",
15
+ "@adhd/apigen-plugin-mcp": "^0.2.1",
16
+ "@adhd/apigen-plugin-batch": "^0.2.0",
17
+ "@adhd/apigen-plugin-cli-output": "^0.2.1",
18
+ "@adhd/apigen-engine-naming": "^0.2.1",
18
19
  "yaml": "1.10.3",
19
20
  "pino": "10.3.1",
20
21
  "pino-pretty": "13.1.3"
package/store/query.d.ts CHANGED
@@ -1,12 +1,38 @@
1
1
  import { BacklogNodeMeta } from './mapping.js';
2
2
  import { GraphBacklogStore } from './graph-backlog-store.js';
3
- import { AuditTrailResult, BacklogFilter, BacklogItem, DependencyGraph, StatsScope, TopoOrderResult } from '../model.js';
3
+ import { AuditTrailResult, BacklogFilter, BacklogItem, DependencyGraph, StatsScope, TopoOrderResult, BacklogItemNotFoundError } from '../model.js';
4
4
  import { NodeRecord } from '@adhd/sox-graph-store';
5
5
 
6
6
  /** Raw NodeRecord query — used internally where the full node (not just the mapped BacklogItem) is needed. */
7
7
  export declare function queryItemNodes(store: GraphBacklogStore, filter?: BacklogFilter): NodeRecord[];
8
8
  export declare function listItems(store: GraphBacklogStore, filter?: BacklogFilter): BacklogItem[];
9
9
  export declare function findItemNode(store: GraphBacklogStore, repo: string, humanId: string): NodeRecord | null;
10
+ /**
11
+ * Finds every LIVE node carrying this `humanId`, across ALL repos (no
12
+ * `namespace` filter) — BUG-BACKLOG-REPO-LOOKUP-UX-001's "did you mean repo
13
+ * X?" hint needs this to distinguish "this humanId truly doesn't exist" from
14
+ * "it exists, just filed under a different repo string than the caller
15
+ * passed." Used only on the miss path (`buildNotFoundError`) — never on the
16
+ * hot successful-lookup path, so it costs nothing when a lookup is correct.
17
+ */
18
+ export declare function findHumanIdInAnyRepo(store: GraphBacklogStore, humanId: string): NodeRecord[];
19
+ /**
20
+ * Every distinct repo value any LIVE backlog item is currently filed under.
21
+ * Used by `createItemNode`'s soft repo-drift warning (write-time half of
22
+ * BUG-BACKLOG-REPO-LOOKUP-UX-001) — an empty store (no items yet) has no
23
+ * "known" repos, so the very first item filed under any repo string never
24
+ * triggers a false-positive warning.
25
+ */
26
+ export declare function knownRepos(store: GraphBacklogStore): Set<string>;
27
+ /**
28
+ * Builds the `BacklogItemNotFoundError` every miss site throws — the single
29
+ * place that decides whether a "did you mean repo X?" hint is warranted
30
+ * (BUG-BACKLOG-REPO-LOOKUP-UX-001, read-time half). Callers pass the SAME
31
+ * `(repo, humanId)` they just failed to find via `findItemNode` — this
32
+ * re-queries WITHOUT the `namespace` restriction to see if the humanId lives
33
+ * under a different repo string instead.
34
+ */
35
+ export declare function buildNotFoundError(store: GraphBacklogStore, repo: string, humanId: string): BacklogItemNotFoundError;
10
36
  export declare function computeStats(store: GraphBacklogStore, scope?: StatsScope): import('../model.js').BacklogStats;
11
37
  export declare function spotlight(store: GraphBacklogStore, scope?: StatsScope, limit?: number): BacklogItem[];
12
38
  export declare function blockers(store: GraphBacklogStore, repo: string, humanId: string): BacklogItem[];