@dzhechkov/harness-core 0.8.46 → 0.8.47

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 (143) hide show
  1. package/.dz-manifest.json +175 -163
  2. package/README.md +84 -2
  3. package/dist/agentdb-index.d.ts.map +1 -1
  4. package/dist/agentdb-index.js +32 -2
  5. package/dist/agentdb-index.js.map +1 -1
  6. package/dist/agentdb-snapshot.d.ts +14 -1
  7. package/dist/agentdb-snapshot.d.ts.map +1 -1
  8. package/dist/agentdb-snapshot.js +100 -4
  9. package/dist/agentdb-snapshot.js.map +1 -1
  10. package/dist/apply-leg.d.ts +9 -1
  11. package/dist/apply-leg.d.ts.map +1 -1
  12. package/dist/apply-leg.js +26 -4
  13. package/dist/apply-leg.js.map +1 -1
  14. package/dist/architecture.d.ts +0 -5
  15. package/dist/architecture.d.ts.map +1 -1
  16. package/dist/architecture.js +25 -2
  17. package/dist/architecture.js.map +1 -1
  18. package/dist/codex-rollouts.d.ts +35 -7
  19. package/dist/codex-rollouts.d.ts.map +1 -1
  20. package/dist/codex-rollouts.js +201 -113
  21. package/dist/codex-rollouts.js.map +1 -1
  22. package/dist/cost-ledger.d.ts +42 -3
  23. package/dist/cost-ledger.d.ts.map +1 -1
  24. package/dist/cost-ledger.js +478 -15
  25. package/dist/cost-ledger.js.map +1 -1
  26. package/dist/feature-adr-routing.d.ts +16 -0
  27. package/dist/feature-adr-routing.d.ts.map +1 -1
  28. package/dist/feature-adr-routing.js +21 -0
  29. package/dist/feature-adr-routing.js.map +1 -1
  30. package/dist/guard.d.ts +7 -0
  31. package/dist/guard.d.ts.map +1 -1
  32. package/dist/guard.js +48 -0
  33. package/dist/guard.js.map +1 -1
  34. package/dist/index.d.ts +11 -6
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +10 -3
  37. package/dist/index.js.map +1 -1
  38. package/dist/loop-plan.d.ts +4 -0
  39. package/dist/loop-plan.d.ts.map +1 -1
  40. package/dist/loop-plan.js +4 -0
  41. package/dist/loop-plan.js.map +1 -1
  42. package/dist/mutation-gate.d.ts +36 -1
  43. package/dist/mutation-gate.d.ts.map +1 -1
  44. package/dist/mutation-gate.js +109 -19
  45. package/dist/mutation-gate.js.map +1 -1
  46. package/dist/npm-homepage.d.ts +64 -0
  47. package/dist/npm-homepage.d.ts.map +1 -0
  48. package/dist/npm-homepage.js +109 -0
  49. package/dist/npm-homepage.js.map +1 -0
  50. package/dist/operations.d.ts +6 -0
  51. package/dist/operations.d.ts.map +1 -1
  52. package/dist/operations.js +150 -24
  53. package/dist/operations.js.map +1 -1
  54. package/dist/pack-inventory.d.ts.map +1 -1
  55. package/dist/pack-inventory.js +6 -1
  56. package/dist/pack-inventory.js.map +1 -1
  57. package/dist/parity.d.ts.map +1 -1
  58. package/dist/parity.js +4 -1
  59. package/dist/parity.js.map +1 -1
  60. package/dist/publish-sibling-drift.d.ts +43 -1
  61. package/dist/publish-sibling-drift.d.ts.map +1 -1
  62. package/dist/publish-sibling-drift.js +269 -13
  63. package/dist/publish-sibling-drift.js.map +1 -1
  64. package/dist/publish.d.ts +5 -1
  65. package/dist/publish.d.ts.map +1 -1
  66. package/dist/publish.js +18 -1
  67. package/dist/publish.js.map +1 -1
  68. package/dist/qe-bridge.d.ts +63 -1
  69. package/dist/qe-bridge.d.ts.map +1 -1
  70. package/dist/qe-bridge.js +82 -0
  71. package/dist/qe-bridge.js.map +1 -1
  72. package/dist/release-package-audit.d.ts +86 -0
  73. package/dist/release-package-audit.d.ts.map +1 -0
  74. package/dist/release-package-audit.js +272 -0
  75. package/dist/release-package-audit.js.map +1 -0
  76. package/dist/release.d.ts +8 -1
  77. package/dist/release.d.ts.map +1 -1
  78. package/dist/release.js +58 -32
  79. package/dist/release.js.map +1 -1
  80. package/dist/round.d.ts +10 -1
  81. package/dist/round.d.ts.map +1 -1
  82. package/dist/round.js +5 -1
  83. package/dist/round.js.map +1 -1
  84. package/dist/run-records.d.ts +11 -0
  85. package/dist/run-records.d.ts.map +1 -1
  86. package/dist/run-records.js +124 -20
  87. package/dist/run-records.js.map +1 -1
  88. package/dist/stage-usage.d.ts +148 -0
  89. package/dist/stage-usage.d.ts.map +1 -0
  90. package/dist/stage-usage.js +261 -0
  91. package/dist/stage-usage.js.map +1 -0
  92. package/dist/statusline.d.ts +23 -0
  93. package/dist/statusline.d.ts.map +1 -1
  94. package/dist/statusline.js +167 -1
  95. package/dist/statusline.js.map +1 -1
  96. package/dist/workflow-run-dispatch.d.ts +21 -19
  97. package/dist/workflow-run-dispatch.d.ts.map +1 -1
  98. package/dist/workflow-run-dispatch.js +206 -95
  99. package/dist/workflow-run-dispatch.js.map +1 -1
  100. package/dist/workflow-run.d.ts +12 -3
  101. package/dist/workflow-run.d.ts.map +1 -1
  102. package/dist/workflow-run.js +29 -2
  103. package/dist/workflow-run.js.map +1 -1
  104. package/package.json +3 -3
  105. package/sbom.json +264 -234
  106. package/src/agentdb-index.ts +31 -2
  107. package/src/agentdb-snapshot.ts +105 -4
  108. package/src/apply-leg.ts +26 -4
  109. package/src/architecture.ts +15 -2
  110. package/src/codex-rollouts.ts +155 -147
  111. package/src/cost-ledger.ts +308 -19
  112. package/src/feature-adr-routing.ts +22 -0
  113. package/src/guard.ts +52 -0
  114. package/src/index.ts +15 -3
  115. package/src/loop-plan.ts +8 -0
  116. package/src/mutation-gate.ts +153 -19
  117. package/src/npm-homepage.ts +142 -0
  118. package/src/operations.ts +177 -22
  119. package/src/pack-inventory.ts +6 -1
  120. package/src/parity.ts +4 -1
  121. package/src/publish-sibling-drift.ts +214 -11
  122. package/src/publish.ts +20 -1
  123. package/src/qe-bridge.ts +86 -1
  124. package/src/release-package-audit.ts +264 -0
  125. package/src/release.ts +55 -22
  126. package/src/round.ts +8 -0
  127. package/src/run-records.ts +101 -22
  128. package/src/stage-usage.ts +191 -0
  129. package/src/statusline.ts +149 -1
  130. package/src/workflow-run-dispatch.ts +148 -89
  131. package/src/workflow-run.ts +40 -4
  132. package/dist/ledger-cost-fill.d.ts +0 -58
  133. package/dist/ledger-cost-fill.d.ts.map +0 -1
  134. package/dist/ledger-cost-fill.js +0 -78
  135. package/dist/ledger-cost-fill.js.map +0 -1
  136. package/dist/retro.d.ts +0 -131
  137. package/dist/retro.d.ts.map +0 -1
  138. package/dist/retro.js +0 -207
  139. package/dist/retro.js.map +0 -1
  140. package/dist/sbom.d.ts +0 -42
  141. package/dist/sbom.d.ts.map +0 -1
  142. package/dist/sbom.js +0 -120
  143. package/dist/sbom.js.map +0 -1
