@ue-shed/map-history 0.1.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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/baseline-materialization.d.ts +17 -0
  4. package/dist/baseline-materialization.d.ts.map +1 -0
  5. package/dist/baseline-materialization.js +86 -0
  6. package/dist/baseline-materialization.js.map +1 -0
  7. package/dist/diff.d.ts +7 -0
  8. package/dist/diff.d.ts.map +1 -0
  9. package/dist/diff.js +159 -0
  10. package/dist/diff.js.map +1 -0
  11. package/dist/errors.d.ts +14 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +27 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/fast-history-target.d.ts +61 -0
  16. package/dist/fast-history-target.d.ts.map +1 -0
  17. package/dist/fast-history-target.js +248 -0
  18. package/dist/fast-history-target.js.map +1 -0
  19. package/dist/historical-project-tree.d.ts +18 -0
  20. package/dist/historical-project-tree.d.ts.map +1 -0
  21. package/dist/historical-project-tree.js +123 -0
  22. package/dist/historical-project-tree.js.map +1 -0
  23. package/dist/index.d.ts +14 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +14 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/map-history.d.ts +24 -0
  28. package/dist/map-history.d.ts.map +1 -0
  29. package/dist/map-history.js +365 -0
  30. package/dist/map-history.js.map +1 -0
  31. package/dist/package-correlation.d.ts +16 -0
  32. package/dist/package-correlation.d.ts.map +1 -0
  33. package/dist/package-correlation.js +76 -0
  34. package/dist/package-correlation.js.map +1 -0
  35. package/dist/perforce-map-scope.d.ts +56 -0
  36. package/dist/perforce-map-scope.d.ts.map +1 -0
  37. package/dist/perforce-map-scope.js +284 -0
  38. package/dist/perforce-map-scope.js.map +1 -0
  39. package/dist/perforce.d.ts +105 -0
  40. package/dist/perforce.d.ts.map +1 -0
  41. package/dist/perforce.js +441 -0
  42. package/dist/perforce.js.map +1 -0
  43. package/dist/playback.d.ts +60 -0
  44. package/dist/playback.d.ts.map +1 -0
  45. package/dist/playback.js +168 -0
  46. package/dist/playback.js.map +1 -0
  47. package/dist/revision-materialization.d.ts +14 -0
  48. package/dist/revision-materialization.d.ts.map +1 -0
  49. package/dist/revision-materialization.js +68 -0
  50. package/dist/revision-materialization.js.map +1 -0
  51. package/dist/revision-plan.d.ts +44 -0
  52. package/dist/revision-plan.d.ts.map +1 -0
  53. package/dist/revision-plan.js +84 -0
  54. package/dist/revision-plan.js.map +1 -0
  55. package/dist/schema.d.ts +7964 -0
  56. package/dist/schema.d.ts.map +1 -0
  57. package/dist/schema.js +292 -0
  58. package/dist/schema.js.map +1 -0
  59. package/dist/submitted-change-selection.d.ts +22 -0
  60. package/dist/submitted-change-selection.d.ts.map +1 -0
  61. package/dist/submitted-change-selection.js +101 -0
  62. package/dist/submitted-change-selection.js.map +1 -0
  63. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UE Shed contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # `@ue-shed/map-history`
