@llblab/pi-state-flow 0.16.1 → 0.16.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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.16.2: Passive first-CWD memory hotfix
8
+
9
+ - `Passive first-CWD memory`: Treats global-only storage as a valid passive-memory state before the current CWD has ever materialized, projecting an empty CWD overlay instead of warning that shared storage is incomplete; CWD-without-global storage still fails closed.
10
+
7
11
  ## 0.16.1: Resumed activation hotfix
8
12
 
9
13
  - `Resumed activation`: Reasserts the selected session stream as a complete semantic cohort when `/state-flow-start` enables a resumed branch, so extension upgrades cannot misclassify retained session state as an omitted write while shared scopes still reconcile against their live owners.
@@ -110,11 +110,12 @@ export class TemporalRuntime {
110
110
  }));
111
111
  if (!shared.global && !shared.cwd)
112
112
  return false;
113
- if (!shared.global || !shared.cwd)
114
- throw new Error("Incomplete passive State Flow shared storage");
113
+ if (!shared.global)
114
+ throw new Error("Incomplete passive State Flow shared storage: CWD state exists without global state");
115
115
  const fresh = createTemporalState({ global: emptyState(), cwd: emptyState(), session: emptyState() }, randomUUID());
116
116
  const basis = backend === "git" ? base.head ?? "unborn" : "files";
117
- this.view = adoptTemporalStreams({ global: shared.global, cwd: shared.cwd, session: fresh.scopes.session }, `passive:${basis}:${randomUUID()}`);
117
+ // Global memory is valid before this CWD has ever materialized its own scope.
118
+ this.view = adoptTemporalStreams({ global: shared.global, cwd: shared.cwd ?? fresh.scopes.cwd, session: fresh.scopes.session }, `passive:${basis}:${randomUUID()}`);
118
119
  this.base = base;
119
120
  this.backend = backend;
120
121
  this.provenanceByScope = {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-state-flow",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "private": false,
5
5
  "description": "Incremental scoped state/context/memory compiler for Pi, inspired by SKILL.state",
6
6
  "keywords": [
package/lib/runtime.ts CHANGED
@@ -128,10 +128,11 @@ export class TemporalRuntime {
128
128
  scope === "cwd" ? this.cwd : undefined, files.get(paths.meta))];
129
129
  })) as Record<(typeof SHARED_SCOPES)[number], ScopeStream | undefined>;
130
130
  if (!shared.global && !shared.cwd) return false;
131
- if (!shared.global || !shared.cwd) throw new Error("Incomplete passive State Flow shared storage");
131
+ if (!shared.global) throw new Error("Incomplete passive State Flow shared storage: CWD state exists without global state");
132
132
  const fresh = createTemporalState({ global: emptyState(), cwd: emptyState(), session: emptyState() }, randomUUID());
133
133
  const basis = backend === "git" ? (base as TemporalGitBase).head ?? "unborn" : "files";
134
- this.view = adoptTemporalStreams({ global: shared.global, cwd: shared.cwd, session: fresh.scopes.session }, `passive:${basis}:${randomUUID()}`);
134
+ // Global memory is valid before this CWD has ever materialized its own scope.
135
+ this.view = adoptTemporalStreams({ global: shared.global, cwd: shared.cwd ?? fresh.scopes.cwd, session: fresh.scopes.session }, `passive:${basis}:${randomUUID()}`);
135
136
  this.base = base;
136
137
  this.backend = backend;
137
138
  this.provenanceByScope = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-state-flow",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "private": false,
5
5
  "description": "Incremental scoped state/context/memory compiler for Pi, inspired by SKILL.state",
6
6
  "keywords": [