ushman-ledger 1.1.0 → 1.2.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.
Files changed (66) hide show
  1. package/AGENTS.md +11 -7
  2. package/CHANGELOG.md +6 -0
  3. package/README.md +22 -3
  4. package/dist/blobs.js +3 -3
  5. package/dist/builders.d.ts +43 -0
  6. package/dist/builders.d.ts.map +1 -1
  7. package/dist/builders.js +7 -2
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +222 -41
  10. package/dist/doctor.d.ts.map +1 -1
  11. package/dist/doctor.js +104 -4
  12. package/dist/handle.d.ts +3 -1
  13. package/dist/handle.d.ts.map +1 -1
  14. package/dist/handle.js +19 -1
  15. package/dist/helpers.d.ts +7 -0
  16. package/dist/helpers.d.ts.map +1 -0
  17. package/dist/helpers.js +38 -0
  18. package/dist/index.d.ts +3 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -2
  21. package/dist/list.d.ts +43 -1
  22. package/dist/list.d.ts.map +1 -1
  23. package/dist/note.d.ts +20 -0
  24. package/dist/note.d.ts.map +1 -1
  25. package/dist/note.js +5 -0
  26. package/dist/patch-resolver.d.ts +27 -0
  27. package/dist/patch-resolver.d.ts.map +1 -0
  28. package/dist/patch-resolver.js +184 -0
  29. package/dist/read-index.d.ts +7 -7
  30. package/dist/record.d.ts.map +1 -1
  31. package/dist/record.js +15 -39
  32. package/dist/render/migration-log.d.ts +3 -0
  33. package/dist/render/migration-log.d.ts.map +1 -0
  34. package/dist/render/migration-log.js +72 -0
  35. package/dist/render/retro.d.ts.map +1 -1
  36. package/dist/render/retro.js +40 -21
  37. package/dist/render/workspace-narrative.d.ts +6 -0
  38. package/dist/render/workspace-narrative.d.ts.map +1 -0
  39. package/dist/render/workspace-narrative.js +69 -0
  40. package/dist/schema/entry-core.d.ts +110 -0
  41. package/dist/schema/entry-core.d.ts.map +1 -0
  42. package/dist/schema/entry-core.js +143 -0
  43. package/dist/schema/entry-migrations.d.ts +3 -0
  44. package/dist/schema/entry-migrations.d.ts.map +1 -0
  45. package/dist/schema/entry-migrations.js +48 -0
  46. package/dist/schema/entry-read.d.ts +694 -0
  47. package/dist/schema/entry-read.d.ts.map +1 -0
  48. package/dist/schema/entry-read.js +92 -0
  49. package/dist/schema/entry-write.d.ts +865 -0
  50. package/dist/schema/entry-write.d.ts.map +1 -0
  51. package/dist/schema/entry-write.js +105 -0
  52. package/dist/schema/entry.d.ts +6 -1369
  53. package/dist/schema/entry.d.ts.map +1 -1
  54. package/dist/schema/entry.js +9 -286
  55. package/dist/schema/note.d.ts +1 -1
  56. package/dist/schema/note.d.ts.map +1 -1
  57. package/dist/schema/note.js +12 -1
  58. package/dist/storage/filesystem.d.ts +2 -0
  59. package/dist/storage/filesystem.d.ts.map +1 -1
  60. package/dist/storage/filesystem.js +2 -0
  61. package/dist/storage/lock-reclaimer.d.ts +2 -0
  62. package/dist/storage/lock-reclaimer.d.ts.map +1 -0
  63. package/dist/storage/lock-reclaimer.js +45 -0
  64. package/dist/version.d.ts +1 -1
  65. package/dist/version.js +1 -1
  66. package/package.json +2 -2
package/dist/doctor.js CHANGED
@@ -7,7 +7,9 @@ import { isReadIndexCurrent, readReadIndex } from "./read-index.js";
7
7
  import { loadLedgerState } from "./recovery.js";
8
8
  import { readManifest } from "./storage/filesystem.js";
