peaks-loop 4.1.19 → 4.1.21

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.
Files changed (27) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +219 -0
  3. package/dist/cli/commands/observability-commands-baseline.d.ts +26 -0
  4. package/dist/cli/commands/observability-commands-baseline.js +74 -0
  5. package/dist/cli/commands/observability-commands-queries.d.ts +5 -0
  6. package/dist/cli/commands/observability-commands-queries.js +8 -1
  7. package/dist/cli/commands/observability-commands.d.ts +7 -1
  8. package/dist/cli/commands/observability-commands.js +19 -3
  9. package/dist/services/artifacts/repair-cycle-service.d.ts +23 -0
  10. package/dist/services/artifacts/repair-cycle-service.js +23 -0
  11. package/dist/services/observability/aggregation-helpers.d.ts +12 -8
  12. package/dist/services/observability/aggregation-helpers.js +12 -25
  13. package/dist/services/observability/aggregation-types.d.ts +40 -0
  14. package/dist/services/observability/aggregation.d.ts +2 -1
  15. package/dist/services/observability/aggregation.js +16 -25
  16. package/dist/services/observability/repair-cycle-metric.d.ts +67 -0
  17. package/dist/services/observability/repair-cycle-metric.js +223 -0
  18. package/dist/services/observability/report-formatter.d.ts +1 -1
  19. package/dist/services/observability/report-formatter.js +16 -4
  20. package/dist/services/observability/results-baseline-artifact.d.ts +29 -0
  21. package/dist/services/observability/results-baseline-artifact.js +80 -0
  22. package/dist/services/observability/results-baseline-rows.d.ts +33 -0
  23. package/dist/services/observability/results-baseline-rows.js +127 -0
  24. package/dist/services/observability/results-baseline.d.ts +115 -0
  25. package/dist/services/observability/results-baseline.js +101 -0
  26. package/package.json +8 -5
  27. package/scripts/canonical-store-report.mjs +84 -0
