guardian-framework 0.1.119 → 0.1.121

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/cli.js CHANGED
@@ -3202,7 +3202,7 @@ __export(exports_package, {
3202
3202
  bin: () => bin,
3203
3203
  author: () => author
3204
3204
  });
3205
- var name = "guardian-framework", version = "0.1.119", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
3205
+ var name = "guardian-framework", version = "0.1.121", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
3206
3206
  var init_package = __esm(() => {
3207
3207
  exports = {
3208
3208
  ".": {
package/dist/exports.js CHANGED
@@ -1987,7 +1987,7 @@ __export(exports_package, {
1987
1987
  bin: () => bin,
1988
1988
  author: () => author
1989
1989
  });
1990
- var name = "guardian-framework", version = "0.1.119", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
1990
+ var name = "guardian-framework", version = "0.1.121", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
1991
1991
  var init_package = __esm(() => {
1992
1992
  exports = {
1993
1993
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.119",
3
+ "version": "0.1.121",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -223,7 +223,15 @@ function mergeRawJson(existing: Record<string, unknown>, incoming: Record<string
223
223
  });
224
224
  }
225
225
  merged.boundedContexts = Array.from(bcMap.values());
226
- for (const key of ["businessContext", "openQuestions", "aggregateRoots", "status"]) {
226
+ // Original prompt/context is immutable once seeded — later saves (summaries,
227
+ // edits) must never erase it.
228
+ for (const key of ["businessContext", "originalPrompt"]) {
229
+ const cur = existing[key];
230
+ const v = incoming[key];
231
+ if (cur !== undefined && String(cur).trim() !== "") merged[key] = cur;
232
+ else if (v !== undefined && String(v).trim() !== "" && String(v).trim() !== "None") merged[key] = v;
233
+ }
234
+ for (const key of ["openQuestions", "aggregateRoots", "status"]) {
227
235
  const v = incoming[key];
228
236
  if (v !== undefined && String(v).trim() !== "" && String(v).trim() !== "None") merged[key] = v;
229
237
  }
@@ -422,6 +430,12 @@ export default function (pi: ExtensionAPI) {
422
430
  parsedJson = mergeRawJson(existing, parsedJson);
423
431
  } catch { /* ignore unreadable prior state */ }
424
432
  }
433
+ // Normalize identity/state so every saved session is self-describing
434
+ // even when saves arrive before/without the explore seed.
435
+ parsedJson.sessionId = parsedJson.sessionId ?? sessionId;
436
+ parsedJson.status = String(parsedJson.status ?? "draft");
437
+ parsedJson.createdAt = parsedJson.createdAt ?? new Date().toISOString();
438
+
425
439
  // Backfill business context from the explore stub if the agent never
426
440
  // supplied it (front matter business_context survives across saves).
427
441
  if (String(parsedJson.businessContext ?? "").trim() === "") {
@@ -825,6 +839,21 @@ export default function (pi: ExtensionAPI) {
825
839
  fs.renameSync(glPath + ".tmp", glPath);
826
840
  }
827
841
 
842
+ // Seed the structured session with the ORIGINAL prompt so it is never
843
+ // lost: businessContext/originalPrompt carry the full business text and
844
+ // survive every domain_save_result merge (protected in mergeRawJson).
845
+ const seedRaw = {
846
+ sessionId,
847
+ businessContext: sanitized,
848
+ originalPrompt: sanitized,
849
+ status: "draft",
850
+ createdAt: new Date().toISOString(),
851
+ };
852
+ const seedPath = path.join(explorationDir, sessionId + ".raw.json");
853
+ const seedTmp = seedPath + ".tmp";
854
+ fs.writeFileSync(seedTmp, JSON.stringify(seedRaw, null, 2), "utf-8");
855
+ fs.renameSync(seedTmp, seedPath);
856
+
828
857
  ctx.ui.notify(
829
858
  "Domain analysis requested: " + sessionId,
830
859
  "success",
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-09-04T19:42:16Z",
2
+ "timestamp": "2026-09-04T20:10:05Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {
@@ -68,7 +68,7 @@
68
68
  "name": "secret_scan",
69
69
  "status": "pass",
70
70
  "message": "",
71
- "duration": 0
71
+ "duration": 1
72
72
  },
73
73
  {
74
74
  "name": "dependency_audit",