package/dist/retro.d.ts DELETED
@@ -1,131 +0,0 @@
1
- /**
2
- * `dz retro` — what was done over a day, a week or a month.
3
- *
4
- * This module is PURE: no filesystem, no network, and — load-bearing — no clock. The window arrives
5
- * as a parameter, because a window you cannot pin in a test is a window whose arithmetic errors you
6
- * cannot catch. MEASURED in this project 2026-08-22: an agent's timestamp was off by a YEAR, the
7
- * query returned 15 530 "hits" for a "week", and nothing about the output looked wrong.
8
- *
9
- * Its second job is refusing. Half of an honest report is declining to answer what the data cannot
10
- * support, and those refusals live here as behaviour — types that cannot express a quarter, a
11
- * decision function that names the real span in days, and a three-state section verdict where
12
- * "the source said nothing" and "the source was not read" can never collapse into one zero.
13
- *
14
- * See features/dz-retro/03_adr/ for the decisions and the measurements behind them.
15
- */
16
- /** The only horizons this project has the data for. A quarter or a year is NOT SPELLABLE (ADR-001). */
17
- export type RetroHorizon = 'day' | 'week' | 'month';
18
- /** Horizons a user may ASK for — recognised so they are refused loudly, never swallowed. */
19
- export type RefusedHorizon = 'quarter' | 'half-year' | 'year';
20
- export declare const REFUSED_HORIZONS: readonly RefusedHorizon[];
21
- export interface RetroWindow {
22
- readonly horizon: RetroHorizon;
23
- /** Inclusive ISO date (YYYY-MM-DD) of the first day in the window. */
24
- readonly startIso: string;
25
- /** Inclusive ISO date of the last day — the anchor. */
26
- readonly endIso: string;
27
- readonly days: number;
28
- }
29
- /**
30
- * The window for a horizon, anchored on an EXPLICIT date. Never reads the clock.
31
- * `atIso` may be a full timestamp; only its date part is used.
32
- */
33
- export declare function retroWindow(horizon: RetroHorizon, atIso: string): RetroWindow;
34
- /** Is this instant inside the window? Compared in UTC, never as strings (ADR/AM-5). */
35
- export declare function withinWindow(w: RetroWindow, isoInstant: string): boolean;
36
- export interface HorizonDecision {
37
- readonly action: 'report' | 'refuse';
38
- readonly reason: string;
39
- }
40
- /**
41
- * May we report over the requested horizon at all?
42
- *
43
- * `spanDays` is the age of the LONGEST record we actually hold. Asking for a year over 174 days of
44
- * data is not a thin report — it is an invented one, so it is refused and the real span is named.
45
- */
46
- export declare function decideHorizon(input: {
47
- requested: string;
48
- spanDays: number;
49
- }): HorizonDecision;
50
- export type SectionStatus = 'full' | 'partial' | 'unavailable';
51
- export interface SectionVerdict {
52
- readonly status: SectionStatus;
53
- /** The date this source's records begin — computed from the source itself, never hardcoded. */
54
- readonly dataStart: string | null;
55
- readonly note: string;
56
- }
57
- /**
58
- * Does this source cover the whole window?
59
- *
60
- * `dataStart: null` means the source was NOT READ — a different fact from "read, and empty".
61
- * Collapsing the two is how a report says "nothing happened" about a week it could not see.
62
- */
63
- export declare function sectionStatus(input: {
64
- dataStart: string | null;
65
- windowStart: string;
66
- }): SectionVerdict;
67
- export interface ForbiddenMetric {
68
- readonly name: string;
69
- /** The measurement that disqualifies it. A bare ban decays into a word list. */
70
- readonly reason: string;
71
- }
72
- /**
73
- * Measures of the INSTRUMENT, not of the work (ADR-003). Each will be proposed again precisely
74
- * because each is a one-liner to compute, so each carries the measurement that refutes it.
75
- */
76
- export declare const FORBIDDEN_METRICS: readonly ForbiddenMetric[];
77
- export interface Delivery {
78
- readonly slug: string;
79
- readonly createdIso: string;
80
- /** 'unique' carries a grade; 'ambiguous' and 'none' are facts about the report, not gaps. */
81
- readonly gradeStatus: 'unique' | 'ambiguous' | 'none' | 'no-report';
82
- readonly grade: string | null;
83
- }
84
- export interface Publish {
85
- readonly pkg: string;
86
- readonly version: string;
87
- readonly iso: string;
88
- }
89
- export interface GuardRun {
90
- readonly iso: string;
91
- readonly verdict: string;
92
- readonly rules: readonly string[];
93
- }
94
- export interface ReuseFacts {
95
- readonly dataStart: string | null;
96
- readonly eventsInWindow: number;
97
- readonly lessonsEverRecalled: number;
98
- readonly lessonsTotal: number;
99
- }
100
- export interface SourceFacts<T> {
101
- readonly dataStart: string | null;
102
- readonly items: readonly T[];
103
- }
104
- export interface RetroFacts {
105
- readonly window: RetroWindow;
106
- /** The longest record we hold, in days — what `decideHorizon` judges against. */
107
- readonly spanDays: number;
108
- /** `null` means NOT READ. An empty `items` means read-and-empty. The type keeps them apart. */
109
- readonly deliveries: SourceFacts<Delivery> | null;
110
- readonly publishes: SourceFacts<Publish> | null;
111
- readonly guard: SourceFacts<GuardRun> | null;
112
- readonly reuse: ReuseFacts | null;
113
- /** Feature dirs on disk that git has never seen — the report is blind to them, and says so. */
114
- readonly uncommittedSlugs: readonly string[];
115
- }
116
- export interface RetroSection {
117
- readonly id: 'deliveries' | 'publishes' | 'discipline' | 'reuse';
118
- readonly title: string;
119
- readonly verdict: SectionVerdict;
120
- readonly lines: readonly string[];
121
- }
122
- export interface RetroReport {
123
- readonly window: RetroWindow;
124
- readonly spanDays: number;
125
- readonly sections: readonly RetroSection[];
126
- readonly caveats: readonly string[];
127
- }
128
- export declare function buildRetro(facts: RetroFacts): RetroReport;
129
- /** The human rendering. `--json` prints the SAME `RetroReport` — one structure, two spellings (FR-6). */
130
- export declare function renderRetro(report: RetroReport): string[];
131
- //# sourceMappingURL=retro.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retro.d.ts","sourceRoot":"","sources":["../src/retro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,uGAAuG;AACvG,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAE9D,eAAO,MAAM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1B,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,OAAO,CAAC;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAQD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAkFzD;AAQD,yGAAyG;AACzG,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAazD"}
package/dist/retro.js DELETED
@@ -1,207 +0,0 @@
1
- /**
2
- * `dz retro` — what was done over a day, a week or a month.
3
- *
4
- * This module is PURE: no filesystem, no network, and — load-bearing — no clock. The window arrives
5
- * as a parameter, because a window you cannot pin in a test is a window whose arithmetic errors you
6
- * cannot catch. MEASURED in this project 2026-08-22: an agent's timestamp was off by a YEAR, the
7
- * query returned 15 530 "hits" for a "week", and nothing about the output looked wrong.
8
- *
9
- * Its second job is refusing. Half of an honest report is declining to answer what the data cannot
10
- * support, and those refusals live here as behaviour — types that cannot express a quarter, a
11
- * decision function that names the real span in days, and a three-state section verdict where
12
- * "the source said nothing" and "the source was not read" can never collapse into one zero.
13
- *
14
- * See features/dz-retro/03_adr/ for the decisions and the measurements behind them.
15
- */
16
- export const REFUSED_HORIZONS = ['quarter', 'half-year', 'year'];
17
- const HORIZON_DAYS = { day: 1, week: 7, month: 30 };
18
- const REFUSED_DAYS = { quarter: 90, 'half-year': 182, year: 365 };
19
- const DAY_MS = 86_400_000;
20
- function isoDay(value) {
21
- return value.slice(0, 10);
22
- }
23
- /**
24
- * The window for a horizon, anchored on an EXPLICIT date. Never reads the clock.
25
- * `atIso` may be a full timestamp; only its date part is used.
26
- */
27
- export function retroWindow(horizon, atIso) {
28
- const end = isoDay(atIso);
29
- const endMs = Date.parse(`${end}T00:00:00.000Z`);
30
- if (Number.isNaN(endMs))
31
- throw new Error(`retroWindow: not an ISO date: ${JSON.stringify(atIso)}`);
32
- const days = HORIZON_DAYS[horizon];
33
- const startMs = endMs - (days - 1) * DAY_MS;
34
- return { horizon, startIso: new Date(startMs).toISOString().slice(0, 10), endIso: end, days };
35
- }
36
- /** Is this instant inside the window? Compared in UTC, never as strings (ADR/AM-5). */
37
- export function withinWindow(w, isoInstant) {
38
- const t = Date.parse(isoInstant);
39
- if (Number.isNaN(t))
40
- return false;
41
- const from = Date.parse(`${w.startIso}T00:00:00.000Z`);
42
- const to = Date.parse(`${w.endIso}T00:00:00.000Z`) + DAY_MS;
43
- return t >= from && t < to;
44
- }
45
- /**
46
- * May we report over the requested horizon at all?
47
- *
48
- * `spanDays` is the age of the LONGEST record we actually hold. Asking for a year over 174 days of
49
- * data is not a thin report — it is an invented one, so it is refused and the real span is named.
50
- */
51
- export function decideHorizon(input) {
52
- const req = input.requested.trim().toLowerCase();
53
- const span = Number.isFinite(input.spanDays) ? Math.max(0, Math.floor(input.spanDays)) : 0;
54
- if (req in HORIZON_DAYS) {
55
- const need = HORIZON_DAYS[req];
56
- if (span < need) {
57
- return {
58
- action: 'refuse',
59
- reason: `a ${req} needs ${need} day(s) of records and we hold ${span} — reporting it would invent the difference`,
60
- };
61
- }
62
- return { action: 'report', reason: `${req}: ${need} day(s) against ${span} day(s) of records` };
63
- }
64
- if (REFUSED_HORIZONS.includes(req)) {
65
- const need = REFUSED_DAYS[req];
66
- return {
67
- action: 'refuse',
68
- reason: `a ${req} needs about ${need} days of records and the longest record here spans ${span} day(s) — there is exactly one complete quarter, so a quarter-over-quarter comparison is arithmetically impossible and a year would be fabrication`,
69
- };
70
- }
71
- return { action: 'refuse', reason: `unknown horizon ${JSON.stringify(input.requested)} — use --day, --week or --month` };
72
- }
73
- /**
74
- * Does this source cover the whole window?
75
- *
76
- * `dataStart: null` means the source was NOT READ — a different fact from "read, and empty".
77
- * Collapsing the two is how a report says "nothing happened" about a week it could not see.
78
- */
79
- export function sectionStatus(input) {
80
- if (input.dataStart === null) {
81
- return { status: 'unavailable', dataStart: null, note: 'source not read — this section says nothing, which is not the same as zero' };
82
- }
83
- const start = isoDay(input.dataStart);
84
- if (start <= isoDay(input.windowStart)) {
85
- return { status: 'full', dataStart: start, note: `records cover the whole window (from ${start})` };
86
- }
87
- return { status: 'partial', dataStart: start, note: `records only begin ${start}, inside the window — everything before that is unknown, not absent` };
88
- }
89
- /**
90
- * Measures of the INSTRUMENT, not of the work (ADR-003). Each will be proposed again precisely
91
- * because each is a one-liner to compute, so each carries the measurement that refutes it.
92
- */
93
- export const FORBIDDEN_METRICS = [
94
- { name: 'commit count', reason: 'this project mandates a commit per logical change; 1318 commits over 66 active days measures compliance with that rule, not output (MEASURED 2026-08-22)' },
95
- { name: 'lines changed', reason: 'generated artifacts dominate — 352 of 1318 commits are docs, and one pipeline run writes 8-10 files before a line of product code exists' },
96
- { name: 'token spend', reason: 'self-declared an estimate, once wrong sixfold, covers 17 days, and 20 of 86 ledger rows carry no number by construction' },
97
- { name: 'learning event volume', reason: '640 in May against 10454 in August, but the sources are post-edit and post-command hooks: the curve measures when hooks were installed' },
98
- { name: 'inventory counts', reason: 'skills, packages and tests only ever grow, so they can only ever flatter' },
99
- { name: 'learned lesson count', reason: 'already refuted by this project’s own dz compounding: 54% of the pool has never been read by anyone' },
100
- ];
101
- function emptyOrUnavailable(v, emptyLine) {
102
- return v.status === 'unavailable'
103
- ? ['not read — this section cannot say anything about this window']
104
- : [emptyLine];
105
- }
106
- export function buildRetro(facts) {
107
- const ws = facts.window.startIso;
108
- const sections = [];
109
- // 1. Deliveries
110
- {
111
- const v = sectionStatus({ dataStart: facts.deliveries?.dataStart ?? null, windowStart: ws });
112
- const items = (facts.deliveries?.items ?? []).filter((d) => withinWindow(facts.window, d.createdIso));
113
- const graded = items.filter((d) => d.gradeStatus === 'unique');
114
- const ambiguous = items.filter((d) => d.gradeStatus === 'ambiguous');
115
- const ungraded = items.filter((d) => d.gradeStatus === 'none' || d.gradeStatus === 'no-report');
116
- const lines = items.length === 0
117
- ? emptyOrUnavailable(v, 'no feature directories were created in this window')
118
- : [
119
- `${items.length} feature director${items.length === 1 ? 'y' : 'ies'} created`,
120
- `${graded.length} carry a grade an independent review stated unambiguously${graded.length > 0 ? `: ${tally(graded.map((d) => d.grade))}` : ''}`,
121
- `${ambiguous.length} have a report that states MORE THAN ONE grade — reported as ambiguous, never guessed`,
122
- `${ungraded.length} have no letter grade in their report, or no report at all`,
123
- 'cadence is not value: this counts deliveries, not what they were worth',
124
- ];
125
- sections.push({ id: 'deliveries', title: 'Deliveries', verdict: v, lines });
126
- }
127
- // 2. Publishes
128
- {
129
- const v = sectionStatus({ dataStart: facts.publishes?.dataStart ?? null, windowStart: ws });
130
- const items = (facts.publishes?.items ?? []).filter((p) => withinWindow(facts.window, p.iso));
131
- const pkgs = new Set(items.map((p) => p.pkg));
132
- const lines = items.length === 0
133
- ? emptyOrUnavailable(v, 'no versions were accepted by the registry in this window')
134
- : [
135
- `${items.length} version(s) accepted by the registry across ${pkgs.size} package(s)`,
136
- 'timestamps are the registry’s own — this is the one record here nobody local can backdate',
137
- ];
138
- sections.push({ id: 'publishes', title: 'Publishes', verdict: v, lines });
139
- }
140
- // 3. Discipline — DESCRIBES, never compares (ADR-004)
141
- {
142
- const v = sectionStatus({ dataStart: facts.guard?.dataStart ?? null, windowStart: ws });
143
- const runs = (facts.guard?.items ?? []).filter((g) => withinWindow(facts.window, g.iso));
144
- const byVerdict = new Map();
145
- const byRule = new Map();
146
- for (const r of runs) {
147
- byVerdict.set(r.verdict, (byVerdict.get(r.verdict) ?? 0) + 1);
148
- for (const rule of r.rules)
149
- byRule.set(rule, (byRule.get(rule) ?? 0) + 1);
150
- }
151
- const lines = runs.length === 0
152
- ? emptyOrUnavailable(v, 'no gate runs were recorded in this window')
153
- : [
154
- `${runs.length} gate run(s): ${[...byVerdict.entries()].map(([k, n]) => `${k} ${n}`).join(', ')}`,
155
- byRule.size === 0
156
- ? 'no rule was violated in this window'
157
- : `violations by rule: ${[...byRule.entries()].sort((a, b) => b[1] - a[1]).map(([k, n]) => `${k} ${n}`).join(', ')}`,
158
- ];
159
- // The caveat is NOT optional and NOT conditional: it is the whole honesty of the section.
160
- lines.push('a rule missing from this list was either never violated or did not yet exist — the log records a rule only when it fires, so it cannot tell those apart');
161
- lines.push('this section describes the window; it deliberately computes no comparison between periods');
162
- sections.push({ id: 'discipline', title: 'Discipline', verdict: v, lines });
163
- }
164
- // 4. Knowledge reuse
165
- {
166
- const v = sectionStatus({ dataStart: facts.reuse?.dataStart ?? null, windowStart: ws });
167
- const r = facts.reuse;
168
- const lines = r === null || r.lessonsTotal === 0
169
- ? emptyOrUnavailable(v, 'no lessons are stored, so there is nothing to reuse')
170
- : [
171
- `${r.eventsInWindow} recall event(s) in this window`,
172
- `${r.lessonsEverRecalled} of ${r.lessonsTotal} stored lessons have ever been read (${Math.round((r.lessonsEverRecalled / r.lessonsTotal) * 100)}%)`,
173
- 'this is a ratio with a hostile denominator: storing more unread lessons makes it worse, not better',
174
- ];
175
- sections.push({ id: 'reuse', title: 'Knowledge reuse', verdict: v, lines });
176
- }
177
- const caveats = [];
178
- if (facts.uncommittedSlugs.length > 0) {
179
- caveats.push(`${facts.uncommittedSlugs.length} feature director${facts.uncommittedSlugs.length === 1 ? 'y is' : 'ies are'} not committed yet and therefore invisible to this report: ${facts.uncommittedSlugs.join(', ')}`);
180
- }
181
- caveats.push('none of the following is computed here, and each carries the measurement that disqualifies it: ' + FORBIDDEN_METRICS.map((m) => m.name).join(', '));
182
- return { window: facts.window, spanDays: facts.spanDays, sections, caveats };
183
- }
184
- function tally(values) {
185
- const m = new Map();
186
- for (const v of values)
187
- m.set(v, (m.get(v) ?? 0) + 1);
188
- return [...m.entries()].sort((a, b) => (a[0] < b[0] ? -1 : 1)).map(([k, n]) => `${k}×${n}`).join(' ');
189
- }
190
- /** The human rendering. `--json` prints the SAME `RetroReport` — one structure, two spellings (FR-6). */
191
- export function renderRetro(report) {
192
- const out = [];
193
- out.push(`dz retro — ${report.window.horizon}: ${report.window.startIso} … ${report.window.endIso} (${report.window.days} day(s))`);
194
- out.push(`records held: ${report.spanDays} day(s)`);
195
- for (const s of report.sections) {
196
- out.push('');
197
- out.push(`${s.title} [${s.verdict.status}]${s.verdict.dataStart !== null ? ` · records from ${s.verdict.dataStart}` : ''}`);
198
- out.push(` ${s.verdict.note}`);
199
- for (const l of s.lines)
200
- out.push(` · ${l}`);
201
- }
202
- out.push('');
203
- for (const c of report.caveats)
204
- out.push(`! ${c}`);
205
- return out;
206
- }
207
- //# sourceMappingURL=retro.js.map
package/dist/retro.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"retro.js","sourceRoot":"","sources":["../src/retro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AAE5F,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AC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAChC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO;QAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/sbom.d.ts DELETED
@@ -1,42 +0,0 @@
1
- export interface SbomPackage {
2
- readonly SPDXID: string;
3
- readonly name: string;
4
- readonly versionInfo: string;
5
- readonly downloadLocation: string;
6
- readonly licenseConcluded: string;
7
- readonly licenseDeclared: string;
8
- readonly externalRefs: readonly {
9
- referenceCategory: string;
10
- referenceType: string;
11
- referenceLocator: string;
12
- }[];
13
- }
14
- export interface SpdxDocument {
15
- readonly spdxVersion: 'SPDX-2.3';
16
- readonly dataLicense: 'CC0-1.0';
17
- readonly SPDXID: 'SPDXRef-DOCUMENT';
18
- readonly name: string;
19
- readonly documentNamespace: string;
20
- readonly creationInfo: {
21
- readonly created: string;
22
- readonly creators: readonly string[];
23
- };
24
- readonly packages: readonly SbomPackage[];
25
- readonly relationships: readonly {
26
- spdxElementId: string;
27
- relationshipType: string;
28
- relatedSpdxElement: string;
29
- }[];
30
- }
31
- /** Build an SPDX-2.3 SBOM document. Pure + deterministic (injected `created`; packages sorted by name+version). */
32
- export declare function buildSbom(input: {
33
- name: string;
34
- lock?: unknown;
35
- pkg?: unknown;
36
- includeDev?: boolean;
37
- created: string;
38
- namespace?: string;
39
- }): SpdxDocument;
40
- /** Shape check for `--validate-only`: returns the problems (empty ⇒ valid SPDX-2.3 skeleton). */
41
- export declare function validateSbom(doc: unknown): string[];
42
- //# sourceMappingURL=sbom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3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ACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,YAAY,CAwBf;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CASnD"}
package/dist/sbom.js DELETED
@@ -1,120 +0,0 @@
1
- // SPDX-2.3 (Software Package Data Exchange) SBOM (Software Bill of Materials) generator for a pack.
2
- //
3
- // Ported from `agent-harness-generator/scripts/sbom.mjs` (RuvNet, MIT). Emits an SPDX-2.3 dependency inventory
4
- // from a `package-lock.json` (npm v1 or v2/v3), falling back to `package.json` dependency ranges when no lockfile
5
- // is present. PURE: operates over injected JSON + an injected `created` timestamp (no wall-clock → deterministic;
6
- // packages sorted by name). The CLI (`dz sbom`) reads the files and writes the output.
7
- /** A valid SPDXID tail is `[a-zA-Z0-9.-]+`; map `@scope/name` → `scope-name`. */
8
- function spdxId(name) {
9
- return 'SPDXRef-Package-' + name.replace(/^@/, '').replace(/[^a-zA-Z0-9.-]+/g, '-');
10
- }
11
- /** purl (package URL) for an npm dep: scope becomes a url-encoded namespace. */
12
- function npmPurl(name, version) {
13
- const v = version && version !== 'NOASSERTION' ? `@${version}` : '';
14
- if (name.startsWith('@')) {
15
- const slash = name.indexOf('/');
16
- if (slash > 0) {
17
- const scope = encodeURIComponent(name.slice(0, slash)); // %40scope
18
- return `pkg:npm/${scope}/${name.slice(slash + 1)}${v}`;
19
- }
20
- }
21
- return `pkg:npm/${name}${v}`;
22
- }
23
- function licenseOf(v) {
24
- if (typeof v === 'string' && v.length > 0)
25
- return v;
26
- if (v && typeof v === 'object' && typeof v.type === 'string')
27
- return v.type;
28
- return 'NOASSERTION';
29
- }
30
- /** Extract deps from a lockfile (npm v2/v3 `packages` map, or v1 `dependencies` tree) or a package.json. */
31
- function extractDeps(input) {
32
- const out = new Map();
33
- const add = (name, version, license, dev) => {
34
- if (!name)
35
- return;
36
- const key = `${name}@${version}`;
37
- if (!out.has(key))
38
- out.set(key, { name, version, license, dev });
39
- };
40
- const lock = input.lock;
41
- // npm v2/v3: flat `packages` map keyed by node_modules path ("" = root, skip it).
42
- if (lock && lock.packages && typeof lock.packages === 'object') {
43
- for (const [path, meta] of Object.entries(lock.packages)) {
44
- if (path === '' || !path.includes('node_modules/'))
45
- continue;
46
- const m = meta;
47
- if (m.dev && !input.includeDev)
48
- continue;
49
- const name = path.slice(path.lastIndexOf('node_modules/') + 'node_modules/'.length);
50
- add(name, typeof m.version === 'string' ? m.version : 'NOASSERTION', licenseOf(m.license), !!m.dev);
51
- }
52
- return [...out.values()];
53
- }
54
- // npm v1: nested `dependencies` tree.
55
- if (lock && lock.dependencies && typeof lock.dependencies === 'object') {
56
- const walk = (deps) => {
57
- for (const [name, meta] of Object.entries(deps)) {
58
- const m = meta;
59
- if (m.dev && !input.includeDev)
60
- continue;
61
- add(name, typeof m.version === 'string' ? m.version : 'NOASSERTION', licenseOf(m.license), !!m.dev);
62
- if (m.dependencies)
63
- walk(m.dependencies);
64
- }
65
- };
66
- walk(lock.dependencies);
67
- return [...out.values()];
68
- }
69
- // fallback: package.json ranges (no resolved versions).
70
- const pkg = input.pkg;
71
- if (pkg) {
72
- for (const [name, range] of Object.entries(pkg.dependencies ?? {}))
73
- add(name, String(range), 'NOASSERTION', false);
74
- if (input.includeDev)
75
- for (const [name, range] of Object.entries(pkg.devDependencies ?? {}))
76
- add(name, String(range), 'NOASSERTION', true);
77
- }
78
- return [...out.values()];
79
- }
80
- /** Build an SPDX-2.3 SBOM document. Pure + deterministic (injected `created`; packages sorted by name+version). */
81
- export function buildSbom(input) {
82
- const deps = extractDeps({ lock: input.lock, pkg: input.pkg, includeDev: !!input.includeDev })
83
- .sort((a, b) => (a.name === b.name ? (a.version < b.version ? -1 : 1) : a.name < b.name ? -1 : 1));
84
- const packages = deps.map((d) => ({
85
- SPDXID: spdxId(`${d.name}-${d.version}`),
86
- name: d.name,
87
- versionInfo: d.version,
88
- downloadLocation: 'NOASSERTION',
89
- licenseConcluded: d.license,
90
- licenseDeclared: d.license,
91
- externalRefs: [{ referenceCategory: 'PACKAGE-MANAGER', referenceType: 'purl', referenceLocator: npmPurl(d.name, d.version) }],
92
- }));
93
- return {
94
- spdxVersion: 'SPDX-2.3',
95
- dataLicense: 'CC0-1.0',
96
- SPDXID: 'SPDXRef-DOCUMENT',
97
- name: `${input.name}-sbom`,
98
- documentNamespace: input.namespace ?? `urn:dz:sbom:${input.name.replace(/^@/, '').replace(/[^a-zA-Z0-9.-]+/g, '-')}`,
99
- creationInfo: { created: input.created, creators: ['Tool: dz-sbom'] },
100
- packages,
101
- relationships: packages.map((p) => ({ spdxElementId: 'SPDXRef-DOCUMENT', relationshipType: 'DESCRIBES', relatedSpdxElement: p.SPDXID })),
102
- };
103
- }
104
- /** Shape check for `--validate-only`: returns the problems (empty ⇒ valid SPDX-2.3 skeleton). */
105
- export function validateSbom(doc) {
106
- const problems = [];
107
- const d = doc;
108
- if (!d || typeof d !== 'object')
109
- return ['not an object'];
110
- if (d.spdxVersion !== 'SPDX-2.3')
111
- problems.push('spdxVersion must be SPDX-2.3');
112
- if (d.SPDXID !== 'SPDXRef-DOCUMENT')
113
- problems.push('SPDXID must be SPDXRef-DOCUMENT');
114
- if (!Array.isArray(d.packages))
115
- problems.push('packages must be an array');
116
- if (!d.creationInfo || typeof d.creationInfo.created !== 'string')
117
- problems.push('creationInfo.created missing');
118
- return problems;
119
- }
120
- //# sourceMappingURL=sbom.js.map
package/dist/sbom.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sbom.js","sourceRoot":"","sources":["../src/sbom.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,EAAE;AACF,+GAA+G;AAC/G,kHAAkH;AAClH,kHAAkH;AAClH,uFAAuF;AA8BvF,iFAAiF;AACjF,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,k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