guardian-framework 0.1.141 → 0.1.143

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.141", 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.143", 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
  ".": {
@@ -14583,7 +14583,8 @@ function generateProjectStructure(targetDir, options) {
14583
14583
  return { modules, layers, files: files2 };
14584
14584
  }
14585
14585
  function runProjectGenerator(targetDir, archDir, options) {
14586
- const modules = options.dryRun ? ["billing", "notifications", "shared"] : discoverModules(archDir);
14586
+ const withContexts = options.withContexts === true;
14587
+ const modules = options.dryRun ? withContexts ? ["billing", "notifications", "shared"] : ["shared"] : withContexts ? discoverModules(archDir) : ["shared"];
14587
14588
  const resolvedModules = modules.length > 0 ? modules : ["shared"];
14588
14589
  const layers = resolveLayers(archDir, options.language, options.defaults);
14589
14590
  return generateProjectStructure(targetDir, {
@@ -14603,7 +14604,7 @@ function existingProjectDetected(targetDir) {
14603
14604
  return fs15.existsSync(srcDir);
14604
14605
  }
14605
14606
  async function runProjectCreate(targetDir, options) {
14606
- const { language, buildTool, groupId, repoTool, validators, dryRun, force } = options;
14607
+ const { language, buildTool, groupId, repoTool, validators, dryRun, force, withContexts } = options;
14607
14608
  if (!SUPPORTED_LANGUAGES.includes(language)) {
14608
14609
  showError(`Unsupported language: ${language}. Supported: ${SUPPORTED_LANGUAGES.join(", ")}`);
14609
14610
  return;
@@ -14639,7 +14640,8 @@ async function runProjectCreate(targetDir, options) {
14639
14640
  groupId,
14640
14641
  buildTool,
14641
14642
  dryRun,
14642
- defaults
14643
+ defaults,
14644
+ withContexts
14643
14645
  });
14644
14646
  if (dryRun) {
14645
14647
  console.log(" Modules:");
@@ -14653,8 +14655,14 @@ async function runProjectCreate(targetDir, options) {
14653
14655
  console.log(` Files to create: ${structurePlan.files.length}
14654
14656
  `);
14655
14657
  } else {
14656
- console.log(` \u2705 ${structurePlan.files.length} files created (${structurePlan.modules.length} modules \xD7 ${structurePlan.layers.length} layers)
14658
+ const scope = withContexts ? `${structurePlan.modules.length} bounded contexts` : "minimal bootstrap: shared kernel";
14659
+ console.log(` \u2705 ${structurePlan.files.length} files created (${scope} \xD7 ${structurePlan.layers.length} layers)
14657
14660
  `);
14661
+ if (!withContexts) {
14662
+ console.log(" \u2139\uFE0F Minimal bootstrap: bounded-context folders are created per roadmap phase.");
14663
+ console.log(` Pre-create every context tree with --withContexts (not recommended).
14664
+ `);
14665
+ }
14658
14666
  }
14659
14667
  console.log(dryRun ? "\uD83D\uDCCB [DRY-RUN] Generating build configuration..." : "\uD83D\uDCC4 Generating build configuration...");
14660
14668
  const buildPlan = generateBuildConfig(targetDir, {
@@ -15571,6 +15579,7 @@ async function runCli() {
15571
15579
  workflows: { type: "string" },
15572
15580
  nonInteractive: { type: "boolean" },
15573
15581
  dryRun: { type: "boolean" },
15582
+ withContexts: { type: "boolean" },
15574
15583
  groupId: { type: "string" },
15575
15584
  force: { type: "boolean" },
15576
15585
  regenerate: { type: "boolean" },
@@ -15629,6 +15638,8 @@ Project options:
15629
15638
  --validators <list> Validators for CI pipeline
15630
15639
  --dryRun Show plan without writing files
15631
15640
  --force Override existing project guard
15641
+ --withContexts Pre-create every bounded-context tree (default: minimal
15642
+ bootstrap \u2014 shared kernel only; contexts come per phase)
15632
15643
  --workflows <list> Workflows (comma-separated)
15633
15644
  --nonInteractive Use defaults/flags, skip prompts
15634
15645
 
@@ -15737,7 +15748,8 @@ async function runCommand(command, args) {
15737
15748
  repoTool: resolvedRepoTool,
15738
15749
  validators: args.values.validators?.split(",") || ["ci", "tests"],
15739
15750
  dryRun: args.values.dryRun,
15740
- force: args.values.force
15751
+ force: args.values.force,
15752
+ withContexts: args.values.withContexts
15741
15753
  });
15742
15754
  } else {
15743
15755
  console.error("Usage: guardian project create [options]");
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.141", 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.143", 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
  ".": {
@@ -14143,7 +14143,8 @@ function generateProjectStructure(targetDir, options) {
14143
14143
  return { modules, layers, files: files2 };
14144
14144
  }
14145
14145
  function runProjectGenerator(targetDir, archDir, options) {
14146
- const modules = options.dryRun ? ["billing", "notifications", "shared"] : discoverModules(archDir);
14146
+ const withContexts = options.withContexts === true;
14147
+ const modules = options.dryRun ? withContexts ? ["billing", "notifications", "shared"] : ["shared"] : withContexts ? discoverModules(archDir) : ["shared"];
14147
14148
  const resolvedModules = modules.length > 0 ? modules : ["shared"];
14148
14149
  const layers = resolveLayers(archDir, options.language, options.defaults);
14149
14150
  return generateProjectStructure(targetDir, {
@@ -14163,7 +14164,7 @@ function existingProjectDetected(targetDir) {
14163
14164
  return fs17.existsSync(srcDir);
14164
14165
  }
14165
14166
  async function runProjectCreate(targetDir, options) {
14166
- const { language, buildTool, groupId, repoTool, validators, dryRun, force } = options;
14167
+ const { language, buildTool, groupId, repoTool, validators, dryRun, force, withContexts } = options;
14167
14168
  if (!SUPPORTED_LANGUAGES.includes(language)) {
14168
14169
  showError(`Unsupported language: ${language}. Supported: ${SUPPORTED_LANGUAGES.join(", ")}`);
14169
14170
  return;
@@ -14199,7 +14200,8 @@ async function runProjectCreate(targetDir, options) {
14199
14200
  groupId,
14200
14201
  buildTool,
14201
14202
  dryRun,
14202
- defaults
14203
+ defaults,
14204
+ withContexts
14203
14205
  });
14204
14206
  if (dryRun) {
14205
14207
  console.log(" Modules:");
@@ -14213,8 +14215,14 @@ async function runProjectCreate(targetDir, options) {
14213
14215
  console.log(` Files to create: ${structurePlan.files.length}
14214
14216
  `);
14215
14217
  } else {
14216
- console.log(` ✅ ${structurePlan.files.length} files created (${structurePlan.modules.length} modules × ${structurePlan.layers.length} layers)
14218
+ const scope = withContexts ? `${structurePlan.modules.length} bounded contexts` : "minimal bootstrap: shared kernel";
14219
+ console.log(` ✅ ${structurePlan.files.length} files created (${scope} × ${structurePlan.layers.length} layers)
14217
14220
  `);
14221
+ if (!withContexts) {
14222
+ console.log(" ℹ️ Minimal bootstrap: bounded-context folders are created per roadmap phase.");
14223
+ console.log(` Pre-create every context tree with --withContexts (not recommended).
14224
+ `);
14225
+ }
14218
14226
  }
14219
14227
  console.log(dryRun ? "\uD83D\uDCCB [DRY-RUN] Generating build configuration..." : "\uD83D\uDCC4 Generating build configuration...");
14220
14228
  const buildPlan = generateBuildConfig(targetDir, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.141",
3
+ "version": "0.1.143",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -13,9 +13,17 @@ contexts into delivery phases with explicit dependencies, database migrations, a
13
13
  acceptance criteria.
14
14
 
15
15
  **Format conventions:**
16
- - Each `## Phase N` section defines one delivery phase
17
- - `### Modules` table lists the bounded contexts implemented in this phase
18
- - `### Dependencies` lists phase prerequisites
16
+ - `## Phase 0: Project Bootstrap` is MINIMUM project setup (build/deps, shared kernel layout,
17
+ config, error envelope, migration tooling, CI + validators, test harness, entrypoint). It is
18
+ NOT a bounded context: no `### Modules` rows and no context folders (context folders are
19
+ created in each context's own build phase)
20
+ - Each `## Phase N` (N≥1) section defines one delivery phase
21
+ - `### Modules` table lists ONLY the bounded contexts built in this phase (contexts start Phase 1)
22
+ - **Invariant:** each bounded context appears in exactly ONE phase's `### Modules` table
23
+ (its build phase). Modules a phase merely uses are referenced under `### Dependencies`,
24
+ never re-listed as Modules (no repeats, no "All")
25
+ - `### Dependencies` lists upstream phases AND the modules they provide (keep these
26
+ references — implementation agents use them)
19
27
  - `### Database Migrations` lists SQL migration files
20
28
  - `### Acceptance Criteria` lists verifiable checkboxes
21
29
 
@@ -1586,6 +1586,34 @@ export default function (pi: ExtensionAPI) {
1586
1586
  if (chunks.length > 0) servicesCatalog = chunks.join("\n\n");
1587
1587
  } catch { /* leave fallback text */ }
1588
1588
 
1589
+ // Dependency context for the roadmap phase: keep the references (they are
1590
+ // useful) and hand the agent the graph so it can order phases without
1591
+ // duplicating a module across Modules tables.
1592
+ let dependencyContext = "(no dependency sections found)";
1593
+ try {
1594
+ const depRaw = JSON.parse(fs.readFileSync(sRawPath, "utf-8")) as Record<string, unknown>;
1595
+ const lines: string[] = [];
1596
+ for (const f of moduleFiles) {
1597
+ const doc = fs.readFileSync(path.join(modulesDir, f), "utf-8");
1598
+ // Accept both formats: "### Depends On" (list of module names/links) and
1599
+ // "**Depends On**". Keep the raw bullets — maximum context for the agent
1600
+ // (references are useful), not just parsed names.
1601
+ const m = doc.match(/(?:###\s*Depends On|\**Depends On\**)\s*\n([\s\S]*?)(?=\n\s*(?:###\s*Used By|\**Used By\**|###\s|##\s)|$)/i);
1602
+ if (!m) continue;
1603
+ const bullets = m[1].split("\n").map((l) => l.trim()).filter((l) => l.startsWith("-")).join("\n");
1604
+ if (bullets) lines.push("### " + f + "\n" + bullets);
1605
+ }
1606
+ const edges = Array.isArray(depRaw.contextMap) ? (depRaw.contextMap as Record<string, unknown>[]) : [];
1607
+ if (edges.length > 0) {
1608
+ lines.push("");
1609
+ lines.push("Context-map relationships (context → context):");
1610
+ for (const e of edges) {
1611
+ lines.push("- " + String(e.from ?? "") + " → " + String(e.to ?? "") + " (" + String(e.relationship ?? "") + ")" + (e.note ? " — " + String(e.note) : ""));
1612
+ }
1613
+ }
1614
+ if (lines.length > 0) dependencyContext = lines.join("\n");
1615
+ } catch { /* leave fallback text */ }
1616
+
1589
1617
  const enrichPrompt = [
1590
1618
  "## Task: Complete Architecture Package",
1591
1619
  "",
@@ -1602,6 +1630,14 @@ export default function (pi: ExtensionAPI) {
1602
1630
  "",
1603
1631
  servicesCatalog,
1604
1632
  "",
1633
+ "### Module dependency references (CONTEXT for phase ordering — keep these, they are useful)",
1634
+ "",
1635
+ "Order phases so a module's dependencies are built first. These are REFERENCES: if a",
1636
+ "later phase uses a module, list it under that phase's `### Dependencies` (with what it",
1637
+ "provides) — never again in its `### Modules` table.",
1638
+ "",
1639
+ dependencyContext,
1640
+ "",
1605
1641
  "**YOU MUST FOLLOW THESE 3 STEPS IN ORDER. Do not skip steps or reorder them.**",
1606
1642
  "",
1607
1643
  "### Source Data",
@@ -1705,16 +1741,38 @@ export default function (pi: ExtensionAPI) {
1705
1741
  "",
1706
1742
  "**After all module docs are enriched, generate the implementation roadmap.**",
1707
1743
  "",
1708
- "Read each module doc's dependency section and create `.pi/architecture/implementation-roadmap.md`",
1709
- "with `## Phase N: Name (Days N-N)` sections, each having:",
1710
- "- Goal, Modules table, Dependencies, Database Migrations, Acceptance Criteria",
1744
+ "Read each module doc's dependency section and the dependency references above; create",
1745
+ "`.pi/architecture/implementation-roadmap.md` with `## Phase N: Name (Days N-N)` sections,",
1746
+ "each having: Goal, Modules table, Dependencies, Database Migrations, Acceptance Criteria.",
1747
+ "",
1748
+ "HARD RULES:",
1749
+ "- Phase 0 is ALWAYS `## Phase 0: Project Bootstrap` — MINIMUM project setup, NOT a",
1750
+ " bounded context. It has no `### Modules` rows (write 'Bootstrap only — no bounded",
1751
+ " contexts' or omit the table). Deliverables: language toolchain + dependency manifest,",
1752
+ " top-level package layout with the shared kernel, config/env handling, error envelope +",
1753
+ " logging baseline, DB migration TOOLING (no module tables), CI + architecture validators,",
1754
+ " test harness, entrypoint with /healthz + /readyz. Reference `/project create` in the",
1755
+ " Goal line. Acceptance: project builds and boots; lint/test/validators green on an empty",
1756
+ " suite. Do NOT create bounded-context folders — each context's folders are created in its",
1757
+ " own build phase.",
1758
+ "- Each bounded context appears in EXACTLY ONE phase's `### Modules` table — the phase where",
1759
+ " it is built (the earliest phase whose dependencies are already satisfied). Never re-list a",
1760
+ " module in a later phase: no repeats, no 'All', no 'Hardening applies to all modules' row.",
1761
+ "- Modules a phase merely USES go under `### Dependencies`, naming what they provide",
1762
+ " (ports/types/endpoints). Keep those references — they are useful and must not be dropped.",
1763
+ "- Total `### Modules` rows across phases 1..N MUST equal the number of module docs",
1764
+ " (Phase 0 Bootstrap contributes 0 rows).",
1765
+ "- Keep the `| Module | Deliverables | Architecture Doc |` columns; Architecture Doc links",
1766
+ " are the per-phase reference that implementation agents follow.",
1711
1767
  "",
1712
1768
  "Organize phases by dependency chain:",
1713
- "- Phase 0: Foundation (no upstream deps)",
1714
- "- Phase 1: Core services depending on Phase 0",
1715
- "- Phase 2+: Following the dependency chain",
1769
+ "- Phase 0: Project Bootstrap — minimal setup only (no bounded contexts, no context folders)",
1770
+ "- Phase 1: Foundation — contexts with no upstream dependencies (their folders appear here)",
1771
+ "- Phase 2+: contexts whose dependencies were built in earlier phases, and so on",
1772
+ "- Do not create a phase just to group later touches of an already-built module.",
1716
1773
  "",
1717
- "Also add: Dependency Graph, Effort Estimates table, Key Milestones",
1774
+ "Also add: Dependency Graph (phase arrows + which modules cross phase boundaries),",
1775
+ "Effort Estimates table, Key Milestones",
1718
1776
  "",
1719
1777
  "### STEP 5: Fill Architecture CHANGELOG",
1720
1778
  "",
@@ -154,6 +154,7 @@ export default function (pi: ExtensionAPI) {
154
154
  const validators = String(parsed.validators || "ci,tests");
155
155
  const dryRun = parsed.dryRun === true || parsed["dry-run"] === true || parsed.d === true;
156
156
  const force = parsed.force === true || parsed.f === true;
157
+ const withContexts = parsed.withContexts === true || parsed["with-contexts"] === true;
157
158
 
158
159
  // Validate language
159
160
  if (!lang || !SUPPORTED_LANGUAGES.includes(lang as typeof SUPPORTED_LANGUAGES[number])) {
@@ -194,6 +195,7 @@ export default function (pi: ExtensionAPI) {
194
195
  };
195
196
  if (dryRun) shellArgs.dryRun = true;
196
197
  if (force) shellArgs.force = true;
198
+ if (withContexts) shellArgs.withContexts = true;
197
199
 
198
200
  const fullCmd = cmd(`${guardianCmd} project create`, shellArgs);
199
201
 
@@ -232,7 +234,9 @@ export default function (pi: ExtensionAPI) {
232
234
  "",
233
235
  dryRun
234
236
  ? "Run without --dryRun to create the project."
235
- : "Project scaffolded. Next: create architecture module docs and use /architect to plan epics.",
237
+ : withContexts
238
+ ? "Project scaffolded (all context trees pre-created). Next: /architect to plan epics."
239
+ : "Minimal project bootstrap complete (shared kernel only; context folders are created per roadmap phase). Next: /architect to plan epics.",
236
240
  ]
237
241
  .filter(Boolean)
238
242
  .join("\n");
@@ -259,9 +263,10 @@ export default function (pi: ExtensionAPI) {
259
263
  "Available /project subcommands:",
260
264
  "",
261
265
  " /project create --lang <language> [options]",
262
- " Scaffold project from architecture decisions",
266
+ " Minimal project bootstrap from architecture decisions (shared kernel + build/CI).",
267
+ " Bounded-context folders are created per roadmap phase, not upfront.",
263
268
  " Required: --lang (typescript, rust, python, go, java)",
264
- " Options: --buildTool, --groupId, --validators, --dryRun, --force",
269
+ " Options: --buildTool, --groupId, --validators, --dryRun, --force, --withContexts",
265
270
  "",
266
271
  " /project status",
267
272
  " Show current scaffolding status",
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-09-25T19:29:02Z",
2
+ "timestamp": "2026-09-25T19:59:49Z",
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": 1,
11
+ "duration_seconds": 0,
12
12
  "results": [
13
13
  {
14
14
  "name": "check_mr_traceability.sh",