guardian-framework 0.1.137 → 0.1.139

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
@@ -3206,7 +3206,7 @@ __export(exports_package, {
3206
3206
  bin: () => bin,
3207
3207
  author: () => author
3208
3208
  });
3209
- var name = "guardian-framework", version = "0.1.137", 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;
3209
+ var name = "guardian-framework", version = "0.1.139", 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;
3210
3210
  var init_package = __esm(() => {
3211
3211
  exports = {
3212
3212
  ".": {
package/dist/exports.js CHANGED
@@ -1991,7 +1991,7 @@ __export(exports_package, {
1991
1991
  bin: () => bin,
1992
1992
  author: () => author
1993
1993
  });
1994
- var name = "guardian-framework", version = "0.1.137", 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;
1994
+ var name = "guardian-framework", version = "0.1.139", 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;
1995
1995
  var init_package = __esm(() => {
1996
1996
  exports = {
1997
1997
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.137",
3
+ "version": "0.1.139",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -262,8 +262,18 @@ function nextPhaseDecision(raw: Record<string, unknown>): { kind: PhaseKind; con
262
262
  const bcs = Array.isArray(raw.boundedContexts) ? (raw.boundedContexts as Record<string, unknown>[]) : [];
263
263
  if (bcs.length === 0) return { kind: "strategic" };
264
264
  const prog = (raw.protocolProgress as Record<string, unknown>) ?? {};
265
- if (prog.requirementsComplete !== true) return { kind: "requirements" };
266
- if (prog.usecasesComplete !== true) return { kind: "usecases" };
265
+ // Completion is flag-based when the model sets the flags, and INFERRED from
266
+ // content otherwise — the restored full protocol (self-sequencing, 0.1.137)
267
+ // does not emit requirementsComplete/usecasesComplete. Without this the
268
+ // driver would keep nudging phases the model already finished.
269
+ const frN = Array.isArray(raw.functionalRequirements) ? raw.functionalRequirements.length : 0;
270
+ const nfrN = Array.isArray(raw.nonFunctionalRequirements) ? raw.nonFunctionalRequirements.length : 0;
271
+ const appN = Array.isArray(raw.applicationServices) ? raw.applicationServices.length : 0;
272
+ const entN = Array.isArray(raw.entities) ? raw.entities.length : 0;
273
+ const requirementsDone = prog.requirementsComplete === true || (frN > 0 && nfrN > 0);
274
+ const usecasesDone = prog.usecasesComplete === true || appN > 0;
275
+ if (!requirementsDone) return { kind: "requirements" };
276
+ if (!usecasesDone) return { kind: "usecases" };
267
277
  // Per-context tactical passes for every non-supporting/generic context that is
268
278
  // not yet enriched (all strategic-listed entities present or any entity saved).
269
279
  const supporting = new Set(bcs
@@ -282,8 +292,13 @@ function nextPhaseDecision(raw: Record<string, unknown>): { kind: PhaseKind; con
282
292
  const bc = bcs.find((x) => String(x.name ?? "") === name);
283
293
  const need = (Array.isArray(bc?.entities) ? (bc!.entities as unknown[]) : []).map(String).filter(Boolean);
284
294
  const have = byContext.get(name);
285
- if (need.length > 0) return need.every((n) => have?.has(n));
286
- return (have?.size ?? 0) > 0 || (Array.isArray(bc?.invariants) && (bc!.invariants as unknown[]).length > 0);
295
+ const haveN = have?.size ?? 0;
296
+ // Count-based (strategic names are refined/renamed during the per-context
297
+ // pass, e.g. strategic "Evidence" -> saved "EvidenceItem"), so name-strict
298
+ // matching would loop. Multi-batch: a context with 12 strategic entities
299
+ // and 6 saved is NOT enriched yet — the driver nudges to continue it.
300
+ if (need.length > 0) return haveN >= need.length;
301
+ return haveN > 0 || (Array.isArray(bc?.invariants) && (bc!.invariants as unknown[]).length > 0);
287
302
  };
288
303
  for (const bc of bcs) {
289
304
  const name = String(bc.name ?? "");
@@ -385,6 +400,8 @@ function buildExploreProtocolMessage(sessionId: string, businessContext: string)
385
400
  " deliberation, no summaries — those burn your output budget and truncate the JSON.",
386
401
  " Emit ONLY the small JSON step for the current phase and stop.",
387
402
  "- After the last context, run /domain --validate " + sessionId + " and report the checks.",
403
+ "- THEN STOP. Exploration is the only task: do NOT run /domain --architect-scaffold or",
404
+ " /domain --enrich — the user triggers scaffold/enrich explicitly after reviewing the model.",
388
405
  ].join("\n");
389
406
  }
390
407
  function buildPhaseNudge(kind: PhaseKind, raw: Record<string, unknown>, sessionId: string, contextName?: string): string {
@@ -829,7 +846,7 @@ export default function (pi: ExtensionAPI) {
829
846
  const decision = nextPhaseDecision(parsedJson);
830
847
  const savedNote = "Domain exploration saved for " + sessionId + ".";
831
848
  if (decision.kind === "done") {
832
- return { content: [{ type: "text" as const, text: savedNote + " Exploration content complete — run /domain --validate " + sessionId }] };
849
+ return { content: [{ type: "text" as const, text: savedNote + " Exploration content complete — run /domain --validate " + sessionId + ", then STOP and report to the user. Do NOT run /domain --architect-scaffold or /domain --enrich; the user triggers those explicitly." }] };
833
850
  }
834
851
  const label = decision.kind === "context" ? "context " + (decision.contextName ?? "") : decision.kind;
835
852
  const nextMsg = buildPhaseNudge(decision.kind, parsedJson, sessionId, decision.contextName);
@@ -961,7 +978,7 @@ export default function (pi: ExtensionAPI) {
961
978
  const header = allPassed
962
979
  ? "Domain Validation - All Checks Passed"
963
980
  : "Domain Validation - Some Checks Failed";
964
- return toolResult(header + "\n" + checks.join("\n"));
981
+ return toolResult(header + "\n" + checks.join("\n") + "\n\nExploration is complete. Stop here — do not run /domain --architect-scaffold or /domain --enrich unless the user asks.");
965
982
  },
966
983
  });
967
984
 
@@ -1456,9 +1473,9 @@ export default function (pi: ExtensionAPI) {
1456
1473
  resultLines.push("", "### Next Steps");
1457
1474
  resultLines.push("1. Review ADR-001 in .pi/architecture/decisions/");
1458
1475
  resultLines.push("2. Review the system diagram in .pi/architecture/diagrams/");
1459
- resultLines.push("3. Use /epic-plan --overview or /architect to plan implementation");
1476
+ resultLines.push("3. Use /epic-plan --overview or /architect to plan implementation (when the user asks)");
1460
1477
  resultLines.push("");
1461
- resultLines.push("To enrich stubs with full DDD content: /domain --enrich " + sessionId);
1478
+ resultLines.push("When the user asks to enrich stubs with full DDD content: /domain --enrich " + sessionId);
1462
1479
 
1463
1480
  ctx.ui.notify("Architecture scaffold complete", "success");
1464
1481
  return resultLines.join("\n");
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-09-25T16:13:52Z",
2
+ "timestamp": "2026-09-25T17:15:00Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {