From ec52834cd46fb861c5cd985a10eee1ff018cb093 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sat, 1 Aug 2026 11:39:35 -0400 Subject: [PATCH] fix: correct stale min attribute and MCP wording from inventory removal Three small leftovers from Task 7 / the inventory-quantity-tracking removal that a final review caught: - Edit.razor's custom-stock quantity input still had min="1" even though its own helper text says "Use -1 for unlimited", validation already accepts -1, and the add-form defaults Quantity to -1 - so the field rendered pre-populated with a value the browser's native min validation flagged as invalid. Matches the min="-1" fix already applied to the catalog-stock input in Task 7. - optimize_job's MCP tool description still claimed the optimizer falls back to "available inventory" when no stock is configured - that auto-discovery fallback was removed in Task 3. An LLM reads this description as ground truth, so stale wording here actively misleads tool use. Also tightened add_job_stock's stockItemId/ isCustomLength wording, which still said "inventory" for what is now just the stock catalog. - CLAUDE.md's CutListPackingService summary said InStockBins comes "from inventory", nudging future readers back toward the auto-discovery mental model this plan removed. --- CLAUDE.md | 2 +- CutList.Mcp/JobTools.cs | 6 +++--- CutList.Web/Components/Pages/Jobs/Edit.razor | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 610b996..ea00d3d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -162,7 +162,7 @@ Abstract base with TPC (Table Per Concrete type) mapping — each shape gets its ### CutListPackingService - `PackAsync(parts, kerfInches, jobStock?)` — runs optimization per material group -- Separates results into `InStockBins` (from inventory) and `ToBePurchasedBins` +- Separates results into `InStockBins` (from catalog-sourced job stock) and `ToBePurchasedBins` - `GetSummary(result)` — calculates total bins, pieces, waste, efficiency % - `SerializeResult(result)` / `LoadSavedResult(json)` — JSON round-trip via DTO layer (`SavedOptimizationResult` etc.) diff --git a/CutList.Mcp/JobTools.cs b/CutList.Mcp/JobTools.cs index 1894867..5240709 100644 --- a/CutList.Mcp/JobTools.cs +++ b/CutList.Mcp/JobTools.cs @@ -257,9 +257,9 @@ public class JobTools string length, [Description("Quantity available (-1 for unlimited, default -1)")] int quantity = -1, - [Description("Stock item ID from inventory (optional - links to tracked inventory)")] + [Description("Stock item ID from the stock catalog (optional - links to a specific catalog stock item)")] int? stockItemId = null, - [Description("True if this is a custom length not from inventory (default false)")] + [Description("True if this is a custom length not sourced from the stock catalog (default false)")] bool isCustomLength = false, [Description("Priority - lower number = used first (default 10)")] int priority = 10) @@ -304,7 +304,7 @@ public class JobTools #region Optimization - [McpServerTool(Name = "optimize_job"), Description("Runs bin packing optimization on a job. The job must have parts defined. If stock is defined, it will be used; otherwise the optimizer uses available inventory. Returns optimized cut layouts per material with efficiency stats.")] + [McpServerTool(Name = "optimize_job"), Description("Runs bin packing optimization on a job. The job must have parts defined, and stock must be explicitly configured on the job (via add_job_stock) for each material used by its parts - there is no fallback to inventory; parts with no matching stock configured come back as items not placed. Returns optimized cut layouts per material with efficiency stats.")] public async Task OptimizeJob( [Description("Job ID")] int jobId, diff --git a/CutList.Web/Components/Pages/Jobs/Edit.razor b/CutList.Web/Components/Pages/Jobs/Edit.razor index d369390..625e0cb 100644 --- a/CutList.Web/Components/Pages/Jobs/Edit.razor +++ b/CutList.Web/Components/Pages/Jobs/Edit.razor @@ -869,7 +869,7 @@ else
- + Use -1 for unlimited