@software-dlc/cli 0.179.0 → 0.181.0

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,5 +1,15 @@
1
1
  # @software-dlc/cli
2
2
 
3
+ ## 0.181.0
4
+
5
+ ## 0.180.1
6
+
7
+ ## 0.180.0
8
+
9
+ ### Minor Changes
10
+
11
+ - 7fa6b30: Graph: the Releases section of `sdlc viewer` is now the hosted app's Releases page, drawn on this checkout's Release records at `proj/<project>/releases`, and no longer opens the classic page. The list holds the candidate, the open Planned Releases and every Release by its label. A Release that did not change the app reads App unchanged, a withdrawn one names what replaced it, and a record that cannot be read is listed as such. The candidate shows its release batch, as `sdlc view` words it. A Release shows its Known issues, its release tracks with each package that moved, its Planned Releases delivery, and its Related threads, tasks, issues and tests. A Planned Release shows its order, members and serving threads. The selected item is the address's query (`?release=`, `?planned=`), and `releases`, `org/<org>/releases` and saved `#release=`, `#releases` and `#planned` links land there. `sdlc viewer` answers these reads under `api/app/releases`: `candidate/batch`, `<label>/related` and `planned/<id>`. A busy store answers 503 with a retry time.
12
+
3
13
  ## 0.179.0
4
14
 
5
15
  ### Minor Changes
