@amalgm/live 0.2.53 → 0.2.55
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/PURPOSE.md +17 -0
- package/dist/contracts/binding.d.ts +3 -2
- package/dist/contracts/binding.d.ts.map +1 -1
- package/dist/contracts/deployments.d.ts +39 -0
- package/dist/contracts/deployments.d.ts.map +1 -0
- package/dist/contracts/deployments.js +75 -0
- package/dist/contracts/deployments.js.map +1 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/detection/adapter-contract.d.ts +0 -33
- package/dist/detection/adapter-contract.d.ts.map +1 -1
- package/dist/detection/adapter-contract.js +0 -32
- package/dist/detection/adapter-contract.js.map +1 -1
- package/dist/detection/diff.d.ts +5 -87
- package/dist/detection/diff.d.ts.map +1 -1
- package/dist/detection/diff.js +5 -111
- package/dist/detection/diff.js.map +1 -1
- package/dist/detection/enrollment.d.ts +8 -17
- package/dist/detection/enrollment.d.ts.map +1 -1
- package/dist/detection/enrollment.js +8 -73
- package/dist/detection/enrollment.js.map +1 -1
- package/dist/detection/index.d.ts +5 -8
- package/dist/detection/index.d.ts.map +1 -1
- package/dist/detection/index.js +5 -8
- package/dist/detection/index.js.map +1 -1
- package/dist/detection/territory.d.ts +1 -27
- package/dist/detection/territory.d.ts.map +1 -1
- package/dist/detection/territory.js +1 -77
- package/dist/detection/territory.js.map +1 -1
- package/dist/entities/cloud.d.ts +31 -6
- package/dist/entities/cloud.d.ts.map +1 -1
- package/dist/entities/cloud.js +210 -47
- package/dist/entities/cloud.js.map +1 -1
- package/dist/entities/graph-head.d.ts +109 -0
- package/dist/entities/graph-head.d.ts.map +1 -0
- package/dist/entities/graph-head.js +267 -0
- package/dist/entities/graph-head.js.map +1 -0
- package/dist/entities/index.d.ts +3 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +3 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/rules.js +2 -2
- package/dist/entities/rules.js.map +1 -1
- package/dist/entities/types.d.ts +3 -0
- package/dist/entities/types.d.ts.map +1 -1
- package/dist/entities/types.js +3 -0
- package/dist/entities/types.js.map +1 -1
- package/dist/files/commands.d.ts.map +1 -1
- package/dist/files/commands.js +2 -13
- package/dist/files/commands.js.map +1 -1
- package/dist/registration/user-ground.d.ts +5 -1
- package/dist/registration/user-ground.d.ts.map +1 -1
- package/dist/registration/user-ground.js +9 -14
- package/dist/registration/user-ground.js.map +1 -1
- package/dist/transfer/cargo.d.ts +46 -12
- package/dist/transfer/cargo.d.ts.map +1 -1
- package/dist/transfer/cargo.js +52 -18
- package/dist/transfer/cargo.js.map +1 -1
- package/dist-cjs/contracts/deployments.js +81 -0
- package/dist-cjs/contracts/deployments.js.map +1 -0
- package/dist-cjs/contracts/index.js +1 -0
- package/dist-cjs/contracts/index.js.map +1 -1
- package/dist-cjs/detection/adapter-contract.js +1 -34
- package/dist-cjs/detection/adapter-contract.js.map +1 -1
- package/dist-cjs/detection/diff.js +5 -113
- package/dist-cjs/detection/diff.js.map +1 -1
- package/dist-cjs/detection/enrollment.js +9 -75
- package/dist-cjs/detection/enrollment.js.map +1 -1
- package/dist-cjs/detection/index.js +5 -8
- package/dist-cjs/detection/index.js.map +1 -1
- package/dist-cjs/detection/territory.js +1 -79
- package/dist-cjs/detection/territory.js.map +1 -1
- package/dist-cjs/entities/cloud.js +212 -49
- package/dist-cjs/entities/cloud.js.map +1 -1
- package/dist-cjs/entities/graph-head.js +280 -0
- package/dist-cjs/entities/graph-head.js.map +1 -0
- package/dist-cjs/entities/index.js +3 -1
- package/dist-cjs/entities/index.js.map +1 -1
- package/dist-cjs/entities/rules.js +1 -1
- package/dist-cjs/entities/rules.js.map +1 -1
- package/dist-cjs/entities/types.js +4 -1
- package/dist-cjs/entities/types.js.map +1 -1
- package/dist-cjs/files/commands.js +1 -12
- package/dist-cjs/files/commands.js.map +1 -1
- package/dist-cjs/registration/user-ground.js +8 -13
- package/dist-cjs/registration/user-ground.js.map +1 -1
- package/dist-cjs/transfer/cargo.js +55 -20
- package/dist-cjs/transfer/cargo.js.map +1 -1
- package/package.json +1 -1
- package/dist/detection/continuity.d.ts +0 -54
- package/dist/detection/continuity.d.ts.map +0 -1
- package/dist/detection/continuity.js +0 -85
- package/dist/detection/continuity.js.map +0 -1
- package/dist-cjs/detection/continuity.js +0 -88
- package/dist-cjs/detection/continuity.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo.js","sourceRoot":"","sources":["../../src/transfer/cargo.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"cargo.js","sourceRoot":"","sources":["../../src/transfer/cargo.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAiDH,8CA2BC;AAMD,kCAyBC;AAzGD,6CAAyD;AACzD,+CAAsF;AAEzE,QAAA,mBAAmB,GAAG,sCAAyB,CAAC;AAC7D;;;uDAGuD;AAC1C,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAC3C;;;2EAG2E;AAC9D,QAAA,4BAA4B,GAAG,CAAC,GAAG,2BAAmB,CAAC;AAiCpE,6EAA6E;AAC7E,SAAgB,iBAAiB,CAC/B,KAAmB;IAEnB,MAAM,QAAQ,GAAsB,EAAE,CAAC;IACvC,IAAI,OAAO,GAAQ,EAAE,CAAC;IACtB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAA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,EACvC,KAAK,EAAE,OAAO,EAAE,EAAE;QAChB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QACD,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;QAClC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IACzB,CAAC,CACF,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amalgm/live",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"description": "Portable realtime SDK for Amalgm — wire contracts, mutation discipline, and delivery state machines behind host-injected adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist-cjs/index.js",
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Root continuity verdicts: what a root's WITNESSED physical identity
|
|
3
|
-
* is, whether its recorded address still holds its ground, and whether
|
|
4
|
-
* a piece of ground rescues a moved root. Ratified by entity-model.md
|
|
5
|
-
* ("Ground that moves is rescued by continuity" — the directory law
|
|
6
|
-
* lifted to roots; "the follow rides witnessed continuity, never
|
|
7
|
-
* clairvoyance").
|
|
8
|
-
*
|
|
9
|
-
* Pure verdicts over injected answers — the host supplies the one look
|
|
10
|
-
* at an address (`statAt`) and the store's witnessed channel row
|
|
11
|
-
* (`channelIdentity`); the ACTIONS a verdict triggers (rebind, presence
|
|
12
|
-
* transitions, the undecided-address decision) stay in the host's
|
|
13
|
-
* wiring, because they re-aim watchers and scans.
|
|
14
|
-
*/
|
|
15
|
-
import type { PhysicalIdentity } from './diff.js';
|
|
16
|
-
import type { RootKind } from '../watching/coverage.js';
|
|
17
|
-
/** What one look at an address found standing there. */
|
|
18
|
-
export type GroundKind = 'file' | 'dir' | 'link' | 'other';
|
|
19
|
-
export interface GroundStat extends PhysicalIdentity {
|
|
20
|
-
readonly kind: GroundKind;
|
|
21
|
-
}
|
|
22
|
-
export interface ContinuityRoot {
|
|
23
|
-
readonly rootId: string;
|
|
24
|
-
readonly path: string;
|
|
25
|
-
readonly kind: RootKind;
|
|
26
|
-
/** Directory roots: the root's own witnessed identity; null/absent when unwitnessed. */
|
|
27
|
-
readonly device?: number | null;
|
|
28
|
-
readonly inode?: number | null;
|
|
29
|
-
}
|
|
30
|
-
export interface ContinuityPorts {
|
|
31
|
-
/**
|
|
32
|
-
* One look at an address: the ground's physical identity and kind, or
|
|
33
|
-
* null when the look did not return ground. ANY failed look answers
|
|
34
|
-
* null here — at the evidence horizon's edge, "could not look" and
|
|
35
|
-
* "not there" both leave the address undecided, so this seam never
|
|
36
|
-
* needs the absent/unsettled split.
|
|
37
|
-
*/
|
|
38
|
-
readonly statAt: (path: string) => GroundStat | null;
|
|
39
|
-
/**
|
|
40
|
-
* A single-ground root's one channel row identity — current as of the
|
|
41
|
-
* last completed scan — or null when unwitnessed. The file laws
|
|
42
|
-
* absorb atomic-save and retarget churn each time a scan witnesses
|
|
43
|
-
* the ground, and continuity can only ever claim what a scan has
|
|
44
|
-
* witnessed.
|
|
45
|
-
*/
|
|
46
|
-
readonly channelIdentity: (rootId: string) => PhysicalIdentity | null;
|
|
47
|
-
}
|
|
48
|
-
export interface ContinuityVerdicts {
|
|
49
|
-
readonly rootIdentity: (root: ContinuityRoot) => PhysicalIdentity | null;
|
|
50
|
-
readonly findMovedRoot: (stat: GroundStat, roots: readonly ContinuityRoot[]) => ContinuityRoot | null;
|
|
51
|
-
readonly addressUndecided: (root: ContinuityRoot) => boolean;
|
|
52
|
-
}
|
|
53
|
-
export declare function createContinuity({ statAt, channelIdentity }: ContinuityPorts): ContinuityVerdicts;
|
|
54
|
-
//# sourceMappingURL=continuity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuity.d.ts","sourceRoot":"","sources":["../../src/detection/continuity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,wFAAwF;IACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,gBAAgB,GAAG,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,gBAAgB,GAAG,IAAI,CAAC;IACzE,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,cAAc,EAAE,KAAK,cAAc,GAAG,IAAI,CAAC;IACtG,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC;CAC9D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,eAAe,GAAG,kBAAkB,CAmEjG"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Root continuity verdicts: what a root's WITNESSED physical identity
|
|
3
|
-
* is, whether its recorded address still holds its ground, and whether
|
|
4
|
-
* a piece of ground rescues a moved root. Ratified by entity-model.md
|
|
5
|
-
* ("Ground that moves is rescued by continuity" — the directory law
|
|
6
|
-
* lifted to roots; "the follow rides witnessed continuity, never
|
|
7
|
-
* clairvoyance").
|
|
8
|
-
*
|
|
9
|
-
* Pure verdicts over injected answers — the host supplies the one look
|
|
10
|
-
* at an address (`statAt`) and the store's witnessed channel row
|
|
11
|
-
* (`channelIdentity`); the ACTIONS a verdict triggers (rebind, presence
|
|
12
|
-
* transitions, the undecided-address decision) stay in the host's
|
|
13
|
-
* wiring, because they re-aim watchers and scans.
|
|
14
|
-
*/
|
|
15
|
-
export function createContinuity({ statAt, channelIdentity }) {
|
|
16
|
-
/**
|
|
17
|
-
* A root's WITNESSED physical identity, for continuity rescue.
|
|
18
|
-
* Directory roots carry their own device:inode (nothing replaces a
|
|
19
|
-
* directory's inode in place). A single-ground root's identity lives
|
|
20
|
-
* in its one channel row. Ground that changed inodes inside a
|
|
21
|
-
* still-open settle window is unwitnessed — no evidence, no claim.
|
|
22
|
-
*/
|
|
23
|
-
function rootIdentity(root) {
|
|
24
|
-
if (root.kind !== 'file') {
|
|
25
|
-
const { device, inode } = root;
|
|
26
|
-
return device == null || inode == null ? null : { device, inode };
|
|
27
|
-
}
|
|
28
|
-
return channelIdentity(root.rootId);
|
|
29
|
-
}
|
|
30
|
-
/** Orphaned means the recorded address no longer holds this ground. */
|
|
31
|
-
function orphanedAtAddress(root) {
|
|
32
|
-
const identity = rootIdentity(root);
|
|
33
|
-
if (!identity)
|
|
34
|
-
return false;
|
|
35
|
-
const stat = statAt(root.path);
|
|
36
|
-
if (!stat)
|
|
37
|
-
return true;
|
|
38
|
-
return stat.device !== identity.device || stat.inode !== identity.inode;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Continuity claims a root exactly like it claims the directories
|
|
42
|
-
* inside one: unique device:inode match, exactly one candidate, and
|
|
43
|
-
* only for a path-orphan — a root whose recorded address still holds
|
|
44
|
-
* its ground is never stolen by a lookalike.
|
|
45
|
-
*/
|
|
46
|
-
function findMovedRoot(stat, roots) {
|
|
47
|
-
const wantDir = stat.kind === 'dir';
|
|
48
|
-
const matches = roots.filter((root) => {
|
|
49
|
-
if (wantDir !== (root.kind !== 'file'))
|
|
50
|
-
return false;
|
|
51
|
-
const identity = rootIdentity(root);
|
|
52
|
-
return identity !== null && identity.device === stat.device && identity.inode === stat.inode;
|
|
53
|
-
});
|
|
54
|
-
const only = matches.length === 1 ? matches[0] : null;
|
|
55
|
-
return only && orphanedAtAddress(only) ? only : null;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* A scan's evidence horizon is the root's ground; the root's own
|
|
59
|
-
* address is the horizon's edge. Ground missing there — or a
|
|
60
|
-
* directory root's address wearing a different physical identity — is
|
|
61
|
-
* UNDECIDABLE from here: moved away, deleted, or replaced by a
|
|
62
|
-
* lookalike all present the same address, and concluding "deleted"
|
|
63
|
-
* would end every channel a rescue could have saved. So the scan
|
|
64
|
-
* concludes nothing: beliefs freeze, the referee convicts the
|
|
65
|
-
* divergence, and the next enrollment moment decides — naming the new
|
|
66
|
-
* address rescues, re-naming this one adopts, and explicit removal is
|
|
67
|
-
* the only deletion (an external filesystem change is never
|
|
68
|
-
* permission to end identity). A single-ground root's address
|
|
69
|
-
* lawfully churns inodes (atomic saves, retargets), so only absence —
|
|
70
|
-
* or foreign directory ground — freezes it; presence is the file
|
|
71
|
-
* laws' business.
|
|
72
|
-
*/
|
|
73
|
-
function addressUndecided(root) {
|
|
74
|
-
const stat = statAt(root.path);
|
|
75
|
-
if (!stat)
|
|
76
|
-
return true;
|
|
77
|
-
if (root.kind === 'file')
|
|
78
|
-
return stat.kind !== 'file' && stat.kind !== 'link';
|
|
79
|
-
if (stat.kind !== 'dir')
|
|
80
|
-
return true;
|
|
81
|
-
return root.device != null && (stat.device !== root.device || stat.inode !== root.inode);
|
|
82
|
-
}
|
|
83
|
-
return { rootIdentity, findMovedRoot, addressUndecided };
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=continuity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuity.js","sourceRoot":"","sources":["../../src/detection/continuity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA8CH,MAAM,UAAU,gBAAgB,CAAC,EAAE,MAAM,EAAE,eAAe,EAAmB;IAC3E;;;;;;OAMG;IACH,SAAS,YAAY,CAAC,IAAoB;QACxC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;YAC/B,OAAO,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACpE,CAAC;QACD,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,uEAAuE;IACvE,SAAS,iBAAiB,CAAC,IAAoB;QAC7C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK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IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;QAC9E,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK;YAAE,OAAO,IAAI,CAAC;QACrC,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Root continuity verdicts: what a root's WITNESSED physical identity
|
|
4
|
-
* is, whether its recorded address still holds its ground, and whether
|
|
5
|
-
* a piece of ground rescues a moved root. Ratified by entity-model.md
|
|
6
|
-
* ("Ground that moves is rescued by continuity" — the directory law
|
|
7
|
-
* lifted to roots; "the follow rides witnessed continuity, never
|
|
8
|
-
* clairvoyance").
|
|
9
|
-
*
|
|
10
|
-
* Pure verdicts over injected answers — the host supplies the one look
|
|
11
|
-
* at an address (`statAt`) and the store's witnessed channel row
|
|
12
|
-
* (`channelIdentity`); the ACTIONS a verdict triggers (rebind, presence
|
|
13
|
-
* transitions, the undecided-address decision) stay in the host's
|
|
14
|
-
* wiring, because they re-aim watchers and scans.
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createContinuity = createContinuity;
|
|
18
|
-
function createContinuity({ statAt, channelIdentity }) {
|
|
19
|
-
/**
|
|
20
|
-
* A root's WITNESSED physical identity, for continuity rescue.
|
|
21
|
-
* Directory roots carry their own device:inode (nothing replaces a
|
|
22
|
-
* directory's inode in place). A single-ground root's identity lives
|
|
23
|
-
* in its one channel row. Ground that changed inodes inside a
|
|
24
|
-
* still-open settle window is unwitnessed — no evidence, no claim.
|
|
25
|
-
*/
|
|
26
|
-
function rootIdentity(root) {
|
|
27
|
-
if (root.kind !== 'file') {
|
|
28
|
-
const { device, inode } = root;
|
|
29
|
-
return device == null || inode == null ? null : { device, inode };
|
|
30
|
-
}
|
|
31
|
-
return channelIdentity(root.rootId);
|
|
32
|
-
}
|
|
33
|
-
/** Orphaned means the recorded address no longer holds this ground. */
|
|
34
|
-
function orphanedAtAddress(root) {
|
|
35
|
-
const identity = rootIdentity(root);
|
|
36
|
-
if (!identity)
|
|
37
|
-
return false;
|
|
38
|
-
const stat = statAt(root.path);
|
|
39
|
-
if (!stat)
|
|
40
|
-
return true;
|
|
41
|
-
return stat.device !== identity.device || stat.inode !== identity.inode;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Continuity claims a root exactly like it claims the directories
|
|
45
|
-
* inside one: unique device:inode match, exactly one candidate, and
|
|
46
|
-
* only for a path-orphan — a root whose recorded address still holds
|
|
47
|
-
* its ground is never stolen by a lookalike.
|
|
48
|
-
*/
|
|
49
|
-
function findMovedRoot(stat, roots) {
|
|
50
|
-
const wantDir = stat.kind === 'dir';
|
|
51
|
-
const matches = roots.filter((root) => {
|
|
52
|
-
if (wantDir !== (root.kind !== 'file'))
|
|
53
|
-
return false;
|
|
54
|
-
const identity = rootIdentity(root);
|
|
55
|
-
return identity !== null && identity.device === stat.device && identity.inode === stat.inode;
|
|
56
|
-
});
|
|
57
|
-
const only = matches.length === 1 ? matches[0] : null;
|
|
58
|
-
return only && orphanedAtAddress(only) ? only : null;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A scan's evidence horizon is the root's ground; the root's own
|
|
62
|
-
* address is the horizon's edge. Ground missing there — or a
|
|
63
|
-
* directory root's address wearing a different physical identity — is
|
|
64
|
-
* UNDECIDABLE from here: moved away, deleted, or replaced by a
|
|
65
|
-
* lookalike all present the same address, and concluding "deleted"
|
|
66
|
-
* would end every channel a rescue could have saved. So the scan
|
|
67
|
-
* concludes nothing: beliefs freeze, the referee convicts the
|
|
68
|
-
* divergence, and the next enrollment moment decides — naming the new
|
|
69
|
-
* address rescues, re-naming this one adopts, and explicit removal is
|
|
70
|
-
* the only deletion (an external filesystem change is never
|
|
71
|
-
* permission to end identity). A single-ground root's address
|
|
72
|
-
* lawfully churns inodes (atomic saves, retargets), so only absence —
|
|
73
|
-
* or foreign directory ground — freezes it; presence is the file
|
|
74
|
-
* laws' business.
|
|
75
|
-
*/
|
|
76
|
-
function addressUndecided(root) {
|
|
77
|
-
const stat = statAt(root.path);
|
|
78
|
-
if (!stat)
|
|
79
|
-
return true;
|
|
80
|
-
if (root.kind === 'file')
|
|
81
|
-
return stat.kind !== 'file' && stat.kind !== 'link';
|
|
82
|
-
if (stat.kind !== 'dir')
|
|
83
|
-
return true;
|
|
84
|
-
return root.device != null && (stat.device !== root.device || stat.inode !== root.inode);
|
|
85
|
-
}
|
|
86
|
-
return { rootIdentity, findMovedRoot, addressUndecided };
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=continuity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuity.js","sourceRoot":"","sources":["../../src/detection/continuity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA8CH,4CAmEC;AAnED,SAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,eAAe,EAAmB;IAC3E;;;;;;OAMG;IACH,SAAS,YAAY,CAAC,IAAoB;QACxC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;YAC/B,OAAO,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACpE,CAAC;QACD,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,uEAAuE;IACvE,SA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