pm-csv 2026.10.18 → 2026.10.23
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 +33 -0
- package/README.md +65 -1
- package/dist/atomic-update.d.ts +3 -2
- package/dist/atomic-update.d.ts.map +1 -1
- package/dist/atomic-update.js +10 -4
- package/dist/atomic-update.js.map +1 -1
- package/dist/edit-refusal.d.ts +21 -0
- package/dist/edit-refusal.d.ts.map +1 -0
- package/dist/edit-refusal.js +21 -0
- package/dist/edit-refusal.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -26
- package/dist/index.js.map +1 -1
- package/dist/lease-guard.d.ts +14 -0
- package/dist/lease-guard.d.ts.map +1 -0
- package/dist/lease-guard.js +25 -0
- package/dist/lease-guard.js.map +1 -0
- package/dist/lineage.d.ts +72 -0
- package/dist/lineage.d.ts.map +1 -0
- package/dist/lineage.js +137 -0
- package/dist/lineage.js.map +1 -0
- package/dist/roundtrip.d.ts +54 -0
- package/dist/roundtrip.d.ts.map +1 -0
- package/dist/roundtrip.js +255 -0
- package/dist/roundtrip.js.map +1 -0
- package/docs/row-lineage-validation.md +49 -0
- package/docs/row-lineage.md +87 -0
- package/docs/spreadsheet-roundtrip.md +146 -0
- package/docs/spreadsheet-validation.md +47 -0
- package/manifest.json +1 -1
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.10.23 - 2026-10-23
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Enable the gated GitHub issue sync ([pm-csv-j60x](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/chores/pm-csv-j60x.toon))
|
|
8
|
+
- Adopt pm-github 2026.10.16: default-branch-safe gated sync and daily gated closeout PRs ([pm-csv-5o9h](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/chores/pm-csv-5o9h.toon))
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Development README names TypeScript 5 while the manifest pins TypeScript 7 ([pm-csv-bqyu](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-bqyu.toon))
|
|
13
|
+
- Harden the release merge wait against mergeStateStatus deadlock ([pm-csv-7izf](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-7izf.toon))
|
|
14
|
+
- The changelog gate stamps an untagged version with the current date, so its verdict flips every midnight with no commit ([pm-csv-bv81](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-bv81.toon))
|
|
15
|
+
- Keep toolchain acceptance aligned with built-in merge drivers and shipped history ([pm-csv-9y0w](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-9y0w.toon))
|
|
16
|
+
- Make legacy CSV importer accept file input and native flags ([pm-csv-76cu](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-76cu.toon))
|
|
17
|
+
- The release job authenticated with a stored npm token that expired, so publishing stopped while every other gate stayed green ([pm-csv-65ev](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-65ev.toon))
|
|
18
|
+
- A release run bumped and committed a new version every night while publishing was impossible, because the only externally-failable step runs last ([pm-csv-545f](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-545f.toon))
|
|
19
|
+
|
|
20
|
+
### Other
|
|
21
|
+
|
|
22
|
+
- Certify pm-csv with pm CLI and SDK 2026.9.28 ([pm-csv-3044](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/chores/pm-csv-3044.toon))
|
|
23
|
+
|
|
24
|
+
## 2026.10.22 - 2026-10-22
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Daily Release workflow is failing ([pm-csv-github-2b408bfa2d7f-134](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-github-2b408bfa2d7f-134.toon))
|
|
29
|
+
- Daily Release workflow is failing ([pm-csv-github-2b408bfa2d7f-86](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-github-2b408bfa2d7f-86.toon))
|
|
30
|
+
- Full git history retains personal identity and redacted host-path blobs ([pm-csv-uaq1](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-uaq1.toon))
|
|
31
|
+
|
|
3
32
|
## 2026.10.12 - 2026-10-12
|
|
4
33
|
|
|
5
34
|
### Added
|
|
@@ -62,6 +91,10 @@
|
|
|
62
91
|
|
|
63
92
|
## 2026.9.6 - 2026-09-06
|
|
64
93
|
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- Temp-tree cleanup races a spawnSync-killed child and fails with ENOTEMPTY on loaded runners ([pm-csv-yriu](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/issues/pm-csv-yriu.toon))
|
|
97
|
+
|
|
65
98
|
### Other
|
|
66
99
|
|
|
67
100
|
- Pin pm-cli 2026.9.5, pm-changelog 2026.9.2, and pm-ops 2026.9.5 ([pm-csv-xq6d](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/chores/pm-csv-xq6d.toon))
|
package/README.md
CHANGED
|
@@ -30,12 +30,29 @@ pm install npm:pm-csv --project
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
+
## Without git
|
|
34
|
+
|
|
35
|
+
CSV validation, import, export, and configured importers work in a plain pm
|
|
36
|
+
tracker without a Git repository. None of these commands requires Git.
|
|
37
|
+
|
|
33
38
|
## Commands
|
|
34
39
|
|
|
40
|
+
| Command | Input and behavior |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `pm csv import <file>` | Import a required CSV file; `--dry-run` previews without writes. |
|
|
43
|
+
| `pm csv-import import <file>` | Same required file, flags, implementation and results as `csv import`. |
|
|
44
|
+
| `pm csv validate <file>` | Validate a CSV file without writes. |
|
|
45
|
+
| `pm csv export` / `pm csv-export export` | Export tracker items as CSV. |
|
|
46
|
+
|
|
35
47
|
### `pm csv import <file>`
|
|
36
48
|
|
|
37
49
|
Read a CSV file and create or update pm items.
|
|
38
50
|
|
|
51
|
+
If any row mutation fails, the command exits nonzero and reports the error
|
|
52
|
+
count, imported/updated/skipped counts, and row errors. Non-atomic imports
|
|
53
|
+
continue with later rows; successful writes remain in the tracker. This also
|
|
54
|
+
applies to `csv-import import` and configured importers.
|
|
55
|
+
|
|
39
56
|
```
|
|
40
57
|
pm csv import tasks.csv
|
|
41
58
|
pm csv import backlog.csv --delimiter ';'
|
|
@@ -70,7 +87,7 @@ pm csv import tasks.csv --atomic # writer-locked, crash-recoverable import
|
|
|
70
87
|
#### Strict import gate
|
|
71
88
|
|
|
72
89
|
Default imports remain lenient for messy spreadsheets: empty titles are skipped,
|
|
73
|
-
unknown statuses fall back to `open`, and
|
|
90
|
+
unknown statuses fall back to `open`, and non-numeric priorities are ignored. Add
|
|
74
91
|
`--strict` when the CSV is expected to be a production source of truth. In
|
|
75
92
|
strict mode the importer runs the same parser as `pm csv validate` before any
|
|
76
93
|
write, then aborts on row-level data issues or duplicate mapped columns so a bad
|
|
@@ -261,6 +278,10 @@ pm csv export --all-fields --output full.csv
|
|
|
261
278
|
|
|
262
279
|
## Programmatic importer: `csv-import`
|
|
263
280
|
|
|
281
|
+
The CLI spelling `pm csv-import import <file>` accepts every `csv import` flag.
|
|
282
|
+
Missing input and import failures exit nonzero. Programmatic callers can still
|
|
283
|
+
supply `options.file`.
|
|
284
|
+
|
|
264
285
|
Register the importer in your pm-cli config to automatically pull from a CSV file on every sync:
|
|
265
286
|
|
|
266
287
|
```jsonc
|
|
@@ -433,3 +454,46 @@ itself lists each affected stream in its output; `pm history --verify <id>` spot
|
|
|
433
454
|
content, so `reconcile` only re-greens the hash chain (no data loss) — see the authoritative
|
|
434
455
|
[pm-cli merge-safety guide](https://github.com/unbraind/pm-cli/blob/main/docs/MERGE_SAFETY.md). The
|
|
435
456
|
older blunt `pm history-repair --all` remains available as a lower-level primitive.
|
|
457
|
+
|
|
458
|
+
## Conflict-aware spreadsheet round trips
|
|
459
|
+
|
|
460
|
+
Use `pm csv checkout --output planning.csv` to export an editable table with
|
|
461
|
+
explicit item/revision/field digests and a baseline JSON file. Edit scalar cells,
|
|
462
|
+
then run `pm csv apply planning.csv --dry-run --json` followed by
|
|
463
|
+
`pm csv apply planning.csv --json`. Apply compares baseline, spreadsheet and
|
|
464
|
+
current tracker values, refuses conflicting changes before application, and
|
|
465
|
+
preserves changes to unedited fields. Identical retries write no item/history
|
|
466
|
+
records, including for terminal keyed items.
|
|
467
|
+
|
|
468
|
+
See the [protocol and CLI/typed SDK example](docs/spreadsheet-roundtrip.md) for
|
|
469
|
+
editable fields, read-only status, bounded refusals, concurrency and recovery
|
|
470
|
+
boundaries. This edit-session protocol reuses the existing SDK coordinator and
|
|
471
|
+
CSV compensation; legacy keyed import remains a separate command.
|
|
472
|
+
|
|
473
|
+
Apply and compensation callbacks refuse with `csv_lease_expired` when their
|
|
474
|
+
monotonic elapsed time reaches the effective item TTL minus a safety margin
|
|
475
|
+
(ten percent, capped at one second). Re-run apply; another writer may have
|
|
476
|
+
changed the item. Checkout and compensation snapshot reads use the same budget.
|
|
477
|
+
The real SDK/CLI takeover regressions now pass in the release suite.
|
|
478
|
+
|
|
479
|
+
This callback deadline is a mitigation. The host must still atomically fence
|
|
480
|
+
persistence after callback return; arbitrary delays there can exhaust the
|
|
481
|
+
remaining lease. That root fix belongs upstream in
|
|
482
|
+
[pm-cli issue 1549](https://github.com/unbraind/pm-cli/issues/1549).
|
|
483
|
+
|
|
484
|
+
## Without git
|
|
485
|
+
|
|
486
|
+
CSV import, export, validation, lineage bundles, checkout and three-way application work in a plain
|
|
487
|
+
tracker initialized with `pm init`. None requires a Git repository. GitHub sync
|
|
488
|
+
and Git-derived changelog provenance are separate host/tooling features.
|
|
489
|
+
|
|
490
|
+
## Cell lineage and rejected-row bundles
|
|
491
|
+
|
|
492
|
+
Use `pm csv bundle input.csv --columns title,priority --output import-bundle`
|
|
493
|
+
to import with a portable cell manifest and a minimal correction/retry CSV.
|
|
494
|
+
Only explicitly permitted fields leave the source. Correct the rejected file
|
|
495
|
+
and import it into a fresh bundle: successful rows are excluded, and stable
|
|
496
|
+
keys make unchanged retries idempotent. The compact TOON/JSON receipt reports
|
|
497
|
+
counts; artifacts include SHA-256 checksums. See the [protocol and worked
|
|
498
|
+
example](docs/row-lineage.md) for the typed SDK, mapping revisions, refusals,
|
|
499
|
+
privacy policy and recovery behavior.
|
package/dist/atomic-update.d.ts
CHANGED
|
@@ -27,8 +27,9 @@ export declare function captureUpdateCompensation(pmRoot: string, id: string, ma
|
|
|
27
27
|
export type CompensationPhase = "canonical_restored" | "representation_written" | "compensation_recorded";
|
|
28
28
|
/**
|
|
29
29
|
* Restore the captured document through an append-only SDK mutation. History
|
|
30
|
-
* verification and writer detection occur
|
|
31
|
-
*
|
|
30
|
+
* verification and writer detection occur inside the item lock. Callback and
|
|
31
|
+
* representation deadlines refuse exhausted leases; atomic persistence fencing
|
|
32
|
+
* still belongs to the host SDK. Refuse any intervening
|
|
32
33
|
* history outside this batch, including edits to unrelated fields. A durable
|
|
33
34
|
* compensation message makes a crash after restoration safe to replay.
|
|
34
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-update.d.ts","sourceRoot":"","sources":["../atomic-update.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"atomic-update.d.ts","sourceRoot":"","sources":["../atomic-update.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAK7H,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,mFAAmF;AACnF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;;;;GAMlE;AAED,8EAA8E;AAC9E,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAE1F;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAC5D,OAAO,CAAC,kCAAkC,CAAC,CAY7C;AAOD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GACzD,OAAO,CAAC,6BAA6B,CAAC,CAkBxC;AAED,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AAiB1G;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAC1D,IAAI,EAAE,6BAA6B,GAAG,SAAS,EAC/C,OAAO,GAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAY,GACrE,OAAO,CAAC,IAAI,CAAC,CAqEf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAW5G"}
|
package/dist/atomic-update.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { acquireLock, appendHistoryEntry, createHistoryEntry, getHistoryPath, nowIso, parseItemDocument, splitFrontMatter, writeFileAtomic, locateItem, mutateItem, readHistoryEntries, readLocatedItem, readSettings, resolveItemTypeRegistry, verifyHistoryEntries, } from "@unbrained/pm-cli/sdk";
|
|
2
2
|
import { decode, encode } from "@toon-format/toon";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
+
import { assertEditLease, guardEditMutation } from "./lease-guard.js";
|
|
4
5
|
/** Version of CSV prior-document compensation; also bound into every step id. */
|
|
5
6
|
export const UPDATE_COMPENSATION_VERSION = 2;
|
|
6
7
|
/** Read authoritative item state, including absent fields and every collection. */
|
|
@@ -49,12 +50,14 @@ function journalHash(value) {
|
|
|
49
50
|
export async function captureUpdateCompensation(pmRoot, id, marker, author) {
|
|
50
51
|
const settings = await readSettings(pmRoot);
|
|
51
52
|
const release = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, false, settings.locks.wait_ms);
|
|
53
|
+
const startedAt = performance.now();
|
|
52
54
|
try {
|
|
53
55
|
const { document, raw, located } = await readUpdateSnapshot(pmRoot, id);
|
|
54
56
|
const history = await readHistoryEntries(getHistoryPath(pmRoot, id), id);
|
|
55
57
|
if (!verifyHistoryEntries(history, document).ok) {
|
|
56
58
|
throw new Error(`Atomic update item ${id} has unverified history; reconcile before retrying.`);
|
|
57
59
|
}
|
|
60
|
+
assertEditLease(performance.now() - startedAt, settings.locks.ttl_seconds);
|
|
58
61
|
return {
|
|
59
62
|
version: UPDATE_COMPENSATION_VERSION, id, marker,
|
|
60
63
|
prior: JSON.stringify(document), raw, format: located.item_format, historyLength: history.length, historyHash: journalHash(history),
|
|
@@ -85,8 +88,9 @@ function parsePriorDocument(raw, id) {
|
|
|
85
88
|
}
|
|
86
89
|
/**
|
|
87
90
|
* Restore the captured document through an append-only SDK mutation. History
|
|
88
|
-
* verification and writer detection occur
|
|
89
|
-
*
|
|
91
|
+
* verification and writer detection occur inside the item lock. Callback and
|
|
92
|
+
* representation deadlines refuse exhausted leases; atomic persistence fencing
|
|
93
|
+
* still belongs to the host SDK. Refuse any intervening
|
|
90
94
|
* history outside this batch, including edits to unrelated fields. A durable
|
|
91
95
|
* compensation message makes a crash after restoration safe to replay.
|
|
92
96
|
*/
|
|
@@ -108,7 +112,7 @@ export async function compensateUpdate(pmRoot, id, marker, author, data, onPhase
|
|
|
108
112
|
await mutateItem({
|
|
109
113
|
pmRoot, settings, id, op: "restore", author, message: restoreMessage,
|
|
110
114
|
skipNoop: true,
|
|
111
|
-
async
|
|
115
|
+
mutate: guardEditMutation(settings.locks.ttl_seconds, async (document) => {
|
|
112
116
|
const history = await readHistoryEntries(getHistoryPath(pmRoot, id), id);
|
|
113
117
|
if (!verifyHistoryEntries(history, document).ok
|
|
114
118
|
|| journalHash(history.slice(0, historyLength)) !== historyHash
|
|
@@ -132,7 +136,7 @@ export async function compensateUpdate(pmRoot, id, marker, author, data, onPhase
|
|
|
132
136
|
document.metadata = structuredClone(prior.metadata);
|
|
133
137
|
document.body = prior.body;
|
|
134
138
|
return { changedFields };
|
|
135
|
-
},
|
|
139
|
+
}),
|
|
136
140
|
});
|
|
137
141
|
if (completed)
|
|
138
142
|
return;
|
|
@@ -141,6 +145,7 @@ export async function compensateUpdate(pmRoot, id, marker, author, data, onPhase
|
|
|
141
145
|
// prior representation in a second, guarded, resumable phase. It has exactly
|
|
142
146
|
// the same canonical hash as the SDK restore, so the derived index is valid.
|
|
143
147
|
const release = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, false, settings.locks.wait_ms);
|
|
148
|
+
const representationStartedAt = performance.now();
|
|
144
149
|
try {
|
|
145
150
|
const current = await readUpdateSnapshot(pmRoot, id);
|
|
146
151
|
const history = await readHistoryEntries(getHistoryPath(pmRoot, id), id);
|
|
@@ -150,6 +155,7 @@ export async function compensateUpdate(pmRoot, id, marker, author, data, onPhase
|
|
|
150
155
|
|| !verifyHistoryEntries(history, represented).ok) {
|
|
151
156
|
throw new Error(`Atomic update item ${id} changed during representation restoration; refusing compensation.`);
|
|
152
157
|
}
|
|
158
|
+
assertEditLease(performance.now() - representationStartedAt, settings.locks.ttl_seconds);
|
|
153
159
|
await writeFileAtomic(current.located.itemPath, contents);
|
|
154
160
|
await onPhase("representation_written");
|
|
155
161
|
await appendHistoryEntry(getHistoryPath(pmRoot, id), createHistoryEntry({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-update.js","sourceRoot":"","sources":["../atomic-update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAC7K,eAAe,EAAE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,GAC7E,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"atomic-update.js","sourceRoot":"","sources":["../atomic-update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAC7K,eAAe,EAAE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,GAC7E,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,iFAAiF;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAE7C,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAc,EAAE,EAAU;IACjE,MAAM,QAAQ,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,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB;SACpH,CAAC,CAAC,CAAC;QACJ,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACzC,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW,EAAE,MAAgC,EAAE,SAAiB;IAClG,IAAI,MAA+B,CAAC;IACpC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,GAAG,MAAM,CAAC,GAAG,CAA4B,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAA4B,EAAE,IAAI,EAAE,CAAC;IAC3E,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAuC,CAAC,CAAC,CAAC,MAAM,CAAC;IACjH,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PmCliError } from "@unbrained/pm-cli/sdk";
|
|
2
|
+
/** Compact diagnostics never echo potentially large/private cell contents. */
|
|
3
|
+
export interface EditConflict {
|
|
4
|
+
id: string;
|
|
5
|
+
fields: string[];
|
|
6
|
+
}
|
|
7
|
+
/** Stable refusal taxonomy shared by SDK callers and command errors. */
|
|
8
|
+
export type EditRefusalCode = "csv_session_invalid" | "csv_edit_invalid" | "csv_edit_conflict" | "csv_edit_apply_failed" | "csv_lease_expired";
|
|
9
|
+
/** Typed refusal with an actionable remedy and at most twenty conflict keys. */
|
|
10
|
+
export declare class EditRefusal extends PmCliError {
|
|
11
|
+
/** Stable machine-readable refusal category. */
|
|
12
|
+
readonly code: EditRefusalCode;
|
|
13
|
+
/** Next action needed before retrying. */
|
|
14
|
+
readonly remedy: string;
|
|
15
|
+
/** First twenty item/field conflicts, without cell contents. */
|
|
16
|
+
readonly conflicts: EditConflict[];
|
|
17
|
+
/** Full conflict count before the diagnostic ceiling. */
|
|
18
|
+
readonly conflictCount: number;
|
|
19
|
+
constructor(code: EditRefusalCode, remedy: string, conflicts?: EditConflict[]);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=edit-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-refusal.d.ts","sourceRoot":"","sources":["../edit-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AACD,wEAAwE;AACxE,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,uBAAuB,GAAG,mBAAmB,CAAC;AAC/I,gFAAgF;AAChF,qBAAa,WAAY,SAAQ,UAAU;IACzC,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC;IACnC,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,YAAY,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,YAAY,EAAO,EAQhF;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PmCliError } from "@unbrained/pm-cli/sdk";
|
|
2
|
+
/** Typed refusal with an actionable remedy and at most twenty conflict keys. */
|
|
3
|
+
export class EditRefusal extends PmCliError {
|
|
4
|
+
/** Stable machine-readable refusal category. */
|
|
5
|
+
code;
|
|
6
|
+
/** Next action needed before retrying. */
|
|
7
|
+
remedy;
|
|
8
|
+
/** First twenty item/field conflicts, without cell contents. */
|
|
9
|
+
conflicts;
|
|
10
|
+
/** Full conflict count before the diagnostic ceiling. */
|
|
11
|
+
conflictCount;
|
|
12
|
+
constructor(code, remedy, conflicts = []) {
|
|
13
|
+
const bounded = conflicts.slice(0, 20);
|
|
14
|
+
super(`${code}: ${remedy}${bounded.length ? `; conflicts=${JSON.stringify(bounded)}; total=${conflicts.length}` : ""}`, 2, { code, required: remedy, nextSteps: [remedy] });
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.remedy = remedy;
|
|
17
|
+
this.conflicts = bounded;
|
|
18
|
+
this.conflictCount = conflicts.length;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=edit-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-refusal.js","sourceRoot":"","sources":["../edit-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AASnD,gFAAgF;AAChF,MAAM,OAAO,WAAY,SAAQ,UAAU;IACzC,gDAAgD;IACvC,IAAI,CAAkB;IAC/B,0CAA0C;IACjC,MAAM,CAAS;IACxB,gEAAgE;IACvD,SAAS,CAAiB;IACnC,yDAAyD;IAChD,aAAa,CAAS;IAC/B,YAAY,IAAqB,EAAE,MAAc,EAAE,SAAS,GAAmB,EAAE;QAC/E,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK,CAAC,GAAG,IAAI,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EACvH,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC;IACxC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -632,4 +632,8 @@ export { loadKeyIndex, buildCsvExport };
|
|
|
632
632
|
export { importCSV };
|
|
633
633
|
export type { CsvExportOptions, CsvImportOptions };
|
|
634
634
|
export type { ParsedRow, ImportRowFilter, DiscoveredField, AutoFieldMapping };
|
|
635
|
+
export { applyEditSession, exportEditSession, parseEditSession, editSessionHeader, EDIT_FIELDS, EditRefusal } from "./roundtrip.ts";
|
|
636
|
+
export type { EditSession, EditSessionRow, EditField, EditReceipt, EditConflict, EditRefusalCode } from "./roundtrip.ts";
|
|
637
|
+
export { importLineage, writeLineageBundle, lineageDigest, LINEAGE_FIELDS, LineageRefusal } from "./lineage.ts";
|
|
638
|
+
export type { LineageField, LineageOptions, CellLineage, RowLineage, LineageManifest, LineageBundle } from "./lineage.ts";
|
|
635
639
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,YAAY,EAAmB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S,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpI,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEzH,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChH,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, createReadStream } from "node:fs";
|
|
1
|
+
import { readFileSync, writeFileSync, createReadStream, mkdirSync } from "node:fs";
|
|
2
2
|
import { basename, resolve } from "node:path";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { certifyCompleteListResult, inspectCompleteListResult, runWorkspaceTransactionGc } from "@unbrained/pm-cli/sdk";
|
|
6
|
+
import { importLineage, writeLineageBundle, LineageRefusal } from "./lineage.js";
|
|
7
|
+
import { applyEditSession, exportEditSession, EditRefusal } from "./roundtrip.js";
|
|
6
8
|
import { captureUpdateCompensation, compensateUpdate, inspectUpdate, UPDATE_COMPENSATION_VERSION } from "./atomic-update.js";
|
|
7
9
|
// ---------------------------------------------------------------------------
|
|
8
10
|
// Error contract
|
|
@@ -2323,7 +2325,7 @@ function prepareCsvExport(pmRoot, rawOptions) {
|
|
|
2323
2325
|
}
|
|
2324
2326
|
export default {
|
|
2325
2327
|
name: "pm-csv",
|
|
2326
|
-
version: "2026.10.
|
|
2328
|
+
version: "2026.10.23",
|
|
2327
2329
|
activate(api) {
|
|
2328
2330
|
// -----------------------------------------------------------------------
|
|
2329
2331
|
// Schema: register an optional `csv_source` provenance field so imported
|
|
@@ -2335,10 +2337,109 @@ export default {
|
|
|
2335
2337
|
api.registerItemFields([
|
|
2336
2338
|
{ name: "csv_source", type: "string", optional: true },
|
|
2337
2339
|
]);
|
|
2340
|
+
api.registerCommand({
|
|
2341
|
+
name: "csv bundle",
|
|
2342
|
+
description: "Import with portable cell lineage and a minimal rejected-row retry CSV (maximum 1000 rows).",
|
|
2343
|
+
arguments: [{ name: "file", required: true, description: "UTF-8 CSV input" }],
|
|
2344
|
+
flags: [
|
|
2345
|
+
{ long: "--output", value_name: "directory", description: "New private bundle directory" },
|
|
2346
|
+
{ long: "--columns", value_name: "fields", description: "Explicit permitted import and diagnostic fields, including title" },
|
|
2347
|
+
{ long: "--map", value_name: "mapping", description: "Source=target pairs, for example Summary=title" },
|
|
2348
|
+
],
|
|
2349
|
+
async run(ctx) {
|
|
2350
|
+
const output = ctx.options["output"];
|
|
2351
|
+
const columns = ctx.options["columns"];
|
|
2352
|
+
if (!output || !columns || !ctx.args[0])
|
|
2353
|
+
throw new LineageRefusal("csv_lineage_invalid", "Provide input.csv --output new-bundle --columns title,priority; only explicitly selected fields can be imported or exported.");
|
|
2354
|
+
let table;
|
|
2355
|
+
try {
|
|
2356
|
+
table = parseCSV(stripBOM(readFileSync(ctx.args[0], "utf8")));
|
|
2357
|
+
mkdirSync(output, { mode: 0o700 });
|
|
2358
|
+
}
|
|
2359
|
+
catch {
|
|
2360
|
+
throw new LineageRefusal("csv_bundle_io", "Provide readable UTF-8 input and a new writable output directory; existing bundles are preserved.");
|
|
2361
|
+
}
|
|
2362
|
+
let fieldMap;
|
|
2363
|
+
try {
|
|
2364
|
+
const parsed = parseFieldMap(ctx.options["map"]);
|
|
2365
|
+
fieldMap = Object.fromEntries(Object.entries(parsed).map(([header, field]) => [
|
|
2366
|
+
table[0]?.find(source => source.trim().toLowerCase() === header) ?? header, field,
|
|
2367
|
+
]));
|
|
2368
|
+
}
|
|
2369
|
+
catch {
|
|
2370
|
+
throw new LineageRefusal("csv_lineage_invalid", "Use --map Source=title,Rank=priority; map only permitted fields.");
|
|
2371
|
+
}
|
|
2372
|
+
const bundle = await importLineage(ctx.pm_root, table, {
|
|
2373
|
+
columns: columns.split(",").map(field => field.trim()),
|
|
2374
|
+
fieldMap,
|
|
2375
|
+
author: ctx.global["author"] ?? "pm-csv",
|
|
2376
|
+
});
|
|
2377
|
+
writeLineageBundle(output, bundle);
|
|
2378
|
+
return bundle.receipt;
|
|
2379
|
+
},
|
|
2380
|
+
});
|
|
2381
|
+
api.registerCommand({
|
|
2382
|
+
name: "csv checkout",
|
|
2383
|
+
description: "Export a conflict-aware CSV edit session and immutable baseline JSON (maximum 1000 items).",
|
|
2384
|
+
flags: [
|
|
2385
|
+
{ long: "--output", value_name: "file", description: "New CSV filename; baseline uses <file>.session.json" },
|
|
2386
|
+
{ long: "--ids", value_name: "ids", description: "Comma-separated canonical item IDs (default: complete tracker)" },
|
|
2387
|
+
],
|
|
2388
|
+
async run(ctx) {
|
|
2389
|
+
const output = ctx.options["output"];
|
|
2390
|
+
if (!output)
|
|
2391
|
+
throw new EditRefusal("csv_edit_invalid", "Provide --output items.csv; retain items.csv.session.json alongside the CSV.");
|
|
2392
|
+
const selection = ctx.options["ids"];
|
|
2393
|
+
const ids = selection ? selection.split(",").map(id => id.trim())
|
|
2394
|
+
: parseCSV(buildCsvExport(ctx.pm_root, { delimiter: ",", columns: ["id"] }).csvText).slice(1).map(row => row[0]);
|
|
2395
|
+
const { session, table } = await exportEditSession(ctx.pm_root, ids);
|
|
2396
|
+
// Exclusive creation prevents accidental replacement of an earlier edit session.
|
|
2397
|
+
try {
|
|
2398
|
+
writeFileSync(`${output}.session.json`, JSON.stringify(session), { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
2399
|
+
writeFileSync(output, serializeCSV(table, ",") + "\n", { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
2400
|
+
}
|
|
2401
|
+
catch (error) {
|
|
2402
|
+
const refusal = new EditRefusal("csv_edit_invalid", "Use new writable checkout filenames. Existing files were preserved; an incomplete new baseline may remain if CSV creation failed.");
|
|
2403
|
+
refusal.cause = error;
|
|
2404
|
+
throw refusal;
|
|
2405
|
+
}
|
|
2406
|
+
return { exported: session.rows.length, session: session.digest };
|
|
2407
|
+
},
|
|
2408
|
+
});
|
|
2409
|
+
api.registerCommand({
|
|
2410
|
+
name: "csv apply",
|
|
2411
|
+
description: "Apply an edited checkout as a three-way patch; conflicts refuse before application.",
|
|
2412
|
+
arguments: [{ name: "file", required: true, description: "Edited checkout CSV" }],
|
|
2413
|
+
flags: [
|
|
2414
|
+
{ long: "--session", value_name: "file", description: "Baseline JSON (default: <file>.session.json)" },
|
|
2415
|
+
{ long: "--dry-run", description: "Read-only conflict check and compact patch counts" },
|
|
2416
|
+
],
|
|
2417
|
+
async run(ctx) {
|
|
2418
|
+
const file = ctx.args[0];
|
|
2419
|
+
if (!file)
|
|
2420
|
+
throw new EditRefusal("csv_edit_invalid", "Provide the edited CSV filename.");
|
|
2421
|
+
const baseline = ctx.options["session"] ?? `${file}.session.json`;
|
|
2422
|
+
let session;
|
|
2423
|
+
let text;
|
|
2424
|
+
try {
|
|
2425
|
+
session = JSON.parse(readFileSync(baseline, "utf8"));
|
|
2426
|
+
text = stripBOM(readFileSync(file, "utf8"));
|
|
2427
|
+
}
|
|
2428
|
+
catch (error) {
|
|
2429
|
+
const refusal = new EditRefusal("csv_session_invalid", "Provide a readable CSV and the unchanged checkout session JSON.");
|
|
2430
|
+
refusal.cause = error;
|
|
2431
|
+
throw refusal;
|
|
2432
|
+
}
|
|
2433
|
+
return { ...await applyEditSession(ctx.pm_root, session, parseCSV(text), {
|
|
2434
|
+
author: ctx.global["author"] ?? "pm-csv",
|
|
2435
|
+
dryRun: readBoolOption(ctx.options, "dry-run", "dryRun"),
|
|
2436
|
+
}) };
|
|
2437
|
+
},
|
|
2438
|
+
});
|
|
2338
2439
|
// -----------------------------------------------------------------------
|
|
2339
2440
|
// Command: pm csv import <file>
|
|
2340
2441
|
// -----------------------------------------------------------------------
|
|
2341
|
-
|
|
2442
|
+
const csvImport = {
|
|
2342
2443
|
name: "csv import",
|
|
2343
2444
|
description: "Import pm items from a CSV file with full RFC-4180 parsing (quoted fields, " +
|
|
2344
2445
|
"embedded newlines, escaped quotes, BOM, CRLF). Expected columns: title, type, " +
|
|
@@ -2349,6 +2450,7 @@ export default {
|
|
|
2349
2450
|
"--source to record import provenance in the csv_source field, and " +
|
|
2350
2451
|
"--status/--type/--priority to import only matching rows (others are skipped). " +
|
|
2351
2452
|
"Use --strict to fail before writing when row-level data issues are present.",
|
|
2453
|
+
arguments: [{ name: "file", required: true, description: "CSV file to import" }],
|
|
2352
2454
|
intent: "import items from a CSV file into pm",
|
|
2353
2455
|
examples: [
|
|
2354
2456
|
"pm csv import tasks.csv",
|
|
@@ -2423,6 +2525,11 @@ export default {
|
|
|
2423
2525
|
fieldMapWarnings: res.fieldMapWarnings,
|
|
2424
2526
|
};
|
|
2425
2527
|
}
|
|
2528
|
+
if (res.errors.length > 0) {
|
|
2529
|
+
throw new CommandError(`Import completed with ${res.errors.length} row error(s): ` +
|
|
2530
|
+
`imported ${res.imported}, updated ${res.updated}, skipped ${res.skipped}${filterNote}.\n` +
|
|
2531
|
+
res.errors.join("\n"));
|
|
2532
|
+
}
|
|
2426
2533
|
console.error(`Imported ${res.imported}, updated ${res.updated}, skipped ${res.skipped}${filterNote}.`);
|
|
2427
2534
|
return {
|
|
2428
2535
|
imported: res.imported,
|
|
@@ -2434,7 +2541,8 @@ export default {
|
|
|
2434
2541
|
fieldMapWarnings: res.fieldMapWarnings,
|
|
2435
2542
|
};
|
|
2436
2543
|
},
|
|
2437
|
-
}
|
|
2544
|
+
};
|
|
2545
|
+
api.registerCommand(csvImport);
|
|
2438
2546
|
// -----------------------------------------------------------------------
|
|
2439
2547
|
// Command: pm csv validate <file>
|
|
2440
2548
|
// -----------------------------------------------------------------------
|
|
@@ -2581,28 +2689,11 @@ export default {
|
|
|
2581
2689
|
// Importer: csv-import (programmatic / config-driven)
|
|
2582
2690
|
// -----------------------------------------------------------------------
|
|
2583
2691
|
api.registerImporter("csv-import", async (ctx) => {
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
const invocation = parseCsvImportInvocation(ctx.options, false);
|
|
2590
|
-
const absolutePath = resolve(filePath);
|
|
2591
|
-
let res;
|
|
2592
|
-
try {
|
|
2593
|
-
res = await executeLoggedCsvImport("csv-import: reading", ctx.pm_root, absolutePath, invocation, ctx.sdk?.commitWorkspaceTransaction, ctx.global?.author ?? undefined);
|
|
2594
|
-
}
|
|
2595
|
-
catch (err) {
|
|
2596
|
-
const msg = errorMessage(err);
|
|
2597
|
-
console.error(`csv-import: failed — ${msg}`);
|
|
2598
|
-
return;
|
|
2599
|
-
}
|
|
2600
|
-
const filterNote = res.filtered > 0 ? ` (${res.filtered} filtered out)` : "";
|
|
2601
|
-
if (res.autoMappings.length > 0) {
|
|
2602
|
-
console.error(`csv-import: auto-mapped columns ${formatAutoMappings(res.autoMappings)}.`);
|
|
2603
|
-
}
|
|
2604
|
-
console.error(`csv-import: done — imported ${res.imported}, updated ${res.updated}, skipped ${res.skipped}${filterNote}.`);
|
|
2605
|
-
});
|
|
2692
|
+
// Configured SDK callers supply options.file; CLI callers supply args.
|
|
2693
|
+
const file = ctx.options["file"];
|
|
2694
|
+
const args = ctx.args.length > 0 ? ctx.args : typeof file === "string" ? [file] : [];
|
|
2695
|
+
return csvImport.run({ ...ctx, args });
|
|
2696
|
+
}, csvImport);
|
|
2606
2697
|
},
|
|
2607
2698
|
};
|
|
2608
2699
|
// ---------------------------------------------------------------------------
|
|
@@ -2625,4 +2716,6 @@ export { loadAppliedByTransaction, itemStatus, compensateCreate };
|
|
|
2625
2716
|
// ONLY for those tests; production callers keep using the command paths.
|
|
2626
2717
|
export { loadKeyIndex, buildCsvExport };
|
|
2627
2718
|
export { importCSV };
|
|
2719
|
+
export { applyEditSession, exportEditSession, parseEditSession, editSessionHeader, EDIT_FIELDS, EditRefusal } from "./roundtrip.js";
|
|
2720
|
+
export { importLineage, writeLineageBundle, lineageDigest, LINEAGE_FIELDS, LineageRefusal } from "./lineage.js";
|
|
2628
2721
|
//# sourceMappingURL=index.js.map
|