@@ -0,0 +1,127 @@
1
+ /**
2
+ * `src/services/observability/results-baseline-rows.ts`
3
+ *
4
+ * WHY THIS MODULE EXISTS. The published rows and the old-vs-new metric
5
+ * comparison are the two parts of the results baseline that decide what a
6
+ * reader is shown, and both are big enough to push the computation module
7
+ * over the repository's 300 raw-line file-size cap.
8
+ *
9
+ * THE RULE THE ROWS OBEY. Every published row is a RATE or a PEAK. A raw
10
+ * count that grows with the number of slices ever recorded is a population
11
+ * descriptor, not a baseline row — those live in their own block of the
12
+ * artifact, and a reader must never mistake one for the other.
13
+ *
14
+ * THE RULE THE COMPARISON OBEY. Version 1 of the repair-cycle metric counted
15
+ * qa-role slice-transition events — QA's own internal state transitions,
16
+ * doubled by the duplicate emission — and was never a repair-cycle count.
17
+ * Version 2 counts repair cycles. The two are recorded side by side so the
18
+ * historical numbers are read as a DIFFERENT MEASUREMENT, not as a
19
+ * regression.
20
+ */
21
+ function ratio(numerator, denominator) {
22
+ if (denominator <= 0)
23
+ return 0;
24
+ return numerator / denominator;
25
+ }
26
+ /** Decimal base of the rounding helper. */
27
+ const DECIMAL_BASE = 10;
28
+ /** How many decimal places a published rate carries. */
29
+ const RATE_DIGITS = 6;
30
+ function round(value, digits) {
31
+ const factor = DECIMAL_BASE ** digits;
32
+ return Math.round(value * factor) / factor;
33
+ }
34
+ /** How many slices hold each value — the measured distribution of one metric. */
35
+ function distributionOf(values) {
36
+ const counts = new Map();
37
+ for (const value of values)
38
+ counts.set(value, (counts.get(value) ?? 0) + 1);
39
+ const out = {};
40
+ for (const key of [...counts.keys()].sort((a, b) => a - b)) {
41
+ out[String(key)] = counts.get(key) ?? 0;
42
+ }
43
+ return out;
44
+ }
45
+ /**
46
+ * The published rows. Every one of them is a RATE or a PEAK: a raw count that
47
+ * grows with the number of slices ever recorded is a population descriptor,
48
+ * not a baseline row.
49
+ */
50
+ export function baselineRows(status, cycles, slices) {
51
+ return [
52
+ {
53
+ id: 'repair-cycle-cap-hit-rate',
54
+ kind: 'rate',
55
+ value: round(ratio(cycles.capHitCount, slices), RATE_DIGITS),
56
+ unit: 'slices at or over the cap / slices',
57
+ description: 'Share of slices at or over the RD/QA repair cap. Version 2 metric.'
58
+ },
59
+ {
60
+ id: 'repair-cycle-peak',
61
+ kind: 'peak',
62
+ value: status.repairCyclePeak,
63
+ unit: 'repair cycles in one slice',
64
+ description: 'Highest repair-cycle count held by a single slice. Version 2 metric.'
65
+ },
66
+ {
67
+ id: 'qa-round-peak',
68
+ kind: 'peak',
69
+ value: cycles.qaRounds.peak,
70
+ unit: 'QA phases in one slice',
71
+ description: 'Highest number of QA phases in one slice. A QA phase is NOT a repair cycle.'
72
+ },
73
+ {
74
+ id: 'slice-success-rate',
75
+ kind: 'rate',
76
+ value: round(ratio(status.successCount, slices), RATE_DIGITS),
77
+ unit: 'successful slices / slices',
78
+ description: 'Share of slices whose final state is a terminal happy state.'
79
+ },
80
+ {
81
+ id: 'slice-failure-rate',
82
+ kind: 'rate',
83
+ value: round(ratio(status.failCount, slices), RATE_DIGITS),
84
+ unit: 'failed slices / slices',
85
+ description: 'Share of slices whose final state is blocked.'
86
+ },
87
+ {
88
+ id: 'fanout-cost-per-slice',
89
+ kind: 'mean',
90
+ value: round(ratio(status.fanoutCostTotal, slices), RATE_DIGITS),
91
+ unit: 'dispatch events / slice',
92
+ description: 'Mean sub-agent dispatch cost per slice.'
93
+ }
94
+ ];
95
+ }
96
+ /**
97
+ * The old-vs-new comparison, recorded so a reader sees that the historical
98
+ * numbers were a DIFFERENT MEASUREMENT and not a regression.
99
+ */
100
+ export function metricComparison(cycles, slices) {
101
+ const legacyValues = cycles.legacyQaEventCount.perSlice.map((row) => row.eventCount);
102
+ const cycleValues = cycles.perSlice.map((row) => row.cycleCount);
103
+ return {
104
+ note: "Version 1 counted qa-role slice-transition events (QA's own internal state transitions, " +
105
+ 'doubled by the duplicate emission) and was never a repair-cycle count. Version 2 counts ' +
106
+ 'repair cycles. The historical numbers below are a different measurement, not a regression — ' +
107
+ 'do not compare a v1 number with a v2 number.',
108
+ v1QaEventCount: {
109
+ metric: cycles.legacyQaEventCount.metric,
110
+ metricVersion: cycles.legacyQaEventCount.metricVersion,
111
+ total: cycles.legacyQaEventCount.total,
112
+ peak: cycles.legacyQaEventCount.peak,
113
+ slicesMeasured: slices,
114
+ slicesAtOrOverCap: cycles.legacyQaEventCount.capHitCount,
115
+ distribution: distributionOf(legacyValues)
116
+ },
117
+ v2RepairCycles: {
118
+ metric: cycles.metric,
119
+ metricVersion: cycles.metricVersion,
120
+ total: cycles.totalCycles,
121
+ peak: cycles.perSlice.reduce((peak, row) => Math.max(peak, row.cycleCount), 0),
122
+ slicesMeasured: slices,
123
+ slicesAtOrOverCap: cycles.capHitCount,
124
+ distribution: distributionOf(cycleValues)
125
+ }
126
+ };
127
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * `src/services/observability/results-baseline.ts`
3
+ *
4
+ * WHY THIS MODULE EXISTS — the results layer had no baseline at all, and the
5
+ * constraint that shapes what a baseline can be here is that the DATA IS NOT
6
+ * IN GIT.
7
+ *
8
+ * Observability data lives at `.peaks/_runtime/<sessionId>/metrics/slices.jsonl`
9
+ * and every such path is gitignored (verified with `git check-ignore`). A CI
10
+ * runner has no session data, therefore a results-layer baseline CANNOT be a
11
+ * CI gate. Pretending otherwise would produce a green CI job that checks
12
+ * nothing, so the tracked artifact says in machine-readable form that it is
13
+ * not CI-enforceable and why, and this module never wires itself into CI.
14
+ *
15
+ * What it IS: a tracked artifact (`.peaks/observability/results-baseline.json`)
16
+ * that records the current results-layer numbers as RATES and PEAKS — never
17
+ * as raw counts that grow with the number of slices ever recorded — is
18
+ * regenerable on demand (`peaks observability baseline --write`) and can be
19
+ * compared during a local run or a slice review (`--check`).
20
+ *
21
+ * The artifact also carries the old-vs-new comparison of the repair-cycle
22
+ * metric, because the historical numbers were a DIFFERENT MEASUREMENT and not
23
+ * a regression: version 1 counted qa-role transition events, version 2 counts
24
+ * repair cycles.
25
+ */
26
+ /** The tracked artifact's path, relative to the project root. */
27
+ export declare const RESULTS_BASELINE_RELATIVE_PATH = ".peaks/observability/results-baseline.json";
28
+ export declare const RESULTS_BASELINE_SCHEMA_VERSION = 1;
29
+ /**
30
+ * Machine-readable statement that this artifact is NOT a CI gate, and why.
31
+ * A reader who finds the file must not assume a CI job enforces it.
32
+ */
33
+ export declare const CI_ENFORCEABLE_REASON: string;
34
+ /**
35
+ * The drift `--check` tolerates per row kind. Absolute, not relative: the
36
+ * baseline rows are rates and peaks, and a relative band on a rate that is
37
+ * near zero would be meaningless.
38
+ */
39
+ export declare const RESULTS_BASELINE_TOLERANCE: {
40
+ readonly rate: 0.02;
41
+ readonly peak: 1;
42
+ readonly mean: 0.5;
43
+ };
44
+ export type BaselineRowKind = 'rate' | 'peak' | 'mean';
45
+ export type BaselineRow = {
46
+ id: string;
47
+ kind: BaselineRowKind;
48
+ value: number;
49
+ unit: string;
50
+ description: string;
51
+ };
52
+ export type BaselineTolerance = {
53
+ rate: number;
54
+ peak: number;
55
+ mean: number;
56
+ note: string;
57
+ };
58
+ export type BaselinePopulation = {
59
+ scope: string;
60
+ sessionIds: string[];
61
+ sessionCount: number;
62
+ sliceCount: number;
63
+ sliceTransitionEventCount: number;
64
+ measuredAt: string;
65
+ };
66
+ export type MetricComparisonSide = {
67
+ metric: string;
68
+ metricVersion: number;
69
+ total: number;
70
+ peak: number;
71
+ slicesMeasured: number;
72
+ slicesAtOrOverCap: number;
73
+ distribution: Record<string, number>;
74
+ };
75
+ export type ResultsBaseline = {
76
+ schemaVersion: number;
77
+ metricVersion: number;
78
+ generatedAt: string;
79
+ ciEnforceable: false;
80
+ ciEnforceableReason: string;
81
+ tolerance: BaselineTolerance;
82
+ baselineRows: BaselineRow[];
83
+ population: BaselinePopulation;
84
+ populationDescriptors: {
85
+ note: string;
86
+ totalSlices: number;
87
+ totalSliceTransitionEvents: number;
88
+ totalRepairCycles: number;
89
+ totalQaRounds: number;
90
+ totalLegacyQaEvents: number;
91
+ };
92
+ metricComparison: {
93
+ note: string;
94
+ v1QaEventCount: MetricComparisonSide;
95
+ v2RepairCycles: MetricComparisonSide;
96
+ };
97
+ };
98
+ export type BaselineDrift = {
99
+ rowId: string;
100
+ kind: 'row-missing' | 'value-drift' | 'metric-version-mismatch';
101
+ tracked: number | null;
102
+ computed: number | null;
103
+ tolerance: number | null;
104
+ };
105
+ /**
106
+ * Compute the baseline over the WHOLE recorded history of a project. This is
107
+ * the population the tracked artifact describes; a session-scoped run would
108
+ * measure a different population and could not be compared with it.
109
+ */
110
+ export declare function computeResultsBaseline(projectRoot: string): ResultsBaseline;
111
+ /**
112
+ * `src/services/observability/results-baseline-artifact.ts` holds the
113
+ * tracked artifact's on-disk side: reading it, writing it, and reporting
114
+ * drift against a freshly computed baseline.
115
+ */
@@ -0,0 +1,101 @@
1
+ /**
2
+ * `src/services/observability/results-baseline.ts`
3
+ *
4
+ * WHY THIS MODULE EXISTS — the results layer had no baseline at all, and the
5
+ * constraint that shapes what a baseline can be here is that the DATA IS NOT
6
+ * IN GIT.
7
+ *
8
+ * Observability data lives at `.peaks/_runtime/<sessionId>/metrics/slices.jsonl`
9
+ * and every such path is gitignored (verified with `git check-ignore`). A CI
10
+ * runner has no session data, therefore a results-layer baseline CANNOT be a
11
+ * CI gate. Pretending otherwise would produce a green CI job that checks
12
+ * nothing, so the tracked artifact says in machine-readable form that it is
13
+ * not CI-enforceable and why, and this module never wires itself into CI.
14
+ *
15
+ * What it IS: a tracked artifact (`.peaks/observability/results-baseline.json`)
16
+ * that records the current results-layer numbers as RATES and PEAKS — never
17
+ * as raw counts that grow with the number of slices ever recorded — is
18
+ * regenerable on demand (`peaks observability baseline --write`) and can be
19
+ * compared during a local run or a slice review (`--check`).
20
+ *
21
+ * The artifact also carries the old-vs-new comparison of the repair-cycle
22
+ * metric, because the historical numbers were a DIFFERENT MEASUREMENT and not
23
+ * a regression: version 1 counted qa-role transition events, version 2 counts
24
+ * repair cycles.
25
+ */
26
+ import { aggregateRepairCycles, aggregateStatus, readAllSessionEvents } from './aggregation.js';
27
+ import { listSessionDirsWithMetrics } from './jsonl-store.js';
28
+ import { REPAIR_CYCLE_METRIC_VERSION } from './repair-cycle-metric.js';
29
+ import { baselineRows, metricComparison } from './results-baseline-rows.js';
30
+ /** The tracked artifact's path, relative to the project root. */
31
+ export const RESULTS_BASELINE_RELATIVE_PATH = '.peaks/observability/results-baseline.json';
32
+ export const RESULTS_BASELINE_SCHEMA_VERSION = 1;
33
+ /**
34
+ * Machine-readable statement that this artifact is NOT a CI gate, and why.
35
+ * A reader who finds the file must not assume a CI job enforces it.
36
+ */
37
+ export const CI_ENFORCEABLE_REASON = 'NOT CI-ENFORCEABLE. The source data lives in .peaks/_runtime/<sessionId>/metrics/slices.jsonl, ' +
38
+ 'and every such path is gitignored — a CI runner has no session data, so there is nothing there to ' +
39
+ 'compare against. This file is a local review artifact: regenerate it with ' +
40
+ '`peaks observability baseline --write` on a machine that has session data and compare it with ' +
41
+ '`peaks observability baseline --check` during a local run or a slice review.';
42
+ /**
43
+ * The drift `--check` tolerates per row kind. Absolute, not relative: the
44
+ * baseline rows are rates and peaks, and a relative band on a rate that is
45
+ * near zero would be meaningless.
46
+ */
47
+ export const RESULTS_BASELINE_TOLERANCE = {
48
+ rate: 0.02,
49
+ peak: 1,
50
+ mean: 0.5
51
+ };
52
+ /**
53
+ * Compute the baseline over the WHOLE recorded history of a project. This is
54
+ * the population the tracked artifact describes; a session-scoped run would
55
+ * measure a different population and could not be compared with it.
56
+ */
57
+ export function computeResultsBaseline(projectRoot) {
58
+ const events = readAllSessionEvents(projectRoot);
59
+ const status = aggregateStatus(events);
60
+ const cycles = aggregateRepairCycles(events);
61
+ const sessionIds = listSessionDirsWithMetrics(projectRoot).map((entry) => entry.sessionId);
62
+ const sliceTransitionEventCount = events.filter((event) => event.category === 'slice-transition').length;
63
+ const slices = status.totalSlices;
64
+ const generatedAt = new Date().toISOString();
65
+ return {
66
+ schemaVersion: RESULTS_BASELINE_SCHEMA_VERSION,
67
+ metricVersion: REPAIR_CYCLE_METRIC_VERSION,
68
+ generatedAt,
69
+ ciEnforceable: false,
70
+ ciEnforceableReason: CI_ENFORCEABLE_REASON,
71
+ tolerance: {
72
+ ...RESULTS_BASELINE_TOLERANCE,
73
+ note: 'Absolute drift allowed per row kind when `peaks observability baseline --check` compares ' +
74
+ 'the tracked artifact with the freshly computed baseline.'
75
+ },
76
+ baselineRows: baselineRows(status, cycles, slices),
77
+ population: {
78
+ scope: 'all-sessions',
79
+ sessionIds,
80
+ sessionCount: sessionIds.length,
81
+ sliceCount: slices,
82
+ sliceTransitionEventCount,
83
+ measuredAt: generatedAt
84
+ },
85
+ populationDescriptors: {
86
+ note: 'Population descriptors, NOT baseline rows: these grow with the number of slices ever ' +
87
+ 'recorded and must never be gated on. The baseline rows above are rates and peaks.',
88
+ totalSlices: slices,
89
+ totalSliceTransitionEvents: sliceTransitionEventCount,
90
+ totalRepairCycles: cycles.totalCycles,
91
+ totalQaRounds: cycles.qaRounds.total,
92
+ totalLegacyQaEvents: cycles.legacyQaEventCount.total
93
+ },
94
+ metricComparison: metricComparison(cycles, slices)
95
+ };
96
+ }
97
+ /**
98
+ * `src/services/observability/results-baseline-artifact.ts` holds the
99
+ * tracked artifact's on-disk side: reading it, writing it, and reporting
100
+ * drift against a freshly computed baseline.
101
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peaks-loop",
3
- "version": "4.1.19",
3
+ "version": "4.1.21",
4
4
  "description": "Loop Engineering CLI — workflow primitive / loop guards / evaluators / slice orchestration",
5
5
  "author": "SquabbyZ",
6
6
  "keywords": [
@@ -87,6 +87,7 @@
87
87
  "scripts/canonical-store-marker.mjs",
88
88
  "scripts/canonical-store-link.mjs",
89
89
  "scripts/canonical-store-prune.mjs",
90
+ "scripts/canonical-store-report.mjs",
90
91
  "scripts/watch.mjs",
91
92
  "scripts/watch-tree.mjs",
92
93
  "skills/**",
@@ -131,10 +132,10 @@
131
132
  "picomatch": "4.0.7",
132
133
  "yaml": "^2.9.1",
133
134
  "zod": "^4.6.7",
134
- "peaks-loop-internal-runtime": "0.0.59",
135
- "peaks-loop-shared": "0.0.108",
136
- "peaks-loop-shared-channel": "0.0.76",
137
- "peaks-loop-mut": "0.1.73"
135
+ "peaks-loop-mut": "0.1.75",
136
+ "peaks-loop-internal-runtime": "0.0.61",
137
+ "peaks-loop-shared": "0.0.110",
138
+ "peaks-loop-shared-channel": "0.0.78"
138
139
  },
139
140
  "devDependencies": {
140
141
  "@changesets/cli": "2.31.1",
@@ -182,6 +183,8 @@
182
183
  "test:audit:silent-warning": "node ./scripts/lint/silent-warning-detector.mjs",
183
184
  "test:ci": "node ./scripts/sync-version.mjs && node ./scripts/lint/silent-warning-detector.mjs && vitest run --coverage",
184
185
  "test:changed": "node scripts/test-changed.mjs",
186
+ "bench:phase-a": "node node_modules/tsx/dist/cli.mjs benchmarks/runtime-detached/baseline.ts",
187
+ "bench:resource-budget": "node node_modules/tsx/dist/cli.mjs benchmarks/runtime-detached/resource-budget-bench.ts",
185
188
  "lint:silent-warning": "node ./scripts/lint/silent-warning-detector.mjs",
186
189
  "test:race": "vitest run --no-file-parallelism packages/peaks-loop-shared-channel/tests/shared-channel.test.ts tests/unit/services/dispatch/dispatch-record-writer.test.ts",
187
190
  "test:replay": "node scripts/fixture-capture-setup.mjs && vitest run tests/unit/services/dispatch/conflict-replay.test.ts tests/unit/services/dispatch/e2e-fixtures.test.ts",
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // THE STORE'S OWN ROWS — the canonical store's entries that the package does NOT ship.
4
+ //
5
+ // WHY THIS MODULE EXISTS. The report the sync command shows used to be built from the
6
+ // PACKAGE's skill list alone: one row per skill peaks-loop ships. That is the
7
+ // package's slice of the store, not the store. A skill the USER put in the store —
8
+ // their own copy, with no sidecar, which peaks-loop never overwrites — was invisible
9
+ // in the report that claims to describe the store: the report said "0 unmanaged"
10
+ // while their skill sat there.
11
+ //
12
+ // The rows here close that gap. Every entry in the store that the package does not
13
+ // ship gets a row:
14
+ //
15
+ // - an entry with NO sidecar is the USER's own → `unmanaged`. It is never
16
+ // overwritten and never pruned, and the report says so.
17
+ // - an entry WITH our sidecar is ours, and this release does not ship it any more
18
+ // → `retired`. A real run removes it; a dry run says what it would remove.
19
+ //
20
+ // THE ROWS ARE ABOUT THE STORE, so the states are the store's: an entry this module
21
+ // reports is never `current` and never `stale` — those two belong to the package's
22
+ // own skills, which the install loop reports.
23
+ //
24
+ // THE ROOT MUST MATCH THE STORE THE COPIES LAND IN. That root is resolved by
25
+ // `resolveKindRoot` with NO `root` option, exactly as `ensureCanonicalCopy` resolves
26
+ // it, so the two always name the same directory.
27
+
28
+ import { existsSync, readdirSync } from 'node:fs';
29
+ import { join } from 'node:path';
30
+
31
+ import {
32
+ MANAGED_MARKER_SUFFIX,
33
+ isManagedEntry,
34
+ readManagedMarker,
35
+ resolveKindRoot
36
+ } from './canonical-store.mjs';
37
+
38
+ /** The scratch prefix the store's atomic writes use; never an asset name. */
39
+ const TEMP_PREFIX = '.peaks-tmp-';
40
+
41
+ /**
42
+ * Every store entry the package does not ship, as report rows.
43
+ *
44
+ * @param {{ kind: string, knownNames: readonly string[], dryRun?: boolean }} options
45
+ * @returns {Array<{ name: string, state: string, action: string, version: string | null, reason: string | null }>}
46
+ */
47
+ export function collectStoreOnlyEntries(options) {
48
+ const { kind, knownNames } = options;
49
+ const dryRun = options.dryRun === true;
50
+ // The SAME resolution `ensureCanonicalCopy` uses: no `root` option, so the
51
+ // canonical root is `$PEAKS_HOME` or `~/.peaks` — the store the copies land in.
52
+ const kindRoot = resolveKindRoot(kind, {});
53
+ if (!existsSync(kindRoot)) return [];
54
+
55
+ const known = new Set(knownNames);
56
+ const rows = [];
57
+ for (const name of readdirSync(kindRoot).sort()) {
58
+ // A sidecar is not an entry, and a scratch file is not an entry either.
59
+ if (name.endsWith(MANAGED_MARKER_SUFFIX)) continue;
60
+ if (name.startsWith(TEMP_PREFIX)) continue;
61
+ // The package's own skills already have a row: the install loop reported them.
62
+ if (known.has(name)) continue;
63
+
64
+ const entryPath = join(kindRoot, name);
65
+ if (!isManagedEntry(entryPath)) {
66
+ rows.push({
67
+ name,
68
+ state: 'unmanaged',
69
+ action: 'unmanaged',
70
+ version: null,
71
+ reason: null
72
+ });
73
+ continue;
74
+ }
75
+ rows.push({
76
+ name,
77
+ state: 'retired',
78
+ action: dryRun ? 'planned' : 'pruned',
79
+ version: readManagedMarker(entryPath)?.version ?? null,
80
+ reason: 'retired'
81
+ });
82
+ }
83
+ return rows;
84
+ }