@neottia/repository-store 0.3.2 → 0.3.4

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/README.md CHANGED
@@ -24,6 +24,8 @@ Installation downloads the exact native prebuild for the package version, platfo
24
24
 
25
25
  The stable C Node-API addon is built from architecture-neutral source. Linux uses `renameat2(..., RENAME_NOREPLACE)` and `fsync`. macOS uses `renamex_np(..., RENAME_EXCL)` and `F_FULLFSYNC`. Windows uses `SetFileInformationByHandle(..., FileRenameInfoEx)` without replacement and the Node/Bun `fsyncSync` descriptor barrier; NTFS journals same-volume namespace mutations because Windows does not expose an unprivileged directory-descriptor flush through Node.js. FreeBSD uses exclusive regular-file hard-link publication and `fsync`; because FreeBSD 14 has no no-replace directory rename, the backend uses a complete regular-file authority lease and never applies its move primitive to directories. Repository authority acquisition checks the addon and filesystem capabilities before it creates claim or lease artifacts. FreeBSD UFS1, ZFS, network filesystems, FreeBSD arm64, Bun on FreeBSD, Windows arm64, ReFS, FAT, remote or removable Windows volumes, missing or unloadable addon builds, unavailable native operations, uncertified filesystems, and shared or network filesystems return `UNSUPPORTED_RUNTIME`. Leased canonical and cache operations, including read-only operations, are unavailable in those environments.
26
26
 
27
+ `diagnoseRepositoryPlatform(root)` reports the runtime tuple, loaded backend, filesystem type and locality, and active checks for no-replace publication, hard links, stable identity, and durability. The probe uses a private temporary directory below `root`, removes it on every path, and does not create repository authority artifacts. The `neottia doctor` command renders this report and supports deterministic JSON output.
28
+
27
29
  ## Canonical files
28
30
 
