jaz-clio 5.6.7 → 5.6.9
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/assets/skills/api/SKILL.md +5 -1
- package/assets/skills/api/references/errors.md +54 -0
- package/assets/skills/cli/SKILL.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jaz-pseudo-sql/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/practice/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +352 -352
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jaz-api
|
|
3
|
-
version: 5.6.
|
|
3
|
+
version: 5.6.9
|
|
4
4
|
description: >-
|
|
5
5
|
Use this skill whenever you call, debug, or review code that touches the Jaz
|
|
6
6
|
REST API. Covers field names, response shapes, 141 production gotchas, error
|
|
@@ -489,6 +489,10 @@ Bills, invoices, and credit notes share identical mandatory field specs. Adding
|
|
|
489
489
|
|
|
490
490
|
157. **Recipe input `*AccountResourceId` fields are account-class-locked — `x-accountClass` in inputSchema is authoritative.** Each `*AccountResourceId` slot on a recipe's input schema carries an `x-accountClass` constraint (`"Asset"`, `"Liability"`, `"Expense"`, `"Revenue"`, `"Equity"`). Passing an account whose class doesn't match the slot's `x-accountClass` is rejected post-commit and silently nulls `capsuleRecipeJob` (Rule 143). Schema location: `get_capsule_recipe(name).data.versions[0].inputSchema.properties.<fieldName>['x-accountClass']` — **note `versions[0].inputSchema`, NOT `inputSchema` at the top level**. Examples: PREPAID_AMORTIZATION needs `prepaidAssetAccountResourceId: Asset` + `expenseAccountResourceId: Expense`; DEFERRED_REVENUE needs `deferredRevenueAccountResourceId: Liability` + `revenueAccountResourceId: Revenue`; ACCRUAL_REVERSAL needs `expenseAccountResourceId: Expense` + `accruedLiabilityAccountResourceId: Liability`. Always pre-validate via `get_account(resourceId).accountClass` against the slot constraint, or just call `preview_capsule_recipe(recipeName, inputs)` to surface every class violation as a clean 422.
|
|
491
491
|
|
|
492
|
+
### Error Recovery
|
|
493
|
+
|
|
494
|
+
158. **Tool error envelopes may carry a structured `repair` suggestion (W1.3).** When a `create_*` / `update_*` / `get_*` tool fails with a high-confidence pattern (404 not found, 422 missing FK, duplicate reference, tax-profile direction mismatch), the response is enriched with `repair: { tool, arguments, reason }`. The `tool` field is ALWAYS read-only AND verified to exist in the registry. Consumption pattern: if `repair` is present, call `execute_tool(repair.tool, repair.arguments)` directly to recover; do NOT retry the original write tool until the repair surfaces the correct resourceId/reference. Full envelope shape, pattern list, and worked example in `references/errors.md` (Repair Suggestions section). Purely additive — no match → no `repair`, fall back to free-text `hint`. Infinite-loop protection comes from the agent-loop repetition guard (same tool+input retried 3× is blocked).
|
|
495
|
+
|
|
492
496
|
## Supporting Files
|
|
493
497
|
|
|
494
498
|
For detailed reference, read these files in this skill directory:
|
|
@@ -858,3 +858,57 @@ Journals support a top-level `currency` object to create entries in a foreign cu
|
|
|
858
858
|
---
|
|
859
859
|
|
|
860
860
|
*Last updated: 2026-03-13 — Added: Nano-classifier errors (classes field, double-wrapped GET), payment record errors (cashflow vs payment IDs), sub-resource raw array errors. Previous: Cash entry path migration, Quick Fix errors.*
|
|
861
|
+
|
|
862
|
+
---
|
|
863
|
+
|
|
864
|
+
## Repair Suggestions (W1.3)
|
|
865
|
+
|
|
866
|
+
When a Jaz tool call fails, the MCP `execute_tool` response (and the daemon-side executor return) may now carry a structured `repair` block alongside the existing `error` / `hint` fields. The block is built by the motherboard registry (`src/core/registry/repair-hints.ts`); the API server is unchanged.
|
|
867
|
+
|
|
868
|
+
### Shape
|
|
869
|
+
|
|
870
|
+
```json
|
|
871
|
+
{
|
|
872
|
+
"error": "lineItems[0].accountResourceId is required if [saveAsDraft] is false",
|
|
873
|
+
"status": 422,
|
|
874
|
+
"endpoint": "/api/v1/invoices",
|
|
875
|
+
"hint": "Validation error — check field values against the tool description.",
|
|
876
|
+
"repair": {
|
|
877
|
+
"tool": "search_accounts",
|
|
878
|
+
"arguments": {},
|
|
879
|
+
"reason": "Line item missing accountResourceId. Search for the right GL account first (e.g. by name or accountType), then retry with the resourceId on each line item."
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
The `repair` field is OMITTED entirely when no high-confidence pattern matches. The agent then falls back to the free-text `hint` field (existing behavior).
|
|
885
|
+
|
|
886
|
+
### Safety invariants
|
|
887
|
+
|
|
888
|
+
- `repair.tool` always starts with a read-only prefix: `search_*`, `list_*`, `get_*`, `view_*`, `describe_*`. Never a write or destructive tool.
|
|
889
|
+
- `repair.tool` is verified to exist in the registry before the suggestion ships. Bogus names (typos, naive plurals) are silently dropped.
|
|
890
|
+
- Recursion bounded by the existing agent-loop repetition guard (`MAX_REPEAT = 2`): same tool+input retried 3× is blocked.
|
|
891
|
+
|
|
892
|
+
### Patterns matched in v1
|
|
893
|
+
|
|
894
|
+
| Trigger | Suggested tool | Used when input contains |
|
|
895
|
+
|---|---|---|
|
|
896
|
+
| `status === 404` or `not found` | `search_contacts` | `contactResourceId` (string) AND error mentions "contact" |
|
|
897
|
+
| `status === 404` on `get_*` / `update_*` / `delete_*` / `finalize_*` / `pay_*` | `search_<entity>s` (only if exists in registry) | any `resourceId` |
|
|
898
|
+
| `status === 422` mentioning `accountResourceId` | `search_accounts` | (no input requirement) |
|
|
899
|
+
| `status === 422` + `duplicate` / `already exists` on `create_*` | `search_<entity>s` filtered by `reference` | `reference` (string) |
|
|
900
|
+
| `status === 422` + tax-profile direction mismatch | `search_tax_profiles` | (no input requirement) |
|
|
901
|
+
|
|
902
|
+
Non-API errors (validation, schema, network) do NOT carry a repair suggestion — pattern-matching free-text is too brittle. The existing `hint` field covers those cases.
|
|
903
|
+
|
|
904
|
+
### Recommended agent consumption
|
|
905
|
+
|
|
906
|
+
```
|
|
907
|
+
1. Receive tool error result with `repair` field present.
|
|
908
|
+
2. Call execute_tool(repair.tool, repair.arguments).
|
|
909
|
+
3. Use the search result to construct a corrected payload.
|
|
910
|
+
4. Retry the original tool ONCE with the corrected payload.
|
|
911
|
+
5. If it still fails, do NOT loop — surface the error to the user.
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
Repair suggestions are advisory, not authoritative. The agent may ignore them when context (recent tool calls, user intent) suggests a different approach is better.
|