@ricsam/r5d-worker 0.0.136 → 0.0.138
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 +4 -94
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/main.mjs +46 -7537
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/personal/action-scheduler.mjs +31 -0
- package/dist/mjs/personal/client.mjs +215 -0
- package/dist/mjs/personal/runtime.mjs +328 -0
- package/dist/mjs/personal/tcp.mjs +217 -0
- package/dist/mjs/runtime/adapter.mjs +42 -0
- package/dist/mjs/runtime/client.mjs +95 -0
- package/dist/mjs/runtime/daemon.mjs +131 -0
- package/dist/mjs/runtime/executor.mjs +436 -0
- package/dist/mjs/runtime/index.mjs +15 -0
- package/dist/mjs/runtime/protocol.mjs +139 -0
- package/dist/mjs/runtime/pty-host.mjs +156 -0
- package/dist/mjs/runtime/pty.mjs +127 -0
- package/dist/mjs/runtime/releases/artifacts.mjs +201 -0
- package/dist/mjs/runtime/releases/grants.mjs +93 -0
- package/dist/mjs/runtime/releases/main.mjs +101 -0
- package/dist/mjs/runtime/releases/manager.mjs +541 -0
- package/dist/mjs/runtime/releases/process.mjs +88 -0
- package/dist/mjs/runtime/releases/retirement.mjs +18 -0
- package/dist/mjs/runtime/releases/rpc-client.mjs +184 -0
- package/dist/mjs/runtime/releases/rpc-main.mjs +213 -0
- package/dist/mjs/runtime/releases/rpc-protocol.mjs +103 -0
- package/dist/mjs/runtime/storage.mjs +156 -0
- package/dist/mjs/runtime/workspace/artifacts.mjs +121 -0
- package/dist/mjs/runtime/workspace/authority.mjs +1355 -0
- package/dist/mjs/runtime/workspace/contracts.mjs +60 -0
- package/dist/mjs/runtime/workspace/file-write.mjs +23 -0
- package/dist/mjs/runtime/workspace/files.mjs +308 -0
- package/dist/mjs/runtime/workspace/http-body.mjs +45 -0
- package/dist/mjs/runtime/workspace/storage-client.mjs +59 -0
- package/dist/mjs/runtime/workspace/storage-wire.mjs +53 -0
- package/dist/types/main.d.ts +0 -1167
- package/dist/types/personal/action-scheduler.d.ts +23 -0
- package/dist/types/personal/client.d.ts +14 -0
- package/dist/types/personal/runtime.d.ts +121 -0
- package/dist/types/personal/tcp.d.ts +14 -0
- package/dist/types/runtime/client.d.ts +17 -0
- package/dist/types/runtime/daemon.d.ts +8 -0
- package/dist/types/runtime/executor.d.ts +35 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/protocol.d.ts +544 -0
- package/dist/types/runtime/pty.d.ts +30 -0
- package/dist/types/runtime/releases/artifacts.d.ts +51 -0
- package/dist/types/runtime/releases/grants.d.ts +16 -0
- package/dist/types/runtime/releases/manager.d.ts +145 -0
- package/dist/types/runtime/releases/process.d.ts +14 -0
- package/dist/types/runtime/releases/retirement.d.ts +15 -0
- package/dist/types/runtime/releases/rpc-client.d.ts +52 -0
- package/dist/types/runtime/releases/rpc-main.d.ts +10 -0
- package/dist/types/runtime/releases/rpc-protocol.d.ts +1139 -0
- package/dist/types/runtime/storage.d.ts +21 -0
- package/dist/types/runtime/test-harness.d.ts +53 -0
- package/dist/types/runtime/workspace/artifacts.d.ts +30 -0
- package/dist/types/runtime/workspace/authority.d.ts +338 -0
- package/dist/types/runtime/workspace/contracts.d.ts +86 -0
- package/dist/types/runtime/workspace/file-write.d.ts +14 -0
- package/dist/types/runtime/workspace/files.d.ts +21 -0
- package/dist/types/runtime/workspace/http-body.d.ts +9 -0
- package/dist/types/runtime/workspace/storage-client.d.ts +23 -0
- package/dist/types/runtime/workspace/storage-wire.d.ts +138 -0
- package/package.json +8 -6
- package/dist/cjs/atomic-rename.cjs +0 -303
- package/dist/cjs/browser-upload.cjs +0 -73
- package/dist/cjs/cli-update.cjs +0 -108
- package/dist/cjs/command-launcher.cjs +0 -423
- package/dist/cjs/control-command-policy.cjs +0 -177
- package/dist/cjs/git-blob-hash.cjs +0 -41
- package/dist/cjs/git-identity.cjs +0 -39
- package/dist/cjs/git-process-environment.cjs +0 -133
- package/dist/cjs/inline-output.cjs +0 -62
- package/dist/cjs/main.cjs +0 -7511
- package/dist/cjs/managed-paths.cjs +0 -215
- package/dist/cjs/plan-lint.cjs +0 -165
- package/dist/cjs/plan-parser.cjs +0 -127
- package/dist/cjs/plan-paths.cjs +0 -53
- package/dist/cjs/port-forward-client.cjs +0 -206
- package/dist/cjs/process-tree.cjs +0 -117
- package/dist/cjs/project-checkout-garbage.cjs +0 -219
- package/dist/cjs/project-mirror-fetch-policy.cjs +0 -82
- package/dist/cjs/project-mirror-refs-token.cjs +0 -85
- package/dist/cjs/project-workspace-state.cjs +0 -972
- package/dist/cjs/project-worktrees.cjs +0 -1713
- package/dist/cjs/pty-output-coalescer.cjs +0 -87
- package/dist/cjs/recovery-journal-protocol.cjs +0 -56
- package/dist/cjs/recovery-journal-runtime.cjs +0 -133
- package/dist/cjs/recovery-journal-thread.cjs +0 -9
- package/dist/cjs/recovery-journal.cjs +0 -742
- package/dist/cjs/recovery-output-window.cjs +0 -77
- package/dist/cjs/recovery-protocol.cjs +0 -31
- package/dist/cjs/recovery-store.cjs +0 -252
- package/dist/cjs/registry-auth.cjs +0 -310
- package/dist/cjs/repository-transition-policy.cjs +0 -49
- package/dist/cjs/runtime-version.cjs +0 -88
- package/dist/cjs/session-file-mutations.cjs +0 -61
- package/dist/cjs/supervisor.cjs +0 -147
- package/dist/cjs/three-way-merge.cjs +0 -346
- package/dist/cjs/working-tree-mirror.cjs +0 -1872
- package/dist/cjs/workspace-automatic-sync-policy.cjs +0 -79
- package/dist/cjs/workspace-branch-incarnation-policy.cjs +0 -37
- package/dist/cjs/workspace-command-sync-policy.cjs +0 -112
- package/dist/cjs/workspace-command-targets.cjs +0 -63
- package/dist/cjs/workspace-filesystem-executor-thread.cjs +0 -36
- package/dist/cjs/workspace-filesystem-executor.cjs +0 -327
- package/dist/cjs/workspace-filesystem-job-types.cjs +0 -144
- package/dist/cjs/workspace-filesystem-jobs.cjs +0 -59
- package/dist/cjs/workspace-git-sync.cjs +0 -3450
- package/dist/cjs/workspace-hydration-ledger.cjs +0 -66
- package/dist/cjs/workspace-hydration-merge.cjs +0 -433
- package/dist/cjs/workspace-hydration-recovery-state.cjs +0 -53
- package/dist/cjs/workspace-incident-state.cjs +0 -37
- package/dist/cjs/workspace-merge-projection.cjs +0 -467
- package/dist/cjs/workspace-mount-boundary.cjs +0 -71
- package/dist/cjs/workspace-mount-hold-fence.cjs +0 -120
- package/dist/cjs/workspace-mutation-gate.cjs +0 -127
- package/dist/cjs/workspace-path-move.cjs +0 -195
- package/dist/cjs/workspace-preserve-only-policy.cjs +0 -36
- package/dist/cjs/workspace-project-config-policy.cjs +0 -53
- package/dist/cjs/workspace-projection-ledger.cjs +0 -81
- package/dist/cjs/workspace-publication-evidence.cjs +0 -46
- package/dist/cjs/workspace-sync-coalescer.cjs +0 -58
- package/dist/mjs/atomic-rename.mjs +0 -261
- package/dist/mjs/browser-upload.mjs +0 -42
- package/dist/mjs/command-launcher.mjs +0 -393
- package/dist/mjs/control-command-policy.mjs +0 -146
- package/dist/mjs/git-blob-hash.mjs +0 -16
- package/dist/mjs/git-identity.mjs +0 -15
- package/dist/mjs/git-process-environment.mjs +0 -105
- package/dist/mjs/inline-output.mjs +0 -37
- package/dist/mjs/managed-paths.mjs +0 -174
- package/dist/mjs/plan-lint.mjs +0 -129
- package/dist/mjs/plan-parser.mjs +0 -94
- package/dist/mjs/plan-paths.mjs +0 -25
- package/dist/mjs/port-forward-client.mjs +0 -172
- package/dist/mjs/project-checkout-garbage.mjs +0 -178
- package/dist/mjs/project-mirror-fetch-policy.mjs +0 -56
- package/dist/mjs/project-mirror-refs-token.mjs +0 -53
- package/dist/mjs/project-workspace-state.mjs +0 -937
- package/dist/mjs/project-worktrees.mjs +0 -1657
- package/dist/mjs/pty-output-coalescer.mjs +0 -61
- package/dist/mjs/recovery-journal-protocol.mjs +0 -30
- package/dist/mjs/recovery-journal-runtime.mjs +0 -112
- package/dist/mjs/recovery-journal-thread.mjs +0 -8
- package/dist/mjs/recovery-journal.mjs +0 -694
- package/dist/mjs/recovery-output-window.mjs +0 -53
- package/dist/mjs/recovery-protocol.mjs +0 -6
- package/dist/mjs/recovery-store.mjs +0 -217
- package/dist/mjs/registry-auth.mjs +0 -269
- package/dist/mjs/repository-transition-policy.mjs +0 -22
- package/dist/mjs/runtime-version.mjs +0 -54
- package/dist/mjs/session-file-mutations.mjs +0 -37
- package/dist/mjs/supervisor.mjs +0 -114
- package/dist/mjs/three-way-merge.mjs +0 -318
- package/dist/mjs/working-tree-mirror.mjs +0 -1817
- package/dist/mjs/workspace-automatic-sync-policy.mjs +0 -48
- package/dist/mjs/workspace-branch-incarnation-policy.mjs +0 -13
- package/dist/mjs/workspace-command-sync-policy.mjs +0 -84
- package/dist/mjs/workspace-command-targets.mjs +0 -37
- package/dist/mjs/workspace-filesystem-executor-thread.mjs +0 -38
- package/dist/mjs/workspace-filesystem-executor.mjs +0 -287
- package/dist/mjs/workspace-filesystem-job-types.mjs +0 -116
- package/dist/mjs/workspace-filesystem-jobs.mjs +0 -55
- package/dist/mjs/workspace-git-sync.mjs +0 -3407
- package/dist/mjs/workspace-hydration-ledger.mjs +0 -42
- package/dist/mjs/workspace-hydration-merge.mjs +0 -399
- package/dist/mjs/workspace-hydration-recovery-state.mjs +0 -29
- package/dist/mjs/workspace-incident-state.mjs +0 -12
- package/dist/mjs/workspace-merge-projection.mjs +0 -433
- package/dist/mjs/workspace-mount-boundary.mjs +0 -37
- package/dist/mjs/workspace-mount-hold-fence.mjs +0 -95
- package/dist/mjs/workspace-mutation-gate.mjs +0 -103
- package/dist/mjs/workspace-path-move.mjs +0 -160
- package/dist/mjs/workspace-preserve-only-policy.mjs +0 -11
- package/dist/mjs/workspace-project-config-policy.mjs +0 -27
- package/dist/mjs/workspace-projection-ledger.mjs +0 -57
- package/dist/mjs/workspace-publication-evidence.mjs +0 -21
- package/dist/mjs/workspace-sync-coalescer.mjs +0 -34
- package/dist/types/atomic-rename.d.ts +0 -78
- package/dist/types/browser-upload.d.ts +0 -7
- package/dist/types/command-launcher.d.ts +0 -104
- package/dist/types/control-command-policy.d.ts +0 -53
- package/dist/types/git-blob-hash.d.ts +0 -10
- package/dist/types/git-identity.d.ts +0 -9
- package/dist/types/git-process-environment.d.ts +0 -9
- package/dist/types/inline-output.d.ts +0 -3
- package/dist/types/managed-paths.d.ts +0 -19
- package/dist/types/plan-lint.d.ts +0 -16
- package/dist/types/plan-parser.d.ts +0 -38
- package/dist/types/plan-paths.d.ts +0 -36
- package/dist/types/port-forward-client.d.ts +0 -8
- package/dist/types/project-checkout-garbage.d.ts +0 -86
- package/dist/types/project-mirror-fetch-policy.d.ts +0 -84
- package/dist/types/project-mirror-refs-token.d.ts +0 -53
- package/dist/types/project-workspace-state.d.ts +0 -188
- package/dist/types/project-worktrees.d.ts +0 -397
- package/dist/types/pty-output-coalescer.d.ts +0 -20
- package/dist/types/recovery-journal-protocol.d.ts +0 -35
- package/dist/types/recovery-journal-runtime.d.ts +0 -12
- package/dist/types/recovery-journal-thread.d.ts +0 -1
- package/dist/types/recovery-journal.d.ts +0 -248
- package/dist/types/recovery-output-window.d.ts +0 -19
- package/dist/types/recovery-protocol.d.ts +0 -59
- package/dist/types/recovery-store.d.ts +0 -52
- package/dist/types/registry-auth.d.ts +0 -47
- package/dist/types/repository-transition-policy.d.ts +0 -26
- package/dist/types/runtime-version.d.ts +0 -1
- package/dist/types/session-file-mutations.d.ts +0 -22
- package/dist/types/supervisor-daemonized-fixture.d.ts +0 -1
- package/dist/types/supervisor-launcher-cleanup-fixture.d.ts +0 -1
- package/dist/types/supervisor-signal-fixture.d.ts +0 -1
- package/dist/types/supervisor.d.ts +0 -23
- package/dist/types/three-way-merge.d.ts +0 -77
- package/dist/types/working-tree-mirror.d.ts +0 -424
- package/dist/types/workspace-automatic-sync-policy.d.ts +0 -57
- package/dist/types/workspace-branch-incarnation-policy.d.ts +0 -14
- package/dist/types/workspace-command-sync-policy.d.ts +0 -57
- package/dist/types/workspace-command-targets.d.ts +0 -37
- package/dist/types/workspace-filesystem-executor-thread.d.ts +0 -1
- package/dist/types/workspace-filesystem-executor.d.ts +0 -123
- package/dist/types/workspace-filesystem-job-types.d.ts +0 -288
- package/dist/types/workspace-filesystem-jobs.d.ts +0 -7
- package/dist/types/workspace-git-sync.d.ts +0 -495
- package/dist/types/workspace-hydration-ledger.d.ts +0 -43
- package/dist/types/workspace-hydration-merge.d.ts +0 -95
- package/dist/types/workspace-hydration-recovery-state.d.ts +0 -10
- package/dist/types/workspace-incident-state.d.ts +0 -19
- package/dist/types/workspace-merge-projection.d.ts +0 -60
- package/dist/types/workspace-mount-boundary.d.ts +0 -10
- package/dist/types/workspace-mount-hold-fence.d.ts +0 -42
- package/dist/types/workspace-mutation-gate.d.ts +0 -42
- package/dist/types/workspace-path-move.d.ts +0 -21
- package/dist/types/workspace-preserve-only-policy.d.ts +0 -15
- package/dist/types/workspace-project-config-policy.d.ts +0 -48
- package/dist/types/workspace-projection-ledger.d.ts +0 -59
- package/dist/types/workspace-publication-evidence.d.ts +0 -17
- package/dist/types/workspace-sync-coalescer.d.ts +0 -28
- /package/dist/types/{credential-authority-lock-fixture.d.ts → runtime/adapter.d.ts} +0 -0
- /package/dist/types/{recovery-journal-stall-fixture.d.ts → runtime/releases/main.d.ts} +0 -0
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
import { type PreparedWorkingTreeMirror, type ProjectedWorkingTreeEntry, type WorkingTreeGitlink, type WorkingTreeMirrorPlan, type WorkingTreeMirrorScope, type WorkingTreeSourceMode } from "./working-tree-mirror";
|
|
2
|
-
import { type WorkspaceHydrationMergeBasis, type WorkspaceHydrationMergeDecision, type WorkspaceHydrationMountSkip as WorkspaceHydrationMountSkipBase } from "./workspace-hydration-merge";
|
|
3
|
-
import { WorkspaceHydrationPreBlobLedger } from "./workspace-hydration-ledger";
|
|
4
|
-
export declare const WORKSPACE_GIT_BRANCH = "main";
|
|
5
|
-
export declare const MAX_WORKSPACE_GIT_DIFF_BYTES: number;
|
|
6
|
-
export declare const WORKSPACE_GIT_CONFIRMED_LARGE_DIFF_PUSH_OPTION = "r5d-confirm-large-diff-v1";
|
|
7
|
-
export declare const WORKSPACE_GIT_HYDRATED_RECEIPT = "r5d/workspace-hydrated-head";
|
|
8
|
-
export declare const WORKSPACE_GIT_HYDRATION_TRANSACTION = "r5d/workspace-hydration-transaction";
|
|
9
|
-
export declare const WORKSPACE_GIT_HYDRATION_RECOVERIES = "r5d/workspace-hydration-recoveries";
|
|
10
|
-
export declare const WORKSPACE_GIT_CHECKOUT_DURABILITY = "r5d/workspace-checkout-durability";
|
|
11
|
-
/** `R5D_MERGE_HYDRATION=0` restores the plain byte mirror for post-publication hydration (docs/merge-hydration-design.md §4). */
|
|
12
|
-
export declare const WORKSPACE_MERGE_HYDRATION_SWITCH = "R5D_MERGE_HYDRATION";
|
|
13
|
-
declare function hydrationPreBlobLedger(workspacePath: string): WorkspaceHydrationPreBlobLedger;
|
|
14
|
-
export type WorkspaceHydrationMountSkip = WorkspaceHydrationMountSkipBase & {
|
|
15
|
-
retainedPaths?: string[];
|
|
16
|
-
};
|
|
17
|
-
export type WorkspaceMountSkipReason = WorkspaceHydrationMountSkip["reason"] | "stale_rewrite_detected";
|
|
18
|
-
/** Why a mount was left at its recorded basis this cycle, with the paths involved; a diagnostic beside `skippedMountIds`. */
|
|
19
|
-
export type WorkspaceMountSkipReasons = Record<string, {
|
|
20
|
-
reason: WorkspaceMountSkipReason;
|
|
21
|
-
paths: string[];
|
|
22
|
-
retainedPaths?: string[];
|
|
23
|
-
}>;
|
|
24
|
-
type WorkspaceHydrationMountBasis = {
|
|
25
|
-
id: string;
|
|
26
|
-
incarnationKey: string;
|
|
27
|
-
sourcePath: string;
|
|
28
|
-
durabilityRootPath: string;
|
|
29
|
-
workspaceRelativePath: string;
|
|
30
|
-
sourceMode: WorkingTreeSourceMode;
|
|
31
|
-
hydrateDeletionMode: "all" | "git";
|
|
32
|
-
preserveLocalOnInitialOuterAbsence: boolean;
|
|
33
|
-
preserveLocalOnHydrationBasisChange: boolean;
|
|
34
|
-
deleteWhenSourceMissing: boolean;
|
|
35
|
-
};
|
|
36
|
-
type WorkspaceHydrationMountReceipt = WorkspaceHydrationMountBasis & {
|
|
37
|
-
head: string;
|
|
38
|
-
};
|
|
39
|
-
export type WorkspaceHydrationReceipt = {
|
|
40
|
-
version: 3;
|
|
41
|
-
mounts: WorkspaceHydrationMountReceipt[];
|
|
42
|
-
/** Non-enumerable read-compat marker used only to finish a v1/v2 crash transition. */
|
|
43
|
-
legacyHead?: string;
|
|
44
|
-
};
|
|
45
|
-
type WorkspaceHydrationTransactionManifest = {
|
|
46
|
-
/** Version 5 makes guarded recovery explicit before any visible mutation. */
|
|
47
|
-
version: 3 | 4 | 5;
|
|
48
|
-
transactionId?: string;
|
|
49
|
-
targetReceipt: WorkspaceHydrationReceipt | null;
|
|
50
|
-
receiptBefore: WorkspaceHydrationReceipt | null;
|
|
51
|
-
mounts: Array<{
|
|
52
|
-
id: string;
|
|
53
|
-
incarnationKey: string;
|
|
54
|
-
sourcePath: string;
|
|
55
|
-
durabilityRootPath: string;
|
|
56
|
-
workspaceRelativePath: string;
|
|
57
|
-
existed: boolean;
|
|
58
|
-
snapshotName: string;
|
|
59
|
-
/**
|
|
60
|
-
* Present when the snapshot holds only the entries hydration replaces or
|
|
61
|
-
* removes, with the paths it creates listed. Without it the snapshot is a
|
|
62
|
-
* complete copy of the mount.
|
|
63
|
-
*/
|
|
64
|
-
scope?: WorkingTreeMirrorScope;
|
|
65
|
-
/** Required in v5: guarded mounts never enter unguarded snapshot restore. */
|
|
66
|
-
recovery?: "snapshot" | "guarded";
|
|
67
|
-
}>;
|
|
68
|
-
/** Settled rollback scopes remain evidence; they are never restored again. */
|
|
69
|
-
preservedMounts?: WorkspaceHydrationTransactionManifest["mounts"];
|
|
70
|
-
};
|
|
71
|
-
export type WorkspaceHydrationRecoveryRequired = {
|
|
72
|
-
transactionId: string;
|
|
73
|
-
transactionPath: string;
|
|
74
|
-
mounts: Array<Pick<WorkspaceHydrationTransactionManifest["mounts"][number], "id" | "incarnationKey" | "sourcePath" | "durabilityRootPath" | "workspaceRelativePath"> & {
|
|
75
|
-
retainedPaths?: string[];
|
|
76
|
-
}>;
|
|
77
|
-
receiptBefore: WorkspaceHydrationReceipt | null;
|
|
78
|
-
};
|
|
79
|
-
export declare class WorkspaceHydrationRecoveryRequiredError extends Error {
|
|
80
|
-
readonly hydrationRecovery: WorkspaceHydrationRecoveryRequired;
|
|
81
|
-
readonly code = "hydration_recovery_required";
|
|
82
|
-
constructor(hydrationRecovery: WorkspaceHydrationRecoveryRequired, options?: ErrorOptions);
|
|
83
|
-
}
|
|
84
|
-
export type WorkspaceHydrationPreservationResult = {
|
|
85
|
-
transactionId: string;
|
|
86
|
-
archivePath: string;
|
|
87
|
-
receiptBefore: WorkspaceHydrationReceipt | null;
|
|
88
|
-
preservedMountIds: string[];
|
|
89
|
-
alreadyPreserved: boolean;
|
|
90
|
-
retainedEntries?: Array<{
|
|
91
|
-
mountId: string;
|
|
92
|
-
sourcePath: string;
|
|
93
|
-
archivePath: string;
|
|
94
|
-
}>;
|
|
95
|
-
};
|
|
96
|
-
export type WorkspaceGitMount = {
|
|
97
|
-
id: string;
|
|
98
|
-
/** Durable logical incarnation (for example the project-branch row id). */
|
|
99
|
-
hydrationIncarnationKey: string;
|
|
100
|
-
sourcePath: string;
|
|
101
|
-
/** Existing managed root through which hydrated source directory entries are durably published. */
|
|
102
|
-
durabilityRootPath: string;
|
|
103
|
-
workspaceRelativePath: string;
|
|
104
|
-
sourceMode: WorkingTreeSourceMode;
|
|
105
|
-
hydrateDeletionMode: "all" | "git";
|
|
106
|
-
/**
|
|
107
|
-
* Only an exact creator-local unpublished mount may treat an absent outer
|
|
108
|
-
* subtree as bootstrap authority before this clone has a hydration receipt.
|
|
109
|
-
* Published/active mounts treat absence as a canonical deletion.
|
|
110
|
-
*/
|
|
111
|
-
preserveLocalOnInitialOuterAbsence?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Preserve a durably copied local tree across an exact checkout-path move.
|
|
114
|
-
* This is transient and must clear after that move is published.
|
|
115
|
-
*/
|
|
116
|
-
preserveLocalOnHydrationBasisChange?: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Workspace-relative path of the subtree this creator-local mount was copied
|
|
119
|
-
* from (its source branch checkout). While the mount's own outer subtree is
|
|
120
|
-
* still unpublished, the automatic diff-size guard measures it against that
|
|
121
|
-
* source subtree instead of counting the whole copied tree as new content.
|
|
122
|
-
*/
|
|
123
|
-
initialPublicationSourceRelativePath?: string;
|
|
124
|
-
/** Remove the outer-workspace subtree when the mounted source was intentionally deleted. */
|
|
125
|
-
deleteWhenSourceMissing?: boolean;
|
|
126
|
-
busy?: () => boolean;
|
|
127
|
-
/** Control-thread diagnostics only; never sent to a filesystem job. */
|
|
128
|
-
describeHolders?: () => string;
|
|
129
|
-
/** Monotonic/opaque visible-mutation token used to catch short writes that begin and end between busy checks. */
|
|
130
|
-
mutationToken?: () => string;
|
|
131
|
-
/**
|
|
132
|
-
* The token a completed cycle observed when it last projected this mount.
|
|
133
|
-
* While the current token still equals it and the mount's hydration basis
|
|
134
|
-
* is the outer HEAD being projected, the outer subtree already carries the
|
|
135
|
-
* visible bytes and the mirror copy is skipped. This is a cross-cycle skip
|
|
136
|
-
* only; the per-cycle busy and token re-checks are unchanged.
|
|
137
|
-
*/
|
|
138
|
-
lastProjectedMutationToken?: string;
|
|
139
|
-
/** Activity-only fence used before checkout readiness is established on reconnect. */
|
|
140
|
-
busyForRecovery?: () => boolean;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* The data of a mount, without its control-thread predicates. This is what a
|
|
144
|
-
* workspace filesystem job receives: a job never evaluates `busy()` or
|
|
145
|
-
* `mutationToken()`; the control thread evaluated them before dispatch and
|
|
146
|
-
* holds the mount (see WorkspaceHydrationTransactionHooks.holdMounts) until
|
|
147
|
-
* the job ends.
|
|
148
|
-
*/
|
|
149
|
-
export type WorkspaceGitMountData = Pick<WorkspaceGitMount, "id" | "hydrationIncarnationKey" | "sourcePath" | "durabilityRootPath" | "workspaceRelativePath" | "sourceMode" | "hydrateDeletionMode" | "preserveLocalOnInitialOuterAbsence" | "preserveLocalOnHydrationBasisChange" | "initialPublicationSourceRelativePath" | "deleteWhenSourceMissing" | "lastProjectedMutationToken">;
|
|
150
|
-
export declare function workspaceGitMountData(mount: WorkspaceGitMount): WorkspaceGitMountData;
|
|
151
|
-
/**
|
|
152
|
-
* Incident-bound configuration keeps project checkouts unready while the
|
|
153
|
-
* canonical remediation owns the workspace. The guarded remediation sync is
|
|
154
|
-
* nevertheless allowed to hydrate an existing checkout when its activity-only
|
|
155
|
-
* fence is clear; the ordinary `busy` predicate would mistake that deliberate
|
|
156
|
-
* unready state for concurrent visible work.
|
|
157
|
-
*/
|
|
158
|
-
export declare function workspaceGitMountsForRemediation(mounts: readonly WorkspaceGitMount[]): WorkspaceGitMount[];
|
|
159
|
-
export type WorkspaceHydrationTransactionContext = {
|
|
160
|
-
/** Unique per transaction; pairs the begin and end observations. */
|
|
161
|
-
transactionId: string;
|
|
162
|
-
workspacePath: string;
|
|
163
|
-
/** Mounts the transaction may hydrate or carry across the durability barrier. */
|
|
164
|
-
mountIds: string[];
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Observes a hydration transaction (snapshot, hydration pass, durability
|
|
168
|
-
* barrier, receipt) and fences the mounts any workspace filesystem job reads
|
|
169
|
-
* or writes. The body runs on the executor thread and on a stalled disk it
|
|
170
|
-
* can run for a long time. `beforeTransaction` is awaited after the last
|
|
171
|
-
* asynchronous precheck and before the final busy observation, so it may
|
|
172
|
-
* announce the operation and yield once; `afterTransaction` runs after the
|
|
173
|
-
* body committed or rolled back. `holdMounts` is called synchronously right
|
|
174
|
-
* after the busy observation that selected the mounts, before the job is
|
|
175
|
-
* dispatched, and its release is called when the job's result or failure
|
|
176
|
-
* arrived: while held, command admission for those mounts waits (see
|
|
177
|
-
* WorkspaceMountHoldFence), which replaces the guarantee the un-yielding body
|
|
178
|
-
* used to give.
|
|
179
|
-
*/
|
|
180
|
-
export type WorkspaceHydrationTransactionHooks = {
|
|
181
|
-
beforeTransaction: (context: WorkspaceHydrationTransactionContext) => Promise<void> | void;
|
|
182
|
-
afterTransaction: (context: WorkspaceHydrationTransactionContext) => void;
|
|
183
|
-
holdMounts: (mountIds: readonly string[], description: string) => () => void;
|
|
184
|
-
};
|
|
185
|
-
export type WorkspaceGitSyncOutcome = "no_change" | "updated" | "pushed" | "large_diff_blocked" | "conflict_blocked";
|
|
186
|
-
export type WorkspaceGitSyncResult = {
|
|
187
|
-
outcome: WorkspaceGitSyncOutcome;
|
|
188
|
-
startingHead: string | null;
|
|
189
|
-
/** The worker-local commit, including an unpublished blocked commit. */
|
|
190
|
-
localHead: string | null;
|
|
191
|
-
remoteHead: string | null;
|
|
192
|
-
publishedHead: string | null;
|
|
193
|
-
rebaseCount: number;
|
|
194
|
-
/**
|
|
195
|
-
* Bytes the automatic publication guard evaluated. A creator-local branch's
|
|
196
|
-
* first publication counts only its divergence from the source subtree.
|
|
197
|
-
*/
|
|
198
|
-
diffSizeBytes: number;
|
|
199
|
-
affectedPaths: string[];
|
|
200
|
-
activeMountIds: string[];
|
|
201
|
-
skippedMountIds: string[];
|
|
202
|
-
/**
|
|
203
|
-
* Mounts merge hydration pinned this cycle (a conflict between a write
|
|
204
|
-
* that landed after the projection read and the inbound change, or a write
|
|
205
|
-
* racing the hydration) and mounts the stale-rewrite detector refused to
|
|
206
|
-
* project, each with the paths involved. Worker-internal until the server
|
|
207
|
-
* contract carries it.
|
|
208
|
-
*/
|
|
209
|
-
mountSkipReasons?: WorkspaceMountSkipReasons;
|
|
210
|
-
/** Token each active mount carried when this cycle projected it; recorded by the caller to skip unchanged mounts later. */
|
|
211
|
-
projectedMutationTokens?: Record<string, string>;
|
|
212
|
-
/** Creator-local mounts whose first outer publication was measured against their source subtree. */
|
|
213
|
-
initialPublicationMountIds?: string[];
|
|
214
|
-
/** Network fetches of the outer workspace head this cycle ran; zero when the advertised head proved them unnecessary. */
|
|
215
|
-
remoteHeadFetches?: number;
|
|
216
|
-
conflictPaths?: string[];
|
|
217
|
-
conflictSnapshotRefs?: {
|
|
218
|
-
local: string;
|
|
219
|
-
remote: string;
|
|
220
|
-
};
|
|
221
|
-
conflictKind?: "integration_rebase" | "projection_merge";
|
|
222
|
-
verifiedAncestorHeads?: string[];
|
|
223
|
-
error?: string;
|
|
224
|
-
};
|
|
225
|
-
/** A guarded remediation was rejected before it was allowed to hydrate or publish. */
|
|
226
|
-
export declare class WorkspaceRemediationAncestryError extends Error {
|
|
227
|
-
constructor(message: string);
|
|
228
|
-
}
|
|
229
|
-
declare function gitCommandArgs(args: string[]): string[];
|
|
230
|
-
declare function workspaceCloneCommandArgs(args: string[], remoteUrl: string, credentialHelper?: string | null, credentialUsername?: string | null): string[];
|
|
231
|
-
export declare function workspaceGitHydrationIsCurrent(workspacePath: string, mounts?: readonly WorkspaceGitMount[]): boolean;
|
|
232
|
-
/**
|
|
233
|
-
* Failure-time variant of the currency check. A mount pinned at a valid
|
|
234
|
-
* recorded basis is convergent whether or not it is busy right now: the next
|
|
235
|
-
* cycle merges it forward from that exact basis and a genuine collision
|
|
236
|
-
* surfaces as a projection_merge conflict, never a silent overwrite. Live
|
|
237
|
-
* busy-ness must not decide safety here because the same disconnect that
|
|
238
|
-
* aborts a sync also clears the process/PTY maps busy-ness is computed from.
|
|
239
|
-
* Configuration-time recovery keeps the strict predicate.
|
|
240
|
-
*/
|
|
241
|
-
export declare function workspaceGitHydrationIsRecoverable(workspacePath: string, mounts?: readonly WorkspaceGitMount[]): boolean;
|
|
242
|
-
/** Executor job body: recover the durable boundary, then record the transition that follows. */
|
|
243
|
-
export declare function runCheckoutTransitionBeginJob(input: {
|
|
244
|
-
workspacePath: string;
|
|
245
|
-
}): null;
|
|
246
|
-
/** Executor job body: make the outer checkout durable and record its head as the durable boundary. */
|
|
247
|
-
export declare function runCheckoutTransitionCompleteJob(input: {
|
|
248
|
-
workspacePath: string;
|
|
249
|
-
}): null;
|
|
250
|
-
/** Executor job body: `recoverWorkspaceCheckoutDurability`. */
|
|
251
|
-
export declare function runCheckoutDurabilityRecoveryJob(input: {
|
|
252
|
-
workspacePath: string;
|
|
253
|
-
preserveResolutionInProgress: boolean;
|
|
254
|
-
}): null;
|
|
255
|
-
/** Executor job body: the outer-tree durability barrier alone. */
|
|
256
|
-
export declare function runOuterCheckoutFsyncJob(input: {
|
|
257
|
-
workspacePath: string;
|
|
258
|
-
}): null;
|
|
259
|
-
/** Read-only admission inspection, including before incident configuration fast paths. */
|
|
260
|
-
export declare function runHydrationRecoveryInspectJob(input: {
|
|
261
|
-
workspacePath: string;
|
|
262
|
-
}): WorkspaceHydrationRecoveryRequired | null;
|
|
263
|
-
/**
|
|
264
|
-
* Explicitly preserve an interrupted guarded transaction. The caller owns
|
|
265
|
-
* workspace admission/exclusion. No visible file is restored or deleted and
|
|
266
|
-
* no mount is receipted at the partially applied target head. The entire
|
|
267
|
-
* transaction directory is archived atomically, including snapshots and any
|
|
268
|
-
* interrupted manifest writes, before ordinary merge projection may resume.
|
|
269
|
-
*/
|
|
270
|
-
export declare function runHydrationPreserveInterruptedJob(input: {
|
|
271
|
-
workspacePath: string;
|
|
272
|
-
expectedTransactionId: string;
|
|
273
|
-
}): WorkspaceHydrationPreservationResult;
|
|
274
|
-
/** Everything the apply phase needs for a merge-hydrated mount, decided before the manifest was written. */
|
|
275
|
-
type WorkspaceHydrationMergePlan = {
|
|
276
|
-
prepared: PreparedWorkingTreeMirror;
|
|
277
|
-
decision: Extract<WorkspaceHydrationMergeDecision, {
|
|
278
|
-
kind: "apply";
|
|
279
|
-
}>;
|
|
280
|
-
plan: WorkingTreeMirrorPlan;
|
|
281
|
-
/** The mount's snapshot directory once the transaction directory is published. */
|
|
282
|
-
snapshotPath: string;
|
|
283
|
-
basis: WorkspaceHydrationMergeBasis;
|
|
284
|
-
};
|
|
285
|
-
declare function beginHydrationTransaction(workspacePath: string, mounts: readonly WorkspaceGitMount[], targetReceipt: WorkspaceHydrationReceipt | null, mergeBases?: Readonly<Record<string, WorkspaceHydrationMergeBasis>>): {
|
|
286
|
-
manifest: WorkspaceHydrationTransactionManifest;
|
|
287
|
-
durabilityScopes: Map<string, readonly string[]>;
|
|
288
|
-
mergePlans: Map<string, WorkspaceHydrationMergePlan>;
|
|
289
|
-
/** Mounts merge hydration decided not to touch; they have no snapshot, no manifest entry and keep their receipt entry. */
|
|
290
|
-
skippedMounts: WorkspaceHydrationMountSkip[];
|
|
291
|
-
targetReceipt: WorkspaceHydrationReceipt | null;
|
|
292
|
-
};
|
|
293
|
-
declare function configureWorkspaceRepository(input: {
|
|
294
|
-
workspacePath: string;
|
|
295
|
-
remoteUrl: string;
|
|
296
|
-
credentialHelper?: string | null;
|
|
297
|
-
credentialUsername?: string | null;
|
|
298
|
-
gitIdentity: {
|
|
299
|
-
name: string;
|
|
300
|
-
email: string;
|
|
301
|
-
};
|
|
302
|
-
}): Promise<void>;
|
|
303
|
-
/**
|
|
304
|
-
* Rebind only the existing canonical checkout's local Git configuration while
|
|
305
|
-
* an incident owns its HEAD. In particular, this deliberately does not fetch,
|
|
306
|
-
* recover durability, move refs, reset the index/worktree, or inspect/abort an
|
|
307
|
-
* in-progress merge or rebase.
|
|
308
|
-
*/
|
|
309
|
-
export declare function configureExistingWorkspaceGitForRemediation(input: {
|
|
310
|
-
workspacePath: string;
|
|
311
|
-
remoteUrl: string;
|
|
312
|
-
credentialHelper?: string | null;
|
|
313
|
-
credentialUsername?: string | null;
|
|
314
|
-
gitIdentity: {
|
|
315
|
-
name: string;
|
|
316
|
-
email: string;
|
|
317
|
-
};
|
|
318
|
-
}): Promise<void>;
|
|
319
|
-
export declare function ensureWorkspaceGitClone(input: {
|
|
320
|
-
workspacePath: string;
|
|
321
|
-
remoteUrl: string;
|
|
322
|
-
credentialHelper?: string | null;
|
|
323
|
-
credentialUsername?: string | null;
|
|
324
|
-
gitIdentity: {
|
|
325
|
-
name: string;
|
|
326
|
-
email: string;
|
|
327
|
-
};
|
|
328
|
-
preserveResolutionInProgress?: boolean;
|
|
329
|
-
/** Server-advertised head of the workspace remote; see resolveWorkspaceRemoteHead. */
|
|
330
|
-
advertisedRemoteHead?: string | null;
|
|
331
|
-
}): Promise<{
|
|
332
|
-
localHead: string | null;
|
|
333
|
-
remoteHead: string | null;
|
|
334
|
-
remoteHeadFetched: boolean;
|
|
335
|
-
}>;
|
|
336
|
-
type ProjectedMountGitlinks = {
|
|
337
|
-
mount: WorkspaceGitMount;
|
|
338
|
-
gitlinks: WorkingTreeGitlink[];
|
|
339
|
-
};
|
|
340
|
-
/**
|
|
341
|
-
* Mirror each mount's visible tree into the outer worktree. A submodule
|
|
342
|
-
* arrives as an empty directory plus a gitlink the caller must stage with
|
|
343
|
-
* `stageWorkspaceGitlinks` before `git add -A`, which can never create one.
|
|
344
|
-
*/
|
|
345
|
-
declare function mirrorMountsToWorkspace(workspacePath: string, mounts: readonly WorkspaceGitMount[], projectedFiles?: Map<string, ProjectedWorkingTreeEntry>): ProjectedMountGitlinks[];
|
|
346
|
-
/**
|
|
347
|
-
* Executor job body: the complete hydration transaction. Snapshot exactly
|
|
348
|
-
* what hydration replaces, hydrate, cross the durability barrier, write the
|
|
349
|
-
* commit marker, publish the receipt, remove the transaction; on failure
|
|
350
|
-
* restore the snapshot unless the visible tree is already durable. The write
|
|
351
|
-
* and fsync ordering is the one the control thread used to run inline.
|
|
352
|
-
*/
|
|
353
|
-
export declare function runHydrationTransactionJob(input: {
|
|
354
|
-
workspacePath: string;
|
|
355
|
-
hydrationMounts: readonly WorkspaceGitMountData[];
|
|
356
|
-
advancedDurabilityMounts: readonly WorkspaceGitMountData[];
|
|
357
|
-
targetReceipt: WorkspaceHydrationReceipt | null;
|
|
358
|
-
mergeBases?: Readonly<Record<string, WorkspaceHydrationMergeBasis>>;
|
|
359
|
-
}): {
|
|
360
|
-
hydratedMountIds: string[];
|
|
361
|
-
skippedMounts: WorkspaceHydrationMountSkip[];
|
|
362
|
-
hydratedPreBlobs: Record<string, Record<string, string>>;
|
|
363
|
-
};
|
|
364
|
-
/** Executor job body: hydrate visible mounts before an outer clone exists (no transaction to record). */
|
|
365
|
-
export declare function runHydrationRawJob(input: {
|
|
366
|
-
workspacePath: string;
|
|
367
|
-
mounts: readonly WorkspaceGitMountData[];
|
|
368
|
-
}): {
|
|
369
|
-
hydratedMountIds: string[];
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* Executor job body: checkout durability recovery, pending hydration
|
|
373
|
-
* transaction restore or completion, and basis-ref repair, in that order.
|
|
374
|
-
*/
|
|
375
|
-
export declare function runHydrationRecoveryJob(input: {
|
|
376
|
-
workspacePath: string;
|
|
377
|
-
preserveResolutionInProgress: boolean;
|
|
378
|
-
}): null;
|
|
379
|
-
export declare function hydrateWorkspaceGitMounts(workspacePath: string, mounts: readonly WorkspaceGitMount[], options?: {
|
|
380
|
-
ignoreBusy?: boolean;
|
|
381
|
-
hydrationHooks?: WorkspaceHydrationTransactionHooks;
|
|
382
|
-
}): Promise<{
|
|
383
|
-
hydratedMountIds: string[];
|
|
384
|
-
skippedMountIds: string[];
|
|
385
|
-
}>;
|
|
386
|
-
export declare function recoverWorkspaceGitHydration(workspacePath: string, mounts: readonly WorkspaceGitMount[], options?: {
|
|
387
|
-
ignoreBusy?: boolean;
|
|
388
|
-
deferMountIds?: ReadonlySet<string>;
|
|
389
|
-
preserveResolutionInProgress?: boolean;
|
|
390
|
-
preserveStaleBases?: boolean;
|
|
391
|
-
hydrationHooks?: WorkspaceHydrationTransactionHooks;
|
|
392
|
-
}): Promise<void>;
|
|
393
|
-
export declare function resetWorkspaceGit(input: {
|
|
394
|
-
workspacePath: string;
|
|
395
|
-
remoteUrl: string;
|
|
396
|
-
credentialHelper?: string | null;
|
|
397
|
-
credentialUsername?: string | null;
|
|
398
|
-
gitIdentity: {
|
|
399
|
-
name: string;
|
|
400
|
-
email: string;
|
|
401
|
-
};
|
|
402
|
-
mounts: readonly WorkspaceGitMount[];
|
|
403
|
-
hydrationHooks?: WorkspaceHydrationTransactionHooks;
|
|
404
|
-
}): Promise<{
|
|
405
|
-
startingHead: string | null;
|
|
406
|
-
localHead: string | null;
|
|
407
|
-
remoteHead: string | null;
|
|
408
|
-
discardedPaths: string[];
|
|
409
|
-
activeMountIds: string[];
|
|
410
|
-
skippedMountIds: string[];
|
|
411
|
-
}>;
|
|
412
|
-
/**
|
|
413
|
-
* Bytes of the raw `git diff --binary` between two revisions, capped at
|
|
414
|
-
* `limit + 1`. `pathspecs` narrows what is measured; callers pass
|
|
415
|
-
* `:(exclude,literal)<path>` for paths whose text is not publication content,
|
|
416
|
-
* such as a subtree a gitlink replaces (see `pathsReplacedByGitlinks`).
|
|
417
|
-
*/
|
|
418
|
-
declare function diffSizeBytes(workspacePath: string, baseRevision: string | null, headRevision: string, limit: number, pathspecs?: readonly string[]): Promise<number>;
|
|
419
|
-
export type SynchronizeWorkspaceGitInput = {
|
|
420
|
-
attemptId?: string;
|
|
421
|
-
workerLabel: string;
|
|
422
|
-
workspacePath: string;
|
|
423
|
-
remoteUrl: string;
|
|
424
|
-
credentialHelper?: string | null;
|
|
425
|
-
credentialUsername?: string | null;
|
|
426
|
-
gitIdentity: {
|
|
427
|
-
name: string;
|
|
428
|
-
email: string;
|
|
429
|
-
};
|
|
430
|
-
mounts: readonly WorkspaceGitMount[];
|
|
431
|
-
commitDetail?: string;
|
|
432
|
-
allowLargeDiff?: boolean;
|
|
433
|
-
maxDiffBytes?: number;
|
|
434
|
-
maxPushAttempts?: number;
|
|
435
|
-
/** Publish edits already made in the outer clone without first projecting visible mounts over them. */
|
|
436
|
-
skipMountMirror?: boolean;
|
|
437
|
-
/** Positive ancestry proof required before a remediation may integrate, publish, or hydrate. */
|
|
438
|
-
requiredAncestorHeads?: readonly string[];
|
|
439
|
-
/**
|
|
440
|
-
* Head of the workspace remote as the server last read it from disk. Equal
|
|
441
|
-
* to the local remote-tracking ref, it lets the cycle skip its workspace
|
|
442
|
-
* head fetches; see resolveWorkspaceRemoteHead. Omit to always fetch.
|
|
443
|
-
*/
|
|
444
|
-
advertisedRemoteHead?: string | null;
|
|
445
|
-
/** Revalidate the worker/config/incident generation after every async boundary. */
|
|
446
|
-
assertStillAdmitted?: () => void;
|
|
447
|
-
/** Test seam for exercising an incident transition during asynchronous diff measurement. */
|
|
448
|
-
measureDiffSize?: typeof diffSizeBytes;
|
|
449
|
-
afterWorkspacePublished?: (context: {
|
|
450
|
-
publishedHead: string;
|
|
451
|
-
activeMountIds: string[];
|
|
452
|
-
}) => void | Promise<void>;
|
|
453
|
-
/** Announces each synchronous hydration transaction of this cycle; see WorkspaceHydrationTransactionHooks. */
|
|
454
|
-
hydrationHooks?: WorkspaceHydrationTransactionHooks;
|
|
455
|
-
};
|
|
456
|
-
export declare function synchronizeWorkspaceGit(input: SynchronizeWorkspaceGitInput): Promise<WorkspaceGitSyncResult>;
|
|
457
|
-
/** Executor job body: byte-mirror one visible mount into the outer checkout, recording what it read. */
|
|
458
|
-
export declare function runProjectionMirrorJob(input: {
|
|
459
|
-
workspacePath: string;
|
|
460
|
-
mount: WorkspaceGitMountData;
|
|
461
|
-
staleRewriteBlobs?: Record<string, string>;
|
|
462
|
-
}): {
|
|
463
|
-
gitlinks: WorkingTreeGitlink[];
|
|
464
|
-
projectedFiles: Record<string, ProjectedWorkingTreeEntry>;
|
|
465
|
-
readAtMs: number;
|
|
466
|
-
staleRewritePaths: string[];
|
|
467
|
-
staleRewriteCleared: string[];
|
|
468
|
-
};
|
|
469
|
-
/** Executor job body: outer-tree edits that follow the mirrors, in the cycle's order. */
|
|
470
|
-
export declare function runProjectionOuterApplyJob(input: {
|
|
471
|
-
workspacePath: string;
|
|
472
|
-
removeMounts: readonly WorkspaceGitMountData[];
|
|
473
|
-
materialize: ReadonlyArray<{
|
|
474
|
-
workspaceRelativePath: string;
|
|
475
|
-
resultTree: string;
|
|
476
|
-
}>;
|
|
477
|
-
restoreFromHead: readonly WorkspaceGitMountData[];
|
|
478
|
-
}): null;
|
|
479
|
-
/** Executor job body: persist projected visible mounts, then publish the projection receipt. */
|
|
480
|
-
export declare function runProjectionReceiptJob(input: {
|
|
481
|
-
workspacePath: string;
|
|
482
|
-
fsyncMounts: readonly WorkspaceGitMountData[];
|
|
483
|
-
receipt: WorkspaceHydrationReceipt;
|
|
484
|
-
}): null;
|
|
485
|
-
export declare const workspaceGitSyncTestHarness: {
|
|
486
|
-
beginHydrationTransaction: typeof beginHydrationTransaction;
|
|
487
|
-
commandArgs: typeof gitCommandArgs;
|
|
488
|
-
workspaceCloneCommandArgs: typeof workspaceCloneCommandArgs;
|
|
489
|
-
configureWorkspaceRepository: typeof configureWorkspaceRepository;
|
|
490
|
-
mirrorMountsToWorkspace: typeof mirrorMountsToWorkspace;
|
|
491
|
-
hydrateMountsFromWorkspace: typeof hydrateWorkspaceGitMounts;
|
|
492
|
-
hydrationPreBlobLedger: typeof hydrationPreBlobLedger;
|
|
493
|
-
resetHydrationPreBlobLedgers(): void;
|
|
494
|
-
};
|
|
495
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blob ids of the bytes merge hydration replaced in a checkout, kept in
|
|
3
|
-
* memory per mount incarnation until a later hydration of the same path
|
|
4
|
-
* replaces them or the mount is hydrated outside a cycle (recovery, reset,
|
|
5
|
-
* configuration), which rewrites the checkout without recording anything.
|
|
6
|
-
*
|
|
7
|
-
* The projection reads it as the stale-rewrite detector
|
|
8
|
-
* (docs/merge-hydration-design.md §3.3): a process that read a file before a
|
|
9
|
-
* hydration and re-emits the same bytes afterwards would otherwise publish a
|
|
10
|
-
* revert of the inbound change as an ordinary local edit. A changed file whose
|
|
11
|
-
* content hashes to the blob hydration replaced is exactly that, so the mount
|
|
12
|
-
* is pinned instead of published, loudly.
|
|
13
|
-
*
|
|
14
|
-
* Deliberately not persisted: a restart loses the entries and the detector is
|
|
15
|
-
* best effort. Phase 2 of the design turns this into a durable ledger if
|
|
16
|
-
* telemetry warrants it.
|
|
17
|
-
*/
|
|
18
|
-
export declare class WorkspaceHydrationPreBlobLedger {
|
|
19
|
-
private readonly mounts;
|
|
20
|
-
private static key;
|
|
21
|
-
/** Blob ids by mount-relative path for the mount, or an empty map. */
|
|
22
|
-
preBlobs(mount: {
|
|
23
|
-
id: string;
|
|
24
|
-
hydrationIncarnationKey: string;
|
|
25
|
-
}): ReadonlyMap<string, string>;
|
|
26
|
-
/** Record the pre-hydration blob of every path a merge hydration replaced; earlier entries for other paths are kept. */
|
|
27
|
-
record(mount: {
|
|
28
|
-
id: string;
|
|
29
|
-
hydrationIncarnationKey: string;
|
|
30
|
-
}, preBlobs: ReadonlyMap<string, string> | Readonly<Record<string, string>>): void;
|
|
31
|
-
/** Forget the mount: its checkout was rewritten by something this ledger did not observe. */
|
|
32
|
-
clearMount(mount: {
|
|
33
|
-
id: string;
|
|
34
|
-
hydrationIncarnationKey: string;
|
|
35
|
-
}): void;
|
|
36
|
-
/** Forget paths whose checkout content moved on from the hydrated bytes: a later return to the old bytes is a deliberate edit. */
|
|
37
|
-
forget(mount: {
|
|
38
|
-
id: string;
|
|
39
|
-
hydrationIncarnationKey: string;
|
|
40
|
-
}, paths: readonly string[]): void;
|
|
41
|
-
clear(): void;
|
|
42
|
-
get size(): number;
|
|
43
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { type PreparedWorkingTreeMirror, type ProjectedWorkingTreeEntry, type WorkingTreeMirrorOverride, type WorkingTreeMirrorSelection } from "./working-tree-mirror";
|
|
3
|
-
/**
|
|
4
|
-
* Where a mount's bytes were read this cycle (docs/merge-hydration-design.md
|
|
5
|
-
* §2.1). `projectedCommit` is the commit whose subtree at the mount path is
|
|
6
|
-
* exactly what projection read: the projected head for a mirrored mount, the
|
|
7
|
-
* synthesized ours commit for a merge-projected one. `projectedFiles` is
|
|
8
|
-
* what the mirror or synthesis saw for each entry, or null when the mount was
|
|
9
|
-
* not read this cycle (its token was unchanged), in which case a changed
|
|
10
|
-
* file is recognized by hashing it against the projected blob.
|
|
11
|
-
*/
|
|
12
|
-
export type WorkspaceHydrationMergeBasis = {
|
|
13
|
-
projectedCommit: string;
|
|
14
|
-
projectedFiles: Record<string, ProjectedWorkingTreeEntry> | null;
|
|
15
|
-
/**
|
|
16
|
-
* Wall-clock time the projection finished reading. A projected stat whose
|
|
17
|
-
* timestamps fall within `RACY_PROJECTION_WINDOW_MS` of it is not trusted
|
|
18
|
-
* to prove the file unchanged (git's racy-clean rule: a rewrite of the
|
|
19
|
-
* same size in the same coarse timestamp tick leaves the stat intact), so
|
|
20
|
-
* such a file is hashed against the projected blob instead.
|
|
21
|
-
*/
|
|
22
|
-
readAtMs?: number;
|
|
23
|
-
};
|
|
24
|
-
export declare const RACY_PROJECTION_WINDOW_MS = 2000;
|
|
25
|
-
export type WorkspaceHydrationSkipReason = "hydration_merge_conflict" | "hydration_target_changed";
|
|
26
|
-
/** A mount merge hydration left at its previous receipt entry, and why. */
|
|
27
|
-
export type WorkspaceHydrationMountSkip = {
|
|
28
|
-
mountId: string;
|
|
29
|
-
reason: WorkspaceHydrationSkipReason;
|
|
30
|
-
paths: string[];
|
|
31
|
-
};
|
|
32
|
-
/** One path whose blob differs between the projected subtree (base) and the hydration head's subtree (theirs). */
|
|
33
|
-
export type WorkspaceSubtreeChange = {
|
|
34
|
-
base: {
|
|
35
|
-
mode: string;
|
|
36
|
-
objectId: string;
|
|
37
|
-
} | null;
|
|
38
|
-
theirs: {
|
|
39
|
-
mode: string;
|
|
40
|
-
objectId: string;
|
|
41
|
-
} | null;
|
|
42
|
-
};
|
|
43
|
-
export type WorkspaceHydrationMergeDecision = {
|
|
44
|
-
kind: "conflict";
|
|
45
|
-
paths: string[];
|
|
46
|
-
} | {
|
|
47
|
-
kind: "target_changed";
|
|
48
|
-
paths: string[];
|
|
49
|
-
} | {
|
|
50
|
-
kind: "apply";
|
|
51
|
-
selection: WorkingTreeMirrorSelection;
|
|
52
|
-
overrides: Map<string, WorkingTreeMirrorOverride>;
|
|
53
|
-
/** The target `lstat` (or absence) every mutated path must still show when it is mutated. */
|
|
54
|
-
expectations: Map<string, fs.Stats | null>;
|
|
55
|
-
/** Blob of the bytes each written or removed path held before hydration; the stale-rewrite detector's input. */
|
|
56
|
-
preBlobs: Map<string, string>;
|
|
57
|
-
/** Paths whose content was three-way merged. */
|
|
58
|
-
mergedPaths: string[];
|
|
59
|
-
/** Paths the checkout changed since projection that hydration leaves as they are. */
|
|
60
|
-
keptPaths: string[];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Decide, per path the hydration head changed relative to what projection
|
|
64
|
-
* read, whether hydration writes theirs (the checkout is unchanged there),
|
|
65
|
-
* leaves the checkout alone (theirs did not change there), writes a
|
|
66
|
-
* three-way merge, or cannot proceed (docs/merge-hydration-design.md §2.2,
|
|
67
|
-
* §2.6). Every path the checkout changed since projection that the head did
|
|
68
|
-
* not change survives untouched, including files created since. Nothing is
|
|
69
|
-
* written here; the result drives `applyWorkingTreeMirror` under guards that
|
|
70
|
-
* re-check each path's `lstat` immediately before mutating it.
|
|
71
|
-
*/
|
|
72
|
-
export declare function decideWorkspaceHydrationMerge(input: {
|
|
73
|
-
prepared: PreparedWorkingTreeMirror;
|
|
74
|
-
changes: ReadonlyMap<string, WorkspaceSubtreeChange>;
|
|
75
|
-
projectedFiles: Readonly<Record<string, ProjectedWorkingTreeEntry>> | null;
|
|
76
|
-
readAtMs?: number;
|
|
77
|
-
/** Blob contents by object id, in one batch. */
|
|
78
|
-
readBaseBlobs: (objectIds: readonly string[]) => Map<string, Buffer>;
|
|
79
|
-
/** Paths marked -diff on either side must never enter the text merger. */
|
|
80
|
-
readBinaryPaths?: (relativePaths: readonly string[]) => ReadonlySet<string>;
|
|
81
|
-
}): WorkspaceHydrationMergeDecision;
|
|
82
|
-
/** Batch attribute reads, with NUL delimiters so arbitrary Git filenames stay intact. */
|
|
83
|
-
export declare function readHydrationBinaryPaths(input: {
|
|
84
|
-
checkoutRoot: string;
|
|
85
|
-
outerRoot: string;
|
|
86
|
-
relativePaths: readonly string[];
|
|
87
|
-
}): Set<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Parse `git diff-tree -r -z --no-renames --raw <base tree> <theirs tree>`
|
|
90
|
-
* output into per-path changes. Records come in pairs: the status line
|
|
91
|
-
* (`:<base mode> <theirs mode> <base id> <theirs id> <status>`) and the path.
|
|
92
|
-
*/
|
|
93
|
-
export declare function parseWorkspaceSubtreeChanges(raw: Buffer): Map<string, WorkspaceSubtreeChange>;
|
|
94
|
-
/** The mount-relative path of a checkout entry as its absolute path, for diagnostics. */
|
|
95
|
-
export declare function describeHydrationSkipPaths(mountSourcePath: string, paths: readonly string[]): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Wire evidence owned by the standalone worker package; no API runtime dependency. */
|
|
2
|
-
export type WorkerHydrationRecovery = {
|
|
3
|
-
transactionId: string;
|
|
4
|
-
transactionPath: string;
|
|
5
|
-
mountIds: string[];
|
|
6
|
-
previousHeads: Record<string, string>;
|
|
7
|
-
retainedPaths?: string[];
|
|
8
|
-
};
|
|
9
|
-
/** Extract durable recovery evidence even through executor/AggregateError wrapping. */
|
|
10
|
-
export declare function findHydrationRecovery(error: unknown): WorkerHydrationRecovery | undefined;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type WorkspaceIncidentUpdate = {
|
|
2
|
-
incidentId: string | null;
|
|
3
|
-
status: "remediating" | "waiting_for_worker" | "resolved" | "confirmed" | "reset" | null;
|
|
4
|
-
};
|
|
5
|
-
export declare function applyWorkspaceIncidentUpdate(currentIncidentId: string | null, update: WorkspaceIncidentUpdate): string | null;
|
|
6
|
-
/**
|
|
7
|
-
* Whether an incoming `workspace_config` is the full configuration a terminal
|
|
8
|
-
* incident update promised: the worker still holds an incident-deferred
|
|
9
|
-
* configuration, no incident is active any more, and the server did not ask
|
|
10
|
-
* for another deferral. Arrival of that configuration disarms the refresh
|
|
11
|
-
* watchdog; from then on the configuration's own generation checks and its
|
|
12
|
-
* failure close govern, so a legitimately long full configuration is never
|
|
13
|
-
* cut off mid-flight by the arrival timer.
|
|
14
|
-
*/
|
|
15
|
-
export declare function workspaceConfigurationRefreshesDeferredConfiguration(input: {
|
|
16
|
-
deferredIncidentId: string | null;
|
|
17
|
-
activeIncidentId: string | null;
|
|
18
|
-
requestedDeferredIncidentId: string | undefined;
|
|
19
|
-
}): boolean;
|