29
31
  ```ts
@@ -0,0 +1,33 @@
1
+ import { type RepositoryRuntime } from './internal/platform-backend.js';
2
+ export interface RepositoryPlatformCheck {
3
+ readonly id: 'platform' | 'architecture' | 'runtime' | 'native-backend' | 'filesystem-type' | 'filesystem-local' | 'filesystem-writable' | 'atomic-no-replace' | 'hard-links' | 'stable-identity' | 'file-durability' | 'directory-durability';
4
+ readonly status: 'pass' | 'fail';
5
+ readonly message: string;
6
+ readonly reason?: 'UNSUPPORTED_PLATFORM' | 'UNSUPPORTED_ARCHITECTURE' | 'UNSUPPORTED_RUNTIME' | 'NATIVE_ADDON_UNAVAILABLE' | 'FILESYSTEM_UNCERTIFIED' | 'FILESYSTEM_NON_LOCAL' | 'FILESYSTEM_READ_ONLY' | 'ATOMIC_NO_REPLACE_UNAVAILABLE' | 'HARD_LINKS_UNAVAILABLE' | 'STABLE_IDENTITY_UNAVAILABLE' | 'FILE_DURABILITY_UNAVAILABLE' | 'DIRECTORY_DURABILITY_UNAVAILABLE';
7
+ readonly remediation?: string;
8
+ }
9
+ export interface RepositoryPlatformDiagnostics {
10
+ readonly schemaVersion: 1;
11
+ readonly status: 'pass' | 'fail';
12
+ readonly runtime: {
13
+ readonly name: RepositoryRuntime;
14
+ readonly version: string;
15
+ readonly platform: NodeJS.Platform;
16
+ readonly architecture: string;
17
+ };
18
+ readonly backend: {
19
+ readonly available: boolean;
20
+ readonly id: string | null;
21
+ readonly leaseArtifact: 'directory' | 'file' | null;
22
+ readonly filesystemRequirement: string | null;
23
+ };
24
+ readonly filesystem: {
25
+ readonly type: string | null;
26
+ readonly local: boolean | null;
27
+ readonly writable: boolean | null;
28
+ };
29
+ readonly durabilityModel: string | null;
30
+ readonly checks: readonly RepositoryPlatformCheck[];
31
+ }
32
+ export declare function diagnoseRepositoryPlatform(root: string): Promise<RepositoryPlatformDiagnostics>;
33
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAC;AAGxC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,EACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,YAAY,GACZ,iBAAiB,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,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACrD;AAYD,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC,CA+KrG"}
@@ -0,0 +1,230 @@
1
+ import { constants } from 'node:fs';
2
+ import { link, lstat, mkdtemp, open, readFile, realpath, rm, unlink, writeFile } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { currentRepositoryRuntime, repositoryPlatformTupleSupport, requireRepositoryPlatformBackend, } from './internal/platform-backend.js';
5
+ export async function diagnoseRepositoryPlatform(root) {
6
+ const runtime = currentRepositoryRuntime();
7
+ const tuple = repositoryPlatformTupleSupport(process.platform, process.arch, runtime);
8
+ const checks = [];
9
+ checks.push(check('platform', tuple.platformKnown, `Platform ${process.platform} has a certified Repository Store backend.`, 'UNSUPPORTED_PLATFORM', `Platform ${process.platform} is not certified for Repository Store.`, 'Use Linux, macOS, Windows Server, or FreeBSD as listed in the support matrix.'));
10
+ checks.push(check('architecture', tuple.architectureCertified, `Architecture ${process.arch} is certified on ${process.platform}.`, 'UNSUPPORTED_ARCHITECTURE', `Architecture ${process.arch} is not certified on ${process.platform}.`, 'Use a certified architecture from the Repository Store support matrix.'));
11
+ checks.push(check('runtime', tuple.runtimeCertified, `Runtime ${runtime} is certified on ${process.platform}-${process.arch}.`, 'UNSUPPORTED_RUNTIME', `Runtime ${runtime} is not certified on ${process.platform}-${process.arch}.`, 'Use a runtime listed for this platform tuple in the Repository Store support matrix.'));
12
+ let backend;
13
+ if (tuple.certified) {
14
+ try {
15
+ backend = requireRepositoryPlatformBackend();
16
+ }
17
+ catch {
18
+ }
19
+ }
20
+ checks.push(check('native-backend', backend !== undefined, 'The native Repository Store backend loaded and passed its integrity receipt check.', 'NATIVE_ADDON_UNAVAILABLE', 'The native Repository Store backend is unavailable or failed its integrity check.', 'Reinstall @neottia/repository-store, or install the C++17 source-build prerequisites and reinstall.'));
21
+ let inspection;
22
+ let probe;
23
+ if (backend !== undefined) {
24
+ try {
25
+ const canonicalRoot = await realpath(root);
26
+ const metadata = await lstat(canonicalRoot);
27
+ if (!metadata.isDirectory() || metadata.isSymbolicLink())
28
+ throw new Error('Diagnostic root is not a directory.');
29
+ inspection = backend.filesystem.inspectLocalPath?.(canonicalRoot);
30
+ if (inspection !== undefined)
31
+ probe = await runActiveProbes(canonicalRoot, backend);
32
+ }
33
+ catch {
34
+ }
35
+ }
36
+ checks.push(check('filesystem-type', inspection?.certified === true, `Filesystem ${inspection?.filesystemType ?? 'unknown'} is certified for this platform.`, 'FILESYSTEM_UNCERTIFIED', `Filesystem ${inspection?.filesystemType ?? 'unknown'} is not certified for this platform.`, backend?.filesystemRequirement ?? 'Use a certified local filesystem from the Repository Store support matrix.'));
37
+ checks.push(check('filesystem-local', inspection?.local === true, 'The target is on a local filesystem.', 'FILESYSTEM_NON_LOCAL', 'The target is not on a certified local filesystem.', 'Move the repository to a local filesystem. Network and shared filesystems are unsupported.'));
38
+ checks.push(check('filesystem-writable', inspection?.writable === true && probe?.temporaryArea === true, 'The target filesystem is writable and the private diagnostic area was removed.', 'FILESYSTEM_READ_ONLY', 'The target filesystem is read-only or does not permit a private diagnostic area.', 'Use a writable repository on a certified local filesystem.'));
39
+ checks.push(capabilityCheck('atomic-no-replace', inspection?.atomicNoReplace === true && probe?.atomicNoReplace === true, 'Atomic no-replace publication succeeded and refused an existing destination.', 'ATOMIC_NO_REPLACE_UNAVAILABLE', 'Atomic no-replace publication is unavailable.', 'Use the certified filesystem and native backend for this platform.'));
40
+ checks.push(capabilityCheck('hard-links', inspection?.hardLinks === true && probe?.hardLinks === true, 'Same-filesystem regular-file hard links preserve the source bytes.', 'HARD_LINKS_UNAVAILABLE', 'Required regular-file hard links are unavailable.', 'Use a certified local filesystem with regular-file hard-link support.'));
41
+ checks.push(capabilityCheck('stable-identity', inspection?.stableIdentity === true && probe?.stableIdentity === true, 'Descriptor and path metadata expose one stable filesystem identity.', 'STABLE_IDENTITY_UNAVAILABLE', 'Stable filesystem identity is unavailable.', 'Use a certified filesystem that exposes stable device and file identities.'));
42
+ checks.push(capabilityCheck('file-durability', inspection?.durability === true && probe?.fileDurability === true, 'The platform file durability barrier completed.', 'FILE_DURABILITY_UNAVAILABLE', 'The required file durability barrier is unavailable.', 'Use the certified filesystem and runtime durability support for this platform.'));
43
+ checks.push(capabilityCheck('directory-durability', inspection?.durability === true && probe?.directoryDurability === true, process.platform === 'win32'
44
+ ? 'NTFS journaling provides the certified namespace durability model.'
45
+ : 'The platform directory durability barrier completed.', 'DIRECTORY_DURABILITY_UNAVAILABLE', 'The required namespace durability model is unavailable.', 'Use the certified filesystem and namespace durability model for this platform.'));
46
+ const frozenChecks = Object.freeze(checks.map((result) => Object.freeze(result)));
47
+ return Object.freeze({
48
+ schemaVersion: 1,
49
+ status: frozenChecks.some((result) => result.status === 'fail') ? 'fail' : 'pass',
50
+ runtime: Object.freeze({
51
+ name: runtime,
52
+ version: runtime === 'bun' ? (process.versions.bun ?? process.version) : process.version,
53
+ platform: process.platform,
54
+ architecture: process.arch,
55
+ }),
56
+ backend: Object.freeze({
57
+ available: backend !== undefined,
58
+ id: backend?.id ?? null,
59
+ leaseArtifact: backend?.leaseArtifact ?? null,
60
+ filesystemRequirement: backend?.filesystemRequirement ?? null,
61
+ }),
62
+ filesystem: Object.freeze({
63
+ type: inspection?.filesystemType ?? null,
64
+ local: inspection?.local ?? null,
65
+ writable: inspection?.writable ?? null,
66
+ }),
67
+ durabilityModel: durabilityModel(backend),
68
+ checks: frozenChecks,
69
+ });
70
+ }
71
+ function check(id, passed, passedMessage, reason, failedMessage, remediation) {
72
+ return passed
73
+ ? { id, status: 'pass', message: passedMessage }
74
+ : { id, status: 'fail', message: failedMessage, reason, remediation };
75
+ }
76
+ function capabilityCheck(id, passed, passedMessage, reason, failedMessage, remediation) {
77
+ return check(id, passed, passedMessage, reason, failedMessage, remediation);
78
+ }
79
+ async function runActiveProbes(root, backend) {
80
+ let temporary;
81
+ let temporaryIdentity;
82
+ let result = failedActiveProbes();
83
+ try {
84
+ temporary = await mkdtemp(join(root, '.neottia-doctor-'));
85
+ temporaryIdentity = await lstat(temporary, { bigint: true });
86
+ if (!temporaryIdentity.isDirectory() || temporaryIdentity.isSymbolicLink()) {
87
+ throw new Error('Private diagnostic area identity is invalid.');
88
+ }
89
+ const [hardLinks, identity] = await probeHardLinks(temporary);
90
+ const atomicNoReplace = await probeAtomicNoReplace(temporary, backend);
91
+ const fileDurability = await probeFileDurability(temporary, backend);
92
+ const directoryDurability = process.platform === 'win32' ? true : await probeDirectoryDurability(temporary, backend);
93
+ result = {
94
+ temporaryArea: true,
95
+ atomicNoReplace,
96
+ hardLinks,
97
+ stableIdentity: identity,
98
+ fileDurability,
99
+ directoryDurability,
100
+ };
101
+ }
102
+ catch {
103
+ result = failedActiveProbes();
104
+ }
105
+ if (temporary === undefined || temporaryIdentity === undefined)
106
+ return result;
107
+ const removed = await removeOwnedTemporaryArea(temporary, temporaryIdentity);
108
+ return removed ? result : { ...result, temporaryArea: false };
109
+ }
110
+ function failedActiveProbes() {
111
+ return {
112
+ temporaryArea: false,
113
+ atomicNoReplace: false,
114
+ hardLinks: false,
115
+ stableIdentity: false,
116
+ fileDurability: false,
117
+ directoryDurability: false,
118
+ };
119
+ }
120
+ async function removeOwnedTemporaryArea(path, expected) {
121
+ try {
122
+ const current = await lstat(path, { bigint: true });
123
+ if (!current.isDirectory() || current.isSymbolicLink() || !sameBigIntIdentity(expected, current))
124
+ return false;
125
+ await rm(path, { recursive: true, force: false });
126
+ return await lstat(path).then(() => false, (error) => hasCode(error, 'ENOENT'));
127
+ }
128
+ catch {
129
+ return false;
130
+ }
131
+ }
132
+ async function probeHardLinks(root) {
133
+ const source = join(root, 'link-source');
134
+ const destination = join(root, 'link-destination');
135
+ const bytes = Buffer.from('neottia-platform-diagnostic\n');
136
+ await writeFile(source, bytes, { flag: 'wx', mode: 0o600 });
137
+ try {
138
+ await link(source, destination);
139
+ const handle = await open(source, 'r');
140
+ try {
141
+ const [sourceState, destinationState, descriptorState, linkedBytes] = await Promise.all([
142
+ lstat(source, { bigint: true }),
143
+ lstat(destination, { bigint: true }),
144
+ handle.stat({ bigint: true }),
145
+ readFile(destination),
146
+ ]);
147
+ const hardLinks = sourceState.nlink >= 2n && destinationState.nlink >= 2n && linkedBytes.equals(bytes);
148
+ const stableIdentity = sameBigIntIdentity(descriptorState, sourceState) && sameBigIntIdentity(descriptorState, destinationState);
149
+ return [hardLinks, stableIdentity];
150
+ }
151
+ finally {
152
+ await handle.close();
153
+ }
154
+ }
155
+ catch {
156
+ return [false, false];
157
+ }
158
+ finally {
159
+ await unlink(destination).catch(() => undefined);
160
+ await unlink(source).catch(() => undefined);
161
+ }
162
+ }
163
+ async function probeAtomicNoReplace(root, backend) {
164
+ const source = join(root, 'publication-source');
165
+ const destination = join(root, 'publication-destination');
166
+ const sourceBytes = Buffer.from('source\n');
167
+ const destinationBytes = Buffer.from('destination\n');
168
+ await writeFile(source, sourceBytes, { flag: 'wx', mode: 0o600 });
169
+ await writeFile(destination, destinationBytes, { flag: 'wx', mode: 0o600 });
170
+ let refused = false;
171
+ try {
172
+ backend.publication.renameNoReplace(source, destination);
173
+ }
174
+ catch (error) {
175
+ refused = hasCode(error, 'EEXIST');
176
+ }
177
+ if (!refused)
178
+ return false;
179
+ if (!(await readFile(source)).equals(sourceBytes) || !(await readFile(destination)).equals(destinationBytes))
180
+ return false;
181
+ await unlink(destination);
182
+ backend.publication.renameNoReplace(source, destination);
183
+ const published = await readFile(destination);
184
+ const sourceMissing = await lstat(source).then(() => false, (error) => hasCode(error, 'ENOENT'));
185
+ return sourceMissing && published.equals(sourceBytes);
186
+ }
187
+ async function probeFileDurability(root, backend) {
188
+ const path = join(root, 'durability-file');
189
+ await writeFile(path, 'durability\n', { flag: 'wx', mode: 0o600 });
190
+ const handle = await open(path, process.platform === 'win32' ? 'r+' : 'r');
191
+ try {
192
+ backend.durability.syncDescriptor(handle.fd);
193
+ return true;
194
+ }
195
+ catch {
196
+ return false;
197
+ }
198
+ finally {
199
+ await handle.close();
200
+ }
201
+ }
202
+ async function probeDirectoryDurability(root, backend) {
203
+ const handle = await open(root, constants.O_RDONLY | constants.O_DIRECTORY);
204
+ try {
205
+ backend.durability.syncDescriptor(handle.fd);
206
+ return true;
207
+ }
208
+ catch {
209
+ return false;
210
+ }
211
+ finally {
212
+ await handle.close();
213
+ }
214
+ }
215
+ function sameBigIntIdentity(left, right) {
216
+ return left.dev === right.dev && left.ino === right.ino;
217
+ }
218
+ function hasCode(error, code) {
219
+ return error instanceof Error && 'code' in error && error.code === code;
220
+ }
221
+ function durabilityModel(backend) {
222
+ if (backend === undefined)
223
+ return null;
224
+ if (backend.platform === 'darwin')
225
+ return 'F_FULLFSYNC for managed files and directories';
226
+ if (backend.platform === 'win32')
227
+ return 'fsyncSync for managed files and NTFS journaling for namespace mutations';
228
+ return 'fsync for managed files and directories';
229
+ }
230
+ //# sourceMappingURL=diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,gCAAgC,GAIjC,MAAM,gCAAgC,CAAC;AAsExC,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,IAAY;IAC3D,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC;IAC3C,MAAM,KAAK,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;AACH,CAAC;AAED,KAAK,UAAU,wBAAwB,CAAC,IAAY,EAAE,OAAkC;IACtF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5E,IAAI,CAAC;QACH,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAiB,EAAE,KAAkB;IAC/D,OAAO,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC;AAC1D,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,IAAY;IAC3C,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,OAA8C;IACrE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,+CAA+C,CAAC;IAC1F,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,yEAAyE,CAAC;IACnH,OAAO,yCAAyC,CAAC;AACnD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { diagnoseRepositoryPlatform, type RepositoryPlatformCheck, type RepositoryPlatformDiagnostics, } from './diagnostics.js';
1
2
  export { CacheSyncError, DurabilityError, LeaseContentionError, PathSafetyError, RecoveryError, RepositoryStoreConfigError, RepositoryStoreError, ResourceLimitError, StaleRevisionError, UnsupportedRuntimeError, type RepositoryStoreErrorCategory, type RepositoryStoreErrorCode, } from './errors.js';
2
3
  export { readManagedFile, scanManagedFiles, type ManagedFile, type ScanManagedFilesOptions } from './files.js';
3
4
  export { withRepositoryLease, type OperationControl, type RepositoryLease, type RepositoryLeaseOptions, } from './lease.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC/G,OAAO,EACL,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,aAA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BAAmB,CAAC;AAC3B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,YAAY,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { diagnoseRepositoryPlatform, } from './diagnostics.js';
1
2
  export { CacheSyncError, DurabilityError, LeaseContentionError, PathSafetyError, RecoveryError, RepositoryStoreConfigError, RepositoryStoreError, ResourceLimitError, StaleRevisionError, UnsupportedRuntimeError, } from './errors.js';
2
3
  export { readManagedFile, scanManagedFiles } from './files.js';
3
4
  export { withRepositoryLease, } from './lease.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAkD,MAAM,YAAY,CAAC;AAC/G,OAAO,EACL,mBAAmB,GAIpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAoB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GAIrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAU1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,GAG3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAkD,MAAM,YAAY,CAAC;AAC/G,OAAO,EACL,mBAAmB,GAIpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAoB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GAIrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAU1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,8 +1,19 @@
1
1
  export interface ExactPublicationBackend {
2
2
  renameNoReplace(source: string, destination: string): void;
3
3
  }
4
+ export interface LocalPathInspection {
5
+ readonly filesystemType: string;
6
+ readonly certified: boolean;
7
+ readonly local: boolean;
8
+ readonly writable: boolean;
9
+ readonly hardLinks: boolean;
10
+ readonly stableIdentity: boolean;
11
+ readonly atomicNoReplace: boolean;
12
+ readonly durability: boolean;
13
+ }
4
14
  export interface LocalFilesystemBackend {
5
15
  supportsLocalPath(path: string): boolean;
16
+ inspectLocalPath?(path: string): LocalPathInspection;
6
17
  }
7
18
  export interface DurabilityBackend {
8
19
  syncDescriptor(descriptor: number): void;
@@ -16,9 +27,18 @@ export interface RepositoryPlatformBackend {
16
27
  readonly filesystem: LocalFilesystemBackend;
17
28
  readonly durability: DurabilityBackend;
18
29
  }
30
+ export type RepositoryRuntime = 'node' | 'bun';
31
+ export interface RepositoryPlatformTupleSupport {
32
+ readonly platformKnown: boolean;
33
+ readonly architectureCertified: boolean;
34
+ readonly runtimeCertified: boolean;
35
+ readonly certified: boolean;
36
+ }
19
37
  export declare function requireRepositoryPlatformBackend(): RepositoryPlatformBackend;
20
38
  export declare function platformRenameNoReplace(backend: RepositoryPlatformBackend, source: string, destination: string): void;
21
39
  export declare function assertPlatformFilesystem(backend: RepositoryPlatformBackend, path: string): void;
22
40
  export declare function setRepositoryPlatformBackendForTests(backend: RepositoryPlatformBackend | null | undefined): void;
23
41
  export declare function isCertifiedRepositoryPlatform(platform: NodeJS.Platform, architecture: string): boolean;
42
+ export declare function repositoryPlatformTupleSupport(platform: NodeJS.Platform, architecture: string, runtime: RepositoryRuntime): RepositoryPlatformTupleSupport;
43
+ export declare function currentRepositoryRuntime(): RepositoryRuntime;
24
44
  //# sourceMappingURL=platform-backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-backend.d.ts","sourceRoot":"","sources":["../../src/internal/platform-backend.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,uBAAuB;IACtC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,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C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAkDD,wBAAgB,gCAAgC,IAAI,yBAAyB,CAmC5E;AAGD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAQrH;AAGD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAO/F;AAGD,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAEhH;AAGD,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAEtG;AAGD,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,iBAAiB,GACzB,8BAA8B,CAWhC;AAED,wBAAgB,wBAAwB,IAAI,iBAAiB,CAE5D"}
@@ -8,6 +8,7 @@ const backendDefinitions = {
8
8
  id: 'linux-node-api',
9
9
  platform: 'linux',
10
10
  architectures: ['x64', 'arm64'],
11
+ runtimes: ['node', 'bun'],
11
12
  filesystemRequirement: 'a certified Linux local filesystem',
12
13
  leaseArtifact: 'directory',
13
14
  },
@@ -15,6 +16,7 @@ const backendDefinitions = {
15
16
  id: 'macos-node-api',
16
17
  platform: 'darwin',
17
18
  architectures: ['x64', 'arm64'],
19
+ runtimes: ['node', 'bun'],
18
20
  filesystemRequirement: 'a local APFS filesystem with certified publication and durability capabilities',
19
21
  leaseArtifact: 'directory',
20
22
  },
@@ -22,6 +24,7 @@ const backendDefinitions = {
22
24
  id: 'windows-node-api',
23
25
  platform: 'win32',
24
26
  architectures: ['x64'],
27
+ runtimes: ['node', 'bun'],
25
28
  filesystemRequirement: 'a local NTFS filesystem with stable identity and hard-link capabilities',
26
29
  leaseArtifact: 'directory',
27
30
  },
@@ -29,6 +32,7 @@ const backendDefinitions = {
29
32
  id: 'freebsd-node-api',
30
33
  platform: 'freebsd',
31
34
  architectures: ['x64'],
35
+ runtimes: ['node'],
32
36
  filesystemRequirement: 'a local UFS2 filesystem with regular-file hard links and directory fsync',
33
37
  leaseArtifact: 'file',
34
38
  },
@@ -43,8 +47,9 @@ export function requireRepositoryPlatformBackend() {
43
47
  throw unsupported('Repository platform backend is disabled for this operation.');
44
48
  }
45
49
  const definition = selectBackendDefinition(process.platform, process.arch);
46
- if (definition === undefined)
47
- throw unsupported(`Repository filesystem operations are unsupported on ${process.platform}.`);
50
+ const runtime = currentRepositoryRuntime();
51
+ if (definition === undefined || !definition.runtimes.includes(runtime))
52
+ throw unsupported(`Repository filesystem operations are unsupported on ${runtime} ${process.platform}-${process.arch}.`);
48
53
  if (loadedBackend !== undefined)
49
54
  return loadedBackend;
50
55
  if (loadFailure !== undefined)
@@ -56,7 +61,10 @@ export function requireRepositoryPlatformBackend() {
56
61
  loadedBackend = Object.freeze({
57
62
  ...definition,
58
63
  publication: Object.freeze({ renameNoReplace: nativeModule.renameNoReplace.bind(nativeModule) }),
59
- filesystem: Object.freeze({ supportsLocalPath: nativeModule.supportsLocalPath.bind(nativeModule) }),
64
+ filesystem: Object.freeze({
65
+ supportsLocalPath: nativeModule.supportsLocalPath.bind(nativeModule),
66
+ inspectLocalPath: (path) => validateLocalPathInspection(nativeModule.inspectLocalPath(path)),
67
+ }),
60
68
  durability: Object.freeze({
61
69
  syncDescriptor: definition.platform === 'win32' ? fsyncSync : nativeModule.syncDescriptor.bind(nativeModule),
62
70
  }),
@@ -94,6 +102,21 @@ export function setRepositoryPlatformBackendForTests(backend) {
94
102
  export function isCertifiedRepositoryPlatform(platform, architecture) {
95
103
  return selectBackendDefinition(platform, architecture) !== undefined;
96
104
  }
105
+ export function repositoryPlatformTupleSupport(platform, architecture, runtime) {
106
+ const definition = backendDefinitions[platform];
107
+ const platformKnown = definition !== undefined;
108
+ const architectureCertified = definition?.architectures.includes(architecture) === true;
109
+ const runtimeCertified = definition?.runtimes.includes(runtime) === true;
110
+ return Object.freeze({
111
+ platformKnown,
112
+ architectureCertified,
113
+ runtimeCertified,
114
+ certified: platformKnown && architectureCertified && runtimeCertified,
115
+ });
116
+ }
117
+ export function currentRepositoryRuntime() {
118
+ return typeof process.versions.bun === 'string' ? 'bun' : 'node';
119
+ }
97
120
  function selectBackendDefinition(platform, architecture) {
98
121
  const definition = backendDefinitions[platform];
99
122
  return definition?.architectures.includes(architecture) === true ? definition : undefined;
@@ -104,11 +127,40 @@ function loadNativeModule() {
104
127
  const candidate = require(verifyNativeAddonIntegrity(packageRoot));
105
128
  if (typeof candidate.platform !== 'string' ||
106
129
  typeof candidate.renameNoReplace !== 'function' ||
130
+ typeof candidate.inspectLocalPath !== 'function' ||
107
131
  typeof candidate.supportsLocalPath !== 'function' ||
108
132
  typeof candidate.syncDescriptor !== 'function')
109
133
  throw new Error('Native addon does not expose the complete platform backend contract.');
110
134
  return candidate;
111
135
  }
136
+ function validateLocalPathInspection(value) {
137
+ if (typeof value !== 'object' || value === null)
138
+ throw new Error('Native filesystem inspection is malformed.');
139
+ const candidate = value;
140
+ const booleanFields = [
141
+ 'certified',
142
+ 'local',
143
+ 'writable',
144
+ 'hardLinks',
145
+ 'stableIdentity',
146
+ 'atomicNoReplace',
147
+ 'durability',
148
+ ];
149
+ if (typeof candidate.filesystemType !== 'string' ||
150
+ candidate.filesystemType.length === 0 ||
151
+ booleanFields.some((field) => typeof candidate[field] !== 'boolean'))
152
+ throw new Error('Native filesystem inspection is malformed.');
153
+ return Object.freeze({
154
+ filesystemType: candidate.filesystemType,
155
+ certified: candidate.certified,
156
+ local: candidate.local,
157
+ writable: candidate.writable,
158
+ hardLinks: candidate.hardLinks,
159
+ stableIdentity: candidate.stableIdentity,
160
+ atomicNoReplace: candidate.atomicNoReplace,
161
+ durability: candidate.durability,
162
+ });
163
+ }
112
164
  function hasCode(error, code) {
113
165
  return typeof error === 'object' && error !== null && 'code' in error && error.code === code;
114
166
  }
@@ -1 +1 @@
1
- {"version":3,"file":"platform-backend.js","sourceRoot":"","sources":["../../src/internal/platform-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AA2CnE,MAAM,kBAAkB,GAAgE;IACtF,KAAK,EAAE;QACL,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,OAAO;QACjB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;QAC/B,qBAAqB,EAAE,oCAAoC;QAC3D,aAAa,EAAE,WAAW;KAC3B;IACD,MAAM,EAAE;QACN,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;QAC/B,qBAAqB,EAAE,gFAAgF;QACvG,aAAa,EAAE,WAAW;KAC3B;IACD,KAAK,EAAE;QACL,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EAAE,OAAO;QACjB,aAAa,EAAE,CAAC,KAAK,CAAC;QACtB,qBAAqB,EAAE,yEAAyE;QAChG,aAAa,EAAE,WAAW;KAC3B;IACD,OAAO,EAAE;QACP,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EAAE,SAAS;QACnB,aAAa,EAAE,CAAC,KAAK,CAAC;QACtB,qBAAqB,EAAE,0EAA0E;QACjG,aAAa,EAAE,MAAM;KACtB;CACF,CAAC;AAEF,IAAI,eAA6D,CAAC;AAClE,IAAI,aAAoD,CAAC;AACzD,IAAI,WAAoB,CAAC;AAGzB,MAAM,UAAU,gCAAgC;IAC9C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CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;QAEpE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,UAAU,EAAE,SAAS,CAAC,UAAU;KACjC,CAAwB,CAAC;AAC5B,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,IAAY;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC/F,CAAC;AAED,SAAS,WAAW,CAAC,OAAe,EAAE,KAAe;IACnD,MAAM,KAAK,GAAG,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACjF,OAAO,KAAK,CAAC;AACf,CAAC"}
package/native/backend.cc CHANGED
@@ -83,6 +83,42 @@ napi_value RenameNoReplace(napi_env env, napi_callback_info info) {
83
83
  return undefined;
84
84
  }
85
85
 
86
+ void SetBooleanProperty(napi_env env, napi_value object, const char* name, bool value) {
87
+ napi_value property;
88
+ napi_get_boolean(env, value, &property);
89
+ napi_set_named_property(env, object, name, property);
90
+ }
91
+
92
+ napi_value InspectLocalPath(napi_env env, napi_callback_info info) {
93
+ size_t argc = 1;
94
+ napi_value argv[1];
95
+ napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
96
+ std::string path;
97
+ if (argc != 1 || !ReadPath(env, argv[0], &path)) {
98
+ napi_throw_type_error(env, nullptr, "inspectLocalPath requires one path");
99
+ return nullptr;
100
+ }
101
+ neottia::repository_store::LocalPathInspection inspection;
102
+ const int error = neottia::repository_store::InspectLocalPath(path.c_str(), &inspection);
103
+ if (error != 0) {
104
+ ThrowErrno(env, error);
105
+ return nullptr;
106
+ }
107
+ napi_value result;
108
+ napi_create_object(env, &result);
109
+ napi_value filesystem_type;
110
+ napi_create_string_utf8(env, inspection.filesystem_type.c_str(), NAPI_AUTO_LENGTH, &filesystem_type);
111
+ napi_set_named_property(env, result, "filesystemType", filesystem_type);
112
+ SetBooleanProperty(env, result, "certified", inspection.certified);
113
+ SetBooleanProperty(env, result, "local", inspection.local);
114
+ SetBooleanProperty(env, result, "writable", inspection.writable);
115
+ SetBooleanProperty(env, result, "hardLinks", inspection.hard_links);
116
+ SetBooleanProperty(env, result, "stableIdentity", inspection.stable_identity);
117
+ SetBooleanProperty(env, result, "atomicNoReplace", inspection.atomic_no_replace);
118
+ SetBooleanProperty(env, result, "durability", inspection.durability);
119
+ return result;
120
+ }
121
+
86
122
  napi_value SupportsLocalPath(napi_env env, napi_callback_info info) {
87
123
  size_t argc = 1;
88
124
  napi_value argv[1];
@@ -129,6 +165,9 @@ napi_value Initialize(napi_env env, napi_value exports) {
129
165
  napi_value rename_function;
130
166
  napi_create_function(env, "renameNoReplace", NAPI_AUTO_LENGTH, RenameNoReplace, nullptr, &rename_function);
131
167
  napi_set_named_property(env, exports, "renameNoReplace", rename_function);
168
+ napi_value inspect_function;
169
+ napi_create_function(env, "inspectLocalPath", NAPI_AUTO_LENGTH, InspectLocalPath, nullptr, &inspect_function);
170
+ napi_set_named_property(env, exports, "inspectLocalPath", inspect_function);
132
171
  napi_value supports_function;
133
172
  napi_create_function(env, "supportsLocalPath", NAPI_AUTO_LENGTH, SupportsLocalPath, nullptr, &supports_function);
134
173
  napi_set_named_property(env, exports, "supportsLocalPath", supports_function);
@@ -1,7 +1,6 @@
1
1
  #include "platform_backend.h"
2
2
 
3
3
  #include <cerrno>
4
- #include <cstring>
5
4
  #include <fcntl.h>
6
5
  #include <sys/mount.h>
7
6
  #include <sys/stat.h>
@@ -27,6 +26,7 @@ int SupportsRequiredDurability(const char* path, bool* supported) {
27
26
  *supported = false;
28
27
  return 0;
29
28
  }
29
+ if (sync_error == 0 && close_error == 0) *supported = true;
30
30
  return sync_error != 0 ? sync_error : close_error;
31
31
  }
32
32
 
@@ -60,13 +60,13 @@ int RenameNoReplace(const char* source, const char* destination) {
60
60
  return unlink_error;
61
61
  }
62
62
 
63
- int SupportsLocalPath(const char* path, bool* supported) {
64
- *supported = false;
63
+ int InspectLocalPath(const char* path, LocalPathInspection* inspection) {
65
64
  struct statfs filesystem;
66
65
  if (statfs(path, &filesystem) != 0) return errno;
67
- if (std::strcmp(filesystem.f_fstypename, "ufs") != 0 || (filesystem.f_flags & MNT_LOCAL) == 0 ||
68
- (filesystem.f_flags & MNT_RDONLY) != 0)
69
- return 0;
66
+ inspection->filesystem_type = filesystem.f_fstypename;
67
+ inspection->local = (filesystem.f_flags & MNT_LOCAL) != 0;
68
+ inspection->writable = (filesystem.f_flags & MNT_RDONLY) == 0;
69
+ if (inspection->filesystem_type != "ufs" || !inspection->local || !inspection->writable) return 0;
70
70
 
71
71
  // FreeBSD reports st_birthtim.tv_sec == -1 for UFS1 and reads the stored
72
72
  // birth time for UFS2. This rejects UFS1 without reading the backing device.
@@ -74,8 +74,25 @@ int SupportsLocalPath(const char* path, bool* supported) {
74
74
  if (lstat(path, &state) != 0) return errno;
75
75
  if (state.st_birthtim.tv_sec == -1) return 0;
76
76
 
77
- *supported = true;
78
- return SupportsRequiredDurability(path, supported);
77
+ inspection->certified = true;
78
+ inspection->hard_links = true;
79
+ inspection->stable_identity = true;
80
+ inspection->atomic_no_replace = true;
81
+ bool durability = false;
82
+ const int durability_error = SupportsRequiredDurability(path, &durability);
83
+ if (durability_error != 0) return durability_error;
84
+ inspection->durability = durability;
85
+ return 0;
86
+ }
87
+
88
+ int SupportsLocalPath(const char* path, bool* supported) {
89
+ LocalPathInspection inspection;
90
+ const int error = InspectLocalPath(path, &inspection);
91
+ if (error != 0) return error;
92
+ *supported = inspection.filesystem_type == "ufs" && inspection.local && inspection.writable &&
93
+ inspection.hard_links && inspection.stable_identity && inspection.atomic_no_replace &&
94
+ inspection.durability;
95
+ return 0;
79
96
  }
80
97
 
81
98
  int SyncDescriptor(int descriptor) { return Sync(descriptor); }
@@ -4,11 +4,56 @@
4
4
  #include <fcntl.h>
5
5
  #include <linux/fs.h>
6
6
  #include <linux/magic.h>
7
- #include <stdio.h>
7
+ #include <cstdio>
8
+ #include <sys/statvfs.h>
8
9
  #include <sys/vfs.h>
9
10
  #include <unistd.h>
10
11
 
11
12
  namespace neottia::repository_store {
13
+ namespace {
14
+
15
+ constexpr long kCifsMagic = 0xff534d42L;
16
+ constexpr long kCephMagic = 0x00c36400L;
17
+ constexpr long kNinePMagic = 0x01021997L;
18
+
19
+ const char* FilesystemType(long type) {
20
+ switch (type) {
21
+ case EXT4_SUPER_MAGIC:
22
+ return "ext4";
23
+ case XFS_SUPER_MAGIC:
24
+ return "xfs";
25
+ case BTRFS_SUPER_MAGIC:
26
+ return "btrfs";
27
+ case TMPFS_MAGIC:
28
+ return "tmpfs";
29
+ case OVERLAYFS_SUPER_MAGIC:
30
+ return "overlay";
31
+ case NFS_SUPER_MAGIC:
32
+ return "nfs";
33
+ case SMB_SUPER_MAGIC:
34
+ return "smb";
35
+ case kCifsMagic:
36
+ return "cifs";
37
+ case kCephMagic:
38
+ return "ceph";
39
+ case kNinePMagic:
40
+ return "9p";
41
+ default:
42
+ return nullptr;
43
+ }
44
+ }
45
+
46
+ bool IsCertifiedFilesystem(long type) {
47
+ return type == EXT4_SUPER_MAGIC || type == XFS_SUPER_MAGIC || type == BTRFS_SUPER_MAGIC || type == TMPFS_MAGIC ||
48
+ type == OVERLAYFS_SUPER_MAGIC;
49
+ }
50
+
51
+ bool IsKnownRemoteFilesystem(long type) {
52
+ return type == NFS_SUPER_MAGIC || type == SMB_SUPER_MAGIC || type == kCifsMagic || type == kCephMagic ||
53
+ type == kNinePMagic;
54
+ }
55
+
56
+ } // namespace
12
57
 
13
58
  const char* Platform() { return "linux"; }
14
59
 
@@ -17,20 +62,34 @@ int RenameNoReplace(const char* source, const char* destination) {
17
62
  return errno;
18
63
  }
19
64
 
20
- int SupportsLocalPath(const char* path, bool* supported) {
65
+ int InspectLocalPath(const char* path, LocalPathInspection* inspection) {
21
66
  struct statfs state;
22
67
  if (statfs(path, &state) != 0) return errno;
23
- switch (state.f_type) {
24
- case EXT4_SUPER_MAGIC:
25
- case XFS_SUPER_MAGIC:
26
- case BTRFS_SUPER_MAGIC:
27
- case TMPFS_MAGIC:
28
- case OVERLAYFS_SUPER_MAGIC:
29
- *supported = true;
30
- break;
31
- default:
32
- *supported = false;
68
+ const char* name = FilesystemType(state.f_type);
69
+ if (name == nullptr) {
70
+ char value[32];
71
+ std::snprintf(value, sizeof(value), "0x%lx", static_cast<unsigned long>(state.f_type));
72
+ inspection->filesystem_type = value;
73
+ } else {
74
+ inspection->filesystem_type = name;
33
75
  }
76
+ const bool certified = IsCertifiedFilesystem(state.f_type);
77
+ inspection->certified = certified;
78
+ inspection->local = !IsKnownRemoteFilesystem(state.f_type);
79
+ inspection->writable = (state.f_flags & ST_RDONLY) == 0;
80
+ inspection->hard_links = certified;
81
+ inspection->stable_identity = certified;
82
+ inspection->atomic_no_replace = certified;
83
+ inspection->durability = certified;
84
+ return 0;
85
+ }
86
+
87
+ int SupportsLocalPath(const char* path, bool* supported) {
88
+ LocalPathInspection inspection;
89
+ const int error = InspectLocalPath(path, &inspection);
90
+ if (error != 0) return error;
91
+ *supported = inspection.local && inspection.writable && inspection.hard_links && inspection.stable_identity &&
92
+ inspection.atomic_no_replace && inspection.durability;
34
93
  return 0;
35
94
  }
36
95
 
@@ -3,7 +3,6 @@
3
3
  #include <cerrno>
4
4
  #include <cstddef>
5
5
  #include <cstdint>
6
- #include <cstring>
7
6
  #include <fcntl.h>
8
7
  #include <stdio.h>
9
8
  #include <sys/attr.h>
@@ -30,6 +29,7 @@ int SupportsRequiredDurability(const char* path, bool* supported) {
30
29
  sync_result = fcntl(descriptor, F_FULLFSYNC, 0);
31
30
  } while (sync_result != 0 && errno == EINTR);
32
31
  if (sync_result == 0) {
32
+ *supported = true;
33
33
  const int close_result = close(descriptor);
34
34
  return close_result == 0 ? 0 : errno;
35
35
  }
@@ -51,13 +51,14 @@ int RenameNoReplace(const char* source, const char* destination) {
51
51
  return errno;
52
52
  }
53
53
 
54
- int SupportsLocalPath(const char* path, bool* supported) {
54
+ int InspectLocalPath(const char* path, LocalPathInspection* inspection) {
55
55
  struct statfs state;
56
56
  if (statfs(path, &state) != 0) return errno;
57
- if (std::strcmp(state.f_fstypename, "apfs") != 0 || (state.f_flags & MNT_LOCAL) == 0) {
58
- *supported = false;
59
- return 0;
60
- }
57
+ inspection->filesystem_type = state.f_fstypename;
58
+ inspection->certified = inspection->filesystem_type == "apfs";
59
+ inspection->local = (state.f_flags & MNT_LOCAL) != 0;
60
+ inspection->writable = (state.f_flags & MNT_RDONLY) == 0;
61
+ if (inspection->filesystem_type != "apfs" || !inspection->local || !inspection->writable) return 0;
61
62
 
62
63
  struct attrlist attributes = {};
63
64
  attributes.bitmapcount = ATTR_BIT_MAP_COUNT;
@@ -65,12 +66,26 @@ int SupportsLocalPath(const char* path, bool* supported) {
65
66
  CapabilityBuffer buffer = {};
66
67
  if (getattrlist(path, &attributes, &buffer, sizeof(buffer), 0) != 0) return errno;
67
68
 
68
- const std::uint32_t required_format = VOL_CAP_FMT_PERSISTENTOBJECTIDS | VOL_CAP_FMT_HARDLINKS;
69
- const std::uint32_t required_interfaces = VOL_CAP_INT_RENAME_EXCL;
70
- *supported = HasCapability(buffer.capabilities, VOL_CAPABILITIES_FORMAT, required_format) &&
71
- HasCapability(buffer.capabilities, VOL_CAPABILITIES_INTERFACES, required_interfaces);
72
- if (!*supported) return 0;
73
- return SupportsRequiredDurability(path, supported);
69
+ inspection->stable_identity = HasCapability(
70
+ buffer.capabilities, VOL_CAPABILITIES_FORMAT, VOL_CAP_FMT_PERSISTENTOBJECTIDS);
71
+ inspection->hard_links = HasCapability(buffer.capabilities, VOL_CAPABILITIES_FORMAT, VOL_CAP_FMT_HARDLINKS);
72
+ inspection->atomic_no_replace =
73
+ HasCapability(buffer.capabilities, VOL_CAPABILITIES_INTERFACES, VOL_CAP_INT_RENAME_EXCL);
74
+ bool durability = false;
75
+ const int durability_error = SupportsRequiredDurability(path, &durability);
76
+ if (durability_error != 0) return durability_error;
77
+ inspection->durability = durability;
78
+ return 0;
79
+ }
80
+
81
+ int SupportsLocalPath(const char* path, bool* supported) {
82
+ LocalPathInspection inspection;
83
+ const int error = InspectLocalPath(path, &inspection);
84
+ if (error != 0) return error;
85
+ *supported = inspection.filesystem_type == "apfs" && inspection.local && inspection.writable &&
86
+ inspection.hard_links && inspection.stable_identity && inspection.atomic_no_replace &&
87
+ inspection.durability;
88
+ return 0;
74
89
  }
75
90
 
76
91
  int SyncDescriptor(int descriptor) {
@@ -1,13 +1,30 @@
1
1
  #pragma once
2
2
 
3
+ #include <string>
4
+
3
5
  namespace neottia::repository_store {
4
6
 
7
+ /** Observable filesystem properties used by platform diagnostics. */
8
+ struct LocalPathInspection {
9
+ std::string filesystem_type;
10
+ bool certified = false;
11
+ bool local = false;
12
+ bool writable = false;
13
+ bool hard_links = false;
14
+ bool stable_identity = false;
15
+ bool atomic_no_replace = false;
16
+ bool durability = false;
17
+ };
18
+
5
19
  /** Returns the Node.js platform identifier implemented by this binary. */
6
20
  const char* Platform();
7
21
 
8
22
  /** Moves source to destination without replacing an existing destination. */
9
23
  int RenameNoReplace(const char* source, const char* destination);
10
24
 
25
+ /** Inspects the filesystem properties required by Repository Store. */
26
+ int InspectLocalPath(const char* path, LocalPathInspection* inspection);
27
+
11
28
  /** Reports whether path resides on a certified local filesystem. */
12
29
  int SupportsLocalPath(const char* path, bool* supported);
13
30
 
@@ -18,6 +18,11 @@ const char* Platform() {
18
18
 
19
19
  int RenameNoReplace(const char*, const char*) { return ENOSYS; }
20
20
 
21
+ int InspectLocalPath(const char*, LocalPathInspection* inspection) {
22
+ inspection->filesystem_type = "unknown";
23
+ return 0;
24
+ }
25
+
21
26
  int SupportsLocalPath(const char*, bool* supported) {
22
27
  *supported = false;
23
28
  return 0;
@@ -85,6 +85,16 @@ bool IsNtfs(const wchar_t* filesystem_name) {
85
85
  return _wcsicmp(filesystem_name, L"NTFS") == 0;
86
86
  }
87
87
 
88
+ int Utf8Text(const wchar_t* value, std::string* output) {
89
+ const int required = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, value, -1, nullptr, 0, nullptr, nullptr);
90
+ if (required == 0) return WindowsError(GetLastError());
91
+ std::vector<char> buffer(static_cast<std::size_t>(required));
92
+ if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, value, -1, buffer.data(), required, nullptr, nullptr) == 0)
93
+ return WindowsError(GetLastError());
94
+ output->assign(buffer.data());
95
+ return 0;
96
+ }
97
+
88
98
  } // namespace
89
99
 
90
100
  const char* Platform() { return "win32"; }
@@ -143,32 +153,43 @@ int RenameNoReplace(const char* source, const char* destination) {
143
153
  return 0;
144
154
  }
145
155
 
146
- int SupportsLocalPath(const char* path, bool* supported) {
147
- *supported = false;
156
+ int InspectLocalPath(const char* path, LocalPathInspection* inspection) {
148
157
  std::wstring absolute;
149
158
  int error = AbsolutePath(path, &absolute);
150
159
  if (error != 0) return error;
151
160
 
152
161
  const std::wstring extended = ExtendedPath(absolute);
153
162
  const DWORD attributes = GetFileAttributesW(extended.c_str());
154
- if (attributes == INVALID_FILE_ATTRIBUTES)
155
- return WindowsError(GetLastError());
156
- if ((attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) return 0;
163
+ if (attributes == INVALID_FILE_ATTRIBUTES) return WindowsError(GetLastError());
164
+ const bool reparse_point = (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
157
165
 
158
166
  wchar_t volume_path[MAX_PATH + 1] = {};
159
- if (!GetVolumePathNameW(absolute.c_str(), volume_path, MAX_PATH + 1))
160
- return WindowsError(GetLastError());
161
- if (GetDriveTypeW(volume_path) != DRIVE_FIXED) return 0;
167
+ if (!GetVolumePathNameW(absolute.c_str(), volume_path, MAX_PATH + 1)) return WindowsError(GetLastError());
168
+ inspection->local = GetDriveTypeW(volume_path) == DRIVE_FIXED;
162
169
 
163
170
  DWORD filesystem_flags = 0;
164
171
  wchar_t filesystem_name[MAX_PATH + 1] = {};
165
- if (!GetVolumeInformationW(volume_path, nullptr, 0, nullptr, nullptr,
166
- &filesystem_flags, filesystem_name, MAX_PATH + 1))
172
+ if (!GetVolumeInformationW(volume_path, nullptr, 0, nullptr, nullptr, &filesystem_flags, filesystem_name,
173
+ MAX_PATH + 1))
167
174
  return WindowsError(GetLastError());
168
- const DWORD required =
169
- FILE_SUPPORTS_HARD_LINKS | FILE_SUPPORTS_OPEN_BY_FILE_ID;
170
- *supported =
171
- IsNtfs(filesystem_name) && (filesystem_flags & required) == required;
175
+ error = Utf8Text(filesystem_name, &inspection->filesystem_type);
176
+ if (error != 0) return error;
177
+ inspection->writable = (filesystem_flags & FILE_READ_ONLY_VOLUME) == 0;
178
+ const bool ntfs = IsNtfs(filesystem_name);
179
+ inspection->certified = ntfs;
180
+ inspection->hard_links = ntfs && (filesystem_flags & FILE_SUPPORTS_HARD_LINKS) != 0 && !reparse_point;
181
+ inspection->stable_identity = ntfs && (filesystem_flags & FILE_SUPPORTS_OPEN_BY_FILE_ID) != 0 && !reparse_point;
182
+ inspection->atomic_no_replace = ntfs && !reparse_point;
183
+ inspection->durability = ntfs && inspection->local && inspection->writable && !reparse_point;
184
+ return 0;
185
+ }
186
+
187
+ int SupportsLocalPath(const char* path, bool* supported) {
188
+ LocalPathInspection inspection;
189
+ const int error = InspectLocalPath(path, &inspection);
190
+ if (error != 0) return error;
191
+ *supported = inspection.local && inspection.writable && inspection.hard_links && inspection.stable_identity &&
192
+ inspection.atomic_no_replace && inspection.durability;
172
193
  return 0;
173
194
  }
174
195
 
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@neottia/repository-store",
4
- "packageVersion": "0.3.2",
5
- "releaseTag": "@neottia/repository-store@0.3.2",
6
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
4
+ "packageVersion": "0.3.4",
5
+ "releaseTag": "@neottia/repository-store@0.3.4",
6
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
7
7
  "signature": {
8
8
  "format": "sigstore-bundle-v0.3",
9
9
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -15,12 +15,12 @@
15
15
  {
16
16
  "platform": "darwin",
17
17
  "architecture": "arm64",
18
- "name": "repository-store-native-v0.3.2-darwin-arm64.node",
19
- "bundle": "repository-store-native-v0.3.2-darwin-arm64.node.sigstore.json",
20
- "attestation": "repository-store-native-v0.3.2-darwin-arm64.node.intoto.jsonl",
21
- "sha256": "8ecf2ccb75de2239921f00a761d58c96d9d7a04669b976c2a4638f4186a5dee0",
22
- "size": 54160,
23
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
18
+ "name": "repository-store-native-v0.3.4-darwin-arm64.node",
19
+ "bundle": "repository-store-native-v0.3.4-darwin-arm64.node.sigstore.json",
20
+ "attestation": "repository-store-native-v0.3.4-darwin-arm64.node.intoto.jsonl",
21
+ "sha256": "7ec4246c48feb76e2f217b4fbeace0684931592e419adfda32d39203d3693c5a",
22
+ "size": 54800,
23
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
24
24
  "signature": {
25
25
  "format": "sigstore-bundle-v0.3",
26
26
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -32,12 +32,12 @@
32
32
  {
33
33
  "platform": "darwin",
34
34
  "architecture": "x64",
35
- "name": "repository-store-native-v0.3.2-darwin-x64.node",
36
- "bundle": "repository-store-native-v0.3.2-darwin-x64.node.sigstore.json",
37
- "attestation": "repository-store-native-v0.3.2-darwin-x64.node.intoto.jsonl",
38
- "sha256": "0110e6131d1439edbca16f2a505e773863ec155c1efe1b3f7637ebcfaa704f31",
39
- "size": 20816,
40
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
35
+ "name": "repository-store-native-v0.3.4-darwin-x64.node",
36
+ "bundle": "repository-store-native-v0.3.4-darwin-x64.node.sigstore.json",
37
+ "attestation": "repository-store-native-v0.3.4-darwin-x64.node.intoto.jsonl",
38
+ "sha256": "2f6bfedfa4d082fb0287a6a74159e0f7e79f7132f33440364753510dd1171825",
39
+ "size": 21456,
40
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
41
41
  "signature": {
42
42
  "format": "sigstore-bundle-v0.3",
43
43
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -49,12 +49,12 @@
49
49
  {
50
50
  "platform": "freebsd",
51
51
  "architecture": "x64",
52
- "name": "repository-store-native-v0.3.2-freebsd-x64.node",
53
- "bundle": "repository-store-native-v0.3.2-freebsd-x64.node.sigstore.json",
54
- "attestation": "repository-store-native-v0.3.2-freebsd-x64.node.intoto.jsonl",
55
- "sha256": "fa2e280a1a5de100520971df8750de4022ec53feedf1526929217b4124345af2",
56
- "size": 18320,
57
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
52
+ "name": "repository-store-native-v0.3.4-freebsd-x64.node",
53
+ "bundle": "repository-store-native-v0.3.4-freebsd-x64.node.sigstore.json",
54
+ "attestation": "repository-store-native-v0.3.4-freebsd-x64.node.intoto.jsonl",
55
+ "sha256": "3b0f225e517daa651ca0c029d076dca7bcb62cca00fac080686d111850aa0aff",
56
+ "size": 20528,
57
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
58
58
  "signature": {
59
59
  "format": "sigstore-bundle-v0.3",
60
60
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -66,12 +66,12 @@
66
66
  {
67
67
  "platform": "linux",
68
68
  "architecture": "arm64",
69
- "name": "repository-store-native-v0.3.2-linux-arm64.node",
70
- "bundle": "repository-store-native-v0.3.2-linux-arm64.node.sigstore.json",
71
- "attestation": "repository-store-native-v0.3.2-linux-arm64.node.intoto.jsonl",
72
- "sha256": "ed2d95b726fecbab782a5e677ed5109f8230e2d5efb921dfe0c6d64c5e9e0c2e",
73
- "size": 71856,
74
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
69
+ "name": "repository-store-native-v0.3.4-linux-arm64.node",
70
+ "bundle": "repository-store-native-v0.3.4-linux-arm64.node.sigstore.json",
71
+ "attestation": "repository-store-native-v0.3.4-linux-arm64.node.intoto.jsonl",
72
+ "sha256": "15d56b396fc6aa506cd2db99ef6b24fb4440d8ae06996ca4e875e9942206d830",
73
+ "size": 72344,
74
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
75
75
  "signature": {
76
76
  "format": "sigstore-bundle-v0.3",
77
77
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -83,12 +83,12 @@
83
83
  {
84
84
  "platform": "linux",
85
85
  "architecture": "x64",
86
- "name": "repository-store-native-v0.3.2-linux-x64.node",
87
- "bundle": "repository-store-native-v0.3.2-linux-x64.node.sigstore.json",
88
- "attestation": "repository-store-native-v0.3.2-linux-x64.node.intoto.jsonl",
89
- "sha256": "c9f10cb643d67d5afd801ebb7eb52497a9ee501db202302a7b6289b815d3ab14",
90
- "size": 17608,
91
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
86
+ "name": "repository-store-native-v0.3.4-linux-x64.node",
87
+ "bundle": "repository-store-native-v0.3.4-linux-x64.node.sigstore.json",
88
+ "attestation": "repository-store-native-v0.3.4-linux-x64.node.intoto.jsonl",
89
+ "sha256": "7530d936f33fab7eab4f358184533f4187b85d2d2ae20aade386b482643cfb71",
90
+ "size": 22192,
91
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
92
92
  "signature": {
93
93
  "format": "sigstore-bundle-v0.3",
94
94
  "certificateIssuer": "https://token.actions.githubusercontent.com",
@@ -100,12 +100,12 @@
100
100
  {
101
101
  "platform": "win32",
102
102
  "architecture": "x64",
103
- "name": "repository-store-native-v0.3.2-win32-x64.node",
104
- "bundle": "repository-store-native-v0.3.2-win32-x64.node.sigstore.json",
105
- "attestation": "repository-store-native-v0.3.2-win32-x64.node.intoto.jsonl",
106
- "sha256": "584ad5e39cb2c6377bdae671bab32cca15aa197250fd3c299ae249d363f187dc",
107
- "size": 138240,
108
- "sourceCommit": "8adbaf09c095d3a3d2ce2411ae4c39f739ed042e",
103
+ "name": "repository-store-native-v0.3.4-win32-x64.node",
104
+ "bundle": "repository-store-native-v0.3.4-win32-x64.node.sigstore.json",
105
+ "attestation": "repository-store-native-v0.3.4-win32-x64.node.intoto.jsonl",
106
+ "sha256": "45a2560788f0067afa944a6155d7965280f29910dfce446b34e1710c4af3581b",
107
+ "size": 141312,
108
+ "sourceCommit": "d09bfe64c32a180a05720e7ec4884f470ad2354a",
109
109
  "signature": {
110
110
  "format": "sigstore-bundle-v0.3",
111
111
  "certificateIssuer": "https://token.actions.githubusercontent.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neottia/repository-store",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Crash-recoverable repository-local canonical file and disposable SQLite storage primitives",
5
5
  "author": "Dragos Cirjan",
6
6
  "license": "MIT",
@@ -70,7 +70,7 @@
70
70
  "install": "node scripts/install-native.mjs",
71
71
  "test": "pnpm run test:installer && pnpm run test:node && pnpm run test:bun && pnpm run test:cross-runtime",
72
72
  "test:installer": "vitest run --root ../.. packages/repository-store/scripts/native-prebuild.spec.mjs",
73
- "test:node": "pnpm run build && vitest run --root ../.. packages/repository-store/src/internal/native-integrity.spec.ts packages/repository-store/src/repository-store.spec.ts packages/repository-store/src/sqlite/cache.spec.ts packages/repository-store/src/sqlite/node-adapter.spec.ts",
73
+ "test:node": "pnpm run build && vitest run --root ../.. packages/repository-store/src/diagnostics.spec.ts packages/repository-store/src/internal/native-integrity.spec.ts packages/repository-store/src/repository-store.spec.ts packages/repository-store/src/sqlite/cache.spec.ts packages/repository-store/src/sqlite/node-adapter.spec.ts",
74
74
  "test:bun": "pnpm run build && bun test ./src/sqlite/bun-adapter.bun.test.ts ./src/publication.bun.test.ts",
75
75
  "test:cross-runtime": "pnpm run build && vitest run --root ../.. packages/repository-store/src/sqlite/cross-runtime.spec.ts",
76
76
  "typecheck": "tsc --noEmit"