@fro.bot/systematic 3.16.4 → 3.16.5
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/index.js +63 -29
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -11776,6 +11776,15 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
11776
11776
|
}
|
|
11777
11777
|
return source;
|
|
11778
11778
|
}
|
|
11779
|
+
function withoutStaleConditionalMetadata(existingMetadata) {
|
|
11780
|
+
if (!("questionAttestation" in existingMetadata))
|
|
11781
|
+
return existingMetadata;
|
|
11782
|
+
if (existingMetadata.sourceDigest !== currentMarkerSource().source) {
|
|
11783
|
+
return existingMetadata;
|
|
11784
|
+
}
|
|
11785
|
+
const { questionAttestation: _stale, ...rest } = existingMetadata;
|
|
11786
|
+
return rest;
|
|
11787
|
+
}
|
|
11779
11788
|
function metadata2() {
|
|
11780
11789
|
const source = currentMarkerSource();
|
|
11781
11790
|
const result = {
|
|
@@ -11821,7 +11830,7 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
11821
11830
|
output.title = "Workflow unit started";
|
|
11822
11831
|
output.output = JSON.stringify({ status: "started" });
|
|
11823
11832
|
output.metadata = {
|
|
11824
|
-
...existingMetadata,
|
|
11833
|
+
...withoutStaleConditionalMetadata(existingMetadata),
|
|
11825
11834
|
...metadata2(),
|
|
11826
11835
|
workflowGuard: { status: "started" }
|
|
11827
11836
|
};
|
|
@@ -11834,7 +11843,7 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
11834
11843
|
reasonCode
|
|
11835
11844
|
});
|
|
11836
11845
|
output.metadata = {
|
|
11837
|
-
...existingMetadata,
|
|
11846
|
+
...withoutStaleConditionalMetadata(existingMetadata),
|
|
11838
11847
|
...metadata2(),
|
|
11839
11848
|
workflowGuard: {
|
|
11840
11849
|
status: "rejected",
|
|
@@ -11842,46 +11851,49 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
11842
11851
|
}
|
|
11843
11852
|
};
|
|
11844
11853
|
}
|
|
11845
|
-
function
|
|
11854
|
+
function targetMetadataField(target) {
|
|
11855
|
+
return target ? { target } : {};
|
|
11856
|
+
}
|
|
11857
|
+
function writeSuccessfulCompletionResult(output, target) {
|
|
11846
11858
|
if (!isRecord7(output))
|
|
11847
11859
|
return;
|
|
11848
11860
|
const existingMetadata = isRecord7(output.metadata) ? output.metadata : {};
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11861
|
+
output.title = "Workflow transition completed";
|
|
11862
|
+
output.output = `workflow guard completed ${target}`;
|
|
11863
|
+
output.metadata = {
|
|
11864
|
+
...withoutStaleConditionalMetadata(existingMetadata),
|
|
11865
|
+
...metadata2(),
|
|
11866
|
+
workflowGuard: { status: "completed", target }
|
|
11867
|
+
};
|
|
11868
|
+
}
|
|
11869
|
+
function writeTerminalCompletionResult(output, result, target) {
|
|
11870
|
+
if (!isRecord7(output))
|
|
11857
11871
|
return;
|
|
11858
|
-
}
|
|
11859
|
-
const reasonCode = "reasonCode" in result ? result.reasonCode : "guard-unavailable";
|
|
11860
|
-
const resultStatus = result.status === "waiting" ? "unavailable" : result.status;
|
|
11872
|
+
const existingMetadata = isRecord7(output.metadata) ? output.metadata : {};
|
|
11861
11873
|
output.title = "Workflow transition unavailable";
|
|
11862
11874
|
output.output = JSON.stringify({
|
|
11863
|
-
status:
|
|
11864
|
-
reasonCode
|
|
11875
|
+
status: result.status,
|
|
11876
|
+
reasonCode: result.reasonCode
|
|
11865
11877
|
});
|
|
11866
11878
|
output.metadata = {
|
|
11867
|
-
...existingMetadata,
|
|
11879
|
+
...withoutStaleConditionalMetadata(existingMetadata),
|
|
11868
11880
|
...metadata2(),
|
|
11869
11881
|
workflowGuard: {
|
|
11870
|
-
status:
|
|
11871
|
-
target,
|
|
11872
|
-
reasonCode
|
|
11882
|
+
status: result.status,
|
|
11883
|
+
...targetMetadataField(target),
|
|
11884
|
+
reasonCode: result.reasonCode
|
|
11873
11885
|
}
|
|
11874
11886
|
};
|
|
11875
11887
|
}
|
|
11876
11888
|
function writeAbandonedCompletionResult(output, target, reasonCode) {
|
|
11877
|
-
|
|
11889
|
+
writeTerminalCompletionResult(output, { target, status: "unavailable", reasonCode }, target);
|
|
11878
11890
|
}
|
|
11879
11891
|
function writeAbandonedCompletionMetadata(output, target, reasonCode) {
|
|
11880
11892
|
if (!isRecord7(output))
|
|
11881
11893
|
return;
|
|
11882
11894
|
const existingMetadata = isRecord7(output.metadata) ? output.metadata : {};
|
|
11883
11895
|
output.metadata = {
|
|
11884
|
-
...existingMetadata,
|
|
11896
|
+
...withoutStaleConditionalMetadata(existingMetadata),
|
|
11885
11897
|
...metadata2(),
|
|
11886
11898
|
workflowGuard: { status: "unavailable", target, reasonCode }
|
|
11887
11899
|
};
|
|
@@ -12303,6 +12315,13 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12303
12315
|
transitionId: pending.transitionId
|
|
12304
12316
|
});
|
|
12305
12317
|
writeAbandonedCompletionMetadata(output, pending.target, "failed-operation");
|
|
12318
|
+
abandonedCompletes.set(callDigest, pending.target);
|
|
12319
|
+
terminalCompletes.set(callDigest, {
|
|
12320
|
+
target: pending.target,
|
|
12321
|
+
status: "unavailable",
|
|
12322
|
+
reasonCode: "failed-operation",
|
|
12323
|
+
metadataOnly: true
|
|
12324
|
+
});
|
|
12306
12325
|
return;
|
|
12307
12326
|
}
|
|
12308
12327
|
const result = guard.finalizeTransition({
|
|
@@ -12312,7 +12331,7 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12312
12331
|
});
|
|
12313
12332
|
if (result.status === "completed" || result.status === "duplicate") {
|
|
12314
12333
|
finalizedCompletes.set(callDigest, pending);
|
|
12315
|
-
|
|
12334
|
+
writeSuccessfulCompletionResult(output, pending.target);
|
|
12316
12335
|
return;
|
|
12317
12336
|
}
|
|
12318
12337
|
markUnavailable();
|
|
@@ -12324,7 +12343,14 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12324
12343
|
};
|
|
12325
12344
|
abandonedCompletes.set(callDigest, pending.target);
|
|
12326
12345
|
terminalCompletes.set(callDigest, terminal);
|
|
12327
|
-
|
|
12346
|
+
writeTerminalCompletionResult(output, terminal, pending.target);
|
|
12347
|
+
}
|
|
12348
|
+
function writeTerminalReplay(output, terminal, target) {
|
|
12349
|
+
if (terminal.metadataOnly) {
|
|
12350
|
+
writeAbandonedCompletionMetadata(output, target, terminal.reasonCode);
|
|
12351
|
+
return;
|
|
12352
|
+
}
|
|
12353
|
+
writeTerminalCompletionResult(output, terminal, target);
|
|
12328
12354
|
}
|
|
12329
12355
|
function replayTerminalComplete(callDigest, finalTarget, output) {
|
|
12330
12356
|
const questionChallengeID = blockedQuestionCalls.get(callDigest);
|
|
@@ -12335,10 +12361,15 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12335
12361
|
return true;
|
|
12336
12362
|
}
|
|
12337
12363
|
}
|
|
12364
|
+
const terminal = terminalCompletes.get(callDigest);
|
|
12365
|
+
if (terminal?.target) {
|
|
12366
|
+
writeTerminalReplay(output, terminal, terminal.target);
|
|
12367
|
+
blockedCompletes.delete(callDigest);
|
|
12368
|
+
return true;
|
|
12369
|
+
}
|
|
12338
12370
|
const replay = finalizedCompletes.get(callDigest);
|
|
12339
12371
|
const abandonedTarget = abandonedCompletes.get(callDigest);
|
|
12340
12372
|
const blockedTarget = blockedCompletes.get(callDigest);
|
|
12341
|
-
const terminal = terminalCompletes.get(callDigest);
|
|
12342
12373
|
const expectedTarget = replay?.target ?? abandonedTarget ?? blockedTarget;
|
|
12343
12374
|
if (!expectedTarget)
|
|
12344
12375
|
return false;
|
|
@@ -12348,8 +12379,6 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12348
12379
|
}
|
|
12349
12380
|
if (replay)
|
|
12350
12381
|
replayComplete(callDigest);
|
|
12351
|
-
if (terminal)
|
|
12352
|
-
writeCompletionResult(output, terminal, expectedTarget);
|
|
12353
12382
|
blockedCompletes.delete(callDigest);
|
|
12354
12383
|
return true;
|
|
12355
12384
|
}
|
|
@@ -12458,13 +12487,18 @@ function createSessionRuntime(options, operationObservers, recoveredOperationCon
|
|
|
12458
12487
|
return readbacks;
|
|
12459
12488
|
}
|
|
12460
12489
|
function finishMismatchedTarget(callDigest, pending, output) {
|
|
12461
|
-
abandonComplete(callDigest, pending,
|
|
12490
|
+
abandonComplete(callDigest, pending, true);
|
|
12491
|
+
terminalCompletes.set(callDigest, {
|
|
12492
|
+
target: pending.target,
|
|
12493
|
+
status: "unavailable",
|
|
12494
|
+
reasonCode: "invalid-transition"
|
|
12495
|
+
});
|
|
12462
12496
|
markUnavailable();
|
|
12463
12497
|
writeAbandonedCompletionResult(output, pending.target, "invalid-transition");
|
|
12464
12498
|
}
|
|
12465
12499
|
function finishUnreplayableComplete(finalTarget, output) {
|
|
12466
12500
|
markUnavailable();
|
|
12467
|
-
writeAbandonedCompletionResult(output, finalTarget
|
|
12501
|
+
writeAbandonedCompletionResult(output, finalTarget, "guard-unavailable");
|
|
12468
12502
|
}
|
|
12469
12503
|
function finishUnavailableReadback(callDigest, pending, output) {
|
|
12470
12504
|
abandonComplete(callDigest, pending, true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fro.bot/systematic",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.5",
|
|
4
4
|
"description": "Compound-engineering loops for OpenCode, Pi, and Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://fro.bot/systematic",
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@biomejs/biome": "2.5.12",
|
|
99
99
|
"@earendil-works/pi-coding-agent": "0.83.0",
|
|
100
|
-
"@opencode-ai/plugin": "1.18.
|
|
101
|
-
"@opencode-ai/sdk": "1.18.
|
|
100
|
+
"@opencode-ai/plugin": "1.18.29",
|
|
101
|
+
"@opencode-ai/sdk": "1.18.29",
|
|
102
102
|
"@semantic-release/exec": "7.1.0",
|
|
103
103
|
"@tintinweb/pi-subagents": "0.14.3",
|
|
104
104
|
"@types/bun": "latest",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"rimraf": "6.1.3",
|
|
113
113
|
"semantic-release": "25.0.9",
|
|
114
114
|
"semantic-release-export-data": "1.2.0",
|
|
115
|
-
"typebox": "1.3.
|
|
115
|
+
"typebox": "1.3.26",
|
|
116
116
|
"typescript": "7.0.2"
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|