@amalgm/live 0.2.22 → 0.2.24

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 (45) hide show
  1. package/PURPOSE.md +31 -13
  2. package/dist/detection/batch.d.ts +49 -0
  3. package/dist/detection/batch.d.ts.map +1 -0
  4. package/dist/detection/batch.js +66 -0
  5. package/dist/detection/batch.js.map +1 -0
  6. package/dist/detection/content.d.ts +30 -0
  7. package/dist/detection/content.d.ts.map +1 -0
  8. package/dist/detection/content.js +115 -0
  9. package/dist/detection/content.js.map +1 -0
  10. package/dist/detection/echo.d.ts +20 -0
  11. package/dist/detection/echo.d.ts.map +1 -0
  12. package/dist/detection/echo.js +22 -0
  13. package/dist/detection/echo.js.map +1 -0
  14. package/dist/detection/enrollment.d.ts +21 -10
  15. package/dist/detection/enrollment.d.ts.map +1 -1
  16. package/dist/detection/enrollment.js +22 -12
  17. package/dist/detection/enrollment.js.map +1 -1
  18. package/dist/detection/index.d.ts +15 -1
  19. package/dist/detection/index.d.ts.map +1 -1
  20. package/dist/detection/index.js +15 -1
  21. package/dist/detection/index.js.map +1 -1
  22. package/dist/detection/record-proposal.d.ts +77 -0
  23. package/dist/detection/record-proposal.d.ts.map +1 -0
  24. package/dist/detection/record-proposal.js +158 -0
  25. package/dist/detection/record-proposal.js.map +1 -0
  26. package/dist/detection/repository.d.ts +28 -0
  27. package/dist/detection/repository.d.ts.map +1 -0
  28. package/dist/detection/repository.js +64 -0
  29. package/dist/detection/repository.js.map +1 -0
  30. package/dist/detection/territory.d.ts +29 -0
  31. package/dist/detection/territory.d.ts.map +1 -0
  32. package/dist/detection/territory.js +78 -0
  33. package/dist/detection/territory.js.map +1 -0
  34. package/dist/detection/watch-boundary.d.ts +29 -0
  35. package/dist/detection/watch-boundary.d.ts.map +1 -0
  36. package/dist/detection/watch-boundary.js +47 -0
  37. package/dist/detection/watch-boundary.js.map +1 -0
  38. package/dist/entities/cloud.d.ts +8 -6
  39. package/dist/entities/cloud.d.ts.map +1 -1
  40. package/dist/entities/cloud.js +21 -7
  41. package/dist/entities/cloud.js.map +1 -1
  42. package/dist/files/commands.d.ts +6 -0
  43. package/dist/files/commands.d.ts.map +1 -1
  44. package/dist/files/commands.js.map +1 -1
  45. package/package.json +5 -1
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Detect's exact output to Record.
3
+ *
4
+ * A proposal is not yet a durable mutation: Record assigns one mutation id,
5
+ * appends it atomically, and then Send publishes that same row. Detect owns the
6
+ * complete result and replay instruction so no later rail has to rediscover
7
+ * filesystem truth.
8
+ */
9
+ import { type CloudEntityRecord } from '../entities/cloud.js';
10
+ import { type ContentManifest } from '../contracts/content.js';
11
+ import { type TransferArtifact } from '../transfer/artifacts.js';
12
+ export declare const DETECTED_CHANGE_CONTRACT = "amalgm.detected-change-proposal@1";
13
+ export type ChangeFacet = 'create' | 'rename' | 'move' | 'retype' | 'content' | 'trash' | 'restore';
14
+ export interface StructureReplay {
15
+ readonly kind: 'structure';
16
+ }
17
+ /** One byte-exact replacement span. Offsets are bytes, not UTF-16 indexes. */
18
+ export interface TextSplice {
19
+ readonly offset: number;
20
+ readonly deleteBytes: number;
21
+ readonly insert: Uint8Array;
22
+ }
23
+ export interface TextReplay {
24
+ readonly kind: 'file.text';
25
+ readonly mode: 'delta' | 'snapshot';
26
+ readonly basePayloadVersion: string | null;
27
+ readonly resultPayloadVersion: string;
28
+ readonly delta: TextSplice | null;
29
+ }
30
+ export interface BinaryReplay {
31
+ readonly kind: 'file.binary';
32
+ readonly resultPayloadVersion: string;
33
+ readonly manifest: ContentManifest;
34
+ }
35
+ export interface LinkReplay {
36
+ readonly kind: 'link';
37
+ readonly resultPayloadVersion: string;
38
+ readonly target: string;
39
+ }
40
+ export interface RepositoryReplay {
41
+ readonly kind: 'repo.git';
42
+ readonly stateId: string;
43
+ readonly cardId: string;
44
+ readonly checkpointId: string;
45
+ readonly cardChanged: boolean;
46
+ readonly checkpointChanged: boolean;
47
+ readonly parentTransportVersion: string | null;
48
+ readonly transportVersion: string;
49
+ }
50
+ export type ReplayInstruction = StructureReplay | TextReplay | BinaryReplay | LinkReplay | RepositoryReplay;
51
+ export interface DetectedChangeProposal {
52
+ readonly contract: typeof DETECTED_CHANGE_CONTRACT;
53
+ /** The permanent UUID whose ordered rail carries this proposal. */
54
+ readonly resourceId: string;
55
+ readonly baseVersion: string | null;
56
+ /** Complete exact result, not a partial update. */
57
+ readonly result: CloudEntityRecord;
58
+ readonly facets: readonly ChangeFacet[];
59
+ readonly replay: ReplayInstruction;
60
+ /** Immutable warehouse objects the replay may need. Heavy bytes are not here. */
61
+ readonly cargo: readonly TransferArtifact[];
62
+ }
63
+ export interface DetectedChangeInput {
64
+ readonly base: CloudEntityRecord | null;
65
+ readonly result: CloudEntityRecord;
66
+ readonly replay: ReplayInstruction;
67
+ /** Required when Detection is explicitly authorized to propose lifecycle. */
68
+ readonly lifecycleAuthorization?: 'trash' | 'restore';
69
+ }
70
+ /**
71
+ * Build one immutable proposal, or null when settled truth has the same logical
72
+ * version. A repository transport-only change is still meaningful because its
73
+ * worktree identity map is part of exact reproduction even when Card and
74
+ * Checkpoint IDs did not move.
75
+ */
76
+ export declare function detectedChangeProposal(input: DetectedChangeInput): DetectedChangeProposal | null;
77
+ //# sourceMappingURL=record-proposal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-proposal.d.ts","sourceRoot":"","sources":["../../src/detection/record-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,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MAAM,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,UAAU,GACV,YAAY,GACZ,UAAU,GACV,gBAAgB,CAAC;AAErB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,OAAO,wBAAwB,CAAC;IACnD,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvD;AAoGD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,mBAAmB,GACzB,sBAAsB,GAAG,IAAI,CAkD/B"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Detect's exact output to Record.
3
+ *
4
+ * A proposal is not yet a durable mutation: Record assigns one mutation id,
5
+ * appends it atomically, and then Send publishes that same row. Detect owns the
6
+ * complete result and replay instruction so no later rail has to rediscover
7
+ * filesystem truth.
8
+ */
9
+ import { assertRecord, } from '../entities/cloud.js';
10
+ import { DERIVED_PAYLOAD } from '../entities/types.js';
11
+ import { checkContentManifest } from '../contracts/content.js';
12
+ import { artifactForRecord } from '../transfer/artifacts.js';
13
+ export const DETECTED_CHANGE_CONTRACT = 'amalgm.detected-change-proposal@1';
14
+ const HASH = /^[0-9a-f]{64}$/;
15
+ const facetsOf = (base, result) => {
16
+ if (base === null)
17
+ return ['create'];
18
+ const facets = [];
19
+ if (base.parentUUID !== result.parentUUID)
20
+ facets.push('move');
21
+ if (base.name !== result.name)
22
+ facets.push('rename');
23
+ if (base.type !== result.type)
24
+ facets.push('retype');
25
+ const resultCarriesPayload = !DERIVED_PAYLOAD.has(result.type) && result.type !== 'reference';
26
+ if ((base.payloadVersion !== result.payloadVersion
27
+ && (base.type === result.type || resultCarriesPayload))
28
+ || (result.type === 'repo.git' && base.transportVersion !== result.transportVersion)) {
29
+ facets.push('content');
30
+ }
31
+ if (base.status !== result.status) {
32
+ if (result.status === 'trashed')
33
+ facets.push('trash');
34
+ else if (base.status === 'trashed' && result.status === 'active')
35
+ facets.push('restore');
36
+ }
37
+ return facets;
38
+ };
39
+ const contentRequired = (base, result, facets) => result.status === 'active'
40
+ && (base === null || facets.includes('content') || facets.includes('retype'))
41
+ && ['file.text', 'file.binary', 'link', 'repo.git'].includes(result.type);
42
+ const validateReplay = (base, result, facets, replay) => {
43
+ const needsContent = contentRequired(base, result, facets);
44
+ if (!needsContent) {
45
+ if (replay.kind !== 'structure') {
46
+ throw new Error('a structural-only detected change must use structure replay');
47
+ }
48
+ return;
49
+ }
50
+ if (replay.kind !== result.type) {
51
+ throw new Error(`detected ${result.type} content cannot use ${replay.kind} replay`);
52
+ }
53
+ if (result.payloadVersion === null) {
54
+ throw new Error(`detected ${result.type} content has no result payload version`);
55
+ }
56
+ switch (replay.kind) {
57
+ case 'file.text':
58
+ if (replay.basePayloadVersion !== (base?.payloadVersion ?? null)
59
+ || replay.resultPayloadVersion !== result.payloadVersion
60
+ || (replay.mode === 'delta') !== (replay.delta !== null)) {
61
+ throw new Error('text replay does not name the detected base and result');
62
+ }
63
+ if (!HASH.test(replay.resultPayloadVersion)
64
+ || (replay.basePayloadVersion !== null && !HASH.test(replay.basePayloadVersion))) {
65
+ throw new Error('text replay has an invalid content head');
66
+ }
67
+ if (replay.delta !== null
68
+ && (!Number.isSafeInteger(replay.delta.offset) || replay.delta.offset < 0
69
+ || !Number.isSafeInteger(replay.delta.deleteBytes) || replay.delta.deleteBytes < 0
70
+ || !(replay.delta.insert instanceof Uint8Array))) {
71
+ throw new Error('text replay has an invalid byte splice');
72
+ }
73
+ break;
74
+ case 'file.binary': {
75
+ const manifest = checkContentManifest(replay.manifest, result.payloadVersion);
76
+ if (!manifest.ok || replay.resultPayloadVersion !== result.payloadVersion) {
77
+ throw new Error('binary replay does not name the detected result');
78
+ }
79
+ break;
80
+ }
81
+ case 'link':
82
+ if (typeof replay.target !== 'string'
83
+ || replay.resultPayloadVersion !== result.payloadVersion
84
+ || !HASH.test(replay.resultPayloadVersion)) {
85
+ throw new Error('link replay does not name the detected result');
86
+ }
87
+ break;
88
+ case 'repo.git':
89
+ if (replay.stateId !== result.payloadVersion
90
+ || result.transportVersion === null
91
+ || replay.transportVersion !== result.transportVersion
92
+ || ![replay.stateId, replay.cardId, replay.checkpointId, replay.transportVersion]
93
+ .every((head) => HASH.test(head))
94
+ || (replay.parentTransportVersion !== null && !HASH.test(replay.parentTransportVersion))
95
+ || typeof replay.cardChanged !== 'boolean'
96
+ || typeof replay.checkpointChanged !== 'boolean') {
97
+ throw new Error('repository replay does not name the detected state and transport');
98
+ }
99
+ break;
100
+ }
101
+ };
102
+ /**
103
+ * Build one immutable proposal, or null when settled truth has the same logical
104
+ * version. A repository transport-only change is still meaningful because its
105
+ * worktree identity map is part of exact reproduction even when Card and
106
+ * Checkpoint IDs did not move.
107
+ */
108
+ export function detectedChangeProposal(input) {
109
+ const result = assertRecord(input.result);
110
+ const base = input.base === null ? null : assertRecord(input.base);
111
+ if (base !== null && base.uuid !== result.uuid) {
112
+ throw new Error('a detected transition cannot change entity UUID');
113
+ }
114
+ if (base === null && result.status !== 'active') {
115
+ throw new Error('newly detected ground must begin active');
116
+ }
117
+ if (base?.status === 'deleted') {
118
+ throw new Error('Detection cannot resurrect a deleted tombstone');
119
+ }
120
+ if (result.status === 'deleted') {
121
+ throw new Error('Detection cannot propose permanent deletion; deletion is an explicit lifecycle operation');
122
+ }
123
+ if (base?.version === result.version && base.transportVersion === result.transportVersion) {
124
+ const sameState = base.type === result.type
125
+ && base.parentUUID === result.parentUUID
126
+ && base.name === result.name
127
+ && base.status === result.status
128
+ && base.payloadVersion === result.payloadVersion;
129
+ if (!sameState)
130
+ throw new Error('one logical version cannot name two different entity states');
131
+ return null;
132
+ }
133
+ const facets = facetsOf(base, result);
134
+ if (facets.length === 0) {
135
+ throw new Error('detected records disagree without a named logical facet');
136
+ }
137
+ if (facets.includes('trash') && input.lifecycleAuthorization !== 'trash') {
138
+ throw new Error('filesystem absence is not authority to Trash an entity');
139
+ }
140
+ if (facets.includes('restore') && input.lifecycleAuthorization !== 'restore') {
141
+ throw new Error('restoring an entity requires explicit lifecycle authority');
142
+ }
143
+ validateReplay(base, result, facets, input.replay);
144
+ const artifact = input.replay.kind === 'structure' ? null : artifactForRecord(result);
145
+ if (input.replay.kind !== 'structure' && artifact === null) {
146
+ throw new Error(`detected ${result.type} replay has no transferable artifact`);
147
+ }
148
+ return Object.freeze({
149
+ contract: DETECTED_CHANGE_CONTRACT,
150
+ resourceId: result.uuid,
151
+ baseVersion: base?.version ?? null,
152
+ result,
153
+ facets: Object.freeze(facets),
154
+ replay: input.replay,
155
+ cargo: Object.freeze(artifact === null ? [] : [artifact]),
156
+ });
157
+ }
158
+ //# sourceMappingURL=record-proposal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-proposal.js","sourceRoot":"","sources":["../../src/detection/record-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sB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CAAC,QAAQ,CAAC,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,28 @@
1
+ /** Repository detection through the existing Card + Checkpoint transport. */
2
+ import { type RepoIdentityEntry, type RepoState } from '../entities/repo-states.js';
3
+ import type { Sha256Hex } from '../entities/types.js';
4
+ import type { CapturedContent } from './content.js';
5
+ import type { RepositoryReplay } from './record-proposal.js';
6
+ export interface PreviousRepositoryCapture {
7
+ readonly stateId: string;
8
+ readonly cardId: string;
9
+ readonly checkpointId: string;
10
+ readonly transportVersion: string;
11
+ readonly identity: readonly RepoIdentityEntry[];
12
+ }
13
+ export interface RepositoryCaptureInput {
14
+ readonly entityId: string;
15
+ /** Git-native capture. `pack` may be a thin incremental pack from the host. */
16
+ readonly state: RepoState;
17
+ readonly identity: readonly RepoIdentityEntry[];
18
+ readonly previous: PreviousRepositoryCapture | null;
19
+ }
20
+ export type CapturedRepository = CapturedContent<RepositoryReplay>;
21
+ /**
22
+ * Verify a fresh full Card + Checkpoint observation and seal one incremental
23
+ * repository transport. Git discovery and pack construction are host effects;
24
+ * this function owns the portable IDs, identity-map delta, binary transport,
25
+ * and exact cargo head.
26
+ */
27
+ export declare function captureRepositoryChange(input: RepositoryCaptureInput, sha256Hex: Sha256Hex): CapturedRepository | null;
28
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/detection/repository.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACrD;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AAcnE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,EAC7B,SAAS,EAAE,SAAS,GACnB,kBAAkB,GAAG,IAAI,CA+C3B"}
@@ -0,0 +1,64 @@
1
+ /** Repository detection through the existing Card + Checkpoint transport. */
2
+ import { deriveCardId, deriveCheckpointId, deriveStateId, encodeRepositoryTransport, planRepositoryIdentity, repositoryIdentityHash, } from '../entities/repo-states.js';
3
+ import { deriveUploadManifest } from '../transfer/upload.js';
4
+ const verifyState = (state, sha256Hex) => {
5
+ const cardId = deriveCardId(state.card, sha256Hex);
6
+ const checkpointId = deriveCheckpointId(state.checkpoint, sha256Hex);
7
+ const stateId = deriveStateId(cardId, checkpointId, sha256Hex);
8
+ if (state.cardId !== cardId || state.checkpointId !== checkpointId || state.stateId !== stateId) {
9
+ throw new Error('repository capture IDs do not describe its Card and Checkpoint');
10
+ }
11
+ if (state.pack !== null && sha256Hex(state.pack.bytes) !== state.pack.sha256) {
12
+ throw new Error('repository Git pack does not match its declared hash');
13
+ }
14
+ };
15
+ /**
16
+ * Verify a fresh full Card + Checkpoint observation and seal one incremental
17
+ * repository transport. Git discovery and pack construction are host effects;
18
+ * this function owns the portable IDs, identity-map delta, binary transport,
19
+ * and exact cargo head.
20
+ */
21
+ export function captureRepositoryChange(input, sha256Hex) {
22
+ verifyState(input.state, sha256Hex);
23
+ if (input.previous
24
+ && new Set(input.previous.identity.map((entry) => entry.path)).size !== input.previous.identity.length) {
25
+ throw new Error('previous repository identity map has duplicate paths');
26
+ }
27
+ const identity = planRepositoryIdentity(input.identity, input.previous?.identity ?? null, sha256Hex);
28
+ const currentIdentityHash = repositoryIdentityHash(input.identity, sha256Hex);
29
+ if (input.previous?.stateId === input.state.stateId
30
+ && repositoryIdentityHash(input.previous.identity, sha256Hex) === currentIdentityHash) {
31
+ return null;
32
+ }
33
+ const bytes = encodeRepositoryTransport(input.state, {
34
+ parentTransportVersion: input.previous?.transportVersion ?? null,
35
+ identityHash: identity.identityHash,
36
+ identityDelta: identity.identityDelta,
37
+ });
38
+ const transportVersion = sha256Hex(bytes);
39
+ const artifact = Object.freeze({
40
+ entityId: input.entityId,
41
+ entityType: 'repo.git',
42
+ kind: 'git',
43
+ contentHash: transportVersion,
44
+ });
45
+ const cargo = Object.freeze({
46
+ artifact,
47
+ bytes,
48
+ manifest: deriveUploadManifest(artifact, bytes, sha256Hex),
49
+ });
50
+ return Object.freeze({
51
+ replay: Object.freeze({
52
+ kind: 'repo.git',
53
+ stateId: input.state.stateId,
54
+ cardId: input.state.cardId,
55
+ checkpointId: input.state.checkpointId,
56
+ cardChanged: input.previous?.cardId !== input.state.cardId,
57
+ checkpointChanged: input.previous?.checkpointId !== input.state.checkpointId,
58
+ parentTransportVersion: input.previous?.transportVersion ?? null,
59
+ transportVersion,
60
+ }),
61
+ cargo,
62
+ });
63
+ }
64
+ //# sourceMappingURL=repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/detection/repository.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EACL,YAAY,EACZ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EAAE,KAAK,CAAC,KAAK,CAAC,OAAO;YAC5B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YAC1B,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY;YACtC,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM;YAC1D,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EAAE,YAAY,KAAK,KAAK,CAAC,KAAK,CAAC,YAAY;YAC5E,sBAAsB,EAAE,KAAK,CAAC,QAAQ,EAAE,gBAAgB,IAAI,IAAI;YAChE,gBAAgB;SACjB,CAAC;QACF,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** Nearest-repository ownership for one detected entity transition. */
2
+ import type { CloudEntityRecord } from '../entities/cloud.js';
3
+ import type { EntityReadPort, EntityRow } from '../entities/types.js';
4
+ export interface EntityRecorderTarget {
5
+ readonly kind: 'entity';
6
+ readonly resourceId: string;
7
+ }
8
+ export interface RepositoryRecorderTarget {
9
+ readonly kind: 'repository';
10
+ readonly resourceId: string;
11
+ }
12
+ export type RecorderTarget = EntityRecorderTarget | RepositoryRecorderTarget;
13
+ export interface RecorderTransition {
14
+ readonly base: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'> | null;
15
+ readonly result: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'>;
16
+ }
17
+ /** The nearest repo at or above `uuid`; nested repositories win. */
18
+ export declare function nearestRepository(uuid: string | null, byUuid: EntityReadPort['byUuid']): EntityRow | null;
19
+ /**
20
+ * Name every recorder whose state a transition can change.
21
+ *
22
+ * Ordinary changes outside repository territory publish on the entity UUID.
23
+ * A change wholly inside one repository publishes only the repository parcel.
24
+ * Crossing a repository boundary also publishes the entity graph transition,
25
+ * plus the source and/or destination repositories whose identity maps and
26
+ * Checkpoints changed.
27
+ */
28
+ export declare function recorderTargets(transition: RecorderTransition, byUuid: EntityReadPort['byUuid']): readonly RecorderTarget[];
29
+ //# sourceMappingURL=territory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territory.d.ts","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,wBAAwB,CAAC;AAE7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;IAClG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;CAC9F;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,GAAG,IAAI,CAYlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,cAAc,EAAE,CA+C3B"}
@@ -0,0 +1,78 @@
1
+ /** Nearest-repository ownership for one detected entity transition. */
2
+ /** The nearest repo at or above `uuid`; nested repositories win. */
3
+ export function nearestRepository(uuid, byUuid) {
4
+ const seen = new Set();
5
+ let cursor = uuid;
6
+ while (cursor !== null) {
7
+ if (seen.has(cursor))
8
+ throw new Error(`registry corrupt: parent cycle at ${cursor}`);
9
+ seen.add(cursor);
10
+ const row = byUuid(cursor);
11
+ if (!row)
12
+ throw new Error(`no entity ${cursor}`);
13
+ if (row.type === 'repo.git')
14
+ return row;
15
+ cursor = row.parentUuid;
16
+ }
17
+ return null;
18
+ }
19
+ /**
20
+ * Name every recorder whose state a transition can change.
21
+ *
22
+ * Ordinary changes outside repository territory publish on the entity UUID.
23
+ * A change wholly inside one repository publishes only the repository parcel.
24
+ * Crossing a repository boundary also publishes the entity graph transition,
25
+ * plus the source and/or destination repositories whose identity maps and
26
+ * Checkpoints changed.
27
+ */
28
+ export function recorderTargets(transition, byUuid) {
29
+ const { base, result } = transition;
30
+ if (base !== null && base.uuid !== result.uuid) {
31
+ throw new Error('a recorder transition cannot change entity UUID');
32
+ }
33
+ const before = nearestRepository(base?.parentUUID ?? null, byUuid);
34
+ const after = nearestRepository(result.parentUUID, byUuid);
35
+ const add = (targets, target) => {
36
+ if (!targets.some((candidate) => candidate.resourceId === target.resourceId))
37
+ targets.push(target);
38
+ };
39
+ // Every `.git` boundary starts its own repository rail, even when nested.
40
+ // Its enclosing repository changes only when the boundary's graph entry
41
+ // changes; ordinary Card/Checkpoint advancement remains on the inner rail.
42
+ if (base?.type === 'repo.git' || result.type === 'repo.git') {
43
+ const targets = [];
44
+ add(targets, {
45
+ kind: result.type === 'repo.git' ? 'repository' : 'entity',
46
+ resourceId: result.uuid,
47
+ });
48
+ const boundaryChanged = base === null
49
+ || base.type !== result.type
50
+ || base.parentUUID !== result.parentUUID
51
+ || base.name !== result.name
52
+ || base.status !== result.status;
53
+ if (boundaryChanged) {
54
+ if (before)
55
+ add(targets, { kind: 'repository', resourceId: before.uuid });
56
+ if (after)
57
+ add(targets, { kind: 'repository', resourceId: after.uuid });
58
+ }
59
+ return Object.freeze(targets);
60
+ }
61
+ if (base === null) {
62
+ return Object.freeze(after
63
+ ? [{ kind: 'repository', resourceId: after.uuid }]
64
+ : [{ kind: 'entity', resourceId: result.uuid }]);
65
+ }
66
+ if (before?.uuid === after?.uuid) {
67
+ return Object.freeze(before
68
+ ? [{ kind: 'repository', resourceId: before.uuid }]
69
+ : [{ kind: 'entity', resourceId: result.uuid }]);
70
+ }
71
+ const targets = [{ kind: 'entity', resourceId: result.uuid }];
72
+ for (const repository of [before, after]) {
73
+ if (repository)
74
+ add(targets, { kind: 'repository', resourceId: repository.uuid });
75
+ }
76
+ return Object.freeze(targets);
77
+ }
78
+ //# sourceMappingURL=territory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territory.js","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAsBvE,oEAAoE;AACpE,MAAM,UAAU,iBAAiB,CAC/B,IAAmB,EACnB,MAAgC;IAEhC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,MAAM,KAAK,IAAI,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,aAAa,MAAM,EAAE,CAAC,CAAC;QACjD,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU;YAAE,OAAO,GAAG,CAAC;QACxC,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;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K,CAAC,EAAE,CAAC;QACzC,IAAI,UAAU;YAAE,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The complete portable boundary from Watch into Detect and back.
3
+ *
4
+ * Watch contributes generation-stamped suspicion only. Detect retains that
5
+ * generation until Record has durably accepted every resulting proposal. A
6
+ * discovered directory creates a logical coverage request; the Watch host
7
+ * decides whether its backend needs another native handle.
8
+ */
9
+ import type { SuspicionSnapshot } from '../watching/suspicion.js';
10
+ export interface DetectionBatch {
11
+ readonly rootId: string;
12
+ readonly generation: number;
13
+ /** null means the complete covered root. */
14
+ readonly suspects: readonly string[] | null;
15
+ }
16
+ export interface DirectoryCoverageRequest {
17
+ readonly kind: 'directory-discovered';
18
+ readonly rootId: string;
19
+ readonly relPath: string;
20
+ }
21
+ /** Freeze Watch's snapshot into Detection's input vocabulary. */
22
+ export declare function detectionBatch(rootId: string, snapshot: SuspicionSnapshot): DetectionBatch;
23
+ /**
24
+ * Tell Watch that newly enrolled directory ground now exists. This is emitted
25
+ * on every platform; only the Watch backend knows whether coverage expansion
26
+ * means another Linux inotify handle or merely a routing-table update.
27
+ */
28
+ export declare function directoryCoverageRequests(batch: Pick<DetectionBatch, 'rootId'>, createdDirectories: readonly string[]): readonly DirectoryCoverageRequest[];
29
+ //# sourceMappingURL=watch-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-boundary.d.ts","sourceRoot":"","sources":["../../src/detection/watch-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAelE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,iBAAiB,GAC1B,cAAc,CAShB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACrC,kBAAkB,EAAE,SAAS,MAAM,EAAE,GACpC,SAAS,wBAAwB,EAAE,CAQrC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The complete portable boundary from Watch into Detect and back.
3
+ *
4
+ * Watch contributes generation-stamped suspicion only. Detect retains that
5
+ * generation until Record has durably accepted every resulting proposal. A
6
+ * discovered directory creates a logical coverage request; the Watch host
7
+ * decides whether its backend needs another native handle.
8
+ */
9
+ import { normalizedRelativePath } from './enrollment.js';
10
+ const detectionRelativePath = (path) => {
11
+ const raw = String(path);
12
+ if (raw.startsWith('/') || /^[A-Za-z]:[\\/]/.test(raw) || raw.includes('\0')) {
13
+ throw new Error('detection path must be root-relative');
14
+ }
15
+ const normalized = normalizedRelativePath(raw);
16
+ if (!normalized || normalized.split('/').some((segment) => segment === '.' || segment === '..')) {
17
+ throw new Error('detection path must be root-relative');
18
+ }
19
+ return normalized;
20
+ };
21
+ /** Freeze Watch's snapshot into Detection's input vocabulary. */
22
+ export function detectionBatch(rootId, snapshot) {
23
+ if (!rootId)
24
+ throw new Error('detection batch root id is required');
25
+ if (!Number.isSafeInteger(snapshot.generation) || snapshot.generation < 0) {
26
+ throw new Error('detection batch generation is invalid');
27
+ }
28
+ const suspects = snapshot.paths === null
29
+ ? null
30
+ : Object.freeze([...new Set(snapshot.paths.map(detectionRelativePath))]);
31
+ return Object.freeze({ rootId, generation: snapshot.generation, suspects });
32
+ }
33
+ /**
34
+ * Tell Watch that newly enrolled directory ground now exists. This is emitted
35
+ * on every platform; only the Watch backend knows whether coverage expansion
36
+ * means another Linux inotify handle or merely a routing-table update.
37
+ */
38
+ export function directoryCoverageRequests(batch, createdDirectories) {
39
+ const paths = [...new Set(createdDirectories.map(detectionRelativePath))]
40
+ .sort();
41
+ return Object.freeze(paths.map((relPath) => Object.freeze({
42
+ kind: 'directory-discovered',
43
+ rootId: batch.rootId,
44
+ relPath,
45
+ })));
46
+ }
47
+ //# sourceMappingURL=watch-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-boundary.js","sourceRoot":"","sources":["../../src/detection/watch-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAU,EAAE;IACrD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,UAAU,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CA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64
64
  * travels to the cloud on its own. The repository is the sync boundary —
