@getchomp/cli 0.2.45 → 0.2.46

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.
@@ -11,10 +11,10 @@ import { startUiServer } from "./ui.js";
11
11
  export const HARNESS_TEXT = `
12
12
  # --- BEGIN CHOMP HARNESS ---
13
13
  You are working in a Chomp-enabled workspace. Use the live codebase map first instead of guessing structure with grep or blind file scans:
14
- 1. Resolve target node IDs with chomp_get_nodes (using search_term / packageName) BEFORE reading source files. For frontend CSS, Tailwind, or React UI edits, call chomp_audit_design_system in parallel during initial discovery. When the user asks an architectural question, queries how a flow works, or requests a visual walkthrough, IMMEDIATELY call chomp_create_view (passing viewLevel: "system" | "package") to spotlight the flow on Chomp Map and share the returned viewUrl link. Do NOT call chomp_create_view on routine coding or implementation prompts.
15
- 2. Call chomp_get_blast_radius (with create_view: false during coding tasks, or create_view: true when answering impact questions) BEFORE modifying a function, class, or route to check upstream callers, downstream dependencies, and input/output types, and use chomp_get_edges to trace call paths.
14
+ 1. Resolve target node IDs BEFORE reading source files by batching terms into a single chomp_get_nodes call using search_terms: [...] (or file_paths: [...] / packageName) instead of firing many single-term lookups. For frontend CSS, Tailwind, or React UI edits, call chomp_audit_design_system in parallel during initial discovery. Only call chomp_create_view (viewLevel: "system" | "package") when the user asks an architectural question, queries how a flow works, or requests a visual walkthrough—do NOT call chomp_create_view on coding prompts.
15
+ 2. Call chomp_get_blast_radius (create_view: false) BEFORE modifying a function, class, or route to check upstream callers, downstream dependencies, and input/output types, and use chomp_get_edges to trace call paths.
16
16
  3. Align new code with canonical workspace boundaries and shared packages (use chomp_get_conventions when unsure, and chomp_local_shims to add Bridges for dynamic or dependency-injected calls).
17
- 4. After finishing edits, run your verification gate IN PARALLEL IN A SINGLE TURN: call chomp_get_diff (which includes architecturalGate for newly introduced middlemen, duplicate flows, duplicate symbols, boundary violations, and cycles; or pass only_new: true to chomp_find_redundancies / chomp_check_boundaries) alongside chomp_diff_design_system when UI files changed. Only fix newly introduced middlemen, duplicate flows, boundary violations, or design-system regressions; do NOT chase pre-existing repo advisories or standard framework/hook unresolved call counts.
17
+ 4. After finishing edits, call chomp_get_diff ONCE as your unified post-edit gate (it evaluates both architecturalGate—new pass-through middlemen, duplicate flows/symbols, upward boundary violations, and cycles—and designSystemGate when a design-system baseline exists). If gateStatus is "PASS", STOP IMMEDIATELY—do NOT call chomp_check_boundaries, chomp_find_redundancies, or chomp_diff_design_system separately. Only call those drill-down tools (with only_new: true) when chomp_get_diff reports "WARN" and you need details to fix a newly introduced regression; never chase pre-existing advisories.
18
18
  # --- END CHOMP HARNESS ---
19
19
  `.trim() + "\n";
20
20
  export const CHOMP_HOOK_BLOCK = `
@@ -360,11 +360,11 @@ export function installKiroIntegration(repoRoot, options) {
360
360
  "",
361
361
  "## Core Workflow",
362
362
  "",
363
- "1. **Map-First Navigation:** Call `chomp_get_nodes` (`search_term` / `packageName`) and `chomp_get_edges` before reading files.",
363
+ "1. **Map-First Navigation:** Batch lookups into a single `chomp_get_nodes` call (`search_terms: [...]` / `file_paths: [...]` / `packageName`) and trace flows with `chomp_get_edges` before reading files.",
364
364
  "2. **Pre-Edit Impact:** Call `chomp_get_blast_radius` (`create_view: false` during coding tasks) before modifying functions, classes, or routes.",
365
365
  "3. **Spotlight Views (Questions Only):** Call `chomp_create_view` only when answering architectural questions or walkthrough requests.",
366
- "4. **Health, Boundaries & Design System:** Call `chomp_audit_health`, `chomp_find_redundancies`, `chomp_check_boundaries`, `chomp_get_conventions`, `chomp_local_shims`, and `chomp_audit_design_system` (for frontend work).",
367
- "5. **Post-Edit Verification:** Call `chomp_get_diff` (and `chomp_diff_design_system` for frontend changes) before completing code changes.",
366
+ "4. **Health, Boundaries & Design System:** Call `chomp_audit_design_system` upfront for frontend work, and `chomp_get_conventions` / `chomp_local_shims` when aligning dynamic patterns.",
367
+ "5. **Unified Post-Edit Gate:** Call `chomp_get_diff` ONCE after edits. If `gateStatus` is `'PASS'`, stop immediately—only call `chomp_check_boundaries`, `chomp_find_redundancies`, or `chomp_diff_design_system` (`only_new: true`) when `chomp_get_diff` reports `'WARN'`.",
368
368
  ].join("\n") + "\n";
369
369
  writeFileSync(powerMdPath, powerMd, "utf8");
370
370
  writeFileSync(powerMcpPath, JSON.stringify({
@@ -217,7 +217,10 @@ export function registerLayoutRoutes(app, state) {
217
217
  if (effectiveTargetRef !== "WORKING_TREE") {
218
218
  const targetRefInfo = await resolveGitRefInfo(repoPath, effectiveTargetRef, gitTargets);
219
219
  if (!targetRefInfo) {
220
- throw new Error(`Unable to resolve git ref '${effectiveTargetRef}' in ${repoPath}`);
220
+ return res.status(404).json({
221
+ error: `Unable to resolve git ref '${effectiveTargetRef}' in ${repoPath}`,
222
+ code: "UNKNOWN_GIT_REF",
223
+ });
221
224
  }
222
225
  const baseShaFull = baseRefInfo?.fullCommitSha ?? activeCommitSha ?? "base";
223
226
  const targetShaFull = targetRefInfo.fullCommitSha;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getchomp/cli",
3
- "version": "0.2.45",
3
+ "version": "0.2.46",
4
4
  "description": "Chomp CLI and local server — map your codebase, check architecture health, and launch Chomp Map.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://getchomp.dev",
@@ -36,9 +36,9 @@
36
36
  "express": "^5.2.1",
37
37
  "typescript": "^5.3.0",
38
38
  "zod": "^3.23.8",
39
- "@getchomp/core": "0.2.45",
40
- "@getchomp/db": "0.2.45",
41
- "@getchomp/mcp": "0.2.45"
39
+ "@getchomp/core": "0.2.46",
40
+ "@getchomp/mcp": "0.2.46",
41
+ "@getchomp/db": "0.2.46"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/better-sqlite3": "^7.6.11",