@astrosheep/pi-goal-next 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/continuation.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrosheep/pi-goal-next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Persistent autonomous goals for pi, with Codex-verbatim goal semantics: continuation prompts, self-audited completion, budgets, and CAS-journaled state.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
package/src/continuation.ts
CHANGED
|
@@ -43,6 +43,8 @@ export function createContinuation(deps: ContinuationDeps): Continuation {
|
|
|
43
43
|
const seq = goal.continuationSeq + 1;
|
|
44
44
|
const result = await deps.commit({ type: "continuation_sent", generation: leaseGeneration }, revision);
|
|
45
45
|
if (result.kind !== "ok" || generation !== leaseGeneration) return;
|
|
46
|
+
const latest = deps.getSnapshot();
|
|
47
|
+
if (!latest || latest.goal.id !== goal.id || latest.goal.status !== "active") return; // user may have cleared/paused during the commit await
|
|
46
48
|
|
|
47
49
|
deps.send({
|
|
48
50
|
customType: "pi-goal-next/continuation",
|