@loomwork/ui-lineage 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +471 -2
- package/dist/conformance.d.ts +4 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +143 -0
- package/dist/conformance.js.map +1 -0
- package/dist/derive.d.ts +15 -0
- package/dist/derive.d.ts.map +1 -0
- package/dist/derive.js +35 -0
- package/dist/derive.js.map +1 -0
- package/dist/esm/conformance.js +140 -0
- package/dist/esm/conformance.js.map +1 -0
- package/dist/esm/derive.js +29 -0
- package/dist/esm/derive.js.map +1 -0
- package/dist/esm/events.js +101 -0
- package/dist/esm/events.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lineage.js +1376 -0
- package/dist/esm/lineage.js.map +1 -0
- package/dist/esm/retention.js +73 -0
- package/dist/esm/retention.js.map +1 -0
- package/dist/esm/rootsFor.js +49 -0
- package/dist/esm/rootsFor.js.map +1 -0
- package/dist/esm/seen.js +733 -0
- package/dist/esm/seen.js.map +1 -0
- package/dist/esm/seenCrypto.js +197 -0
- package/dist/esm/seenCrypto.js.map +1 -0
- package/dist/esm/seenGc.js +122 -0
- package/dist/esm/seenGc.js.map +1 -0
- package/dist/esm/state.js +185 -0
- package/dist/esm/state.js.map +1 -0
- package/dist/esm/store.js +172 -0
- package/dist/esm/store.js.map +1 -0
- package/dist/events.d.ts +781 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +106 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/lineage.d.ts +394 -0
- package/dist/lineage.d.ts.map +1 -0
- package/dist/lineage.js +1383 -0
- package/dist/lineage.js.map +1 -0
- package/dist/retention.d.ts +45 -0
- package/dist/retention.d.ts.map +1 -0
- package/dist/retention.js +78 -0
- package/dist/retention.js.map +1 -0
- package/dist/rootsFor.d.ts +33 -0
- package/dist/rootsFor.d.ts.map +1 -0
- package/dist/rootsFor.js +52 -0
- package/dist/rootsFor.js.map +1 -0
- package/dist/seen.d.ts +375 -0
- package/dist/seen.d.ts.map +1 -0
- package/dist/seen.js +739 -0
- package/dist/seen.js.map +1 -0
- package/dist/seenCrypto.d.ts +72 -0
- package/dist/seenCrypto.d.ts.map +1 -0
- package/dist/seenCrypto.js +210 -0
- package/dist/seenCrypto.js.map +1 -0
- package/dist/seenGc.d.ts +73 -0
- package/dist/seenGc.d.ts.map +1 -0
- package/dist/seenGc.js +126 -0
- package/dist/seenGc.js.map +1 -0
- package/dist/state.d.ts +66 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +190 -0
- package/dist/state.js.map +1 -0
- package/dist/store.d.ts +93 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +177 -0
- package/dist/store.js.map +1 -0
- package/package.json +60 -3
- package/src/conformance.ts +148 -0
- package/src/derive.ts +57 -0
- package/src/events.ts +125 -0
- package/src/index.ts +79 -0
- package/src/lineage.ts +1655 -0
- package/src/retention.ts +118 -0
- package/src/rootsFor.ts +75 -0
- package/src/seen.ts +965 -0
- package/src/seenCrypto.ts +271 -0
- package/src/seenGc.ts +233 -0
- package/src/state.ts +268 -0
- package/src/store.ts +274 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA2B,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,mBAAmB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;;;;;QAnC1B;;;;;WAKG;;QAEH;;;;;WAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOH,kGAAkG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqB1F,CAAC;AAEX,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,gBACjB,CAAC;AAEpC;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC,CAKzF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACtE,GAAG,IAAI,CAGP"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LINEAGE_SENSITIVE_PATHS = exports.isLineageEventType = exports.PAYLOAD_SCHEMAS = exports.PromotedPayload = exports.BranchedPayload = exports.RevertedPayload = exports.ComposedPayload = exports.EXPERIENCE_PROMOTED = exports.EXPERIENCE_BRANCHED = exports.EXPERIENCE_REVERTED = exports.EXPERIENCE_COMPOSED = void 0;
|
|
4
|
+
exports.registerLineageSensitivePaths = registerLineageSensitivePaths;
|
|
5
|
+
const ui_core_1 = require("@loomwork/ui-core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
// ── The lineage event protocol ────────────────────────────────────────────────
|
|
8
|
+
// A lineage is the append-only log of ONE experience's versions. Every entry is an event whose
|
|
9
|
+
// type names what happened and whose payload carries the content address (`ref`) of the stored
|
|
10
|
+
// artifact plus enough to VERIFY it without trusting the blob:
|
|
11
|
+
//
|
|
12
|
+
// EXPERIENCE_COMPOSED a version produced by ops folded onto its parent (or the genesis, ops [])
|
|
13
|
+
// EXPERIENCE_REVERTED a version that restores an older artifact's content as a NEW version
|
|
14
|
+
// EXPERIENCE_BRANCHED the first version of a NEW lineage forked from a version of another
|
|
15
|
+
// EXPERIENCE_PROMOTED the app chose to SHOW a version (head is "latest", promoted is "shown")
|
|
16
|
+
//
|
|
17
|
+
// `EXPERIENCE_COMPOSED` is the same name and `{ ref, parents, ops }` core's `log.ts` declared as a
|
|
18
|
+
// userspace convention; here it gains a producer, a consumer and a validator. The extra fields
|
|
19
|
+
// (`experienceId`, `versionHash`, `by`) are additive. `EXPERIENCE_PROMOTED` is redeclared (not
|
|
20
|
+
// imported) because importing it from `@loomwork/ui-planner` would put the planner's whole graph —
|
|
21
|
+
// hydration, the sandbox — into a server-side store package; `lineage.test.ts` asserts the two
|
|
22
|
+
// spellings never drift.
|
|
23
|
+
exports.EXPERIENCE_COMPOSED = "EXPERIENCE_COMPOSED";
|
|
24
|
+
exports.EXPERIENCE_REVERTED = "EXPERIENCE_REVERTED";
|
|
25
|
+
exports.EXPERIENCE_BRANCHED = "EXPERIENCE_BRANCHED";
|
|
26
|
+
exports.EXPERIENCE_PROMOTED = "EXPERIENCE_PROMOTED";
|
|
27
|
+
const ContentRefSchema = zod_1.z.object({ __loomContent: zod_1.z.string().min(1) });
|
|
28
|
+
const Hash = zod_1.z.string().min(1);
|
|
29
|
+
const RecordedOperationSchema = zod_1.z.object({
|
|
30
|
+
op: ui_core_1.Operation,
|
|
31
|
+
baseVersion: zod_1.z.string().optional(),
|
|
32
|
+
by: ui_core_1.Provenance,
|
|
33
|
+
at: zod_1.z.string(),
|
|
34
|
+
});
|
|
35
|
+
const Common = {
|
|
36
|
+
experienceId: zod_1.z.string().min(1),
|
|
37
|
+
versionHash: Hash,
|
|
38
|
+
ref: ContentRefSchema,
|
|
39
|
+
parents: zod_1.z.array(Hash),
|
|
40
|
+
by: ui_core_1.Provenance,
|
|
41
|
+
};
|
|
42
|
+
exports.ComposedPayload = zod_1.z.object({
|
|
43
|
+
...Common,
|
|
44
|
+
ops: zod_1.z.array(RecordedOperationSchema),
|
|
45
|
+
/**
|
|
46
|
+
* What the author said about the change (U7): UNTRUSTED text (a planner's model text), bounded
|
|
47
|
+
* and stripped by `boundSummary` on the way in AND on the way out of the fold, since the log is
|
|
48
|
+
* untrusted input. Optional, so every version written before it replays unchanged; it is not in
|
|
49
|
+
* the content address (nothing here is).
|
|
50
|
+
*/
|
|
51
|
+
summary: zod_1.z.string().optional(),
|
|
52
|
+
/**
|
|
53
|
+
* The strictest class of everything the author READ to write `summary` (the experience, tool
|
|
54
|
+
* samples, caller context), stamped by the host at compose. A summary is judged against it (and
|
|
55
|
+
* against the version's own class floor) before a viewer is shown it. Recorded on the event, not
|
|
56
|
+
* in the content address. Absent = unknown, and the floor alone gates the summary.
|
|
57
|
+
*/
|
|
58
|
+
summaryClass: ui_core_1.Sensitivity.optional(),
|
|
59
|
+
});
|
|
60
|
+
exports.RevertedPayload = zod_1.z.object({ ...Common, revertedTo: Hash });
|
|
61
|
+
exports.BranchedPayload = zod_1.z.object({
|
|
62
|
+
...Common,
|
|
63
|
+
from: zod_1.z.object({ experienceId: zod_1.z.string().min(1), versionHash: Hash }),
|
|
64
|
+
/** The version of the SOURCE line whose sticky classes were carried in (its head at the fork). */
|
|
65
|
+
carriedFrom: Hash,
|
|
66
|
+
});
|
|
67
|
+
exports.PromotedPayload = zod_1.z.object({
|
|
68
|
+
ref: ContentRefSchema,
|
|
69
|
+
experienceId: zod_1.z.string().min(1),
|
|
70
|
+
versionHash: Hash,
|
|
71
|
+
by: ui_core_1.Provenance,
|
|
72
|
+
});
|
|
73
|
+
exports.PAYLOAD_SCHEMAS = {
|
|
74
|
+
[exports.EXPERIENCE_COMPOSED]: exports.ComposedPayload,
|
|
75
|
+
[exports.EXPERIENCE_REVERTED]: exports.RevertedPayload,
|
|
76
|
+
[exports.EXPERIENCE_BRANCHED]: exports.BranchedPayload,
|
|
77
|
+
[exports.EXPERIENCE_PROMOTED]: exports.PromotedPayload,
|
|
78
|
+
};
|
|
79
|
+
const isLineageEventType = (t) => Object.hasOwn(exports.PAYLOAD_SCHEMAS, t);
|
|
80
|
+
exports.isLineageEventType = isLineageEventType;
|
|
81
|
+
/**
|
|
82
|
+
* The payload paths that carry host or model TEXT, per event type: the op props and labels, the
|
|
83
|
+
* author's `summary` and the `by` provenance (a user's own words and ids). These are what a host
|
|
84
|
+
* seals under its owner's key so erasing the owner makes the line unreadable
|
|
85
|
+
* (`registerLineageSensitivePaths`). Everything else on an event is an identifier (`experienceId`,
|
|
86
|
+
* `versionHash`, `ref`, `parents`, `from`, `carriedFrom`, `revertedTo`) or a class
|
|
87
|
+
* (`summaryClass`), and stays plain so the log's structure survives the key.
|
|
88
|
+
*
|
|
89
|
+
* `ops` is one path: it covers every nested op's `by`, props, labels and prompt text.
|
|
90
|
+
*/
|
|
91
|
+
exports.LINEAGE_SENSITIVE_PATHS = {
|
|
92
|
+
[exports.EXPERIENCE_COMPOSED]: ["ops", "summary", "by"],
|
|
93
|
+
[exports.EXPERIENCE_REVERTED]: ["by"],
|
|
94
|
+
[exports.EXPERIENCE_BRANCHED]: ["by"],
|
|
95
|
+
[exports.EXPERIENCE_PROMOTED]: ["by"],
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Register {@link LINEAGE_SENSITIVE_PATHS} on a crypto event store (`EncryptingEventStore`'s
|
|
99
|
+
* `registerSensitive`). Call it once at composition, before the first lineage write: what was
|
|
100
|
+
* written before stays plaintext.
|
|
101
|
+
*/
|
|
102
|
+
function registerLineageSensitivePaths(store) {
|
|
103
|
+
for (const [type, paths] of Object.entries(exports.LINEAGE_SENSITIVE_PATHS))
|
|
104
|
+
store.registerSensitive(type, paths);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAuHA,sEAKC;AA5HD,+CAAuE;AACvE,6BAAwB;AAExB,iFAAiF;AACjF,+FAA+F;AAC/F,+FAA+F;AAC/F,+DAA+D;AAC/D,EAAE;AACF,mGAAmG;AACnG,8FAA8F;AAC9F,6FAA6F;AAC7F,iGAAiG;AACjG,EAAE;AACF,mGAAmG;AACnG,+FAA+F;AAC/F,+FAA+F;AAC/F,mGAAmG;AACnG,+FAA+F;AAC/F,yBAAyB;AAEZ,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAQzD,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE/B,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,mBAAS;IACb,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,EAAE,EAAE,oBAAU;IACd,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG;IACb,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,C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,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAyB,EAAE,CACrE,MAAM,CAAC,MAAM,CAAC,uBAAe,EAAE,CAAC,CAAC,CAAC;AADvB,QAAA,kBAAkB,sBACK;AAEpC;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAA0D;IAC5F,CAAC,2BAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC;IAC/C,CAAC,2BAAmB,CAAC,EAAE,CAAC,IAAI,CAAC;IAC7B,CAAC,2BAAmB,CAAC,EAAE,CAAC,IAAI,CAAC;IAC7B,CAAC,2BAAmB,CAAC,EAAE,CAAC,IAAI,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,6BAA6B,CAAC,KAE7C;IACC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,+BAAuB,CAAC;QACjE,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { LineErasedError, LineUnreadableError, Lineage, classifyLineFailure } from "./lineage";
|
|
2
|
+
export type { LineBlockedError, PinsExtra } from "./lineage";
|
|
3
|
+
export type { Committed, HeadMoved, LineageOptions, LineageResult, PromotedMoved, Refusal, Refused, } from "./lineage";
|
|
4
|
+
export { branchArtifact, revertArtifact } from "./derive";
|
|
5
|
+
export type { Authored } from "./derive";
|
|
6
|
+
export { BranchedPayload, ComposedPayload, EXPERIENCE_BRANCHED, EXPERIENCE_COMPOSED, EXPERIENCE_PROMOTED, EXPERIENCE_REVERTED, LINEAGE_SENSITIVE_PATHS, PromotedPayload, RevertedPayload, registerLineageSensitivePaths, } from "./events";
|
|
7
|
+
export type { LineageEventType, SummaryClass } from "./events";
|
|
8
|
+
export { foldLineage } from "./state";
|
|
9
|
+
export type { Fold, LineageState, VersionKind, VersionRecord } from "./state";
|
|
10
|
+
export { InMemoryLineageStore, LINEAGE_STREAM_PREFIX, LINEAGE_WORKFLOW_ID, LOOM_UI_STREAM_NAMESPACE, eventStoreLineageStore, } from "./store";
|
|
11
|
+
export type { AppendOutcome, LineageRecord, LineageStore, PrefixedLineageStore, StoredLineageRecord, } from "./store";
|
|
12
|
+
export { checkLineageStoreConformance } from "./conformance";
|
|
13
|
+
export { DEFAULT_MAX_SEEN_VIEWS, DEFAULT_MAX_SKEW_MS, MAX_SEEN_READ, SEEN_STREAM_PREFIX, SEEN_WORKFLOW_ID, SeenLog, VIEWER_ERASED, VIEWS_RETAINED, VIEW_RECORDED, ViewRecordPayload, seenStoreOptions, seenStreamKey, } from "./seen";
|
|
14
|
+
export type { SeenLogOptions, SeenRefusal, SeenResult, SeenRetention, SeenUnreadable, SeenView, } from "./seen";
|
|
15
|
+
export { InMemorySeenKeyStore, SEALED_REF_BLOCK, checkSeenKeyStoreConformance, seenKeySubject, } from "./seenCrypto";
|
|
16
|
+
export type { SeenKeyStore } from "./seenCrypto";
|
|
17
|
+
export { collectSeenGarbage, collectSeenRoots } from "./seenGc";
|
|
18
|
+
export type { SeenGcOptions, SeenGcReport, SeenGcResult } from "./seenGc";
|
|
19
|
+
export { DEFAULT_KEEP_LAST, retainedVersions, validateRetentionPolicy } from "./retention";
|
|
20
|
+
export type { Retained, RetentionPolicy } from "./retention";
|
|
21
|
+
export { rootsFor } from "./rootsFor";
|
|
22
|
+
export type { RootsForOptions } from "./rootsFor";
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC/F,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC7D,YAAY,EACV,S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,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rootsFor = exports.validateRetentionPolicy = exports.retainedVersions = exports.DEFAULT_KEEP_LAST = exports.collectSeenRoots = exports.collectSeenGarbage = exports.seenKeySubject = exports.checkSeenKeyStoreConformance = exports.SEALED_REF_BLOCK = exports.InMemorySeenKeyStore = exports.seenStreamKey = exports.seenStoreOptions = exports.ViewRecordPayload = exports.VIEW_RECORDED = exports.VIEWS_RETAINED = exports.VIEWER_ERASED = exports.SeenLog = exports.SEEN_WORKFLOW_ID = exports.SEEN_STREAM_PREFIX = exports.MAX_SEEN_READ = exports.DEFAULT_MAX_SKEW_MS = exports.DEFAULT_MAX_SEEN_VIEWS = exports.checkLineageStoreConformance = exports.eventStoreLineageStore = exports.LOOM_UI_STREAM_NAMESPACE = exports.LINEAGE_WORKFLOW_ID = exports.LINEAGE_STREAM_PREFIX = exports.InMemoryLineageStore = exports.foldLineage = exports.registerLineageSensitivePaths = exports.RevertedPayload = exports.PromotedPayload = exports.LINEAGE_SENSITIVE_PATHS = exports.EXPERIENCE_REVERTED = exports.EXPERIENCE_PROMOTED = exports.EXPERIENCE_COMPOSED = exports.EXPERIENCE_BRANCHED = exports.ComposedPayload = exports.BranchedPayload = exports.revertArtifact = exports.branchArtifact = exports.classifyLineFailure = exports.Lineage = exports.LineUnreadableError = exports.LineErasedError = void 0;
|
|
4
|
+
var lineage_1 = require("./lineage");
|
|
5
|
+
Object.defineProperty(exports, "LineErasedError", { enumerable: true, get: function () { return lineage_1.LineErasedError; } });
|
|
6
|
+
Object.defineProperty(exports, "LineUnreadableError", { enumerable: true, get: function () { return lineage_1.LineUnreadableError; } });
|
|
7
|
+
Object.defineProperty(exports, "Lineage", { enumerable: true, get: function () { return lineage_1.Lineage; } });
|
|
8
|
+
Object.defineProperty(exports, "classifyLineFailure", { enumerable: true, get: function () { return lineage_1.classifyLineFailure; } });
|
|
9
|
+
var derive_1 = require("./derive");
|
|
10
|
+
Object.defineProperty(exports, "branchArtifact", { enumerable: true, get: function () { return derive_1.branchArtifact; } });
|
|
11
|
+
Object.defineProperty(exports, "revertArtifact", { enumerable: true, get: function () { return derive_1.revertArtifact; } });
|
|
12
|
+
var events_1 = require("./events");
|
|
13
|
+
Object.defineProperty(exports, "BranchedPayload", { enumerable: true, get: function () { return events_1.BranchedPayload; } });
|
|
14
|
+
Object.defineProperty(exports, "ComposedPayload", { enumerable: true, get: function () { return events_1.ComposedPayload; } });
|
|
15
|
+
Object.defineProperty(exports, "EXPERIENCE_BRANCHED", { enumerable: true, get: function () { return events_1.EXPERIENCE_BRANCHED; } });
|
|
16
|
+
Object.defineProperty(exports, "EXPERIENCE_COMPOSED", { enumerable: true, get: function () { return events_1.EXPERIENCE_COMPOSED; } });
|
|
17
|
+
Object.defineProperty(exports, "EXPERIENCE_PROMOTED", { enumerable: true, get: function () { return events_1.EXPERIENCE_PROMOTED; } });
|
|
18
|
+
Object.defineProperty(exports, "EXPERIENCE_REVERTED", { enumerable: true, get: function () { return events_1.EXPERIENCE_REVERTED; } });
|
|
19
|
+
Object.defineProperty(exports, "LINEAGE_SENSITIVE_PATHS", { enumerable: true, get: function () { return events_1.LINEAGE_SENSITIVE_PATHS; } });
|
|
20
|
+
Object.defineProperty(exports, "PromotedPayload", { enumerable: true, get: function () { return events_1.PromotedPayload; } });
|
|
21
|
+
Object.defineProperty(exports, "RevertedPayload", { enumerable: true, get: function () { return events_1.RevertedPayload; } });
|
|
22
|
+
Object.defineProperty(exports, "registerLineageSensitivePaths", { enumerable: true, get: function () { return events_1.registerLineageSensitivePaths; } });
|
|
23
|
+
var state_1 = require("./state");
|
|
24
|
+
Object.defineProperty(exports, "foldLineage", { enumerable: true, get: function () { return state_1.foldLineage; } });
|
|
25
|
+
var store_1 = require("./store");
|
|
26
|
+
Object.defineProperty(exports, "InMemoryLineageStore", { enumerable: true, get: function () { return store_1.InMemoryLineageStore; } });
|
|
27
|
+
Object.defineProperty(exports, "LINEAGE_STREAM_PREFIX", { enumerable: true, get: function () { return store_1.LINEAGE_STREAM_PREFIX; } });
|
|
28
|
+
Object.defineProperty(exports, "LINEAGE_WORKFLOW_ID", { enumerable: true, get: function () { return store_1.LINEAGE_WORKFLOW_ID; } });
|
|
29
|
+
Object.defineProperty(exports, "LOOM_UI_STREAM_NAMESPACE", { enumerable: true, get: function () { return store_1.LOOM_UI_STREAM_NAMESPACE; } });
|
|
30
|
+
Object.defineProperty(exports, "eventStoreLineageStore", { enumerable: true, get: function () { return store_1.eventStoreLineageStore; } });
|
|
31
|
+
var conformance_1 = require("./conformance");
|
|
32
|
+
Object.defineProperty(exports, "checkLineageStoreConformance", { enumerable: true, get: function () { return conformance_1.checkLineageStoreConformance; } });
|
|
33
|
+
var seen_1 = require("./seen");
|
|
34
|
+
Object.defineProperty(exports, "DEFAULT_MAX_SEEN_VIEWS", { enumerable: true, get: function () { return seen_1.DEFAULT_MAX_SEEN_VIEWS; } });
|
|
35
|
+
Object.defineProperty(exports, "DEFAULT_MAX_SKEW_MS", { enumerable: true, get: function () { return seen_1.DEFAULT_MAX_SKEW_MS; } });
|
|
36
|
+
Object.defineProperty(exports, "MAX_SEEN_READ", { enumerable: true, get: function () { return seen_1.MAX_SEEN_READ; } });
|
|
37
|
+
Object.defineProperty(exports, "SEEN_STREAM_PREFIX", { enumerable: true, get: function () { return seen_1.SEEN_STREAM_PREFIX; } });
|
|
38
|
+
Object.defineProperty(exports, "SEEN_WORKFLOW_ID", { enumerable: true, get: function () { return seen_1.SEEN_WORKFLOW_ID; } });
|
|
39
|
+
Object.defineProperty(exports, "SeenLog", { enumerable: true, get: function () { return seen_1.SeenLog; } });
|
|
40
|
+
Object.defineProperty(exports, "VIEWER_ERASED", { enumerable: true, get: function () { return seen_1.VIEWER_ERASED; } });
|
|
41
|
+
Object.defineProperty(exports, "VIEWS_RETAINED", { enumerable: true, get: function () { return seen_1.VIEWS_RETAINED; } });
|
|
42
|
+
Object.defineProperty(exports, "VIEW_RECORDED", { enumerable: true, get: function () { return seen_1.VIEW_RECORDED; } });
|
|
43
|
+
Object.defineProperty(exports, "ViewRecordPayload", { enumerable: true, get: function () { return seen_1.ViewRecordPayload; } });
|
|
44
|
+
Object.defineProperty(exports, "seenStoreOptions", { enumerable: true, get: function () { return seen_1.seenStoreOptions; } });
|
|
45
|
+
Object.defineProperty(exports, "seenStreamKey", { enumerable: true, get: function () { return seen_1.seenStreamKey; } });
|
|
46
|
+
var seenCrypto_1 = require("./seenCrypto");
|
|
47
|
+
Object.defineProperty(exports, "InMemorySeenKeyStore", { enumerable: true, get: function () { return seenCrypto_1.InMemorySeenKeyStore; } });
|
|
48
|
+
Object.defineProperty(exports, "SEALED_REF_BLOCK", { enumerable: true, get: function () { return seenCrypto_1.SEALED_REF_BLOCK; } });
|
|
49
|
+
Object.defineProperty(exports, "checkSeenKeyStoreConformance", { enumerable: true, get: function () { return seenCrypto_1.checkSeenKeyStoreConformance; } });
|
|
50
|
+
Object.defineProperty(exports, "seenKeySubject", { enumerable: true, get: function () { return seenCrypto_1.seenKeySubject; } });
|
|
51
|
+
var seenGc_1 = require("./seenGc");
|
|
52
|
+
Object.defineProperty(exports, "collectSeenGarbage", { enumerable: true, get: function () { return seenGc_1.collectSeenGarbage; } });
|
|
53
|
+
Object.defineProperty(exports, "collectSeenRoots", { enumerable: true, get: function () { return seenGc_1.collectSeenRoots; } });
|
|
54
|
+
var retention_1 = require("./retention");
|
|
55
|
+
Object.defineProperty(exports, "DEFAULT_KEEP_LAST", { enumerable: true, get: function () { return retention_1.DEFAULT_KEEP_LAST; } });
|
|
56
|
+
Object.defineProperty(exports, "retainedVersions", { enumerable: true, get: function () { return retention_1.retainedVersions; } });
|
|
57
|
+
Object.defineProperty(exports, "validateRetentionPolicy", { enumerable: true, get: function () { return retention_1.validateRetentionPolicy; } });
|
|
58
|
+
var rootsFor_1 = require("./rootsFor");
|
|
59
|
+
Object.defineProperty(exports, "rootsFor", { enumerable: true, get: function () { return rootsFor_1.rootsFor; } });
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAA+F;AAAtF,0GAAA,eAAe,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAW3E,mCAA0D;AAAjD,wGAAA,cAAc,OAAA;AAAE,wGAAA,cAAc,OAAA;AAEvC,mCAWkB;AAVhB,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA;AACf,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AACnB,iHAAA,uBAAuB,OAAA;AACvB,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA;AACf,uHAAA,6BAA6B,OAAA;AAG/B,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AAEpB,iCAMiB;AALf,6GAAA,oBAAoB,OAAA;AACpB,8GAAA,qBAAqB,OAAA;AACrB,4GAAA,mBAAmB,OAAA;AACnB,iHAAA,wBAAwB,OAAA;AACxB,+GAAA,sBAAsB,OAAA;AASxB,6CAA6D;AAApD,2HAAA,4BAA4B,OAAA;AACrC,+BAagB;AAZd,8GAAA,sBAAsB,OAAA;AACtB,2GAAA,mBAAmB,OAAA;AACnB,qGAAA,aAAa,OAAA;AACb,0GAAA,kBAAkB,OAAA;AAClB,wGAAA,gBAAgB,OAAA;AAChB,+FAAA,OAAO,OAAA;AACP,qGAAA,aAAa,OAAA;AACb,sGAAA,cAAc,OAAA;AACd,qGAAA,aAAa,OAAA;AACb,yGAAA,iBAAiB,OAAA;AACjB,wGAAA,gBAAgB,OAAA;AAChB,qGAAA,aAAa,OAAA;AAUf,2CAKsB;AAJpB,kHAAA,oBAAoB,OAAA;AACpB,8GAAA,gBAAgB,OAAA;AAChB,0HAAA,4BAA4B,OAAA;AAC5B,4GAAA,cAAc,OAAA;AAGhB,mCAAgE;AAAvD,4GAAA,kBAAkB,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAG7C,yCAA2F;AAAlF,8GAAA,iBAAiB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAErE,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import type { ContentStore } from "@loomwork/plugin-content";
|
|
2
|
+
import { type Audience, type DeclaredToolClasses, type Experience, type Finding, type NodeExplanation, type ProjectionCatalog, type Provenance, type ProvenanceLedger, type ReadPolicy, type RecordedOperation, type UndeclaredToolPolicy, type Viewer } from "@loomwork/ui-core";
|
|
3
|
+
import { type SummaryClass } from "./events";
|
|
4
|
+
import { type RetentionPolicy } from "./retention";
|
|
5
|
+
import { type LineageState, type VersionRecord } from "./state";
|
|
6
|
+
import { type LineageStore } from "./store";
|
|
7
|
+
export type HeadMoved = {
|
|
8
|
+
readonly kind: "head-moved";
|
|
9
|
+
readonly expectedHead: string | null;
|
|
10
|
+
readonly actualHead: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type PromotedMoved = {
|
|
13
|
+
readonly kind: "promoted-moved";
|
|
14
|
+
readonly expectedPromoted: string | null;
|
|
15
|
+
readonly actualPromoted: string | null;
|
|
16
|
+
};
|
|
17
|
+
export type Refused = {
|
|
18
|
+
readonly kind: "refused";
|
|
19
|
+
readonly finding: Finding;
|
|
20
|
+
};
|
|
21
|
+
/** Why a write did not happen. A lost race is typed (`head-moved`) and carries the winner. */
|
|
22
|
+
export type Refusal = HeadMoved | PromotedMoved | Refused;
|
|
23
|
+
export type LineageResult<T> = {
|
|
24
|
+
ok: true;
|
|
25
|
+
value: T;
|
|
26
|
+
} | {
|
|
27
|
+
ok: false;
|
|
28
|
+
refusal: Refusal;
|
|
29
|
+
};
|
|
30
|
+
export interface Committed {
|
|
31
|
+
readonly experience: Experience;
|
|
32
|
+
readonly version: VersionRecord;
|
|
33
|
+
}
|
|
34
|
+
export interface LineageOptions {
|
|
35
|
+
readonly events: LineageStore;
|
|
36
|
+
readonly content: ContentStore;
|
|
37
|
+
/** Clock for event times; injectable so a test (or a replaying host) is deterministic. */
|
|
38
|
+
readonly now?: () => string;
|
|
39
|
+
/**
|
|
40
|
+
* The host's read policy, bound ONCE: every read this lineage serves under a viewer (`explain`)
|
|
41
|
+
* applies it, and a `SeenLog` or `LineageChangeFeed` built over this lineage inherits it. A
|
|
42
|
+
* per-call value may only ADD to it (`mergeReadPolicy`). Absent = no policy (the experience's own
|
|
43
|
+
* classes only).
|
|
44
|
+
*/
|
|
45
|
+
readonly readPolicy?: ReadPolicy;
|
|
46
|
+
/**
|
|
47
|
+
* Host hook: has this line's erasure been CONFIRMED? A read that hits a sealed line whose key is
|
|
48
|
+
* unavailable (`isKeyUnavailable`) or whose blob is shredded (`isPayloadShredded`) cannot tell an
|
|
49
|
+
* erasure from "the key is not on this node" or "the ciphertext does not open" (loom says so
|
|
50
|
+
* itself). The line is reported `line-erased` ONLY when this returns true, else `line-unreadable`.
|
|
51
|
+
* Implement it with your KeyStore: `(id) => keys.wasDestroyed(subjectOf({ executionId: stream(id) }))`.
|
|
52
|
+
* Absent = nothing is ever confirmed. A throwing hook counts as "not confirmed". Both outcomes
|
|
53
|
+
* fail closed; only a confirmed erasure is skipped by the GC root walks.
|
|
54
|
+
*/
|
|
55
|
+
readonly confirmErased?: (experienceId: string) => Promise<boolean>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Thrown by the reads that return plain values (`forEachContentRef`, `pins` and so `rootsFor`) when
|
|
59
|
+
* a line's key is gone AND the host confirmed the erasure (`LineageOptions.confirmErased`). Those
|
|
60
|
+
* reads SKIP a confirmed-erased line (it contributes no roots), so this reaches a caller only from a
|
|
61
|
+
* single-line read; every method that returns a `LineageResult` (or `verify`'s findings) reports the
|
|
62
|
+
* same condition as a `refused` result with code `line-erased` instead of throwing.
|
|
63
|
+
*/
|
|
64
|
+
export declare class LineErasedError extends Error {
|
|
65
|
+
readonly experienceId: string;
|
|
66
|
+
readonly name = "LineErasedError";
|
|
67
|
+
readonly code: "line-erased";
|
|
68
|
+
readonly confirmed: true;
|
|
69
|
+
constructor(experienceId: string, options?: {
|
|
70
|
+
readonly cause?: unknown;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The line's key is unavailable on this node, or its ciphertext / artifact does not open, and the
|
|
75
|
+
* erasure is NOT confirmed (no `confirmErased` hook, or it said no). Could be a destroyed key, a key
|
|
76
|
+
* this node does not hold, a tampered event, a drifted `subjectOf`, or an artifact written before an
|
|
77
|
+
* `EncryptingContentStore` was composed (`reason: "artifact-unsealed"`). Fail closed, but not an
|
|
78
|
+
* erasure: GC refuses rather than guess, and a read says so. `reason` is also the refusal's finding code.
|
|
79
|
+
*/
|
|
80
|
+
export declare class LineUnreadableError extends Error {
|
|
81
|
+
readonly experienceId: string;
|
|
82
|
+
readonly name = "LineUnreadableError";
|
|
83
|
+
readonly code: "line-unreadable";
|
|
84
|
+
readonly confirmed: false;
|
|
85
|
+
readonly reason: "line-unreadable" | "artifact-unsealed";
|
|
86
|
+
constructor(experienceId: string, options?: {
|
|
87
|
+
readonly cause?: unknown;
|
|
88
|
+
readonly reason?: "line-unreadable" | "artifact-unsealed";
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export type LineBlockedError = LineErasedError | LineUnreadableError;
|
|
92
|
+
/**
|
|
93
|
+
* Classify a read failure of one line: `undefined` when it is not an unreadable-line failure
|
|
94
|
+
* (rethrow it), else a typed error. ONE rule: `line-erased` iff the host's `confirmErased` says so;
|
|
95
|
+
* `isPayloadShredded` alone is not confirmation. An undecryptable blob is never an erasure.
|
|
96
|
+
*/
|
|
97
|
+
export declare function classifyLineFailure(experienceId: string, err: unknown, confirmErased?: (experienceId: string) => Promise<boolean>): Promise<LineBlockedError | undefined>;
|
|
98
|
+
/** What else uses the lineage's content store, for {@link Lineage.pins}. */
|
|
99
|
+
export interface PinsExtra {
|
|
100
|
+
/** Versions to retain whatever the policy says (e.g. the ones a seen log still records views of). */
|
|
101
|
+
readonly keepVersions?: Iterable<{
|
|
102
|
+
readonly experienceId: string;
|
|
103
|
+
readonly versionHash: string;
|
|
104
|
+
}>;
|
|
105
|
+
/** Addresses of other users of the same store (e.g. a seen log's sealed value blobs). */
|
|
106
|
+
readonly keepAddresses?: Iterable<string> | AsyncIterable<string>;
|
|
107
|
+
/**
|
|
108
|
+
* How many retained artifacts of ONE line are read at once, to find the refs inside their bytes.
|
|
109
|
+
* Default 8; a positive integer (anything else throws). 1 reads strictly one after another.
|
|
110
|
+
*/
|
|
111
|
+
readonly concurrency?: number;
|
|
112
|
+
}
|
|
113
|
+
export declare class Lineage {
|
|
114
|
+
private readonly events;
|
|
115
|
+
private readonly content;
|
|
116
|
+
private readonly now;
|
|
117
|
+
private readonly policy;
|
|
118
|
+
private readonly streamPrefix;
|
|
119
|
+
private readonly workflowId;
|
|
120
|
+
private readonly confirmErased;
|
|
121
|
+
constructor(opts: LineageOptions);
|
|
122
|
+
/**
|
|
123
|
+
* The `ContentAccess` of one line's artifact blobs: the line's STREAM id (the id its events live
|
|
124
|
+
* under) and the lineage workflow id. A content store that seals by owner (`EncryptingContentStore`)
|
|
125
|
+
* resolves it through the host's `subjectOf`, the same mapping its event store applies to the
|
|
126
|
+
* stream, so one mapping covers a line's events and blobs. A plain store ignores it.
|
|
127
|
+
*/
|
|
128
|
+
private accessFor;
|
|
129
|
+
/**
|
|
130
|
+
* Classify a read failure of `experienceId` with this lineage's `confirmErased` hook: a typed
|
|
131
|
+
* {@link LineErasedError} (confirmed) or {@link LineUnreadableError}, or `undefined` when `err` is
|
|
132
|
+
* not an unreadable-line failure. Readers built over this lineage (the change feed) use it.
|
|
133
|
+
*/
|
|
134
|
+
block(experienceId: string, err: unknown): Promise<LineBlockedError | undefined>;
|
|
135
|
+
/** Every record of a line; an unreadable line THROWS a {@link LineBlockedError}, anything else propagates. */
|
|
136
|
+
private readLine;
|
|
137
|
+
private confirms;
|
|
138
|
+
/**
|
|
139
|
+
* A write step failed with `err`: a typed refusal when the line is (now) unreadable, else rethrow.
|
|
140
|
+
* The re-read catches a key destroyed between `state()` and the append, whose own error is untyped.
|
|
141
|
+
*/
|
|
142
|
+
private failedWrite;
|
|
143
|
+
/** The read policy bound at construction (empty when none); readers built over this lineage inherit it. */
|
|
144
|
+
get readPolicy(): ReadPolicy;
|
|
145
|
+
/**
|
|
146
|
+
* Whether `other` is this lineage's own store, or may write under a stream prefix that overlaps its
|
|
147
|
+
* own (`a.startsWith(b) || b.startsWith(a)`: `x:` and `x:y:` collide). A `SeenLog` refuses such a
|
|
148
|
+
* store: a viewer's record must never share streams with the line it describes.
|
|
149
|
+
*
|
|
150
|
+
* FAIL-CLOSED: the vetted store's `streamPrefix` must be readable (the package's prefixed stores
|
|
151
|
+
* and `InMemoryLineageStore` are). A decorator that HIDES `streamPrefix` cannot be told apart from a
|
|
152
|
+
* colliding store, so it is refused: re-expose `streamPrefix` on the wrapper (copied from the inner
|
|
153
|
+
* store) if it is legitimate. The reverse is a documented limit: if THIS lineage's store is such a
|
|
154
|
+
* wrapper its prefix is assumed to be the default (`LINEAGE_STREAM_PREFIX`).
|
|
155
|
+
*/
|
|
156
|
+
sharesStreamsWith(other: LineageStore): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Call `visit` with every content address any version of any line cites (artifacts, op payloads,
|
|
159
|
+
* anything stored as a content ref in an event), CONSERVATIVELY: any `__loomContent` string found
|
|
160
|
+
* anywhere in a payload counts, claim-check envelopes included. This is the lineage's half of the
|
|
161
|
+
* root set a content collector marks. One line is held in memory at a time. Throws if the store
|
|
162
|
+
* cannot enumerate its lines (`listStreams`): a collector must refuse then, never guess.
|
|
163
|
+
*/
|
|
164
|
+
forEachContentRef(visit: (address: string) => void): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* U17 — the content addresses a collector must KEEP, as the `roots` of loom's `sweepUnpinnedContent`:
|
|
167
|
+
* for every line, the artifact of each version `policy` retains (`retainedVersions`: the newest N,
|
|
168
|
+
* the head, the promoted version, the genesis, every fork's source) plus every OTHER content ref the
|
|
169
|
+
* line's events cite (anything an op carries) plus every content ref found INSIDE a retained
|
|
170
|
+
* artifact's own bytes (a node whose props hold a media ref: the sweep does not read blobs, so
|
|
171
|
+
* nothing else would root it). The artifact ref of a version the policy does not keep is
|
|
172
|
+
* deliberately absent, so that blob becomes reclaimable.
|
|
173
|
+
*
|
|
174
|
+
* USE IT INSTEAD OF scanning the lineage's streams, never as well: a scanned stream pins every
|
|
175
|
+
* version's artifact for ever (a bare ref is load-bearing to loom's sweep), so pass the lineage's
|
|
176
|
+
* `LineageStore` to neither `eventStores` nor `snapshotStores`. Mind the consequence: a reclaimed
|
|
177
|
+
* version's event stays in the log, `get` of it reports the missing artifact, and `verify` of a line
|
|
178
|
+
* that has had versions reclaimed reports them (and the versions derived from them) until the line
|
|
179
|
+
* is verified from a retained checkpoint. Reclaim only versions nobody needs to re-open.
|
|
180
|
+
*
|
|
181
|
+
* THE ROOT SET MUST BE COMPLETE. With `reclaimOrphans: { completeScan: true }` loom erases every
|
|
182
|
+
* blob in the store that no root names. The lineage is only ONE user of its content store: pass
|
|
183
|
+
* the others through `extra` (a {@link SeenLog} sharing the store: `collectSeenRoots(log)`), and
|
|
184
|
+
* add any other lineage's `pins()` and loom's own execution scan to the same `roots`. A
|
|
185
|
+
* version a viewer's recorded view still names is kept via `extra.keepVersions`.
|
|
186
|
+
*
|
|
187
|
+
* RACES. A promote, a branch (and a seen-log record) TOUCH the artifact they newly cite
|
|
188
|
+
* (`ContentStore.touch`, SPI 1.4.0, ADR 0055 D6 amendment 2), so a sweep whose roots were computed
|
|
189
|
+
* a moment earlier still refuses to delete it. That also covers a fork made between this method's
|
|
190
|
+
* two passes. It needs a store with `touch`; loom's sweep refuses to erase through one without it.
|
|
191
|
+
*
|
|
192
|
+
* COST. Linear in the number of RETAINED, DISTINCT artifacts, and each one is read in full: the
|
|
193
|
+
* refs a version cites (media, blobs) live only inside its artifact's bytes, and neither the version
|
|
194
|
+
* event nor the store records which artifacts hold any, so there is nothing to skip on without
|
|
195
|
+
* reading. The reads are bounded, not avoided: a retention policy that keeps fewer versions reads
|
|
196
|
+
* fewer artifacts, artifacts shared by versions or forks are read once per call, and `extra.concurrency`
|
|
197
|
+
* sets how many of a line are in flight. Run it from the collector, not on a request path. (Skipping
|
|
198
|
+
* ref-free artifacts would need a "cites refs" flag stamped on the version event at write time: a
|
|
199
|
+
* lineage event-schema change, not done here.)
|
|
200
|
+
*
|
|
201
|
+
* Two passes, one line in memory at a time. Throws if the store cannot enumerate its lines, if
|
|
202
|
+
* any line fails to fold, if a retained artifact cannot be read for a reason other than being
|
|
203
|
+
* already gone, or on a malformed policy (a collector must refuse, never guess).
|
|
204
|
+
*/
|
|
205
|
+
pins(policy?: RetentionPolicy, extra?: PinsExtra): AsyncGenerator<string, void, undefined>;
|
|
206
|
+
/**
|
|
207
|
+
* Tell the content store that `versionHashes` of `experienceId` were JUST re-cited (by a promote,
|
|
208
|
+
* a branch, a recorded view): `ContentStore.touch` on their artifacts, so a collector's
|
|
209
|
+
* conditional delete spares them (loom ADR 0055 D6 amendment 2). A store without `touch` is
|
|
210
|
+
* left alone (loom's sweep will not erase through one). Refuses when an artifact is already gone.
|
|
211
|
+
*/
|
|
212
|
+
cite(experienceId: string, versionHashes: readonly string[]): Promise<LineageResult<void>>;
|
|
213
|
+
/** The folded state of a line (empty state for an unknown one). A malformed log is a finding. */
|
|
214
|
+
state(experienceId: string): Promise<LineageResult<LineageState>>;
|
|
215
|
+
/** The latest version's hash, or null for a line with no version. */
|
|
216
|
+
head(experienceId: string): Promise<LineageResult<string | null>>;
|
|
217
|
+
/** Every version, oldest first. */
|
|
218
|
+
versions(experienceId: string): Promise<LineageResult<readonly VersionRecord[]>>;
|
|
219
|
+
/**
|
|
220
|
+
* `from` (default the head) and its ancestors WITHIN this line, newest first, following
|
|
221
|
+
* `parents`. A branch's first version stops the walk (its parent is in another line; see
|
|
222
|
+
* `VersionRecord.from`). Iterative with a visited set: a forged cycle cannot loop it.
|
|
223
|
+
*/
|
|
224
|
+
walk(experienceId: string, from?: string): Promise<LineageResult<readonly VersionRecord[]>>;
|
|
225
|
+
/** One version's artifact, hash-verified (`getExperience`). */
|
|
226
|
+
get(experienceId: string, versionHash: string): Promise<LineageResult<Experience>>;
|
|
227
|
+
/** The latest version's artifact. */
|
|
228
|
+
resolveLatest(experienceId: string): Promise<LineageResult<Experience>>;
|
|
229
|
+
/** The promoted (shown) version's artifact, or refused when nothing is promoted. */
|
|
230
|
+
resolvePromoted(experienceId: string): Promise<LineageResult<Experience>>;
|
|
231
|
+
private load;
|
|
232
|
+
/**
|
|
233
|
+
* The per-node ledger of version `versionHash` (default the head): which recorded op created and
|
|
234
|
+
* last changed each node, derived from the log alone (no artifact is read, nothing is stored).
|
|
235
|
+
* A revert has the ledger of the version it restores; a branch starts from its source version's.
|
|
236
|
+
* Bounded: a chain of reverts or branches deeper than `MAX_VERIFY_DEPTH` ends in an unknown
|
|
237
|
+
* origin rather than recursing without limit.
|
|
238
|
+
*/
|
|
239
|
+
provenance(experienceId: string, versionHash?: string): Promise<LineageResult<ProvenanceLedger>>;
|
|
240
|
+
private ledgerAt;
|
|
241
|
+
/**
|
|
242
|
+
* Why is `nodeId` in version `versionHash` (default the head), FOR `viewer`? The ledger of that
|
|
243
|
+
* version read through core's `explainNode`: unknown, restricted and unreadable all answer the
|
|
244
|
+
* same bare `{ available: false }`. The creating version's summary and the request that prompted
|
|
245
|
+
* it are shown only when the viewer may see the strictest class of the viewed version, of the
|
|
246
|
+
* version that wrote them, and of what the planner read (`summaryClass`); a version that cannot be
|
|
247
|
+
* read counts as `secret`. Performs no authorization: `viewer` is the host's claim.
|
|
248
|
+
*/
|
|
249
|
+
explain(experienceId: string, nodeId: string, opts?: {
|
|
250
|
+
readonly viewer?: Viewer;
|
|
251
|
+
/** The surface's audience: `"broadcast"` explains as a viewer with no clearance. */
|
|
252
|
+
readonly audience?: Audience;
|
|
253
|
+
readonly versionHash?: string;
|
|
254
|
+
readonly projections?: ProjectionCatalog;
|
|
255
|
+
readonly hydrationProjectionId?: string;
|
|
256
|
+
readonly declaredToolClasses?: DeclaredToolClasses;
|
|
257
|
+
readonly undeclared?: UndeclaredToolPolicy;
|
|
258
|
+
}): Promise<LineageResult<NodeExplanation>>;
|
|
259
|
+
/**
|
|
260
|
+
* The line state and record of version `hash`, on this line or on a line it was branched from
|
|
261
|
+
* (breadth-first through `branched` versions, at most `MAX_VERIFY_DEPTH` lines, each visited once).
|
|
262
|
+
*/
|
|
263
|
+
private findVersion;
|
|
264
|
+
/**
|
|
265
|
+
* Several versions' artifacts from ONE fold of the line (`get` refolds the whole log per call).
|
|
266
|
+
* A version that is unknown or cannot be read maps to `undefined`.
|
|
267
|
+
*/
|
|
268
|
+
getMany(experienceId: string, versionHashes: readonly string[]): Promise<LineageResult<ReadonlyMap<string, Experience | undefined>>>;
|
|
269
|
+
/** Begin a line: the genesis artifact becomes its first version. Refused when the line exists. */
|
|
270
|
+
start(genesis: Experience, by: Provenance): Promise<LineageResult<Committed>>;
|
|
271
|
+
/**
|
|
272
|
+
* Advance the head to `artifact`, which `ops` produce from the version `expectedHead`.
|
|
273
|
+
*
|
|
274
|
+
* REFUSES, writing nothing, when: `expectedHead` is not the head (`head-moved`, carrying the real
|
|
275
|
+
* one — the caller re-reads and re-authors; nothing is ever silently overwritten); the artifact
|
|
276
|
+
* does not name `expectedHead` as its only parent; or replaying `ops` from the parent does not
|
|
277
|
+
* reproduce the artifact's content address (`ops-artifact-mismatch`), including an op the host
|
|
278
|
+
* will not allow or one declared against a different base. `ops` is empty only for the first
|
|
279
|
+
* version of a line. The artifact may arrive unsealed.
|
|
280
|
+
*/
|
|
281
|
+
advance(input: {
|
|
282
|
+
readonly experienceId: string;
|
|
283
|
+
readonly expectedHead: string | null;
|
|
284
|
+
readonly artifact: Experience;
|
|
285
|
+
readonly ops: readonly RecordedOperation[];
|
|
286
|
+
readonly by: Provenance;
|
|
287
|
+
/**
|
|
288
|
+
* Whether a recorded `declassify*` op may be replayed. Per call and HOST-ONLY: it lowers a
|
|
289
|
+
* class, so the code that authored the ops (never a planner's output, never stored config)
|
|
290
|
+
* passes it for this one write. Default false. `verify` does not need it (see there).
|
|
291
|
+
*/
|
|
292
|
+
readonly allowDeclassify?: boolean;
|
|
293
|
+
/** What the author said about the change (a planner's `PlanResult.summary`): untrusted, bounded on the way in. */
|
|
294
|
+
readonly summary?: string;
|
|
295
|
+
/**
|
|
296
|
+
* The strictest class of everything the author read to write `summary` (the planner's inputs,
|
|
297
|
+
* context and samples included). HOST-STAMPED; a viewer sees the summary only when cleared for
|
|
298
|
+
* it AND for the version's own class floor. Absent: only the floor gates it, so a host whose
|
|
299
|
+
* planner saw classified context MUST pass it. Refused when it is not a known class.
|
|
300
|
+
*/
|
|
301
|
+
readonly summaryClass?: SummaryClass;
|
|
302
|
+
}): Promise<LineageResult<Committed>>;
|
|
303
|
+
/**
|
|
304
|
+
* The concurrent-author path: fold `ops` onto the head yourself. The first op is applied with
|
|
305
|
+
* `applyAt`, so one that declares a `baseVersion` other than the head is refused
|
|
306
|
+
* (`stale-base-version`) instead of landing on a surface its author never saw; then the result is
|
|
307
|
+
* committed through {@link advance}'s verification, so what is recorded is exactly what replays.
|
|
308
|
+
*/
|
|
309
|
+
compose(input: {
|
|
310
|
+
readonly experienceId: string;
|
|
311
|
+
readonly expectedHead: string;
|
|
312
|
+
readonly ops: readonly RecordedOperation[];
|
|
313
|
+
readonly by: Provenance;
|
|
314
|
+
/** As on {@link advance}: per call, host-only, default false. */
|
|
315
|
+
readonly allowDeclassify?: boolean;
|
|
316
|
+
/** As on {@link advance}. */
|
|
317
|
+
readonly summary?: string;
|
|
318
|
+
/** As on {@link advance}. */
|
|
319
|
+
readonly summaryClass?: SummaryClass;
|
|
320
|
+
}): Promise<LineageResult<Committed>>;
|
|
321
|
+
/**
|
|
322
|
+
* Restore the content of version `to` as a NEW version on top of `expectedHead` — history is
|
|
323
|
+
* never rewritten, and the revert itself can be reverted. Sticky classes the line learned since
|
|
324
|
+
* `to` are carried forward (never lowered; see derive.ts). `to` may be any version of the line
|
|
325
|
+
* except the head (which would restore nothing).
|
|
326
|
+
*/
|
|
327
|
+
revert(input: {
|
|
328
|
+
readonly experienceId: string;
|
|
329
|
+
readonly expectedHead: string;
|
|
330
|
+
readonly to: string;
|
|
331
|
+
readonly by: Provenance;
|
|
332
|
+
}): Promise<LineageResult<Committed>>;
|
|
333
|
+
/** Undo: revert to the head's parent, as a new version. Redo is `revert` to the hash you left. */
|
|
334
|
+
undo(input: {
|
|
335
|
+
readonly experienceId: string;
|
|
336
|
+
readonly expectedHead: string;
|
|
337
|
+
readonly by: Provenance;
|
|
338
|
+
}): Promise<LineageResult<Committed>>;
|
|
339
|
+
/**
|
|
340
|
+
* Fork version `from` of one line into a NEW line `experienceId`. The new line's first version
|
|
341
|
+
* has `from` as its (cross-line) parent and carries the sticky classes of the source line's head
|
|
342
|
+
* at the fork, so branching an old version never launders a class the source learned later.
|
|
343
|
+
* Refused when the new line already exists.
|
|
344
|
+
*/
|
|
345
|
+
branch(input: {
|
|
346
|
+
readonly from: {
|
|
347
|
+
readonly experienceId: string;
|
|
348
|
+
readonly versionHash: string;
|
|
349
|
+
};
|
|
350
|
+
readonly experienceId: string;
|
|
351
|
+
readonly by: Provenance;
|
|
352
|
+
}): Promise<LineageResult<Committed>>;
|
|
353
|
+
/**
|
|
354
|
+
* Mark version `versionHash` as the one the app SHOWS (an agent's ops yield a new version; showing
|
|
355
|
+
* it is this separate act). Compare-and-set on the promoted pointer: `expectedPromoted` is what
|
|
356
|
+
* the caller saw (null = nothing promoted yet).
|
|
357
|
+
*/
|
|
358
|
+
promote(input: {
|
|
359
|
+
readonly experienceId: string;
|
|
360
|
+
readonly versionHash: string;
|
|
361
|
+
readonly expectedPromoted: string | null;
|
|
362
|
+
readonly by: Provenance;
|
|
363
|
+
}): Promise<LineageResult<{
|
|
364
|
+
readonly promoted: string;
|
|
365
|
+
readonly sequence: number;
|
|
366
|
+
}>>;
|
|
367
|
+
/**
|
|
368
|
+
* Rebuild a whole line from its log and compare it to what is stored — the consumer of
|
|
369
|
+
* `EXPERIENCE_COMPOSED`. Starting from the genesis artifact (attested by its address alone: there
|
|
370
|
+
* is nothing before it to replay from), each version is REBUILT, never read back from its blob:
|
|
371
|
+
* a composed version by replaying its ops on the rebuilt parent, a revert or branch by recomputing
|
|
372
|
+
* it from the rebuilt artifacts it names. The rebuilt content address must equal the logged one
|
|
373
|
+
* and the stored blob must hash to it. Returns every finding; `[]` = the line is consistent.
|
|
374
|
+
*
|
|
375
|
+
* A branch is only as sound as its source: `verify` also verifies the source line up to the
|
|
376
|
+
* version the fork carried classes from (`carriedFrom`), recursively (a visited set and a depth
|
|
377
|
+
* bound stop a forged cycle), and reports what it finds on the branch, prefixed with the source
|
|
378
|
+
* line; `carriedFrom` must be the forked version or a descendant of it on the source line. A
|
|
379
|
+
* version whose parent could not be rebuilt is reported, not skipped silently. Ops replay with
|
|
380
|
+
* `declassify*` ALLOWED: this checks that addresses reproduce, and the write path is the gate.
|
|
381
|
+
*/
|
|
382
|
+
verify(experienceId: string): Promise<Finding[]>;
|
|
383
|
+
/** Verify `experienceId` from its start through version `upTo` (null = the whole line). */
|
|
384
|
+
private verifyLine;
|
|
385
|
+
/**
|
|
386
|
+
* The one write path: check `expectedHead` against the head, let `prepare` verify and build the
|
|
387
|
+
* version, store its bytes, then append at the log's tip. A lost append re-reads: if the head is
|
|
388
|
+
* still `expectedHead` (only a promotion slipped in) it retries at the new tip; otherwise it is
|
|
389
|
+
* `head-moved`. The blob is written BEFORE the event and is content-addressed, so a lost race
|
|
390
|
+
* leaves an unreferenced, harmless blob — never a log entry without bytes.
|
|
391
|
+
*/
|
|
392
|
+
private commit;
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../src/lineage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAEf,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,iBAAiB,EAEtB,KAAK,oBAAoB,EAEzB,KAAK,MAAM,EAUZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAA+B,MAAM,SAAS,CAAC;AAC7F,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAcjB,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,E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