@hearsay-tools/squawk 0.18.0-dev.7915 → 0.18.0-dev.7926
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/dist/ci-wait/tools.d.ts +4 -4
- package/dist/core/agent-runner.d.ts +2 -2
- package/dist/core/runner-definition.d.ts +3 -1
- package/dist/core/runner-definition.js.map +1 -1
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/project-migration/auto.js +30 -13
- package/dist/project-migration/auto.js.map +1 -1
- package/dist/project-migration/live.d.ts +9 -0
- package/dist/project-migration/live.js +58 -1
- package/dist/project-migration/live.js.map +1 -1
- package/dist/project-migration/pending.d.ts +10 -0
- package/dist/project-migration/pending.js +57 -0
- package/dist/project-migration/pending.js.map +1 -0
- package/dist/project-migration/plan.d.ts +3 -0
- package/dist/project-migration/plan.js +1 -1
- package/dist/project-migration/plan.js.map +1 -1
- package/dist/project-paths.d.ts +2 -0
- package/dist/project-paths.js +7 -4
- package/dist/project-paths.js.map +1 -1
- package/dist/runners/acp/events.d.ts +2 -1
- package/dist/runners/acp/events.js +4 -1
- package/dist/runners/acp/events.js.map +1 -1
- package/dist/runners/acp/session.d.ts +9 -1
- package/dist/runners/acp/session.js +35 -7
- package/dist/runners/acp/session.js.map +1 -1
- package/dist/runners/antigravity/antigravity-session.d.ts +3 -2
- package/dist/runners/antigravity/antigravity-session.js +7 -6
- package/dist/runners/antigravity/antigravity-session.js.map +1 -1
- package/dist/runners/antigravity/facts.js +2 -0
- package/dist/runners/antigravity/facts.js.map +1 -1
- package/dist/runners/antigravity/mock.d.ts +9 -9
- package/dist/runners/antigravity/mock.js +9 -9
- package/dist/runners/antigravity/mock.js.map +1 -1
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +98 -98
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/package.json +4 -4
package/dist/ci-wait/tools.d.ts
CHANGED
|
@@ -263,10 +263,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
263
263
|
}[];
|
|
264
264
|
isError: boolean;
|
|
265
265
|
details: {
|
|
266
|
-
ok: false;
|
|
267
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
268
|
-
message: string;
|
|
269
|
-
} | {
|
|
270
266
|
ok: true;
|
|
271
267
|
task: {
|
|
272
268
|
id: string;
|
|
@@ -278,6 +274,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
278
274
|
url?: string | undefined;
|
|
279
275
|
};
|
|
280
276
|
note: string;
|
|
277
|
+
} | {
|
|
278
|
+
ok: false;
|
|
279
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
280
|
+
message: string;
|
|
281
281
|
};
|
|
282
282
|
}>;
|
|
283
283
|
export declare function invokeScheduledTasksTool(input: unknown): Promise<{
|
|
@@ -341,8 +341,8 @@ interface InputDeliveryFacts {
|
|
|
341
341
|
/**
|
|
342
342
|
* What resolves `sendAgentMessage`'s Promise (hearsay-tools/cezarion#2991). `write`: the local
|
|
343
343
|
* pipe write, so the provider can neither delay nor reject it (Claude's stdin). `response`: a
|
|
344
|
-
* native
|
|
345
|
-
*
|
|
344
|
+
* native signal the provider can delay or reject (an RPC result, an HTTP acknowledgement, a
|
|
345
|
+
* prompt response id, or the first agent update in the ACP turn a prompt opens).
|
|
346
346
|
*/
|
|
347
347
|
readonly acknowledgement: 'write' | 'response';
|
|
348
348
|
/** The native mechanism. Documentation only: no code branches on it. */
|
|
@@ -78,7 +78,9 @@ export interface RunnerMock {
|
|
|
78
78
|
/** Permission-policy runners prove tool admission through recorded native responses. */
|
|
79
79
|
readonly toolGrantObservation?: 'permission-policy';
|
|
80
80
|
/** ACP idle session/prompt replies are turn completion, not an independent receipt
|
|
81
|
-
* (Antigravity CLI cli-prompt-*.ndjson in its recorded fixtures).
|
|
81
|
+
* (Antigravity CLI cli-prompt-*.ndjson in its recorded fixtures). The turn's first agent work
|
|
82
|
+
* acknowledges the prompt, so the mock's `hold-ack` holds only the turn end and its
|
|
83
|
+
* `hold-response` holds the acknowledgement. */
|
|
82
84
|
readonly promptResponseEndsTurn?: true;
|
|
83
85
|
readonly defaultApprovalEcho?: string;
|
|
84
86
|
/** The env var the runner reads to locate its binary; a test points it at the mock script. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-definition.js","sourceRoot":"","sources":["../../src/core/runner-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner-definition.js","sourceRoot":"","sources":["../../src/core/runner-definition.ts"],"names":[],"mappings":"AA+UA,0BAA0B;AAC1B,MAAM,UAAU,YAAY,CAAC,UAA4B;IACvD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -27,18 +27,6 @@ export declare function delegationFailure(error: unknown): {
|
|
|
27
27
|
export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
|
|
28
28
|
"/list": {
|
|
29
29
|
$get: {
|
|
30
|
-
output: {
|
|
31
|
-
error: string;
|
|
32
|
-
code?: "invalid_input" | undefined;
|
|
33
|
-
};
|
|
34
|
-
outputFormat: "json";
|
|
35
|
-
status: 400;
|
|
36
|
-
input: {
|
|
37
|
-
query: {
|
|
38
|
-
offset?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
30
|
output: {
|
|
43
31
|
workers: {
|
|
44
32
|
workerId: string;
|
|
@@ -85,6 +73,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
85
73
|
offset?: string | undefined;
|
|
86
74
|
};
|
|
87
75
|
};
|
|
76
|
+
} | {
|
|
77
|
+
output: {
|
|
78
|
+
error: string;
|
|
79
|
+
code?: "invalid_input" | undefined;
|
|
80
|
+
};
|
|
81
|
+
outputFormat: "json";
|
|
82
|
+
status: 400;
|
|
83
|
+
input: {
|
|
84
|
+
query: {
|
|
85
|
+
offset?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
} & {
|
|
@@ -629,18 +629,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
629
629
|
} & {
|
|
630
630
|
"/:workerId": {
|
|
631
631
|
$get: {
|
|
632
|
-
output: {
|
|
633
|
-
error: string;
|
|
634
|
-
code?: "invalid_input" | undefined;
|
|
635
|
-
};
|
|
636
|
-
outputFormat: "json";
|
|
637
|
-
status: 400;
|
|
638
|
-
input: {
|
|
639
|
-
param: {
|
|
640
|
-
workerId: string;
|
|
641
|
-
};
|
|
642
|
-
};
|
|
643
|
-
} | {
|
|
644
632
|
output: {
|
|
645
633
|
workerId: string;
|
|
646
634
|
settled: boolean;
|
|
@@ -758,11 +746,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
758
746
|
workerId: string;
|
|
759
747
|
};
|
|
760
748
|
};
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
} & {
|
|
764
|
-
"/:workerId/collect": {
|
|
765
|
-
$post: {
|
|
749
|
+
} | {
|
|
766
750
|
output: {
|
|
767
751
|
error: string;
|
|
768
752
|
code?: "invalid_input" | undefined;
|
|
@@ -773,10 +757,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
773
757
|
param: {
|
|
774
758
|
workerId: string;
|
|
775
759
|
};
|
|
776
|
-
} & {
|
|
777
|
-
json: Record<string, never>;
|
|
778
760
|
};
|
|
779
|
-
}
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
} & {
|
|
764
|
+
"/:workerId/collect": {
|
|
765
|
+
$post: {
|
|
780
766
|
output: {
|
|
781
767
|
workerId: string;
|
|
782
768
|
parentRunId: string;
|
|
@@ -899,11 +885,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
899
885
|
} & {
|
|
900
886
|
json: Record<string, never>;
|
|
901
887
|
};
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
} & {
|
|
905
|
-
"/:workerId/steer": {
|
|
906
|
-
$post: {
|
|
888
|
+
} | {
|
|
907
889
|
output: {
|
|
908
890
|
error: string;
|
|
909
891
|
code?: "invalid_input" | undefined;
|
|
@@ -915,11 +897,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
915
897
|
workerId: string;
|
|
916
898
|
};
|
|
917
899
|
} & {
|
|
918
|
-
json:
|
|
919
|
-
text: string;
|
|
920
|
-
};
|
|
900
|
+
json: Record<string, never>;
|
|
921
901
|
};
|
|
922
|
-
}
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
} & {
|
|
905
|
+
"/:workerId/steer": {
|
|
906
|
+
$post: {
|
|
923
907
|
output: {
|
|
924
908
|
workerId: string;
|
|
925
909
|
state: "delivered" | "queued";
|
|
@@ -935,11 +919,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
935
919
|
text: string;
|
|
936
920
|
};
|
|
937
921
|
};
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
} & {
|
|
941
|
-
"/:workerId/stop": {
|
|
942
|
-
$post: {
|
|
922
|
+
} | {
|
|
943
923
|
output: {
|
|
944
924
|
error: string;
|
|
945
925
|
code?: "invalid_input" | undefined;
|
|
@@ -951,9 +931,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
951
931
|
workerId: string;
|
|
952
932
|
};
|
|
953
933
|
} & {
|
|
954
|
-
json:
|
|
934
|
+
json: {
|
|
935
|
+
text: string;
|
|
936
|
+
};
|
|
955
937
|
};
|
|
956
|
-
}
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
} & {
|
|
941
|
+
"/:workerId/stop": {
|
|
942
|
+
$post: {
|
|
957
943
|
output: {
|
|
958
944
|
workerId: string;
|
|
959
945
|
state: "stopping" | "terminated";
|
|
@@ -967,11 +953,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
967
953
|
} & {
|
|
968
954
|
json: Record<string, never>;
|
|
969
955
|
};
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
} & {
|
|
973
|
-
"/:workerId/destroy": {
|
|
974
|
-
$post: {
|
|
956
|
+
} | {
|
|
975
957
|
output: {
|
|
976
958
|
error: string;
|
|
977
959
|
code?: "invalid_input" | undefined;
|
|
@@ -983,11 +965,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
983
965
|
workerId: string;
|
|
984
966
|
};
|
|
985
967
|
} & {
|
|
986
|
-
json:
|
|
987
|
-
discardWork?: true | undefined;
|
|
988
|
-
};
|
|
968
|
+
json: Record<string, never>;
|
|
989
969
|
};
|
|
990
|
-
}
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
} & {
|
|
973
|
+
"/:workerId/destroy": {
|
|
974
|
+
$post: {
|
|
991
975
|
output: {
|
|
992
976
|
workerId: string;
|
|
993
977
|
state: "complete" | "incomplete";
|
|
@@ -1016,6 +1000,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1016
1000
|
discardWork?: true | undefined;
|
|
1017
1001
|
};
|
|
1018
1002
|
};
|
|
1003
|
+
} | {
|
|
1004
|
+
output: {
|
|
1005
|
+
error: string;
|
|
1006
|
+
code?: "invalid_input" | undefined;
|
|
1007
|
+
};
|
|
1008
|
+
outputFormat: "json";
|
|
1009
|
+
status: 400;
|
|
1010
|
+
input: {
|
|
1011
|
+
param: {
|
|
1012
|
+
workerId: string;
|
|
1013
|
+
};
|
|
1014
|
+
} & {
|
|
1015
|
+
json: {
|
|
1016
|
+
discardWork?: true | undefined;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
1019
|
} | {
|
|
1020
1020
|
output: {
|
|
1021
1021
|
workerId: string;
|
|
@@ -1051,11 +1051,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1051
1051
|
"/:workerId/diff": {
|
|
1052
1052
|
$get: {
|
|
1053
1053
|
output: {
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
workerId: string;
|
|
1055
|
+
baselineSha: string;
|
|
1056
|
+
diff: string;
|
|
1057
|
+
truncated: boolean;
|
|
1056
1058
|
};
|
|
1057
1059
|
outputFormat: "json";
|
|
1058
|
-
status:
|
|
1060
|
+
status: 200;
|
|
1059
1061
|
input: {
|
|
1060
1062
|
param: {
|
|
1061
1063
|
workerId: string;
|
|
@@ -1063,13 +1065,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1063
1065
|
};
|
|
1064
1066
|
} | {
|
|
1065
1067
|
output: {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
diff: string;
|
|
1069
|
-
truncated: boolean;
|
|
1068
|
+
error: string;
|
|
1069
|
+
code?: "invalid_input" | undefined;
|
|
1070
1070
|
};
|
|
1071
1071
|
outputFormat: "json";
|
|
1072
|
-
status:
|
|
1072
|
+
status: 400;
|
|
1073
1073
|
input: {
|
|
1074
1074
|
param: {
|
|
1075
1075
|
workerId: string;
|
|
@@ -6,7 +6,8 @@ import { CockpitOwnership, migrationFencePaths } from '../server/cockpit-ownersh
|
|
|
6
6
|
import { ProjectMigrationRefusedError, resolveKeptRunIds } from './engine.js';
|
|
7
7
|
import { projectCockpits, projectForeignTasksOffline } from './live.js';
|
|
8
8
|
import { moveUnderFence } from './offline.js';
|
|
9
|
-
import { LEGACY_PROJECT_DIR,
|
|
9
|
+
import { LEGACY_PROJECT_DIR, planProjectMigration } from './plan.js';
|
|
10
|
+
import { legacyMoveWorkLeft } from './pending.js';
|
|
10
11
|
import { ProjectMigrationRecoveryError, recoverProjectMigration } from './recovery.js';
|
|
11
12
|
import { automationLeaseHeld } from '../automations/store.js';
|
|
12
13
|
/** Each cockpit run's (its ownership's) attempt per project: no retry loop inside one run, and a
|
|
@@ -28,43 +29,56 @@ async function blocker(root, homes) {
|
|
|
28
29
|
function refusal(plan) {
|
|
29
30
|
return [...plan.blockers, ...plan.conflicts.map(conflict => `${conflict.path}: ${conflict.reason}`)].join('; ');
|
|
30
31
|
}
|
|
32
|
+
const errorText = (error) => error instanceof Error ? error.message : String(error);
|
|
31
33
|
/**
|
|
32
|
-
* 'nothing' when there is nothing to move, a reason when the move must wait, or undefined to go
|
|
33
|
-
*
|
|
34
|
+
* 'nothing' when there is nothing to move, a reason when the move must wait, or undefined to go
|
|
35
|
+
* ahead. With no other writer live, the plan runs once, in the move under the fence, which refuses
|
|
36
|
+
* a plan with a blocker or conflict before its journal exists. With one live, the move waits; the
|
|
37
|
+
* plan runs here only so that a refusal the operator must fix first is named instead.
|
|
34
38
|
*/
|
|
35
39
|
async function precheck(root, homes) {
|
|
40
|
+
// An unmarked project moves while its `.ai/cezar/` exists, even with nothing in it to carry: the move marks it.
|
|
41
|
+
if (!projectMoveMarked(root) && !pathPresent(join(root, ...LEGACY_PROJECT_DIR.split('/'))))
|
|
42
|
+
return 'nothing';
|
|
43
|
+
const live = await blocker(root, homes).catch(errorText);
|
|
44
|
+
if (!live)
|
|
45
|
+
return undefined;
|
|
36
46
|
try {
|
|
37
47
|
const plan = await planProjectMigration(root, { keep: await resolveKeptRunIds({ repoRoot: root }) });
|
|
38
48
|
const refused = refusal(plan);
|
|
39
49
|
if (refused)
|
|
40
50
|
return { reason: refused };
|
|
41
|
-
|
|
42
|
-
if (plan.alreadyMoved || (!projectMoveMarked(root) && !pathPresent(plan.source)))
|
|
51
|
+
if (plan.alreadyMoved)
|
|
43
52
|
return 'nothing';
|
|
44
|
-
|
|
45
|
-
return live ? { reason: live } : undefined;
|
|
53
|
+
return { reason: live };
|
|
46
54
|
}
|
|
47
55
|
catch (error) {
|
|
56
|
+
// As in the move itself, a plan refused anyway names its own refusal, not a failure to read the kept tasks.
|
|
48
57
|
if (error instanceof ProjectMigrationRefusedError)
|
|
49
58
|
return { reason: refusal(error.plan) };
|
|
50
|
-
return { reason:
|
|
59
|
+
return { reason: errorText(error) };
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
/**
|
|
54
63
|
* The move under `ownership`'s fence. Any failure before the journal exists (a refusal, a race, a
|
|
55
64
|
* file system error claiming the fence) is a reason to wait: nothing moved, the project is served
|
|
56
|
-
* as before.
|
|
65
|
+
* as before. A refused plan names its own blockers and conflicts, not a failure to read the kept
|
|
66
|
+
* tasks. Only a failure after the journal exists closes the project through recovery.
|
|
57
67
|
*/
|
|
58
68
|
async function move(root, ownership, fault) {
|
|
59
69
|
try {
|
|
60
70
|
const answer = await moveUnderFence(root, ownership, fault);
|
|
71
|
+
if (answer.alreadyMoved)
|
|
72
|
+
return 'nothing';
|
|
61
73
|
return { gitMv: answer.gitMv, leftovers: answer.leftovers };
|
|
62
74
|
}
|
|
63
75
|
catch (error) {
|
|
64
76
|
const journal = migrationFencePaths(projectPaths(root).write).journal;
|
|
65
77
|
if (pathPresent(journal))
|
|
66
78
|
throw new ProjectMigrationRecoveryError(journal, root, error);
|
|
67
|
-
|
|
79
|
+
if (error instanceof ProjectMigrationRefusedError)
|
|
80
|
+
return { reason: refusal(error.plan) };
|
|
81
|
+
return { reason: errorText(error) };
|
|
68
82
|
}
|
|
69
83
|
}
|
|
70
84
|
/** What a later caller of an attempt that already ran sees: nothing left for it to move. */
|
|
@@ -98,9 +112,10 @@ export function moveProjectWhenIdle(root, options) {
|
|
|
98
112
|
async function attempt(root, options) {
|
|
99
113
|
markFreshProject(root);
|
|
100
114
|
// A completed move marked the project (hearsay-tools/cezarion#3150): `.ai/cezar/` is its fallback
|
|
101
|
-
// now, and holds nothing more to move once only
|
|
102
|
-
// project still needs the move that marks it, even when its
|
|
103
|
-
|
|
115
|
+
// now, and holds nothing more to move once only items that never move or still stay are left in
|
|
116
|
+
// it (`pending.ts`). An unmarked project still needs the move that marks it, even when its
|
|
117
|
+
// `.ai/cezar/` is empty or tracked only.
|
|
118
|
+
if (projectMoveMarked(root) && !await legacyMoveWorkLeft(root))
|
|
104
119
|
return { status: 'nothing' };
|
|
105
120
|
const log = options.log ?? ((line) => console.warn(line));
|
|
106
121
|
const blocked = (reason) => {
|
|
@@ -115,6 +130,8 @@ async function attempt(root, options) {
|
|
|
115
130
|
const ownership = options.ownership ?? new CockpitOwnership();
|
|
116
131
|
try {
|
|
117
132
|
const result = await move(root, ownership, options.fault);
|
|
133
|
+
if (result === 'nothing')
|
|
134
|
+
return { status: 'nothing' };
|
|
118
135
|
if ('reason' in result)
|
|
119
136
|
return blocked(result.reason);
|
|
120
137
|
log(`[${productIdentity().command}] ${movedNotice(root, result.leftovers)}${result.gitMv.length
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto.js","sourceRoot":"","sources":["../../src/project-migration/auto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"auto.js","sourceRoot":"","sources":["../../src/project-migration/auto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;A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AO,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC3G,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;wDACwD;AACxD,MAAM,UAAU,kBAAkB,CAAC,OAA8C,EAAE,IAAwB;IACzG,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAG,OAAO,eAAe,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7G,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,aAAa,CAAC,MAAgD;IAC5E,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAa,EAAE,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAwB,CAAC;IACzG,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -62,3 +62,12 @@ export declare function projectForeignTasksOffline(root: string): LiveProjectTas
|
|
|
62
62
|
* items move.
|
|
63
63
|
*/
|
|
64
64
|
export declare function projectKeptRunIds(root: string): ReadonlySet<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Which of `ids` can still resume, by the rule of `projectKeptRunIds`, read by id instead of
|
|
67
|
+
* parsing every row of every store: the cockpit's check whether the items a moved project keeps
|
|
68
|
+
* in `.ai/cezar/` may move now. Each store is read in place, so SQLite may touch its shared-memory
|
|
69
|
+
* file; the cockpit that asks opens the store anyway. Undefined when the answer is unknown: a store
|
|
70
|
+
* or an index without a store cannot be read, or a task is not archived or is live but its record
|
|
71
|
+
* cannot be read. The full plan then decides, as before.
|
|
72
|
+
*/
|
|
73
|
+
export declare function keptAmong(root: string, ids: ReadonlySet<string>): ReadonlySet<string> | undefined;
|
|
@@ -4,7 +4,7 @@ import { readCockpitLeases } from '../home/leases.js';
|
|
|
4
4
|
import { pathPresent, projectPaths } from '../project-paths.js';
|
|
5
5
|
import { projectLiveTasks } from '../runs/live-tasks.js';
|
|
6
6
|
import { claimOwnerLive } from '../runs/run-claims.js';
|
|
7
|
-
import { RUNS_DB_FILE } from '../runs/run-database.js';
|
|
7
|
+
import { RUNS_DB_FILE, RunDatabase } from '../runs/run-database.js';
|
|
8
8
|
import { parseRunRecords } from '../runs/store.js';
|
|
9
9
|
import { isLiveRecord } from '../runs/run-row.js';
|
|
10
10
|
import { anotherCockpitOwner } from '../server/cockpit-ownership.js';
|
|
@@ -187,4 +187,61 @@ export function projectKeptRunIds(root) {
|
|
|
187
187
|
kept.add(run.id);
|
|
188
188
|
return kept;
|
|
189
189
|
}
|
|
190
|
+
function taskFacts(db, id, facts) {
|
|
191
|
+
const row = db.get(id);
|
|
192
|
+
// The first store whose record parses wins; a row not archived that parses nowhere is unknown.
|
|
193
|
+
if (row && !facts.run) {
|
|
194
|
+
facts.run = record(parseJson(row.data));
|
|
195
|
+
if (!facts.run && !row.archived)
|
|
196
|
+
facts.unparsed = true;
|
|
197
|
+
}
|
|
198
|
+
if (row?.live)
|
|
199
|
+
facts.live = true;
|
|
200
|
+
const family = db.familyOf(id);
|
|
201
|
+
const claim = family === undefined ? undefined : db.getClaim(family);
|
|
202
|
+
if (claim && claimOwnerLive(claim))
|
|
203
|
+
facts.foreign = true;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Which of `ids` can still resume, by the rule of `projectKeptRunIds`, read by id instead of
|
|
207
|
+
* parsing every row of every store: the cockpit's check whether the items a moved project keeps
|
|
208
|
+
* in `.ai/cezar/` may move now. Each store is read in place, so SQLite may touch its shared-memory
|
|
209
|
+
* file; the cockpit that asks opens the store anyway. Undefined when the answer is unknown: a store
|
|
210
|
+
* or an index without a store cannot be read, or a task is not archived or is live but its record
|
|
211
|
+
* cannot be read. The full plan then decides, as before.
|
|
212
|
+
*/
|
|
213
|
+
export function keptAmong(root, ids) {
|
|
214
|
+
const facts = new Map([...ids].map(id => [id, { unparsed: false, live: false, foreign: false }]));
|
|
215
|
+
try {
|
|
216
|
+
for (const directory of projectPaths(root).reads) {
|
|
217
|
+
const database = join(directory, RUNS_DB_FILE);
|
|
218
|
+
if (!pathPresent(database)) {
|
|
219
|
+
if (pathPresent(join(directory, 'runs.json')))
|
|
220
|
+
return undefined;
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const db = RunDatabase.openReadOnly(database);
|
|
224
|
+
if (!db)
|
|
225
|
+
return undefined;
|
|
226
|
+
try {
|
|
227
|
+
for (const [id, known] of facts)
|
|
228
|
+
taskFacts(db, id, known);
|
|
229
|
+
}
|
|
230
|
+
finally {
|
|
231
|
+
db.close();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
const kept = new Set();
|
|
239
|
+
for (const [id, { run, unparsed, live, foreign }] of facts) {
|
|
240
|
+
if (!run && (unparsed || live || foreign))
|
|
241
|
+
return undefined;
|
|
242
|
+
if (run && (!run.archived || foreign || (live && isLiveRecord(run))))
|
|
243
|
+
kept.add(id);
|
|
244
|
+
}
|
|
245
|
+
return kept;
|
|
246
|
+
}
|
|
190
247
|
//# sourceMappingURL=live.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.js","sourceRoot":"","sources":["../../src/project-migration/live.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C,IAAI,KAAK;oBAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAAC,CAAC;oBAAS,CAAC;gBAAC,EAAE,CAAC,KAAK,EAAE,CAAC;YAAC,CAAC;QAC5F,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,SAAS,CAAC;IAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;QAC3D,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC;YAAE,OAAO,SAAS,CAAC;QAC5D,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a moved project's `.ai/cezar/` holds anything a move would act on now: the cockpit's
|
|
3
|
+
* check before it plans a moved project at a start. The plan reads every run row, receipt and
|
|
4
|
+
* evidence file, so it runs only when this answers true. Three kinds of item never move and do not
|
|
5
|
+
* count: the `cockpit.lock*` ownership claims, tracked files (the move prints their `git mv`), and
|
|
6
|
+
* the items of the tasks the kept-task list names while each can still resume. An item of any
|
|
7
|
+
* other kind, or of a task that has since been archived or deleted, counts. When Git, the kept-task
|
|
8
|
+
* list or a run store cannot be read, or Git warns while it lists, the answer is true and the plan decides.
|
|
9
|
+
*/
|
|
10
|
+
export declare function legacyMoveWorkLeft(root: string): Promise<boolean>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { runGit } from '../git-command.js';
|
|
3
|
+
import { legacyItemOwner } from '../legacy-runs.js';
|
|
4
|
+
import { keptAmong } from './live.js';
|
|
5
|
+
import { currentLeftovers, LEGACY_PROJECT_DIR, legacyStateLeft, MIGRATED_PROJECT_DIR } from './plan.js';
|
|
6
|
+
/**
|
|
7
|
+
* The untracked and ignored files under `.ai/cezar/`; a nested Git worktree is one entry that ends
|
|
8
|
+
* in `/`. Undefined when the listing may be incomplete: Git failed, or it warned (a directory it
|
|
9
|
+
* cannot open is skipped with a warning and exit 0).
|
|
10
|
+
*/
|
|
11
|
+
async function untrackedListing(root) {
|
|
12
|
+
try {
|
|
13
|
+
const { stdout, stderr } = await runGit(['ls-files', '-z', '--others', '--', LEGACY_PROJECT_DIR], { cwd: root, maxBuffer: 256 * 1024 * 1024, timeout: 60_000 });
|
|
14
|
+
return stderr.trim() ? undefined : stdout;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether a moved project's `.ai/cezar/` holds anything a move would act on now: the cockpit's
|
|
22
|
+
* check before it plans a moved project at a start. The plan reads every run row, receipt and
|
|
23
|
+
* evidence file, so it runs only when this answers true. Three kinds of item never move and do not
|
|
24
|
+
* count: the `cockpit.lock*` ownership claims, tracked files (the move prints their `git mv`), and
|
|
25
|
+
* the items of the tasks the kept-task list names while each can still resume. An item of any
|
|
26
|
+
* other kind, or of a task that has since been archived or deleted, counts. When Git, the kept-task
|
|
27
|
+
* list or a run store cannot be read, or Git warns while it lists, the answer is true and the plan decides.
|
|
28
|
+
*/
|
|
29
|
+
export async function legacyMoveWorkLeft(root) {
|
|
30
|
+
const source = join(root, ...LEGACY_PROJECT_DIR.split('/'));
|
|
31
|
+
const destination = join(root, ...MIGRATED_PROJECT_DIR.split('/'));
|
|
32
|
+
if (!legacyStateLeft(source, destination))
|
|
33
|
+
return false;
|
|
34
|
+
// An unreadable kept-task list is work: the move rewrites it from the run store.
|
|
35
|
+
const leftovers = currentLeftovers(destination);
|
|
36
|
+
if (leftovers === undefined)
|
|
37
|
+
return true;
|
|
38
|
+
const recorded = new Set(leftovers);
|
|
39
|
+
const listed = await untrackedListing(root);
|
|
40
|
+
if (listed === undefined)
|
|
41
|
+
return true;
|
|
42
|
+
const owners = new Set();
|
|
43
|
+
for (const path of listed.split('\0').filter(Boolean)) {
|
|
44
|
+
const parts = path.replace(/\/$/, '').split('/').slice(LEGACY_PROJECT_DIR.split('/').length);
|
|
45
|
+
if (parts[0]?.startsWith('cockpit.lock'))
|
|
46
|
+
continue;
|
|
47
|
+
const owner = legacyItemOwner(parts, recorded);
|
|
48
|
+
if (owner === undefined)
|
|
49
|
+
return true;
|
|
50
|
+
owners.add(owner);
|
|
51
|
+
}
|
|
52
|
+
if (owners.size === 0)
|
|
53
|
+
return false;
|
|
54
|
+
const kept = keptAmong(root, owners);
|
|
55
|
+
return kept === undefined || [...owners].some(id => !kept.has(id));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=pending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../src/project-migration/pending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAExG;;;;GAIG;AACH,KAAK,UAAU,gBAAgB,CAAC,IAAY;IAC1C,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,CAAC,UAAU,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CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7F,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC;YAAE,SAAS;QACnD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC/C,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAI,KAAK,SAAS,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -112,6 +112,9 @@ export declare function legacyItemsPresent(source: string): boolean;
|
|
|
112
112
|
/** Whether a moved project still has work for a move: items in the old directory `source`, or an
|
|
113
113
|
* unreadable kept-task list in `destination`, which a move rewrites from the run store. */
|
|
114
114
|
export declare function legacyStateLeft(source: string, destination: string): boolean;
|
|
115
|
+
/** The leftover tasks the moved directory `destination` names now, read from disk; undefined
|
|
116
|
+
* when the file is present but unreadable, so the move rewrites it from the run store. */
|
|
117
|
+
export declare function currentLeftovers(destination: string): string[] | undefined;
|
|
115
118
|
/** The dry run as text: every move, repair, rewrite, tracked file and conflict, and the boundary. */
|
|
116
119
|
export declare function describeProjectMigrationPlan(plan: ProjectMigrationPlan): string;
|
|
117
120
|
export {};
|
|
@@ -538,7 +538,7 @@ export function legacyStateLeft(source, destination) {
|
|
|
538
538
|
}
|
|
539
539
|
/** The leftover tasks the moved directory `destination` names now, read from disk; undefined
|
|
540
540
|
* when the file is present but unreadable, so the move rewrites it from the run store. */
|
|
541
|
-
function currentLeftovers(destination) {
|
|
541
|
+
export function currentLeftovers(destination) {
|
|
542
542
|
forgetLegacyRunIds(destination);
|
|
543
543
|
try {
|
|
544
544
|
return [...legacyRunIds(destination)].sort();
|