65
65
  * its one Card + Checkpoint state carries the worktree's bytes AND its
66
66
  * children's permanent UUIDs (the transport identity map), so a register
67
- * or a rebase is one parcel, never one postcard per file. A nested
68
- * repository inside another repo's worktree is enclosed too: it becomes
69
- * cloud-visible only when registered explicitly as its own tree.
67
+ * or a rebase is one parcel, never one postcard per file. Repository
68
+ * boundaries are retained separately by `travelingRecords`: every `.git`
69
+ * starts a new parcel even when another repository encloses it.
70
70
  * Missing ancestry keeps the record traveling rather than risking a
71
71
  * silently unsynced entity.
72
72
  */
@@ -74,9 +74,11 @@ export declare function enclosedByRepositoryAncestor(record: {
74
74
  readonly uuid: string;
75
75
  readonly parentUUID: string | null | undefined;
76
76
  }, lookup: CloudAncestorLookup): boolean;
77
- /** Project a complete local entity graph onto the cloud registry. Repository
78
- * children keep their local SQLite identities, but their proper repo ancestor
79
- * transports those identities and bytes in its one immutable state parcel. */
77
+ /** Project a complete local entity graph onto the cloud registry. Ordinary
78
+ * repository children keep their local SQLite identities inside the nearest
79
+ * repository parcel. Every nested repository and the folder spine required to
80
+ * reach it remain graph records, so each `.git` owns and exposes exactly one
81
+ * independent transport without publishing per-file postcards. */
80
82
  export declare function travelingRecords(records: readonly unknown[]): readonly CloudEntityRecord[];
81
83
  /** Normalize records into the one canonical snapshot: asserted, sorted by
82
84
  * uuid, duplicates refused. */
@@ -1 +1 @@
1
- {"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../src/entities/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAmC,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGjH;;;;;+DAK+D;AAC/D,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAEhE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAK7C;;mCAEmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAA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