guardian-framework 0.1.41 → 0.1.43

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
@@ -1335,7 +1335,7 @@ __export(exports_package, {
1335
1335
  bin: () => bin,
1336
1336
  author: () => author
1337
1337
  });
1338
- var name = "guardian-framework", version = "0.1.41", 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;
1338
+ var name = "guardian-framework", version = "0.1.43", 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;
1339
1339
  var init_package = __esm(() => {
1340
1340
  exports = {
1341
1341
  ".": {
package/dist/exports.js CHANGED
@@ -995,7 +995,7 @@ __export(exports_package, {
995
995
  bin: () => bin,
996
996
  author: () => author
997
997
  });
998
- var name = "guardian-framework", version = "0.1.41", 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;
998
+ var name = "guardian-framework", version = "0.1.43", 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;
999
999
  var init_package = __esm(() => {
1000
1000
  exports = {
1001
1001
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -446,8 +446,11 @@ export default function (pi: ExtensionAPI) {
446
446
  issueContent || `Review .pi/issues/${issueFilename} for full details.`,
447
447
  ].join("\n");
448
448
 
449
- ctx.ui.notify(`Epic "${epicName}" created with ${items.length} issues. Pipeline ${pipelineId} ready.`, "success");
450
- return instructions;
449
+ pi.sendMessage(
450
+ { content: instructions, display: true },
451
+ { deliverAs: "followUp", triggerTurn: true },
452
+ );
453
+ return;
451
454
  } catch (e) {
452
455
  ctx.ui.notify(`Architect error: ${e}`, "error");
453
456
  }
@@ -404,6 +404,7 @@ class PipelineManager {
404
404
  this.state.status = "done";
405
405
  this.state.currentItemIndex = this.state.items.length;
406
406
  this.state.currentStepIndex = 0;
407
+ this.syncRoadmapState();
407
408
  changed = true;
408
409
  }
409
410
 
@@ -608,16 +609,8 @@ class PipelineManager {
608
609
  advanceStep(): void {
609
610
  if (!this.state) return;
610
611
 
611
- // Before advancing, verify the current step's work actually happened
612
+ // Auto-run acceptance gates for validate steps
612
613
  if (this.state.currentStepIndex < this.state.steps.length) {
613
- const { verified, reason } = this.verifyCurrentStep();
614
- if (!verified) {
615
- // Reality disagrees with state — reconcile from git and refuse to advance
616
- this.reconcile();
617
- return; // don't advance, state was wrong
618
- }
619
-
620
- // Auto-run acceptance gates for validate steps
621
614
  const step = this.state.steps[this.state.currentStepIndex];
622
615
  if (step.name === "validate" && step.acceptance.type !== "none") {
623
616
  const { allPassed, errors } = this.runAcceptanceGates(step);
@@ -661,12 +654,54 @@ class PipelineManager {
661
654
 
662
655
  if (this.state.currentItemIndex >= this.state.items.length) {
663
656
  this.state.status = "done";
657
+ this.syncRoadmapState();
664
658
  }
665
659
  }
666
660
 
667
661
  savePipelineState(this.cwd, this.state);
668
662
  }
669
663
 
664
+ /**
665
+ * When pipeline completes, sync the roadmap state file to reflect done phases.
666
+ */
667
+ private syncRoadmapState(): void {
668
+ try {
669
+ const roadmapPath = join(this.cwd, ".pi", ".guardian-roadmap-state.json");
670
+ if (!existsSync(roadmapPath)) return;
671
+ const raw = readFileSync(roadmapPath, "utf-8");
672
+ const roadmap = JSON.parse(raw) as { phases?: { index: number; status: string }[] };
673
+ if (!roadmap.phases) return;
674
+ for (const phase of roadmap.phases) {
675
+ const phaseModules = this.state!.items.filter((item) =>
676
+ item.toLowerCase().includes(`phase${phase.index}`) ||
677
+ this.isItemInPhase(item, phase.index)
678
+ );
679
+ const allDone = phaseModules.every((item) => {
680
+ const r = this.state!.results.find((res) => res.item === item);
681
+ return r && r.status === "done";
682
+ });
683
+ if (allDone && phaseModules.length > 0) {
684
+ phase.status = "done";
685
+ }
686
+ }
687
+ writeFileSync(roadmapPath, JSON.stringify(roadmap, null, 2));
688
+ } catch { /* roadmap file may not exist */ }
689
+ }
690
+
691
+ private isItemInPhase(item: string, phaseIndex: number): boolean {
692
+ try {
693
+ const roadmapPath = join(this.cwd, ".pi", "architecture", "implementation-roadmap.md");
694
+ if (!existsSync(roadmapPath)) return false;
695
+ const content = readFileSync(roadmapPath, "utf-8");
696
+ // Check if item appears under the phase section
697
+ const phaseSection = content.match(
698
+ new RegExp(`## Phase ${phaseIndex}:.*?\\n(?:.|\\n)*?(?=\\n## Phase|$)`),
699
+ );
700
+ if (!phaseSection) return false;
701
+ return phaseSection[0].includes(item);
702
+ } catch { return false; }
703
+ }
704
+
670
705
  /**
671
706
  * Run acceptance gates for a step and return pass/fail.
672
707
  */
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-07-04T06:05:46Z",
2
+ "timestamp": "2026-07-04T06:23:57Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {
@@ -8,7 +8,7 @@
8
8
  "failed": 1,
9
9
  "skipped": 12
10
10
  },
11
- "duration_seconds": 0,
11
+ "duration_seconds": 1,
12
12
  "results": [
13
13
  {
14
14
  "name": "check_mr_traceability.sh",