@@ -130,7 +130,7 @@ export declare function inspectSnapshotCommand(input: {
130
130
  kind: "semantic_annotation";
131
131
  data: {
132
132
  source_evidence: {
133
- status?: "candidate" | "accepted" | "provisional" | "superseded" | "stale" | undefined;
133
+ status?: "candidate" | "accepted" | "superseded" | "provisional" | "stale" | undefined;
134
134
  symbolic_ref?: {
135
135
  ref_type: "route" | "table" | "external" | "patch_local" | "source_symbol" | "ui" | "concept";
136
136
  name: string;
@@ -154,7 +154,7 @@ export declare function inspectSnapshotCommand(input: {
154
154
  kind?: "tests" | "calls" | "renders" | "imports" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | undefined;
155
155
  summary?: string | undefined;
156
156
  confidence?: number | undefined;
157
- status?: "candidate" | "accepted" | "provisional" | "superseded" | "stale" | undefined;
157
+ status?: "candidate" | "accepted" | "superseded" | "provisional" | "stale" | undefined;
158
158
  } | undefined;
159
159
  references?: {
160
160
  path: string;
@@ -169,7 +169,7 @@ export declare function inspectSnapshotCommand(input: {
169
169
  kind?: "tests" | "calls" | "renders" | "imports" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | undefined;
170
170
  summary?: string | undefined;
171
171
  confidence?: number | undefined;
172
- status?: "candidate" | "accepted" | "provisional" | "superseded" | "stale" | undefined;
172
+ status?: "candidate" | "accepted" | "superseded" | "provisional" | "stale" | undefined;
173
173
  }[] | undefined;
174
174
  confidence?: number | undefined;
175
175
  summary?: string | undefined;
@@ -183,7 +183,7 @@ export declare function inspectSnapshotCommand(input: {
183
183
  contract_version: "evidence-reference-v1";
184
184
  references: {
185
185
  reference_id: string;
186
- source_class: "message" | "document" | "file" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
186
+ source_class: "file" | "message" | "document" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
187
187
  provider_key: string;
188
188
  profile_version: number;
189
189
  resource: {
@@ -191,7 +191,7 @@ export declare function inspectSnapshotCommand(input: {
191
191
  id: string;
192
192
  display_key?: string | undefined;
193
193
  };
194
- relations: ("tests" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates" | "tracks")[];
194
+ relations: ("tests" | "tracks" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates")[];
195
195
  provider_instance_id?: string | undefined;
196
196
  tenant_id?: string | undefined;
197
197
  ancestors?: {
@@ -213,13 +213,13 @@ export declare function inspectSnapshotCommand(input: {
213
213
  origin?: "legacy_v1" | undefined;
214
214
  canonical_url?: string | undefined;
215
215
  content_digest?: string | undefined;
216
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
216
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
217
217
  summary?: string | undefined;
218
218
  confidence?: number | undefined;
219
219
  claim_object_hash?: `sha256:${string}` | undefined;
220
220
  }[];
221
221
  primary_reference_id?: string | undefined;
222
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
222
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
223
223
  summary?: string | undefined;
224
224
  confidence?: number | undefined;
225
225
  symbolic_ref?: {
@@ -242,7 +242,7 @@ export declare function inspectSnapshotCommand(input: {
242
242
  contract_version: "evidence-reference-v1";
243
243
  references: {
244
244
  reference_id: string;
245
- source_class: "message" | "document" | "file" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
245
+ source_class: "file" | "message" | "document" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
246
246
  provider_key: string;
247
247
  profile_version: number;
248
248
  resource: {
@@ -250,7 +250,7 @@ export declare function inspectSnapshotCommand(input: {
250
250
  id: string;
251
251
  display_key?: string | undefined;
252
252
  };
253
- relations: ("tests" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates" | "tracks")[];
253
+ relations: ("tests" | "tracks" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates")[];
254
254
  provider_instance_id?: string | undefined;
255
255
  tenant_id?: string | undefined;
256
256
  ancestors?: {
@@ -272,13 +272,13 @@ export declare function inspectSnapshotCommand(input: {
272
272
  origin?: "legacy_v1" | undefined;
273
273
  canonical_url?: string | undefined;
274
274
  content_digest?: string | undefined;
275
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
275
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
276
276
  summary?: string | undefined;
277
277
  confidence?: number | undefined;
278
278
  claim_object_hash?: `sha256:${string}` | undefined;
279
279
  }[];
280
280
  primary_reference_id?: string | undefined;
281
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
281
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
282
282
  summary?: string | undefined;
283
283
  confidence?: number | undefined;
284
284
  symbolic_ref?: {
@@ -301,7 +301,7 @@ export declare function inspectSnapshotCommand(input: {
301
301
  contract_version: "evidence-reference-v1";
302
302
  references: {
303
303
  reference_id: string;
304
- source_class: "message" | "document" | "file" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
304
+ source_class: "file" | "message" | "document" | "design" | "source_code" | "work_item" | "comment" | "runtime" | "external_record";
305
305
  provider_key: string;
306
306
  profile_version: number;
307
307
  resource: {
@@ -309,7 +309,7 @@ export declare function inspectSnapshotCommand(input: {
309
309
  id: string;
310
310
  display_key?: string | undefined;
311
311
  };
312
- relations: ("tests" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates" | "tracks")[];
312
+ relations: ("tests" | "tracks" | "calls" | "renders" | "implements" | "imports" | "verifies" | "references" | "defines" | "configures" | "migrates" | "persists" | "infers" | "supports" | "contradicts" | "decides" | "approves" | "discusses" | "illustrates")[];
313
313
  provider_instance_id?: string | undefined;
314
314
  tenant_id?: string | undefined;
315
315
  ancestors?: {
@@ -331,13 +331,13 @@ export declare function inspectSnapshotCommand(input: {
331
331
  origin?: "legacy_v1" | undefined;
332
332
  canonical_url?: string | undefined;
333
333
  content_digest?: string | undefined;
334
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
334
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
335
335
  summary?: string | undefined;
336
336
  confidence?: number | undefined;
337
337
  claim_object_hash?: `sha256:${string}` | undefined;
338
338
  }[];
339
339
  primary_reference_id?: string | undefined;
340
- review_status?: "candidate" | "accepted" | "provisional" | "superseded" | undefined;
340
+ review_status?: "candidate" | "accepted" | "superseded" | "provisional" | undefined;
341
341
  summary?: string | undefined;
342
342
  confidence?: number | undefined;
343
343
  symbolic_ref?: {
@@ -10,7 +10,10 @@ import { type TaskModel } from './app-tasks-read.js';
10
10
  * sections after Holds (tasks/<id>/sections, the same page read) and its Related
11
11
  * (tasks/<id>/related, release_links.py trace);
12
12
  * - issues: the local issue command (`issue list --all`, `issue show`);
13
- * - releases: release_history.py, the Releases view's read of every Release and the candidate.
13
+ * - releases: release_history.py, the Releases view's read of every Release and the candidate;
14
+ * release_plan.py list, the open Planned Releases; release_links.py view, a Release's Related and a
15
+ * Planned Release (with release_links.py threads for the threads serving it); and the board read's
16
+ * release batch for the candidate's card (la-releases, app-releases.ts maps them).
14
17
  *
15
18
  * A store a writer holds locked, or one that kept changing during the read, answers 503 with
16
19
  * retry: the page may read again in a moment. Any other failure is said on the viewer's terminal and
@@ -54,6 +57,8 @@ export type AppContractReaderInput = {
54
57
  model?: TaskModel;
55
58
  run?: EngineRun;
56
59
  now?: () => number;
60
+ /** Whether the engine has a script; absent, the file system answers. Older view code lacks release_links.py. */
61
+ exists?: (script: string) => boolean;
57
62
  };
58
63
  /** The reader, and what drops its kept Tasks reads after a write (a Done) changed them. */
59
64
  export type AppContractReader = ((route: AppContractRoute) => Promise<AppContractAnswer>) & {
@@ -387,56 +392,7 @@ export declare function localIssueEvents(history: unknown[], nameOf?: (key: stri
387
392
  created_at: string;
388
393
  note: string;
389
394
  }[];
390
- /**
391
- * One of release_history.py's Releases in the hosted Release's shape. Its version is its label (the
392
- * app version, or its batch when it has no app section, so two Releases never share one); the
393
- * previous Release is the next older one listed, given by the caller.
394
- */
395
- export declare function localRelease(entry: Record<string, unknown>, previous: Record<string, unknown> | undefined): {
396
- landings?: number | undefined;
397
- id: string;
398
- version: string;
399
- computed_bump: string | null;
400
- bump: string | null;
401
- declared_reason: string | null;
402
- declared_by_name: string | null;
403
- source_judged: boolean;
404
- marks_approximate: boolean;
405
- written_by_name: null;
406
- written_at: string;
407
- previous_release_id: string | null;
408
- breaking: boolean;
409
- commit: string | null;
410
- };
411
- /**
412
- * release_history.py's candidate as the hosted candidate. Its previous Release is the newest one
413
- * listed, given by the caller and named by its label as the list names it (the candidate's own
414
- * `previous` is that Release's app version, which a Release with no app section shares).
415
- */
416
- export declare function localCandidate(entry: Record<string, unknown>, newest: Record<string, unknown> | undefined): {
417
- head_commit_id: string;
418
- previous_release: {
419
- id: string;
420
- version: string;
421
- } | null;
422
- next_version: string;
423
- version: string;
424
- commits_since: number | null;
425
- classification: {
426
- bump: "patch" | "minor" | "major";
427
- marks_approximate: boolean;
428
- } | null;
429
- changes: {
430
- node_id: string;
431
- node_type: string;
432
- label: string;
433
- change: string;
434
- bump: null;
435
- why: string | null;
436
- modeling_only: boolean;
437
- }[];
438
- };
395
+ export { localCandidate, localRelease } from './app-releases.js';
439
396
  /** The read behind sdlc viewer's api/app/ routes. */
440
397
  export declare function appContractReader(input: AppContractReaderInput): AppContractReader;
441
- export {};
442
398
  //# sourceMappingURL=app-contract-readers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-contract-readers.d.ts","sourceRoot":"","sources":["../../src/local/app-contract-readers.ts"],"names":[],"mappings":"AAKA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;;;;;;;;;;;GAiBG;AAEH,kGAAkG;AAClG,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,CAAC;AAE9E,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE,sGAAsG;AACtG,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,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QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM;QAAM,MAAM;WAAS,MAAM;cAAY,MAAM;cAAY,OAAO;IA0DrI;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM;;;;;;;;;;;;;;IAsBpF;AAkBD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjE,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAuTlF"}
@@ -1,9 +1,11 @@
1
1
  import { execFile } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
2
3
  import { createRequire } from 'node:module';
3
4
  import path from 'node:path';
4
5
  import { engineLayout } from '../checkout.js';
5
6
  import { LIST_ID, LOCAL_TASK_OFFERS, localTaskMembers, localTaskPage, localTaskStatuses, localWaitingOnYou, taskBoardRead } from './app-tasks-read.js';
6
7
  import { localTaskRelated, localTaskSections, taskOnBoard } from './app-task-sections.js';
8
+ import { localBatch, localCandidate, localPlannedList, localPlannedRelease, localRelease, localReleaseDetail, localReleaseRelated } from './app-releases.js';
7
9
  const ENGINE_TIMEOUT_MS = 120_000;
8
10
  /** How long an answer serves later requests, by what it reads. */
9
11
  const KEEP_MS = { board: 15_000, issues: 10_000, issue: 10_000, releases: 30_000, task: 10_000 };
@@ -14,7 +16,8 @@ const LOCAL = 'local';
14
16
  const TRUE = new Set(['true', '1']);
15
17
  const ISSUE_STATUSES = new Set(['open', 'triaged', 'escalated', 'waiting_on_fix', 'resolved', 'closed']);
16
18
  const RESOLUTIONS = new Set(['fixed', 'works_as_intended', 'planned', 'duplicate', 'wont_fix', 'cannot_reproduce']);
17
- const BUMPS = new Set(['patch', 'minor', 'major']);
19
+ // The kept reads the Releases page's Read again and Try again drop (fresh=1).
20
+ const RELEASE_KEYS = /^(releases|planned-list|serving|release-related:|planned:)/;
18
21
  class Refusal extends Error {
19
22
  status;
20
23
  reason;
@@ -543,66 +546,8 @@ function eventDetails(value) {
543
546
  .join(', ');
544
547
  }
545
548
  // ---- Releases ----------------------------------------------------------------------------------
546
- /** A Release's or the candidate's bump reasons as its change lines. */
547
- function releaseChanges(entry) {
548
- return list(entry.reason_lines)
549
- .map(record)
550
- .map((line) => ({
551
- node_id: String(line.node ?? ''),
552
- node_type: String(line.type ?? ''),
553
- label: String(line.label ?? ''),
554
- change: String(line.change ?? ''),
555
- bump: null,
556
- why: text(line.why),
557
- modeling_only: false
558
- }));
559
- }
560
- /**
561
- * One of release_history.py's Releases in the hosted Release's shape. Its version is its label (the
562
- * app version, or its batch when it has no app section, so two Releases never share one); the
563
- * previous Release is the next older one listed, given by the caller.
564
- */
565
- export function localRelease(entry, previous) {
566
- const override = record(entry.override);
567
- const version = String(entry.version ?? entry.id);
568
- return {
569
- id: String(entry.id ?? version),
570
- version,
571
- computed_bump: text(entry.computed),
572
- bump: text(entry.bump),
573
- declared_reason: text(override.reason),
574
- declared_by_name: text(override.by),
575
- source_judged: entry.unjudged === 0,
576
- marks_approximate: entry.lower_bound === true,
577
- written_by_name: null,
578
- written_at: iso(entry.released_at) ?? '',
579
- previous_release_id: previous ? String(previous.id ?? previous.version) : null,
580
- breaking: entry.bump === 'major',
581
- commit: text(entry.commit),
582
- ...(typeof entry.landings === 'number' ? { landings: entry.landings } : {})
583
- };
584
- }
585
- /**
586
- * release_history.py's candidate as the hosted candidate. Its previous Release is the newest one
587
- * listed, given by the caller and named by its label as the list names it (the candidate's own
588
- * `previous` is that Release's app version, which a Release with no app section shares).
589
- */
590
- export function localCandidate(entry, newest) {
591
- const bump = String(entry.bump ?? '');
592
- const previous = newest ? localRelease(newest, undefined) : null;
593
- const version = text(entry.app_version) ?? text(entry.version) ?? text(entry.previous) ?? '';
594
- return {
595
- head_commit_id: String(entry.commit ?? ''),
596
- previous_release: previous ? { id: previous.id, version: previous.version } : null,
597
- next_version: version,
598
- version,
599
- commits_since: typeof entry.commits === 'number' ? entry.commits : null,
600
- classification: BUMPS.has(bump)
601
- ? { bump: bump, marks_approximate: entry.lower_bound === true }
602
- : null,
603
- changes: releaseChanges(entry)
604
- };
605
- }
549
+ // The mappings are app-releases.ts's; the readers that feed them run below.
550
+ export { localCandidate, localRelease } from './app-releases.js';
606
551
  // ---- The reader --------------------------------------------------------------------------------
607
552
  /** The read behind sdlc viewer's api/app/ routes. */
608
553
  export function appContractReader(input) {
@@ -686,9 +631,43 @@ export function appContractReader(input) {
686
631
  return loaded;
687
632
  };
688
633
  const history = () => keep('releases', KEEP_MS.releases, () => engine('release_history.py', []));
689
- const releases = async () => list((await history()).releases)
690
- .map(record)
691
- .filter((entry) => !('error' in entry));
634
+ // Every listed Release, a record that cannot be read among them; readable() leaves those out.
635
+ const releases = async () => list((await history()).releases).map(record);
636
+ const readable = async () => (await releases()).filter((entry) => !('error' in entry));
637
+ const plannedList = () => keep('planned-list', KEEP_MS.releases, async () => {
638
+ const printed = record(JSON.parse(await run(script('release_plan.py'), ['--repo', input.repo, 'list'])));
639
+ if (printed.ok !== true)
640
+ throw new Error(`release_plan.py: ${String(printed.error ?? 'it did not answer')}`);
641
+ return localPlannedList(printed.result);
642
+ });
643
+ // release_links.py: an unknown subject is a 404, view code without it is too old for the read.
644
+ const links = async (key, args) => {
645
+ if (!(input.exists ?? existsSync)(script('release_links.py')))
646
+ throw new Refusal(409, 'This viewer reads no release links; update the main checkout and restart sdlc viewer.', 'view_outdated');
647
+ return keep(key, KEEP_MS.releases, async () => {
648
+ // A failed run keeps its message, so a locked store still reads as busy (503 with retry).
649
+ const out = await run(script('release_links.py'), ['--repo', input.repo, ...args]);
650
+ let printed;
651
+ try {
652
+ printed = record(JSON.parse(out));
653
+ }
654
+ catch {
655
+ throw new Error('release_links.py printed no JSON');
656
+ }
657
+ if (typeof printed.unknown === 'string')
658
+ throw new Refusal(404, printed.unknown, 'not_found');
659
+ if (printed.ok !== true)
660
+ throw new Error(`release_links.py: ${String(printed.error ?? 'it did not answer')}`);
661
+ return record(printed.result);
662
+ });
663
+ };
664
+ const dropReleases = () => {
665
+ for (const key of [...kept.keys(), ...reading.keys()])
666
+ if (RELEASE_KEYS.test(key)) {
667
+ kept.delete(key);
668
+ reading.delete(key);
669
+ }
670
+ };
692
671
  const answer = async (segments, query) => {
693
672
  const [domain, ...rest] = segments;
694
673
  const route = rest.join('/');
@@ -805,12 +784,31 @@ export function appContractReader(input) {
805
784
  }
806
785
  }
807
786
  if (domain === 'releases') {
787
+ // Read again and Try again read past what is kept (fresh=1); the board read is the Tasks page's.
788
+ if (query.get('fresh') === '1')
789
+ dropReleases();
790
+ // In this order, so candidate, planned and related are never read as a label.
808
791
  if (!route) {
792
+ const all = await releases();
793
+ let planned;
794
+ let planned_error;
795
+ try {
796
+ planned = await plannedList();
797
+ }
798
+ catch (error) {
799
+ // A failed Planned Releases read never costs the list.
800
+ process.stderr.write(`sdlc viewer: releases planned failed: ${error instanceof Error ? error.message : String(error)}\n`);
801
+ planned_error = 'release_plan.py could not list them; see the sdlc viewer terminal.';
802
+ }
803
+ const listed = all.filter((entry) => !('error' in entry));
809
804
  return {
810
805
  release_branch: null,
811
- releases: (await releases()).map((entry, index, all) => localRelease(entry, all[index + 1])),
806
+ releases: all.map((entry) => localRelease(entry, listed[listed.indexOf(entry) + 1])),
812
807
  next_before: null,
813
- can_write: false
808
+ can_write: false,
809
+ local: { read_at: new Date(now()).toISOString() },
810
+ ...(planned ? { planned } : {}),
811
+ ...(planned_error ? { planned_error } : {})
814
812
  };
815
813
  }
816
814
  if (route === 'candidate') {
@@ -820,16 +818,44 @@ export function appContractReader(input) {
820
818
  const entry = record(candidate);
821
819
  if (typeof entry.error === 'string')
822
820
  throw new Error(`the candidate cannot be described: ${entry.error}`);
823
- return { candidate: localCandidate(entry, (await releases())[0]) };
821
+ return { candidate: localCandidate(entry, (await readable())[0]) };
822
+ }
823
+ if (route === 'candidate/batch') {
824
+ let raw;
825
+ try {
826
+ raw = (await board()).release_batch;
827
+ }
828
+ catch (error) {
829
+ // A failed board read never refuses the candidate: its batch reads unknown.
830
+ process.stderr.write(`sdlc viewer: releases batch failed: ${error instanceof Error ? error.message : String(error)}\n`);
831
+ }
832
+ return { batch: localBatch(raw) };
833
+ }
834
+ if (rest.length === 2 && rest[0] === 'planned') {
835
+ const id = rest[1];
836
+ const view = await links(`planned:${id}`, ['view', '--planned', id]);
837
+ const [open, serving, titles] = await Promise.all([
838
+ plannedList().catch(() => []),
839
+ links('serving', ['threads']).catch(() => null),
840
+ board()
841
+ .then((read) => new Map((read.threads ?? []).map((t) => [String(t.key), String(t.title ?? t.key)])))
842
+ .catch(() => new Map())
843
+ ]);
844
+ return localPlannedRelease(view, open, serving, titles);
845
+ }
846
+ if (rest.length === 2 && rest[1] === 'related') {
847
+ const label = rest[0];
848
+ const view = await links(`release-related:${label}`, ['view', '--release', label, '--threads']);
849
+ const names = new Map((await plannedList().catch(() => [])).map((p) => [p.id, p.name]));
850
+ return localReleaseRelated(view, names);
824
851
  }
825
852
  if (rest.length === 1) {
826
853
  const version = rest[0];
827
- const all = await releases();
854
+ const all = await readable();
828
855
  const index = all.findIndex((entry) => entry.id === version || entry.version === version);
829
856
  if (index < 0)
830
857
  throw notFound();
831
- const found = all[index];
832
- return { release: { ...localRelease(found, all[index + 1]), changes: releaseChanges(found) } };
858
+ return { release: localReleaseDetail(all[index], all[index + 1]) };
833
859
  }
834
860
  }
835
861
  throw notFound();