@amalgm/live 0.2.0 → 0.2.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/PURPOSE.md
CHANGED
|
@@ -58,9 +58,11 @@ its cutover.
|
|
|
58
58
|
survive renames and rediscovery; local paths locate it but never become a
|
|
59
59
|
second identity, and every registry change emits both legacy `projects`
|
|
60
60
|
and canonical `workspaces` resource events.
|
|
61
|
-
12. **User ground is portable;
|
|
62
|
-
authenticated `users/<email>/` home is registrable except the reserved
|
|
63
|
-
`.amalgm/` directory
|
|
61
|
+
12. **User ground is portable; coordination state is not.** Everything beneath
|
|
62
|
+
an authenticated `users/<email>/` home is registrable except the reserved
|
|
63
|
+
`.amalgm/` directory, transient SQLite journal/lock sidecars, and paths
|
|
64
|
+
excluded by its tracked `.amalgmignore`; the durable SQLite database itself
|
|
65
|
+
remains portable ground.
|
|
64
66
|
13. **The graph, not SQLite, travels.** R2 receives canonical entity snapshots
|
|
65
67
|
and immutable content; a machine derives its SQLite rows, paths, physical
|
|
66
68
|
identities, observer evidence, and watcher bindings locally.
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/** The injected policy shape: relative path in, verdict out. */
|
|
13
13
|
export type EnrollmentPolicy = (relPath: string) => boolean;
|
|
14
|
-
/** The Git-like names at the user-ground boundary.
|
|
15
|
-
*
|
|
16
|
-
* portable ground so every machine evaluates the same rules. */
|
|
14
|
+
/** The Git-like names at the user-ground boundary. Structural coordination
|
|
15
|
+
* state is local and cannot be negated by user policy; the ignore file is
|
|
16
|
+
* portable ground so every machine evaluates the same user rules. */
|
|
17
17
|
export declare const AMALGM_CONTROL_DIRECTORY = ".amalgm";
|
|
18
18
|
export declare const AMALGM_IGNORE_FILE = ".amalgmignore";
|
|
19
19
|
export declare const DEFAULT_AMALGM_IGNORE = "/.amalgm/\n";
|
|
@@ -23,11 +23,14 @@ export declare const defaultShouldEnroll: EnrollmentPolicy;
|
|
|
23
23
|
export declare function normalizedRelativePath(relPath: string): string;
|
|
24
24
|
/** `.amalgm/` is local control state wherever a registered tree is rooted. */
|
|
25
25
|
export declare function isAmalgmControlPath(relPath: string): boolean;
|
|
26
|
+
/** SQLite's WAL, shared-memory, and rollback-journal files coordinate one
|
|
27
|
+
* local database connection. They are not a portable copy of the database. */
|
|
28
|
+
export declare function isSqliteCoordinationPath(relPath: string): boolean;
|
|
26
29
|
/**
|
|
27
30
|
* Compile the root `.amalgmignore` for a user ground. Rules are ordered and
|
|
28
|
-
* `!` negates a prior user rule.
|
|
29
|
-
* structural
|
|
30
|
-
* excludes it. The policy file itself always travels.
|
|
31
|
+
* `!` negates a prior user rule. Reserved control state and transient SQLite
|
|
32
|
+
* coordination files are structural exclusions; every other path is ground
|
|
33
|
+
* unless this tracked file excludes it. The policy file itself always travels.
|
|
31
34
|
*/
|
|
32
35
|
export declare function createUserGroundEnrollmentPolicy(ignoreText?: string): EnrollmentPolicy;
|
|
33
36
|
//# sourceMappingURL=enrollment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;
|
|
1
|
+
{"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,qBAAqB,gBAAoC,CAAC;AAgDvE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC;AAEF,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;8EAC8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjE;AAsDD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,SAAK,GAAG,gBAAgB,CAalF"}
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* Pure string policy: a host may inject its own `EnrollmentPolicy`
|
|
10
10
|
* everywhere this default is accepted.
|
|
11
11
|
*/
|
|
12
|
-
/** The Git-like names at the user-ground boundary.
|
|
13
|
-
*
|
|
14
|
-
* portable ground so every machine evaluates the same rules. */
|
|
12
|
+
/** The Git-like names at the user-ground boundary. Structural coordination
|
|
13
|
+
* state is local and cannot be negated by user policy; the ignore file is
|
|
14
|
+
* portable ground so every machine evaluates the same user rules. */
|
|
15
15
|
export const AMALGM_CONTROL_DIRECTORY = '.amalgm';
|
|
16
16
|
export const AMALGM_IGNORE_FILE = '.amalgmignore';
|
|
17
17
|
export const DEFAULT_AMALGM_IGNORE = `/${AMALGM_CONTROL_DIRECTORY}/\n`;
|
|
@@ -85,6 +85,12 @@ export function normalizedRelativePath(relPath) {
|
|
|
85
85
|
export function isAmalgmControlPath(relPath) {
|
|
86
86
|
return normalizedRelativePath(relPath).split('/').includes(AMALGM_CONTROL_DIRECTORY);
|
|
87
87
|
}
|
|
88
|
+
/** SQLite's WAL, shared-memory, and rollback-journal files coordinate one
|
|
89
|
+
* local database connection. They are not a portable copy of the database. */
|
|
90
|
+
export function isSqliteCoordinationPath(relPath) {
|
|
91
|
+
const name = normalizedRelativePath(relPath).split('/').at(-1) ?? '';
|
|
92
|
+
return /\.(?:db|sqlite|sqlite3)-(?:wal|shm|journal)$/i.test(name);
|
|
93
|
+
}
|
|
88
94
|
function escapeRegex(character) {
|
|
89
95
|
return /[\\^$.*+?()[\]{}|]/.test(character) ? `\\${character}` : character;
|
|
90
96
|
}
|
|
@@ -141,16 +147,16 @@ function ignoreRule(line) {
|
|
|
141
147
|
}
|
|
142
148
|
/**
|
|
143
149
|
* Compile the root `.amalgmignore` for a user ground. Rules are ordered and
|
|
144
|
-
* `!` negates a prior user rule.
|
|
145
|
-
* structural
|
|
146
|
-
* excludes it. The policy file itself always travels.
|
|
150
|
+
* `!` negates a prior user rule. Reserved control state and transient SQLite
|
|
151
|
+
* coordination files are structural exclusions; every other path is ground
|
|
152
|
+
* unless this tracked file excludes it. The policy file itself always travels.
|
|
147
153
|
*/
|
|
148
154
|
export function createUserGroundEnrollmentPolicy(ignoreText = '') {
|
|
149
155
|
const rules = String(ignoreText).split(/\r?\n/).map(ignoreRule)
|
|
150
156
|
.filter((rule) => rule !== null);
|
|
151
157
|
return (input) => {
|
|
152
158
|
const relPath = normalizedRelativePath(input);
|
|
153
|
-
if (!relPath || isAmalgmControlPath(relPath))
|
|
159
|
+
if (!relPath || isAmalgmControlPath(relPath) || isSqliteCoordinationPath(relPath))
|
|
154
160
|
return false;
|
|
155
161
|
if (relPath === AMALGM_IGNORE_FILE)
|
|
156
162
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;
|
|
1
|
+
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;qEAEqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,wBAAwB,KAAK,CAAC;AAEvE,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AAmB,CAAC,OAAO,CAAC,IAAI,wBAAwB,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAChG,IAAI,OAAO,KAAK,kBAAkB;YAAE,OAAO,IAAI,CAAC;QAChD,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,QAAQ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9D,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amalgm/live",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
"license": "UNLICENSED",
|