@git-stunts/git-warp 10.8.0 → 11.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/README.md +53 -32
- package/SECURITY.md +64 -0
- package/bin/cli/commands/check.js +168 -0
- package/bin/cli/commands/doctor/checks.js +422 -0
- package/bin/cli/commands/doctor/codes.js +46 -0
- package/bin/cli/commands/doctor/index.js +239 -0
- package/bin/cli/commands/doctor/types.js +89 -0
- package/bin/cli/commands/history.js +73 -0
- package/bin/cli/commands/info.js +139 -0
- package/bin/cli/commands/install-hooks.js +128 -0
- package/bin/cli/commands/materialize.js +99 -0
- package/bin/cli/commands/path.js +88 -0
- package/bin/cli/commands/query.js +194 -0
- package/bin/cli/commands/registry.js +28 -0
- package/bin/cli/commands/seek.js +592 -0
- package/bin/cli/commands/trust.js +154 -0
- package/bin/cli/commands/verify-audit.js +113 -0
- package/bin/cli/commands/view.js +45 -0
- package/bin/cli/infrastructure.js +336 -0
- package/bin/cli/schemas.js +177 -0
- package/bin/cli/shared.js +244 -0
- package/bin/cli/types.js +85 -0
- package/bin/presenters/index.js +6 -0
- package/bin/presenters/text.js +136 -0
- package/bin/warp-graph.js +5 -2346
- package/index.d.ts +32 -2
- package/index.js +2 -0
- package/package.json +8 -7
- package/src/domain/WarpGraph.js +106 -3252
- package/src/domain/errors/QueryError.js +2 -2
- package/src/domain/errors/TrustError.js +29 -0
- package/src/domain/errors/index.js +1 -0
- package/src/domain/services/AuditMessageCodec.js +137 -0
- package/src/domain/services/AuditReceiptService.js +471 -0
- package/src/domain/services/AuditVerifierService.js +693 -0
- package/src/domain/services/HttpSyncServer.js +36 -22
- package/src/domain/services/MessageCodecInternal.js +3 -0
- package/src/domain/services/MessageSchemaDetector.js +2 -2
- package/src/domain/services/SyncAuthService.js +69 -3
- package/src/domain/services/WarpMessageCodec.js +4 -1
- package/src/domain/trust/TrustCanonical.js +42 -0
- package/src/domain/trust/TrustCrypto.js +111 -0
- package/src/domain/trust/TrustEvaluator.js +180 -0
- package/src/domain/trust/TrustRecordService.js +274 -0
- package/src/domain/trust/TrustStateBuilder.js +209 -0
- package/src/domain/trust/canonical.js +68 -0
- package/src/domain/trust/reasonCodes.js +64 -0
- package/src/domain/trust/schemas.js +160 -0
- package/src/domain/trust/verdict.js +42 -0
- package/src/domain/types/git-cas.d.ts +20 -0
- package/src/domain/utils/RefLayout.js +59 -0
- package/src/domain/warp/PatchSession.js +18 -0
- package/src/domain/warp/Writer.js +18 -3
- package/src/domain/warp/_internal.js +26 -0
- package/src/domain/warp/_wire.js +58 -0
- package/src/domain/warp/_wiredMethods.d.ts +100 -0
- package/src/domain/warp/checkpoint.methods.js +397 -0
- package/src/domain/warp/fork.methods.js +323 -0
- package/src/domain/warp/materialize.methods.js +188 -0
- package/src/domain/warp/materializeAdvanced.methods.js +339 -0
- package/src/domain/warp/patch.methods.js +529 -0
- package/src/domain/warp/provenance.methods.js +284 -0
- package/src/domain/warp/query.methods.js +279 -0
- package/src/domain/warp/subscribe.methods.js +272 -0
- package/src/domain/warp/sync.methods.js +549 -0
- package/src/infrastructure/adapters/GitGraphAdapter.js +67 -1
- package/src/infrastructure/adapters/InMemoryGraphAdapter.js +36 -0
- package/src/ports/CommitPort.js +10 -0
- package/src/ports/RefPort.js +17 -0
- package/src/hooks/post-merge.sh +0 -60
package/index.d.ts
CHANGED
|
@@ -558,6 +558,16 @@ export interface GitPlumbing {
|
|
|
558
558
|
executeStream(options: { args: string[] }): Promise<AsyncIterable<Uint8Array> & { collect(opts?: { asString?: boolean }): Promise<Buffer | string> }>;
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
/**
|
|
562
|
+
* In-memory persistence adapter for fast unit/integration tests.
|
|
563
|
+
*
|
|
564
|
+
* Implements the same GraphPersistencePort contract as GitGraphAdapter
|
|
565
|
+
* but stores all data in Maps — no real Git I/O required.
|
|
566
|
+
*/
|
|
567
|
+
export class InMemoryGraphAdapter extends GraphPersistencePort {
|
|
568
|
+
constructor();
|
|
569
|
+
}
|
|
570
|
+
|
|
561
571
|
/**
|
|
562
572
|
* Implementation of GraphPersistencePort and IndexStoragePort using GitPlumbing.
|
|
563
573
|
*/
|
|
@@ -1301,6 +1311,8 @@ export class PatchSession {
|
|
|
1301
1311
|
removeEdge(from: string, to: string, label: string): this;
|
|
1302
1312
|
/** Sets a property on a node. */
|
|
1303
1313
|
setProperty(nodeId: string, key: string, value: unknown): this;
|
|
1314
|
+
/** Sets a property on an edge. */
|
|
1315
|
+
setEdgeProperty(from: string, to: string, label: string, key: string, value: unknown): this;
|
|
1304
1316
|
/** Builds the patch object without committing. */
|
|
1305
1317
|
build(): unknown;
|
|
1306
1318
|
/** Commits the patch with CAS protection. */
|
|
@@ -1321,7 +1333,10 @@ export class Writer {
|
|
|
1321
1333
|
head(): Promise<string | null>;
|
|
1322
1334
|
/** Begins a new patch session. */
|
|
1323
1335
|
beginPatch(): Promise<PatchSession>;
|
|
1324
|
-
/**
|
|
1336
|
+
/**
|
|
1337
|
+
* Builds and commits a patch in one call.
|
|
1338
|
+
* @throws {WriterError} COMMIT_IN_PROGRESS if called while another commitPatch() is in progress (not reentrant)
|
|
1339
|
+
*/
|
|
1325
1340
|
commitPatch(build: (p: PatchSession) => void | Promise<void>): Promise<string>;
|
|
1326
1341
|
}
|
|
1327
1342
|
|
|
@@ -1419,6 +1434,7 @@ export interface ApplySyncResult {
|
|
|
1419
1434
|
export interface SyncAuthServerOptions {
|
|
1420
1435
|
keys: Record<string, string>;
|
|
1421
1436
|
mode?: 'enforce' | 'log-only';
|
|
1437
|
+
allowedWriters?: string[];
|
|
1422
1438
|
}
|
|
1423
1439
|
|
|
1424
1440
|
/**
|
|
@@ -1485,6 +1501,7 @@ export default class WarpGraph {
|
|
|
1485
1501
|
compactOnCheckpoint?: boolean;
|
|
1486
1502
|
};
|
|
1487
1503
|
checkpointPolicy?: { every: number };
|
|
1504
|
+
/** If true (default), query methods auto-materialize when no cached state exists. */
|
|
1488
1505
|
autoMaterialize?: boolean;
|
|
1489
1506
|
onDeleteWithData?: 'reject' | 'cascade' | 'warn';
|
|
1490
1507
|
clock?: ClockPort;
|
|
@@ -1512,7 +1529,19 @@ export default class WarpGraph {
|
|
|
1512
1529
|
/**
|
|
1513
1530
|
* Creates a new patch for adding operations.
|
|
1514
1531
|
*/
|
|
1515
|
-
createPatch(): Promise<
|
|
1532
|
+
createPatch(): Promise<PatchSession>;
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Convenience wrapper: creates a patch, runs the callback, and commits.
|
|
1536
|
+
*
|
|
1537
|
+
* The callback receives a patch builder and may be synchronous or
|
|
1538
|
+
* asynchronous. The commit happens only after the callback resolves.
|
|
1539
|
+
* If the callback throws or rejects, no commit is attempted.
|
|
1540
|
+
*
|
|
1541
|
+
* Not reentrant: calling `graph.patch()` inside a callback throws.
|
|
1542
|
+
* Use `createPatch()` directly for nested or concurrent patches.
|
|
1543
|
+
*/
|
|
1544
|
+
patch(build: (patch: PatchSession) => void | Promise<void>): Promise<string>;
|
|
1516
1545
|
|
|
1517
1546
|
/**
|
|
1518
1547
|
* Returns patches from a writer's ref chain.
|
|
@@ -1638,6 +1667,7 @@ export default class WarpGraph {
|
|
|
1638
1667
|
maxRequestBytes?: number;
|
|
1639
1668
|
httpPort: HttpServerPort;
|
|
1640
1669
|
auth?: SyncAuthServerOptions;
|
|
1670
|
+
allowedWriters?: string[];
|
|
1641
1671
|
}): Promise<{ close(): Promise<void>; url: string }>;
|
|
1642
1672
|
|
|
1643
1673
|
/**
|
package/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import IndexStoragePort from './src/ports/IndexStoragePort.js';
|
|
|
33
33
|
import LoggerPort from './src/ports/LoggerPort.js';
|
|
34
34
|
import ClockPort from './src/ports/ClockPort.js';
|
|
35
35
|
import SeekCachePort from './src/ports/SeekCachePort.js';
|
|
36
|
+
import InMemoryGraphAdapter from './src/infrastructure/adapters/InMemoryGraphAdapter.js';
|
|
36
37
|
import NoOpLogger from './src/infrastructure/adapters/NoOpLogger.js';
|
|
37
38
|
import ConsoleLogger, { LogLevel } from './src/infrastructure/adapters/ConsoleLogger.js';
|
|
38
39
|
import ClockAdapter from './src/infrastructure/adapters/ClockAdapter.js';
|
|
@@ -107,6 +108,7 @@ const TraversalService = CommitDagTraversalService;
|
|
|
107
108
|
|
|
108
109
|
export {
|
|
109
110
|
GitGraphAdapter,
|
|
111
|
+
InMemoryGraphAdapter,
|
|
110
112
|
GraphNode,
|
|
111
113
|
BitmapIndexBuilder,
|
|
112
114
|
BitmapIndexReader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git-stunts/git-warp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.2.1",
|
|
4
4
|
"description": "Deterministic WARP graph over Git: graph-native storage, traversal, and tooling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"bin/warp-graph.js",
|
|
45
45
|
"bin/presenters",
|
|
46
|
+
"bin/cli",
|
|
46
47
|
"bin/git-warp",
|
|
47
48
|
"src",
|
|
48
49
|
"index.js",
|
|
@@ -68,12 +69,12 @@
|
|
|
68
69
|
"benchmark": "sh -c 'if [ \"$GIT_STUNTS_DOCKER\" = \"1\" ]; then vitest bench --run test/benchmark \"$@\"; else docker compose run --build --rm test npm run benchmark:local -- \"$@\"; fi' --",
|
|
69
70
|
"benchmark:local": "vitest bench --run test/benchmark",
|
|
70
71
|
"demo": "cd examples && docker compose up -d && docker compose exec demo bash",
|
|
71
|
-
"demo:setup": "cd examples && docker compose up -d && docker compose exec demo sh -c 'cd /app && npm install --silent && cd /demo && node /app/examples/setup.js'",
|
|
72
|
-
"demo:explore": "cd examples && docker compose exec demo node /app/examples/explore.js",
|
|
73
|
-
"demo:inspect": "cd examples && docker compose exec demo node /app/examples/inspect-index.js",
|
|
74
|
-
"demo:lagrangian": "cd examples && docker compose exec demo node /app/examples/lagrangian-path.js",
|
|
75
|
-
"demo:bench-streaming": "cd examples && docker compose up -d && docker compose exec demo node /app/examples/streaming-benchmark.js",
|
|
76
|
-
"demo:bench-traversal": "cd examples && docker compose up -d && docker compose exec demo node /app/examples/traversal-benchmark.js",
|
|
72
|
+
"demo:setup": "cd examples && docker compose up -d && docker compose exec demo sh -c 'cd /app && npm install --silent && cd /demo && node /app/examples/scripts/setup.js'",
|
|
73
|
+
"demo:explore": "cd examples && docker compose exec demo node /app/examples/scripts/explore.js",
|
|
74
|
+
"demo:inspect": "cd examples && docker compose exec demo node /app/examples/scripts/inspect-index.js",
|
|
75
|
+
"demo:lagrangian": "cd examples && docker compose exec demo node /app/examples/scripts/lagrangian-path.js",
|
|
76
|
+
"demo:bench-streaming": "cd examples && docker compose up -d && docker compose exec demo node /app/examples/scripts/streaming-benchmark.js",
|
|
77
|
+
"demo:bench-traversal": "cd examples && docker compose up -d && docker compose exec demo node /app/examples/scripts/traversal-benchmark.js",
|
|
77
78
|
"demo:down": "cd examples && docker compose down -v",
|
|
78
79
|
"setup:hooks": "node scripts/setup-hooks.js",
|
|
79
80
|
"prepare": "patch-package && node scripts/setup-hooks.js",
|