9
9
  const BLOB_HASH_CONCURRENCY = 16;
10
+ const CHECKPOINT_MAX_AGE_MS = 24 * 60 * 60 * 1_000;
10
11
  const ENTRY_READ_BATCH_SIZE = 32;
12
+ const OPEN_ISSUE_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1_000;
11
13
  const checkPrevChain = (entry, previousByPhase, issues) => {
12
14
  const expectedPrev = previousByPhase.get(entry.phase) ?? null;
13
15
  if (entry.prevEntryId !== expectedPrev) {
@@ -66,13 +68,51 @@ const buildReadFailure = (error) => ({
66
68
  issues: [`Failed to read ledger state: ${error instanceof Error ? (error.message ?? error.name) : String(error)}.`],
67
69
  ok: false,
68
70
  });
69
- const inspectDoctorEntry = ({ blobChecks, entry, issues, latestByPhase, manifest, previousByPhase, unseenManifestEntryIds, }) => {
70
- unseenManifestEntryIds.delete(entry.id);
71
- checkPrevChain(entry, previousByPhase, issues);
71
+ const isChangeLogEntry = (entry) => entry.kind === 'change-log';
72
+ const isOpenIssueNote = (entry) => entry.kind === 'note' && entry.subkind === 'open-issue';
73
+ const trackResolutionLinks = (entry, resolvedLedgerIds) => {
74
+ if (entry.links.correctsLedgerId) {
75
+ resolvedLedgerIds.add(entry.links.correctsLedgerId);
76
+ }
77
+ if (entry.links.supersedesLedgerId) {
78
+ resolvedLedgerIds.add(entry.links.supersedesLedgerId);
79
+ }
80
+ };
81
+ const trackIdempotencyEntry = (entry, entriesByIdempotencyKey) => {
82
+ const idempotencyKey = entry.links.idempotencyKey;
83
+ if (!idempotencyKey) {
84
+ return;
85
+ }
86
+ const existingEntries = entriesByIdempotencyKey.get(idempotencyKey) ?? [];
87
+ existingEntries.push({ id: entry.id, ts: entry.ts });
88
+ entriesByIdempotencyKey.set(idempotencyKey, existingEntries);
89
+ };
90
+ const checkChangeLogWarnings = ({ checkpointEntries, entriesByIdempotencyKey, issues, nowMs, openIssueEntries, resolvedLedgerIds, }) => {
91
+ for (const checkpointEntry of checkpointEntries) {
92
+ const ageMs = nowMs - Date.parse(checkpointEntry.ts);
93
+ if (ageMs <= CHECKPOINT_MAX_AGE_MS) {
94
+ continue;
95
+ }
96
+ const idempotencyKey = checkpointEntry.links.idempotencyKey;
97
+ const hasFollowUp = typeof idempotencyKey === 'string' &&
98
+ (entriesByIdempotencyKey.get(idempotencyKey) ?? []).some((candidate) => candidate.id !== checkpointEntry.id && candidate.ts >= checkpointEntry.ts);
99
+ if (!hasFollowUp) {
100
+ issues.push(`Pre-change checkpoint ${checkpointEntry.id} is older than 24h and has no follow-up entry with matching idempotencyKey.`);
101
+ }
102
+ }
103
+ for (const openIssueEntry of openIssueEntries) {
104
+ const ageMs = nowMs - Date.parse(openIssueEntry.ts);
105
+ if (ageMs <= OPEN_ISSUE_MAX_AGE_MS || resolvedLedgerIds.has(openIssueEntry.id)) {
106
+ continue;
107
+ }
108
+ issues.push(`Open issue note ${openIssueEntry.id} is older than 30 days and has no resolution link.`);
109
+ }
110
+ };
111
+ const inspectManifestLocation = ({ entry, issues, latestByPhase, manifest, }) => {
72
112
  const manifestLocation = manifest.entryLocations[entry.id];
73
113
  if (!manifestLocation) {
74
114
  issues.push(`Manifest is missing entry location for ${entry.id}.`);
75
- return;
115
+ return null;
76
116
  }
77
117
  if (manifestLocation.phase !== entry.phase) {
78
118
  issues.push(`Manifest phase mismatch for ${entry.id}: expected ${entry.phase}, found ${manifestLocation.phase}.`);
@@ -81,6 +121,25 @@ const inspectDoctorEntry = ({ blobChecks, entry, issues, latestByPhase, manifest
81
121
  if (!currentLatest || manifestLocation.sequence > currentLatest.sequence) {
82
122
  latestByPhase.set(entry.phase, { entryId: entry.id, sequence: manifestLocation.sequence });
83
123
  }
124
+ return manifestLocation;
125
+ };
126
+ const inspectNarrativeEntry = ({ checkpointEntries, entry, issues, openIssueEntries, }) => {
127
+ if (isChangeLogEntry(entry)) {
128
+ if (entry.subkind === 'pre-change-checkpoint') {
129
+ checkpointEntries.push(entry);
130
+ }
131
+ if (entry.smokeResult === 'fail' && !entry.rollbackPlan) {
132
+ issues.push(`Change-log entry ${entry.id} has smokeResult=fail but no rollbackPlan.`);
133
+ }
134
+ if (entry.subkind === 'rollback' && !entry.rollsBack) {
135
+ issues.push(`Change-log rollback entry ${entry.id} is missing rollsBack.`);
136
+ }
137
+ }
138
+ if (isOpenIssueNote(entry)) {
139
+ openIssueEntries.push(entry);
140
+ }
141
+ };
142
+ const inspectPatchEntry = ({ blobChecks, entry, }) => {
84
143
  if (entry.kind !== 'agent-patch' && entry.kind !== 'operator-patch') {
85
144
  return;
86
145
  }
@@ -88,13 +147,42 @@ const inspectDoctorEntry = ({ blobChecks, entry, issues, latestByPhase, manifest
88
147
  blobChecks.push({ blobHash, entryId: entry.id });
89
148
  }
90
149
  };
150
+ const inspectDoctorEntry = ({ blobChecks, checkpointEntries, entry, entriesByIdempotencyKey, issues, latestByPhase, manifest, openIssueEntries, previousByPhase, resolvedLedgerIds, unseenManifestEntryIds, }) => {
151
+ unseenManifestEntryIds.delete(entry.id);
152
+ checkPrevChain(entry, previousByPhase, issues);
153
+ trackIdempotencyEntry(entry, entriesByIdempotencyKey);
154
+ trackResolutionLinks(entry, resolvedLedgerIds);
155
+ if (!inspectManifestLocation({
156
+ entry,
157
+ issues,
158
+ latestByPhase,
159
+ manifest,
160
+ })) {
161
+ return;
162
+ }
163
+ inspectNarrativeEntry({
164
+ checkpointEntries,
165
+ entry,
166
+ issues,
167
+ openIssueEntries,
168
+ });
169
+ inspectPatchEntry({
170
+ blobChecks,
171
+ entry,
172
+ });
173
+ };
91
174
  const collectDoctorState = async (workspaceRoot, manifest, readIndex) => {
92
175
  const issues = [];
93
176
  const previousByPhase = new Map();
94
177
  const latestByPhase = new Map();
95
178
  const unseenManifestEntryIds = new Set(Object.keys(manifest.entryLocations));
96
179
  const blobChecks = [];
180
+ const checkpointEntries = [];
181
+ const entriesByIdempotencyKey = new Map();
182
+ const openIssueEntries = [];
183
+ const resolvedLedgerIds = new Set();
97
184
  let entryCount = 0;
185
+ const nowMs = Date.now();
98
186
  const orderedEntries = getOrderedEntryLocations(manifest, readIndex, {});
99
187
  checkManifestSequenceOrder(orderedEntries, issues);
100
188
  for (let index = 0; index < orderedEntries.length; index += ENTRY_READ_BATCH_SIZE) {
@@ -111,15 +199,27 @@ const collectDoctorState = async (workspaceRoot, manifest, readIndex) => {
111
199
  entryCount += 1;
112
200
  inspectDoctorEntry({
113
201
  blobChecks,
202
+ checkpointEntries,
114
203
  entry: resolvedEntry.entry,
204
+ entriesByIdempotencyKey,
115
205
  issues,
116
206
  latestByPhase,
117
207
  manifest,
208
+ openIssueEntries,
118
209
  previousByPhase,
210
+ resolvedLedgerIds,
119
211
  unseenManifestEntryIds,
120
212
  });
121
213
  }
122
214
  }
215
+ checkChangeLogWarnings({
216
+ checkpointEntries,
217
+ entriesByIdempotencyKey,
218
+ issues,
219
+ nowMs,
220
+ openIssueEntries,
221
+ resolvedLedgerIds,
222
+ });
123
223
  return {
124
224
  blobChecks,
125
225
  entryCount,
package/dist/handle.d.ts CHANGED
@@ -3,7 +3,7 @@ import { runLedgerDoctor } from './doctor.ts';
3
3
  import { type LedgerFilter } from './list.ts';
4
4
  import { appendNote, type NoteBody } from './note.ts';
5
5
  import type { LedgerEntry, LedgerPhase } from './schema/entry.ts';
6
- export type RenderTarget = 'dependency-graph' | 'jsonl' | 'retro' | 'timeline-html';
6
+ export type RenderTarget = 'dependency-graph' | 'jsonl' | 'migration-log-md' | 'retro' | 'timeline-html' | 'workspace-narrative-md';
7
7
  export type LedgerHandle = {
8
8
  readonly archive: (outPath: string) => Promise<{
9
9
  integrityHash: string;
@@ -19,7 +19,9 @@ export type LedgerHandle = {
19
19
  }>;
20
20
  readonly render: (options: {
21
21
  out?: string;
22
+ limit?: number;
22
23
  phase?: LedgerPhase;
24
+ since?: string;
23
25
  to: RenderTarget;
24
26
  }) => Promise<string>;
25
27
  readonly show: (entryId: string) => Promise<LedgerEntry | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAA8B,KAAK,YAAY,EAAe,MAAM,WAAW,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAOtD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGlE,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,eAAe,CAAC;A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O,EAAE;QACvB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,EAAE,YAAY,CAAC;KACpB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACnE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,YAAY,CAyC5E,CAAC"}
package/dist/handle.js CHANGED
@@ -1,3 +1,4 @@
1
+ import path from 'node:path';
1
2
  import { archiveLedger } from "./archive.js";
2
3
  import { computeCoverage } from "./coverage.js";
3
4
  import { runLedgerDoctor } from "./doctor.js";
@@ -8,8 +9,10 @@ import { appendRecord, readEntryById } from "./record.js";
8
9
  import { loadLedgerState, prepareLedgerState } from "./recovery.js";
9
10
  import { renderDependencyGraph } from "./render/dependency-graph.js";
10
11
  import { renderJsonl } from "./render/jsonl.js";
12
+ import { renderMigrationLogMarkdown } from "./render/migration-log.js";
11
13
  import { renderRetroMarkdown } from "./render/retro.js";
12
14
  import { renderTimelineHtml } from "./render/timeline-html.js";
15
+ import { renderWorkspaceNarrativeMarkdown } from "./render/workspace-narrative.js";
13
16
  import { resolveLedgerPaths, writeAtomicTextFile } from "./storage/filesystem.js";
14
17
  const renderEntries = async ({ filter, target, workspaceRoot, }) => {
15
18
  const { manifest, readIndex } = await loadLedgerState(workspaceRoot);
@@ -18,6 +21,8 @@ const renderEntries = async ({ filter, target, workspaceRoot, }) => {
18
21
  return renderDependencyGraph(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
19
22
  case 'jsonl':
20
23
  return renderJsonl(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
24
+ case 'migration-log-md':
25
+ return renderMigrationLogMarkdown(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
21
26
  case 'timeline-html':
22
27
  return renderTimelineHtml(iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter));
23
28
  case 'retro':
@@ -25,6 +30,11 @@ const renderEntries = async ({ filter, target, workspaceRoot, }) => {
25
30
  entries: iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter),
26
31
  manifest,
27
32
  });
33
+ case 'workspace-narrative-md':
34
+ return renderWorkspaceNarrativeMarkdown({
35
+ entries: iterateEntriesFromManifest(workspaceRoot, manifest, readIndex, filter),
36
+ workspaceName: path.basename(workspaceRoot),
37
+ });
28
38
  }
29
39
  };
30
40
  const resolveRenderOutputPath = (workspaceRoot, target) => {
@@ -32,8 +42,12 @@ const resolveRenderOutputPath = (workspaceRoot, target) => {
32
42
  switch (target) {
33
43
  case 'retro':
34
44
  return paths.renderFile;
45
+ case 'migration-log-md':
46
+ return paths.renderMigrationLogFile;
35
47
  case 'timeline-html':
36
48
  return paths.renderTimelineFile;
49
+ case 'workspace-narrative-md':
50
+ return paths.renderWorkspaceNarrativeFile;
37
51
  default:
38
52
  return null;
39
53
  }
@@ -56,7 +70,11 @@ export const openLedger = async (workspaceRoot) => {
56
70
  },
57
71
  render: async (options) => {
58
72
  const content = await renderEntries({
59
- filter: { phase: options.phase },
73
+ filter: {
74
+ limit: options.limit,
75
+ phase: options.phase,
76
+ since: options.since,
77
+ },
60
78
  target: options.to,
61
79
  workspaceRoot,
62
80
  });
@@ -0,0 +1,7 @@
1
+ export declare const createWorkspaceFixture: () => Promise<{
2
+ cleanup: () => Promise<void>;
3
+ workspaceRoot: string;
4
+ }>;
5
+ export declare const ageFile: (filePath: string, ageMs?: number) => Promise<void>;
6
+ export declare const waitForFile: (filePath: string, timeoutMs?: number) => Promise<void>;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB;;;EAuBlC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,UAAU,MAAM,EAAE,cAAc,kBAG7D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,UAAU,MAAM,EAAE,kBAAiB,kBAcpE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { mkdir, mkdtemp, rm, stat, utimes, writeFile } from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ export const createWorkspaceFixture = async () => {
5
+ const workspaceRoot = await mkdtemp(path.join(os.tmpdir(), 'ushman-ledger-'));
6
+ await mkdir(path.join(workspaceRoot, '.lab'), { recursive: true });
7
+ await mkdir(path.join(workspaceRoot, 'src'), { recursive: true });
8
+ await writeFile(path.join(workspaceRoot, '.lab', 'lab.json'), `${JSON.stringify({
9
+ schemaVersion: 'ushman-lab/v4.0',
10
+ workspaceId: '3d71d4fb-dca0-4d63-9ad6-69d59a2395f4',
11
+ }, null, 2)}\n`, 'utf8');
12
+ return {
13
+ cleanup: async () => {
14
+ await rm(workspaceRoot, { force: true, recursive: true });
15
+ },
16
+ workspaceRoot,
17
+ };
18
+ };
19
+ export const ageFile = async (filePath, ageMs = 61_000) => {
20
+ const staleTime = new Date(Date.now() - ageMs);
21
+ await utimes(filePath, staleTime, staleTime);
22
+ };
23
+ export const waitForFile = async (filePath, timeoutMs = 1_000) => {
24
+ const deadline = Date.now() + timeoutMs;
25
+ while (Date.now() <= deadline) {
26
+ try {
27
+ await stat(filePath);
28
+ return;
29
+ }
30
+ catch (error) {
31
+ if (error.code !== 'ENOENT') {
32
+ throw error;
33
+ }
34
+ }
35
+ await new Promise((resolve) => setTimeout(resolve, 10));
36
+ }
37
+ throw new Error(`Timed out waiting for file: ${filePath}`);
38
+ };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- export { buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from './builders.ts';
1
+ export { buildChangeLogRecord, buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from './builders.ts';
2
2
  export { runLedgerCli } from './cli.ts';
3
3
  export { type CoverageReport, computeCoverage } from './coverage.ts';
4
4
  export { type LedgerHandle, type RenderTarget, openLedger } from './handle.ts';
5
5
  export type { LedgerFilter } from './list.ts';
6
- export { type AgentPatchDiff, AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, type LedgerEntry, LedgerEntrySchema, type LedgerKind, LedgerLinksSchema, type LedgerPhase, LedgerPhaseSchema, type LedgerRecord, LedgerRecordSchema, NoteEntrySchema, type OperatorDecisionAction, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, type OperatorDecisionPayload, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, type StripDecisionRevertedPayload, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from './schema/entry.ts';
6
+ export { appendCleanupWaveNote, appendDecompositionWaveNote, appendNote, appendOpenIssueNote, appendSemanticCleanupSummaryNote, appendVerifiedFlowNote, type NoteBody, } from './note.ts';
7
+ export { type AgentPatchDiff, AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, type ChangeLogEntry, ChangeLogEntrySchema, type ChangeLogFileChange, ChangeLogFileChangeSchema, type ChangeLogParityStatus, ChangeLogParityStatusSchema, type ChangeLogRecord, ChangeLogRecordSchema, type ChangeLogSmokeResult, ChangeLogSmokeResultSchema, type ChangeLogSubkind, ChangeLogSubkindSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, type LedgerEntry, LedgerEntrySchema, type LedgerKind, LedgerLinksSchema, type LedgerLinks, type LedgerPhase, LedgerPhaseSchema, type LedgerRecord, LedgerRecordSchema, type NoteEntry, NoteEntrySchema, type OperatorDecisionAction, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, type OperatorDecisionPayload, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, type StripDecisionRevertedPayload, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from './schema/entry.ts';
7
8
  export { type NoteSubkind, NoteSubkindSchema } from './schema/note.ts';
8
9
  export { resolveLedgerPaths } from './storage/filesystem.ts';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACH,KAAK,cAAc,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,UAAU,EACf,iBAAiB,EACjB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,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,EACrB,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,UAAU,EACf,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,SAAS,EACd,eAAe,EACf,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- export { buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from "./builders.js";
1
+ export { buildChangeLogRecord, buildCorrectionRecord, buildOperatorDecisionRecord, buildStripDecisionRevertedRecord, buildValidatorResultRecord, } from "./builders.js";
2
2
  export { runLedgerCli } from "./cli.js";
3
3
  export { computeCoverage } from "./coverage.js";
4
4
  export { openLedger } from "./handle.js";
5
- export { AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, LedgerEntrySchema, LedgerLinksSchema, LedgerPhaseSchema, LedgerRecordSchema, NoteEntrySchema, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
5
+ export { appendCleanupWaveNote, appendDecompositionWaveNote, appendNote, appendOpenIssueNote, appendSemanticCleanupSummaryNote, appendVerifiedFlowNote, } from "./note.js";
6
+ export { AgentPatchDiffSchema, AgentPatchEntrySchema, AgentPatchRecordSchema, ChangeLogEntrySchema, ChangeLogFileChangeSchema, ChangeLogParityStatusSchema, ChangeLogRecordSchema, ChangeLogSmokeResultSchema, ChangeLogSubkindSchema, CorrectionEntrySchema, CorrectionRecordSchema, EmitterSchema, LedgerEntrySchema, LedgerLinksSchema, LedgerPhaseSchema, LedgerRecordSchema, NoteEntrySchema, OperatorDecisionActionSchema, OperatorDecisionEntrySchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchEntrySchema, OperatorPatchRecordSchema, parseLedgerEntry, parseLedgerRecord, RuntimeEventEntrySchema, StripDecisionRevertedEntrySchema, StripDecisionRevertedPayloadSchema, StripDecisionRevertedRecordSchema, ToolInvocationEntrySchema, ToolInvocationRecordSchema, ValidatorResultEntrySchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
6
7
  export { NoteSubkindSchema } from "./schema/note.js";
7
8
  export { resolveLedgerPaths } from "./storage/filesystem.js";
package/dist/list.d.ts CHANGED
@@ -259,7 +259,7 @@ export declare const readManifestEntryBatch: ({ allowMissing, entryLocations, wo
259
259
  } | {
260
260
  body: string;
261
261
  kind: "note";
262
- subkind: "regression" | "automation" | "retro" | "operator" | "tooling-gap";
262
+ subkind: "regression" | "automation" | "retro" | "operator" | "tooling-gap" | "cleanup-wave" | "verified-flow" | "open-issue" | "decomposition-wave" | "semantic-cleanup-summary";
263
263
  details?: {
264
264
  [x: string]: unknown;
265
265
  } | undefined;
@@ -321,6 +321,48 @@ export declare const readManifestEntryBatch: ({ allowMissing, entryLocations, wo
321
321
  schemaVersion: "ushman-ledger-entry/v1";
322
322
  summary: string;
323
323
  ts: string;
324
+ } | {
325
+ commandsRun?: string[] | undefined;
326
+ filesChanged: {
327
+ added?: number | undefined;
328
+ path: string;
329
+ removed?: number | undefined;
330
+ }[];
331
+ hypothesis?: string | undefined;
332
+ kind: "change-log";
333
+ parityStatus?: "not-run" | "green" | "yellow" | "red" | undefined;
334
+ rollbackPlan?: string | undefined;
335
+ rollsBack?: string | undefined;
336
+ smokeNotes?: string | undefined;
337
+ smokeResult?: "pass" | "fail" | "partial" | "not-run" | undefined;
338
+ subkind: "vendor-extract" | "pre-change-checkpoint" | "semantic-cleanup" | "decomposition" | "rollback" | "hotfix" | "smoke";
339
+ details?: {
340
+ [x: string]: unknown;
341
+ } | undefined;
342
+ emitter: {
343
+ tool: string;
344
+ user?: string | undefined;
345
+ version: string;
346
+ };
347
+ id: string;
348
+ links: {
349
+ affectedFiles?: string[] | undefined;
350
+ blobs?: string[] | undefined;
351
+ briefId?: string | undefined;
352
+ correctsLedgerId?: string | undefined;
353
+ gitRef?: string | undefined;
354
+ idempotencyKey?: string | undefined;
355
+ stripDecisionId?: string | undefined;
356
+ supersedesLedgerId?: string | undefined;
357
+ validatorVerdictId?: string | undefined;
358
+ } & {
359
+ [key: string]: unknown;
360
+ };
361
+ phase: "capture" | "intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
362
+ prevEntryId: string | null;
363
+ schemaVersion: "ushman-ledger-entry/v1";
364
+ summary: string;
365
+ ts: string;
324
366
  };
325
367
  entryId: string;
326
368
  location: {
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQI,CAAC;AA6CN,eAAO,MAAM,0BAA0B,GACnC,eAAe,MAAM,EACrB,UAAU,cAAc,EACxB,WAAW,eAAe,EAC1B,SAAQ,YAAiB,KAC1B,aAAa,CAAC,WAAW,CAwB3B,CAAC;AAEF,eAAO,MAAM,WAAW,GACpB,eAAe,MAAM,EACrB,SAAQ,YAAiB,KAC1B,aAAa,CAAC,WAAW,CAG3B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,eAAe,MAAM,EAAE,SAAQ,YAAiB,KAAG,OAAO,CAAC,WAAW,EAAE,CAM5G,CAAC"}
package/dist/note.d.ts CHANGED
@@ -10,4 +10,24 @@ export declare const appendNote: (workspaceRoot: string, subkind: NoteSubkind, n
10
10
  entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
11
11
  id: string;
12
12
  }>;
13
+ export declare const appendCleanupWaveNote: (workspaceRoot: string, noteBody: NoteBody) => Promise<{
14
+ entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
15
+ id: string;
16
+ }>;
17
+ export declare const appendVerifiedFlowNote: (workspaceRoot: string, noteBody: NoteBody) => Promise<{
18
+ entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
19
+ id: string;
20
+ }>;
21
+ export declare const appendOpenIssueNote: (workspaceRoot: string, noteBody: NoteBody) => Promise<{
22
+ entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
23
+ id: string;
24
+ }>;
25
+ export declare const appendDecompositionWaveNote: (workspaceRoot: string, noteBody: NoteBody) => Promise<{
26
+ entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
27
+ id: string;
28
+ }>;
29
+ export declare const appendSemanticCleanupSummaryNote: (workspaceRoot: string, noteBody: NoteBody) => Promise<{
30
+ entry: Awaited<ReturnType<typeof appendRecord>>["entry"];
31
+ id: string;
32
+ }>;
13
33
  //# sourceMappingURL=note.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../src/note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,MAAM,MAAM,QAAQ,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,UAAU,GACnB,eAAe,MAAM,EACrB,SAAS,WAAW,EACpB,UAAU,QAAQ,KACnB,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAYlF,CAAC"}
1
+ {"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../src/note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,MAAM,MAAM,QAAQ,GAAG;IACnB,QAAQ,CAAC,IAAI,EA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Root, subkind, noteBody) => {
13
13
  summary: noteBody.summary,
14
14
  });
15
15
  };
16
+ export const appendCleanupWaveNote = (workspaceRoot, noteBody) => appendNote(workspaceRoot, 'cleanup-wave', noteBody);
17
+ export const appendVerifiedFlowNote = (workspaceRoot, noteBody) => appendNote(workspaceRoot, 'verified-flow', noteBody);
18
+ export const appendOpenIssueNote = (workspaceRoot, noteBody) => appendNote(workspaceRoot, 'open-issue', noteBody);
19
+ export const appendDecompositionWaveNote = (workspaceRoot, noteBody) => appendNote(workspaceRoot, 'decomposition-wave', noteBody);
20
+ export const appendSemanticCleanupSummaryNote = (workspaceRoot, noteBody) => appendNote(workspaceRoot, 'semantic-cleanup-summary', noteBody);
@@ -0,0 +1,27 @@
1
+ import { type AgentPatchDiff, type ChangeLogFileChange, type LedgerLinks, type LedgerRecord } from './schema/entry.ts';
2
+ type AgentPatchRecord = Extract<LedgerRecord, {
3
+ kind: 'agent-patch';
4
+ }>;
5
+ type OperatorPatchRecord = Extract<LedgerRecord, {
6
+ kind: 'operator-patch';
7
+ }>;
8
+ type ResolvedAgentPatchRecord = Omit<AgentPatchRecord, 'diffPath' | 'diffText' | 'links'> & {
9
+ readonly diff: AgentPatchDiff;
10
+ readonly links: LedgerLinks;
11
+ };
12
+ type ResolvedOperatorPatchRecord = Omit<OperatorPatchRecord, 'diffPath' | 'diffText' | 'links'> & {
13
+ readonly diff: AgentPatchDiff;
14
+ readonly links: LedgerLinks;
15
+ };
16
+ export type ResolvedPatchRecord = ResolvedAgentPatchRecord | ResolvedOperatorPatchRecord;
17
+ export declare const deriveFilesChangedFromPatch: (patchText: string) => ChangeLogFileChange[];
18
+ export declare function resolvePatchRecord(args: {
19
+ readonly record: AgentPatchRecord;
20
+ readonly workspaceRoot: string;
21
+ }): Promise<ResolvedAgentPatchRecord>;
22
+ export declare function resolvePatchRecord(args: {
23
+ readonly record: OperatorPatchRecord;
24
+ readonly workspaceRoot: string;
25
+ }): Promise<ResolvedOperatorPatchRecord>;
26
+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