@akagilnc/pi-workflow-roles 0.1.5679 → 0.1.5698
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/acp-host/production-host.js +4016 -3944
- package/dist/external-host-turn-loop.js +35 -17
- package/dist/headless-host/production-host.js +3246 -3174
- package/dist/migrate-book-topology.js +129 -100
- package/dist/pi/role-turn-host.js +1 -1
- package/dist/public-cli/main.js +1672 -1621
- package/dist/report-ticket-tool.js +12 -2
- package/dist/role-run-path-rewrite.js +149 -0
- package/dist/role-run-relocation.js +11 -121
- package/dist/run-dossier.js +10 -1
- package/dist/session-identity.js +1 -0
- package/dist/submission-ledger.js +11 -0
- package/package.json +1 -1
- package/resources/navigator-route-playbook.md +2 -12
- package/souls/navigator.md +2 -4
- package/src/acp-host/production-host.ts +1 -0
- package/src/acp-host/role-turn-host.ts +2 -2
- package/src/external-host-turn-loop.ts +36 -22
- package/src/headless-host/production-host.ts +1 -0
- package/src/headless-host/role-turn-host.ts +2 -2
- package/src/pi/role-turn-host.ts +1 -1
- package/src/prepared-role-turn.ts +2 -0
- package/src/report-ticket-tool.ts +12 -2
- package/src/role-envelope.ts +20 -11
- package/src/role-run-path-rewrite.ts +238 -0
- package/src/role-run-relocation.ts +34 -200
- package/src/role-runtime.ts +29 -12
- package/src/run-dossier.ts +11 -1
- package/src/session-identity.ts +1 -0
- package/src/submission-ledger.ts +11 -0
|
@@ -30,16 +30,17 @@ export async function resolveLiveRunDirectoryPath(recordedPath, home) {
|
|
|
30
30
|
/**
|
|
31
31
|
* Prefer the request path when it still exists; otherwise re-locate by run id
|
|
32
32
|
* (resolveLiveRunDirectoryPath). Mutates the live request so later turn-record /
|
|
33
|
-
* exit-copy / fault notes stay on the new leaf.
|
|
33
|
+
* exit-copy / fault notes stay on the new leaf. Authority is required so opaque
|
|
34
|
+
* principal wire is resealed — never shape-guessed in place (#1183).
|
|
34
35
|
*/
|
|
35
|
-
export async function syncTurnRequestLivePlacement(request) {
|
|
36
|
+
export async function syncTurnRequestLivePlacement(request, authority) {
|
|
36
37
|
const live = await resolveLiveRunDirectoryPath(request.runDirectory, request.home);
|
|
37
38
|
if (live === undefined) {
|
|
38
39
|
const parsed = parseRunLeaf(basename(request.runDirectory));
|
|
39
40
|
throw new Error(`admitted run ${parsed?.runId ?? "(unparseable)"} missing after host turn; not found under ${request.home}`);
|
|
40
41
|
}
|
|
41
42
|
if (live !== request.runDirectory) {
|
|
42
|
-
projectTurnRequestLiveRunDirectory(request, live);
|
|
43
|
+
projectTurnRequestLiveRunDirectory(request, live, authority);
|
|
43
44
|
}
|
|
44
45
|
return live;
|
|
45
46
|
}
|
|
@@ -47,34 +48,51 @@ export async function syncTurnRequestLivePlacement(request) {
|
|
|
47
48
|
* Soft live-path sync for cleanup / dossier work: lookup failure stays beside the
|
|
48
49
|
* caller and never revives a vanished leaf. Same authority as syncTurnRequestLivePlacement.
|
|
49
50
|
*/
|
|
50
|
-
export async function trySyncTurnRequestLivePlacement(request) {
|
|
51
|
+
export async function trySyncTurnRequestLivePlacement(request, authority) {
|
|
51
52
|
try {
|
|
52
|
-
return { runDirectory: await syncTurnRequestLivePlacement(request) };
|
|
53
|
+
return { runDirectory: await syncTurnRequestLivePlacement(request, authority) };
|
|
53
54
|
}
|
|
54
55
|
catch (resolveError) {
|
|
55
56
|
return { resolveError };
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
/**
|
|
59
|
-
* Retain a package fault on the live leaf when locatable.
|
|
60
|
-
*
|
|
61
|
-
* the
|
|
60
|
+
* Retain a package fault on the live leaf when locatable. Directory lookup only —
|
|
61
|
+
* does not mutate live principal identity (#1183). Lookup failure must not replace
|
|
62
|
+
* the original fault or block later cleanup.
|
|
62
63
|
*/
|
|
63
64
|
export async function retainPackageFaultBesideLivePlacement(request, input) {
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
const resolveDiagnostic = `live run path resolve failed beside fault: ${describeErrorIdentity(live.resolveError)}`;
|
|
65
|
+
let runDirectory = request.runDirectory;
|
|
66
|
+
if (!existsSync(runDirectory)) {
|
|
67
67
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const found = await resolveLiveRunDirectoryPath(request.runDirectory, request.home);
|
|
69
|
+
if (found === undefined) {
|
|
70
|
+
const resolveDiagnostic = `live run path resolve failed beside fault: admitted run missing under ${request.home}`;
|
|
71
|
+
try {
|
|
72
|
+
process.stderr.write(`${input.diagnostic}\n`);
|
|
73
|
+
process.stderr.write(`${resolveDiagnostic}\n`);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Best-effort presentation beside an already-chosen terminal.
|
|
77
|
+
}
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
runDirectory = found;
|
|
70
81
|
}
|
|
71
|
-
catch {
|
|
72
|
-
|
|
82
|
+
catch (resolveError) {
|
|
83
|
+
const resolveDiagnostic = `live run path resolve failed beside fault: ${describeErrorIdentity(resolveError)}`;
|
|
84
|
+
try {
|
|
85
|
+
process.stderr.write(`${input.diagnostic}\n`);
|
|
86
|
+
process.stderr.write(`${resolveDiagnostic}\n`);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Best-effort presentation beside an already-chosen terminal.
|
|
90
|
+
}
|
|
91
|
+
return;
|
|
73
92
|
}
|
|
74
|
-
return;
|
|
75
93
|
}
|
|
76
94
|
await retainPackageFault({
|
|
77
|
-
runDirectory
|
|
95
|
+
runDirectory,
|
|
78
96
|
diagnostic: input.diagnostic,
|
|
79
97
|
...(Object.hasOwn(input, "error") ? { error: input.error } : {}),
|
|
80
98
|
});
|