2
+
3
+ The optional, Perforce-backed UE Shed workflow for reconstructing and explaining the saved actor
4
+ history of one Unreal map.
5
+
6
+ The package owns Perforce acquisition, historical temporary project state, actor continuity, and
7
+ semantic changes. It uses `@ue-shed/unreal-assets` for each saved-world snapshot and is the only UE
8
+ Shed package that depends on `p4client-ts`.
9
+
10
+ Deep History reconstructs one complete map-scope corpus. Fast History is a separate request mode that
11
+ accepts a single-actor Investigation Target, proves that actor's external-actor package from the
12
+ SavedWorld projection, and returns explicit targeted-coverage metadata.
13
+
14
+ The first implementation is intentionally Perforce-specific. A source-neutral revision abstraction
15
+ is deferred until another real producer exists.
16
+
17
+ Install the headless package with its exact compatible release dependencies:
18
+
19
+ ```powershell
20
+ npm install --save-exact @ue-shed/map-history @ue-shed/protocol @ue-shed/unreal-assets effect@4.0.0-beta.98 p4client-ts@0.7.1
21
+ ```
22
+
23
+ The root export owns Perforce acquisition and therefore requires a configured `p4` executable and
24
+ workspace. Browser or renderer consumers should use `@ue-shed/map-history/contract` and
25
+ `@ue-shed/map-history/playback`; those entrypoints perform no Perforce or filesystem operations.
26
+ World Log presentation remains private to the maintained extension and is not bundled with this
27
+ headless package.
28
+
29
+ Conventional map history follows a bounded linear chain of direct Perforce moves, including when a
30
+ stale local source path still exists after the depot map moved. Copy, branch, merge, and ambiguous
31
+ integration graphs are not treated as map identity.
32
+
33
+ Browser-safe consumers can import `@ue-shed/map-history/playback` to derive the saved actor state at
34
+ the range start or immediately after a selected submitted changelist. Playback uses the retained
35
+ range-start snapshot and semantic deltas locally; it neither serializes full snapshots per
36
+ changelist nor receives Perforce or filesystem authority.
37
+
38
+ See [the product contract](../../docs/products/map-history.md) and
39
+ [Plan 034](../../plans/034-build-perforce-map-history.md).
40
+
41
+ ## Real Perforce conformance
42
+
43
+ `pnpm test:perforce-map-history` provisions a temporary generic localhost depot from the committed
44
+ Unreal-generated map-history bundles. It does not use the active `p4` CLI configuration, a
45
+ contributor workspace, or a hosted Perforce server. See the
46
+ [fixture instructions](../../fixtures/perforce-map-history/README.md) for the optional executable
47
+ override and cache controls.
@@ -0,0 +1,17 @@
1
+ import { Effect } from "effect";
2
+ import { MapHistoryError } from "./errors.js";
3
+ import type { HistoricalProjectTree } from "./historical-project-tree.js";
4
+ import { type ResolvedPerforceMapScope } from "./perforce-map-scope.js";
5
+ import { PerforceHistorySource } from "./perforce.js";
6
+ /**
7
+ * Inventories and materializes the exact map state before the selected range. The inventory is
8
+ * bounded per scope and as one combined set, so a partial P4 response can never become a baseline.
9
+ */
10
+ export declare function materializeBaseline(options: {
11
+ readonly change: number;
12
+ readonly concurrency: number;
13
+ readonly maxFiles: number;
14
+ readonly scope: ResolvedPerforceMapScope;
15
+ readonly tree: HistoricalProjectTree;
16
+ }): Effect.Effect<number, MapHistoryError, PerforceHistorySource>;
17
+ //# sourceMappingURL=baseline-materialization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline-materialization.d.ts","sourceRoot":"","sources":["../src/baseline-materialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAsB,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAA0B,MAAM,eAAe,CAAC;AAgC9E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;CACrC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,qBAAqB,CAAC,CA8DhE"}
@@ -0,0 +1,86 @@
1
+ import { Effect } from "effect";
2
+ import { MapHistoryError } from "./errors.js";
3
+ import { scopedPerforceFile } from "./perforce-map-scope.js";
4
+ import { PerforceHistorySource } from "./perforce.js";
5
+ import { materializePlannedRevision } from "./revision-materialization.js";
6
+ import { planScopedRevision } from "./revision-plan.js";
7
+ function baselineError(message, recovery) {
8
+ return new MapHistoryError({
9
+ kind: "baseline_unavailable",
10
+ message,
11
+ recovery,
12
+ retrySafe: false
13
+ });
14
+ }
15
+ function resourceLimitError(change, maxFiles) {
16
+ return new MapHistoryError({
17
+ kind: "resource_limit",
18
+ message: `Baseline changelist ${change} exceeds the ${maxFiles} file limit.`,
19
+ recovery: "Narrow the selected map scope or raise maxMaterializedFiles explicitly.",
20
+ retrySafe: false
21
+ });
22
+ }
23
+ function isSameDepotRevision(left, right) {
24
+ return (left.action === right.action &&
25
+ left.changelist === right.changelist &&
26
+ left.depotPath === right.depotPath &&
27
+ left.revision === right.revision &&
28
+ left.type === right.type);
29
+ }
30
+ /**
31
+ * Inventories and materializes the exact map state before the selected range. The inventory is
32
+ * bounded per scope and as one combined set, so a partial P4 response can never become a baseline.
33
+ */
34
+ export function materializeBaseline(options) {
35
+ return Effect.fn("MapHistory.materializeBaseline")(function* () {
36
+ const source = yield* PerforceHistorySource;
37
+ const byDepotPath = new Map();
38
+ for (const depotPath of options.scope.fileSpecs) {
39
+ const remaining = options.maxFiles - byDepotPath.size;
40
+ if (remaining <= 0)
41
+ return yield* Effect.fail(resourceLimitError(options.change, options.maxFiles));
42
+ const listed = yield* source.listDepotFilesAtChange({
43
+ change: options.change,
44
+ depotPath,
45
+ maxFiles: remaining
46
+ });
47
+ if (listed.hasMore) {
48
+ return yield* Effect.fail(resourceLimitError(options.change, options.maxFiles));
49
+ }
50
+ for (const file of listed.files) {
51
+ const previous = byDepotPath.get(file.depotPath);
52
+ if (previous !== undefined && !isSameDepotRevision(previous, file)) {
53
+ return yield* Effect.fail(baselineError(`Perforce returned conflicting baseline revisions for ${file.depotPath}.`, "Check the Perforce depot mapping and retry the historical reconstruction."));
54
+ }
55
+ byDepotPath.set(file.depotPath, file);
56
+ if (byDepotPath.size > options.maxFiles) {
57
+ return yield* Effect.fail(resourceLimitError(options.change, options.maxFiles));
58
+ }
59
+ }
60
+ }
61
+ const files = [...byDepotPath.values()];
62
+ const scoped = files
63
+ .map((file) => scopedPerforceFile(options.scope, file.depotPath))
64
+ .filter((file) => file !== undefined);
65
+ if (!scoped.some((file) => file.depotPath === options.scope.mapDepotPath)) {
66
+ return yield* Effect.fail(baselineError(`The selected map does not exist at baseline changelist ${options.change}.`, "Choose a range after the map was created or include its creation changelist."));
67
+ }
68
+ const plan = planScopedRevision({
69
+ files: files.map((file) => ({
70
+ action: file.action,
71
+ depotPath: file.depotPath,
72
+ revision: file.revision,
73
+ type: file.type
74
+ })),
75
+ scope: scoped
76
+ });
77
+ return yield* materializePlannedRevision({
78
+ change: options.change,
79
+ concurrency: options.concurrency,
80
+ maxFiles: options.maxFiles,
81
+ plan,
82
+ tree: options.tree
83
+ });
84
+ })();
85
+ }
86
+ //# sourceMappingURL=baseline-materialization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline-materialization.js","sourceRoot":"","sources":["../src/baseline-materialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAiC,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAA0B,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,0BAA0B,E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} from "./schema.js";
3
+ export declare function actorIdentityOf(actor: SavedWorldActor): ActorIdentity;
4
+ export declare function actorIdentityKey(identity: ActorIdentity): string;
5
+ export declare function savedWorldPositionsEqual(before: SavedWorldPosition, after: SavedWorldPosition): boolean;
6
+ export declare function diffSavedWorldSnapshots(before: SavedWorld, after: SavedWorld): MapSnapshotDiff;
7
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAmC,eAAe,EAAE,MAAM,aAAa,CAAC;AAInG,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CASrE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAIhE;AA4BD,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,kBAAkB,GACvB,OAAO,CAsBT;AAqDD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CA0D9F"}
package/dist/diff.js ADDED
@@ -0,0 +1,159 @@
1
+ const ZERO_GUID = /^0{8}-0{8}-0{8}-0{8}$/;
2
+ export function actorIdentityOf(actor) {
3
+ if (actor.actorGuid !== undefined && !ZERO_GUID.test(actor.actorGuid)) {
4
+ return { actorGuid: actor.actorGuid, kind: "actor_guid" };
5
+ }
6
+ return {
7
+ actorPath: actor.actorPath,
8
+ kind: "object_path",
9
+ packageName: actor.packageName
10
+ };
11
+ }
12
+ export function actorIdentityKey(identity) {
13
+ return identity.kind === "actor_guid"
14
+ ? `guid:${identity.actorGuid}`
15
+ : `path:${identity.packageName}\u0000${identity.actorPath}`;
16
+ }
17
+ function indexActors(actors) {
18
+ const indexed = new Map();
19
+ const identities = new Map();
20
+ const ambiguous = new Set();
21
+ for (const actor of actors) {
22
+ const identity = actorIdentityOf(actor);
23
+ const key = actorIdentityKey(identity);
24
+ if (indexed.has(key)) {
25
+ ambiguous.add(key);
26
+ indexed.delete(key);
27
+ identities.delete(key);
28
+ continue;
29
+ }
30
+ if (ambiguous.has(key))
31
+ continue;
32
+ indexed.set(key, actor);
33
+ identities.set(key, identity);
34
+ }
35
+ return { actors: indexed, identities, ambiguous };
36
+ }
37
+ export function savedWorldPositionsEqual(before, after) {
38
+ if (before.status !== after.status)
39
+ return false;
40
+ switch (before.status) {
41
+ case "resolved":
42
+ return (after.status === "resolved" &&
43
+ before.location.x === after.location.x &&
44
+ before.location.y === after.location.y &&
45
+ before.location.z === after.location.z);
46
+ case "missing_attachment_parent":
47
+ return (after.status === "missing_attachment_parent" &&
48
+ before.parentPath === after.parentPath);
49
+ case "missing_root_component":
50
+ return true;
51
+ case "attachment_cycle":
52
+ case "ambiguous_component_path":
53
+ case "unsupported_absolute_transform":
54
+ return after.status === before.status && before.componentPath === after.componentPath;
55
+ }
56
+ }
57
+ function coverageOf(world) {
58
+ return {
59
+ completeness: world.completeness,
60
+ failedPackages: world.summary.failedPackages,
61
+ partialPackages: world.summary.partialPackages
62
+ };
63
+ }
64
+ function compareMatchedActor(identity, before, after) {
65
+ const changes = [];
66
+ if (before.packageName !== after.packageName || before.actorPath !== after.actorPath) {
67
+ changes.push({ after, before, identity, kind: "actor_package_changed" });
68
+ }
69
+ if (before.classPath !== after.classPath) {
70
+ changes.push({ after, before, identity, kind: "actor_class_changed" });
71
+ }
72
+ if (before.label !== after.label) {
73
+ changes.push({ after, before, identity, kind: "actor_label_changed" });
74
+ }
75
+ if (before.position.status === "resolved" && after.position.status === "resolved") {
76
+ if (before.position.location.x !== after.position.location.x ||
77
+ before.position.location.y !== after.position.location.y ||
78
+ before.position.location.z !== after.position.location.z) {
79
+ changes.push({
80
+ after,
81
+ afterLocation: after.position.location,
82
+ before,
83
+ beforeLocation: before.position.location,
84
+ identity,
85
+ kind: "actor_moved"
86
+ });
87
+ }
88
+ }
89
+ else if (!savedWorldPositionsEqual(before.position, after.position)) {
90
+ changes.push({
91
+ after,
92
+ afterPosition: after.position,
93
+ before,
94
+ beforePosition: before.position,
95
+ identity,
96
+ kind: "actor_position_resolution_changed"
97
+ });
98
+ }
99
+ return changes;
100
+ }
101
+ export function diffSavedWorldSnapshots(before, after) {
102
+ const beforeIndex = indexActors(before.actors);
103
+ const afterIndex = indexActors(after.actors);
104
+ const ambiguous = new Set([...beforeIndex.ambiguous, ...afterIndex.ambiguous]);
105
+ const diagnostics = [...ambiguous].sort().map((key) => ({
106
+ code: "ambiguous_actor_identity",
107
+ message: `Actor continuity is ambiguous for ${key}.`,
108
+ retrySafe: false
109
+ }));
110
+ const changes = [];
111
+ const keys = new Set([...beforeIndex.actors.keys(), ...afterIndex.actors.keys()]);
112
+ for (const key of [...keys].sort()) {
113
+ if (ambiguous.has(key))
114
+ continue;
115
+ const beforeActor = beforeIndex.actors.get(key);
116
+ const afterActor = afterIndex.actors.get(key);
117
+ const identity = beforeIndex.identities.get(key) ?? afterIndex.identities.get(key);
118
+ if (identity === undefined)
119
+ continue;
120
+ if (beforeActor === undefined && afterActor !== undefined) {
121
+ if (before.completeness === "partial") {
122
+ diagnostics.push({
123
+ code: "actor_addition_withheld_partial_snapshot",
124
+ message: `Actor addition is unproven because the earlier snapshot is partial for ${key}.`,
125
+ retrySafe: false
126
+ });
127
+ continue;
128
+ }
129
+ changes.push({ after: afterActor, identity, kind: "actor_added" });
130
+ continue;
131
+ }
132
+ if (beforeActor !== undefined && afterActor === undefined) {
133
+ if (after.completeness === "partial") {
134
+ diagnostics.push({
135
+ code: "actor_removal_withheld_partial_snapshot",
136
+ message: `Actor removal is unproven because the later snapshot is partial for ${key}.`,
137
+ retrySafe: false
138
+ });
139
+ continue;
140
+ }
141
+ changes.push({ before: beforeActor, identity, kind: "actor_removed" });
142
+ continue;
143
+ }
144
+ if (beforeActor !== undefined && afterActor !== undefined) {
145
+ changes.push(...compareMatchedActor(identity, beforeActor, afterActor));
146
+ }
147
+ }
148
+ const beforeCoverage = coverageOf(before);
149
+ const afterCoverage = coverageOf(after);
150
+ if (JSON.stringify(beforeCoverage) !== JSON.stringify(afterCoverage)) {
151
+ changes.push({
152
+ after: afterCoverage,
153
+ before: beforeCoverage,
154
+ kind: "snapshot_coverage_changed"
155
+ });
156
+ }
157
+ return { changes, diagnostics };
158
+ }
159
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAE1C,MAAM,UAAU,eAAe,CAAC,KAAsB;IACrD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACvE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO;QACN,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC9B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAuB;IACvD,OAAO,QAAQ,CAAC,IAAI,KAAK,YAAY;QACpC,CAAC,CAAC,QAAQ,QAAQ,CAAC,SAAS,EAAE;QAC9B,CAAC,CAAC,QAAQ,QAAQ,CAAC,WAAW,SAAS,QAAQ,CAAC,SAAS,EAAE,CAAC;AAC9D,CAAC;AAQD,SAAS,WAAW,CAAC,MAAkC;IACtD,MAAM,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,GAAG,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rorKind: Schema.Literals<readonly ["invalid_target", "invalid_range", "perforce_configuration", "perforce_authentication", "perforce_command", "ambiguous_depot_mapping", "ambiguous_map_lineage", "map_lineage_limit", "resource_limit", "materialization", "temporary_storage", "saved_world_decode", "baseline_unavailable", "unsupported_history_layout", "cancelled"]>;
3
+ export type MapHistoryErrorKind = Schema.Schema.Type<typeof MapHistoryErrorKind>;
4
+ declare const MapHistoryError_base: Schema.Class<MapHistoryError, Schema.TaggedStruct<"MapHistoryError", {
5
+ readonly kind: Schema.Literals<readonly ["invalid_target", "invalid_range", "perforce_configuration", "perforce_authentication", "perforce_command", "ambiguous_depot_mapping", "ambiguous_map_lineage", "map_lineage_limit", "resource_limit", "materialization", "temporary_storage", "saved_world_decode", "baseline_unavailable", "unsupported_history_layout", "cancelled"]>;
6
+ readonly message: Schema.NonEmptyString;
7
+ readonly recovery: Schema.NonEmptyString;
8
+ readonly retrySafe: Schema.Boolean;
9
+ readonly cause: Schema.optionalKey<Schema.Defect>;
10
+ }>, import("effect/Cause").YieldableError>;
11
+ export declare class MapHistoryError extends MapHistoryError_base {
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,mBAAmB,oWAgB9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;;;;;;;;AAEjF,qBAAa,eAAgB,SAAQ,oBAMnC;CAAG"}
package/dist/errors.js ADDED
@@ -0,0 +1,27 @@
1
+ import { Schema } from "effect";
2
+ export const MapHistoryErrorKind = Schema.Literals([
3
+ "invalid_target",
4
+ "invalid_range",
5
+ "perforce_configuration",
6
+ "perforce_authentication",
7
+ "perforce_command",
8
+ "ambiguous_depot_mapping",
9
+ "ambiguous_map_lineage",
10
+ "map_lineage_limit",
11
+ "resource_limit",
12
+ "materialization",
13
+ "temporary_storage",
14
+ "saved_world_decode",
15
+ "baseline_unavailable",
16
+ "unsupported_history_layout",
17
+ "cancelled"
18
+ ]);
19
+ export class MapHistoryError extends Schema.TaggedErrorClass()("MapHistoryError", {
20
+ kind: MapHistoryErrorKind,
21
+ message: Schema.NonEmptyString,
22
+ recovery: Schema.NonEmptyString,
23
+ retrySafe: Schema.Boolean,
24
+ cause: Schema.optionalKey(Schema.Defect())
25
+ }) {
26
+ }
27
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClD,gBAAgB;IAChB,eAAe;IACf,wBAAwB;IACxB,yBAAyB;IACzB,kBAAkB;IAClB,yBAAyB;IACzB,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,4BAA4B;IAC5B,WAAW;CACX,CAAC,CAAC;AAGH,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,gBAAgB,EAAmB,CAAC,iBAAiB,EAAE;IAClG,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAC,cAAc;IAC/B,SAAS,EAAE,MAAM,CAAC,OAAO;IACzB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC;CAAG"}
@@ -0,0 +1,61 @@
1
+ import type { AssetReader } from "@ue-shed/unreal-assets";
2
+ import type { SavedWorld, SavedWorldActor } from "@ue-shed/protocol";
3
+ import { Effect } from "effect";
4
+ import { MapHistoryError } from "./errors.js";
5
+ import { PerforceHistorySource } from "./perforce.js";
6
+ import { type ResolvedPerforceMapScope } from "./perforce-map-scope.js";
7
+ import type { ActorIdentity, FastHistoryInvestigationTarget, FastHistoryTargetedCoverage, PerforceDepotPath, PerforceFastMapHistoryQuery } from "./schema.js";
8
+ export interface ProvenFastHistoryActorTarget {
9
+ readonly actor: SavedWorldActor;
10
+ readonly identity: ActorIdentity;
11
+ readonly packageName: string;
12
+ readonly packageProjectRelativePath: string;
13
+ }
14
+ export interface ResolvedPerforceFastMapScope {
15
+ readonly coverage: FastHistoryTargetedCoverage;
16
+ readonly proven: ProvenFastHistoryActorTarget;
17
+ readonly provenTargets: readonly ProvenFastHistoryActorTarget[];
18
+ readonly scope: ResolvedPerforceMapScope;
19
+ }
20
+ /**
21
+ * Proves one present-day SavedWorld actor is the Investigation Target and derives its package path
22
+ * from the existing actor projection. Returns a typed failure when continuity or package scope
23
+ * cannot be established without guessing.
24
+ */
25
+ export declare function proveFastHistoryActorTarget(options: {
26
+ readonly scope: ResolvedPerforceMapScope;
27
+ readonly target: FastHistoryInvestigationTarget;
28
+ readonly world: SavedWorld;
29
+ }): ProvenFastHistoryActorTarget | MapHistoryError;
30
+ /** Proves every current actor in an exact class target without inferring historical membership. */
31
+ export declare function proveFastHistoryActorClassTargets(options: {
32
+ readonly scope: ResolvedPerforceMapScope;
33
+ readonly target: FastHistoryInvestigationTarget;
34
+ readonly world: SavedWorld;
35
+ }): readonly ProvenFastHistoryActorTarget[] | MapHistoryError;
36
+ /** Builds the explicit targeted-coverage document Fast History must return with every result. */
37
+ export declare function fastHistoryTargetedCoverage(options: {
38
+ readonly mapDepotFileSpec: PerforceDepotPath;
39
+ readonly mapPackageName: string;
40
+ readonly proven: ProvenFastHistoryActorTarget;
41
+ readonly targetDepotFileSpec: PerforceDepotPath;
42
+ }): FastHistoryTargetedCoverage;
43
+ /** Builds explicit coverage metadata for an exact current actor-class target. */
44
+ export declare function fastHistoryActorClassTargetedCoverage(options: {
45
+ readonly mapDepotFileSpec: PerforceDepotPath;
46
+ readonly mapPackageName: string;
47
+ readonly proven: readonly ProvenFastHistoryActorTarget[];
48
+ readonly target: Extract<FastHistoryInvestigationTarget, {
49
+ kind: "actor_class";
50
+ }>;
51
+ readonly targetPackages: readonly {
52
+ readonly depotFileSpec: PerforceDepotPath;
53
+ readonly proven: ProvenFastHistoryActorTarget;
54
+ }[];
55
+ }): FastHistoryTargetedCoverage;
56
+ /**
57
+ * Resolves Fast History acquisition to the selected map plus proven Investigation Target packages.
58
+ * Unrelated external-actor packages never enter the Perforce file specs or allowlist.
59
+ */
60
+ export declare function resolvePerforceFastMapScope(query: PerforceFastMapHistoryQuery): Effect.Effect<ResolvedPerforceFastMapScope, MapHistoryError, AssetReader | PerforceHistorySource>;
61
+ //# sourceMappingURL=fast-history-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-history-target.d.ts","sourceRoot":"","sources":["../src/fast-history-target.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAIN,KAAK,wBAAwB,EAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACX,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE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