guardian-framework 0.1.102 → 0.1.104

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
@@ -3197,7 +3197,7 @@ __export(exports_package, {
3197
3197
  bin: () => bin,
3198
3198
  author: () => author
3199
3199
  });
3200
- var name = "guardian-framework", version = "0.1.102", 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;
3200
+ var name = "guardian-framework", version = "0.1.104", 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;
3201
3201
  var init_package = __esm(() => {
3202
3202
  exports = {
3203
3203
  ".": {
package/dist/exports.js CHANGED
@@ -1982,7 +1982,7 @@ __export(exports_package, {
1982
1982
  bin: () => bin,
1983
1983
  author: () => author
1984
1984
  });
1985
- var name = "guardian-framework", version = "0.1.102", 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;
1985
+ var name = "guardian-framework", version = "0.1.104", 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;
1986
1986
  var init_package = __esm(() => {
1987
1987
  exports = {
1988
1988
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.102",
3
+ "version": "0.1.104",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -121,15 +121,57 @@ function buildInScope(comp: ModuleComponent, primaryAcRows: AcRow[], implSteps:
121
121
  ];
122
122
  }
123
123
 
124
- /** Detect whether project at `cwd` is a Java project. */
125
- function isJavaProject(cwd?: string): boolean {
126
- if (!cwd) return false;
124
+ /** Supported project languages. */
125
+ type ProjectLanguage = "typescript" | "java" | "python" | "go" | "rust";
126
+
127
+ /** Detect project language at `cwd` by checking for build files. */
128
+ function detectLanguage(cwd?: string): ProjectLanguage {
129
+ if (!cwd) return "typescript";
127
130
  try {
128
- return existsSync(join(cwd, "pom.xml")) ||
129
- existsSync(join(cwd, "build.gradle")) ||
130
- existsSync(join(cwd, "build.gradle.kts"));
131
+ if (existsSync(join(cwd, "pom.xml")) || existsSync(join(cwd, "build.gradle")) || existsSync(join(cwd, "build.gradle.kts")))
132
+ return "java";
133
+ if (existsSync(join(cwd, "go.mod")))
134
+ return "go";
135
+ if (existsSync(join(cwd, "Cargo.toml")))
136
+ return "rust";
137
+ if (existsSync(join(cwd, "pyproject.toml")) || existsSync(join(cwd, "setup.py")) || existsSync(join(cwd, "requirements.txt")))
138
+ return "python";
139
+ return "typescript";
131
140
  } catch {
132
- return false;
141
+ return "typescript";
142
+ }
143
+ }
144
+
145
+ /** Language-specific file extension for implementation files. */
146
+ function implExtension(lang: ProjectLanguage): string {
147
+ switch (lang) {
148
+ case "java": return "java";
149
+ case "python": return "py";
150
+ case "go": return "go";
151
+ case "rust": return "rs";
152
+ default: return "ts";
153
+ }
154
+ }
155
+
156
+ /** Language-specific test directory base. */
157
+ function testBaseDirFromLang(lang: ProjectLanguage): string {
158
+ switch (lang) {
159
+ case "java": return "src/test/java";
160
+ case "python": return "tests";
161
+ case "go": return "tests";
162
+ case "rust": return "tests";
163
+ default: return "tests/unit";
164
+ }
165
+ }
166
+
167
+ /** Language-specific test runner command hint. */
168
+ function testRunnerHintFromLang(lang: ProjectLanguage): string {
169
+ switch (lang) {
170
+ case "java": return "mvn test";
171
+ case "python": return "pytest";
172
+ case "go": return "go test ./...";
173
+ case "rust": return "cargo test";
174
+ default: return "bun test";
133
175
  }
134
176
  }
135
177
 
@@ -156,9 +198,10 @@ export function generateIssueMarkdown(
156
198
  const inScope = buildInScope(comp, compAcs, implSteps, moduleId);
157
199
 
158
200
  // Language-aware test paths
159
- const isJava = isJavaProject(cwd);
160
- const testBaseDir = isJava ? "src/test/java" : "tests/unit";
161
- const testRunnerHint = isJava ? "mvn test" : "bun test";
201
+ const lang = detectLanguage(cwd);
202
+ const ext = implExtension(lang);
203
+ const testBaseDir = testBaseDirFromLang(lang);
204
+ const testRunnerHint = testRunnerHintFromLang(lang);
162
205
 
163
206
  const testLine = tdd
164
207
  ? ` - "update: ${testBaseDir}/ (failing tests already generated — make them pass)"`
@@ -252,7 +295,7 @@ ${yamlAcs}
252
295
  All Acceptance Criteria in that file must be satisfied before this issue is closed.
253
296
  Component focus: ${comp.name}.
254
297
  CONCRETE IMPLEMENTATIONS MUST BE CREATED — interface stubs from the contract freeze
255
- are not sufficient. Each domain service/aggregate needs a concrete .impl.${isJava ? "java" : "ts"} file.
298
+ are not sufficient. Each domain service/aggregate needs a concrete .impl.${ext} file.
256
299
 
257
300
  file_changes:
258
301
  - "create: src/${moduleId}/domain/"
@@ -307,7 +350,7 @@ ${stepsMarkdown}
307
350
  > **Agent instructions:**
308
351
  > 1. Open \`.pi/architecture/modules/${slice.module}.md\` — read the full Acceptance Criteria table
309
352
  > 2. Identify which rows are your responsibility for **${comp.name}**
310
- > 3. Create concrete implementation files (\`.impl.${isJava ? "java" : "ts"}\`) in \`src/${moduleId}/\` — the interface stubs from the contract freeze are NOT enough
353
+ > 3. Create concrete implementation files (\`.impl.${ext}\`) in \`src/${moduleId}/\` — the interface stubs from the contract freeze are NOT enough
311
354
  > 4. Each domain aggregate/service must have a working implementation with business logic
312
355
  > 5. Verify each AC row is satisfied in \`src/\` before marking done
313
356
  > 6. Run validators and create MR
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-07-20T12:29:56Z",
2
+ "timestamp": "2026-07-20T15:54:07Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {
@@ -5,6 +5,13 @@
5
5
 
6
6
  ## General Rules
7
7
 
8
+ > **IMPORTANT — Controllers/routers are CONCRETE, no interface needed:**
9
+ > HTTP controllers, routers, and API handlers must NOT have a separate contract
10
+ > interface (no `IUserController`, no `UserHandlerInterface`, no `handlers.ts`
11
+ > as a type contract). The concrete router/handler file IS the contract.
12
+ > Domain interfaces (services, repositories) SHOULD have interfaces — but the
13
+ > HTTP layer is an adapter, not an abstractable domain concern.
14
+
8
15
  Every issue must contain:
9
16
 
10
17
  - **Why** — Business or platform reason