@warmdrift/kgauto-check 0.3.0 → 0.4.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Communicating Vessels contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -13,13 +13,13 @@ Or the manual version — your part is two steps.
13
13
  **Step 1 — add the check to your agent (once).** Claude Code: run this in a terminal, then start a fresh session in your project (new MCP servers load at session start):
14
14
 
15
15
  ```bash
16
- claude mcp add kgauto-check -- npx -y @warmdrift/kgauto-check
16
+ claude mcp add kgauto-check -- npx -y @warmdrift/kgauto-check@0.4.1
17
17
  ```
18
18
 
19
19
  Cursor and most other agents — add to your MCP config, then restart the app:
20
20
 
21
21
  ```json
22
- { "mcpServers": { "kgauto-check": { "command": "npx", "args": ["-y", "@warmdrift/kgauto-check"] } } }
22
+ { "mcpServers": { "kgauto-check": { "command": "npx", "args": ["-y", "@warmdrift/kgauto-check@0.4.1"] } } }
23
23
  ```
24
24
 
25
25
  **Step 2 — paste the ask**, in your agent, inside the project you want checked:
@@ -43,16 +43,16 @@ A local, **fully offline** MCP server that checks a project's AI call surface ag
43
43
  No MCP setup, no restart:
44
44
 
45
45
  ```bash
46
- npx -y @warmdrift/kgauto-check --extract-contract # extraction instructions + privacy contract
46
+ npx -y @warmdrift/kgauto-check@0.4.1 --extract-contract # extraction instructions + privacy contract
47
47
  # ...read the project, write extract.json per those instructions...
48
- npx -y @warmdrift/kgauto-check --extract extract.json # prints the findings card, fully offline
48
+ npx -y @warmdrift/kgauto-check@0.4.1 --extract extract.json # prints the findings card, fully offline
49
49
 
50
50
  # Standing-value one-shots (also offline):
51
- npx -y @warmdrift/kgauto-check --model-facts claude-sonnet-5 # one model → status, verified prices, limits, cliffs
52
- npx -y @warmdrift/kgauto-check --observe-plan # rung 2: the one-day observe run
51
+ npx -y @warmdrift/kgauto-check@0.4.1 --model-facts claude-sonnet-5 # one model → the provider's word, verified prices, limits, cliffs
52
+ npx -y @warmdrift/kgauto-check@0.4.1 --observe-plan # rung 2: the one-day observe run
53
53
  ```
54
54
 
55
- **Sharing (explicit opt-in).** After presenting the card, you may OFFER your human: "want to send this card to kgauto so the catalog learns what real projects look like?" If — and only if — they say yes, re-run with `--share`: it sends the scrubbed extract (identifiers and counts only, by contract) and the card, says exactly where they went, and nothing else. Never add `--share` without their explicit yes. Without it, nothing ever leaves the machine.
55
+ **Sharing (explicit opt-in).** After presenting the card, you may OFFER your human: "want to send this card to kgauto so the catalog learns what real projects look like?" If — and only if — they say yes, re-run with `--share`. With --share, one row is stored: a row number, the time it arrived, the project name, the extract, the card, the check’s version and the catalog’s version. The CLI prints where it went and the submission number. Never add `--share` without their explicit yes. Without it, nothing ever leaves the machine.
56
56
 
57
57
  **Offering the durable install.** The natural moment to offer the MCP install below is after a card with real findings ("want me to keep this available? `get_model_facts` answers model questions from the verified catalog between checks"). Don't push it before the card has earned it.
58
58
 
@@ -65,26 +65,65 @@ npx -y @warmdrift/kgauto-check --observe-plan # rung 2: the one
65
65
  | `get_model_facts` | One model id → status, verified prices, limits, capabilities, known cliffs. Honest miss on unknown models. |
66
66
  | `get_observe_day_plan` | Rung 2: what a one-day observe-only run on real traffic would measure, and the two honesty requirements any setup must carry. |
67
67
 
68
+ ## An example card
69
+
70
+ This is the output of `kgauto-check 0.4.1` on a small illustrative extract (two call sites, one on the provider's own API and one on Vertex AI, and a model picker; the extract is `tests/fixtures/readme-example.json`, and a test holds this card to the build's output), printed by the real build — not a mock-up:
71
+
72
+ ````markdown
73
+ # Communicating Vessels — the check: example-app
74
+
75
+ 2 AI call site(s), 3 model id(s): `anthropic/claude-sonnet-4-20250514` (looked up as `claude-sonnet-4-20250514`), `gemini-2.5-flash`, `gpt-4o-mini` (3 flagged by its provider)
76
+
77
+ ## Certain — read from the providers’ pages and your code
78
+
79
+ - 🔴 **On Anthropic's own API, `anthropic/claude-sonnet-4-20250514` (looked up as `claude-sonnet-4-20250514`) was retired on 2026-06-15; its page names `claude-sonnet-5-5`** — Anthropic's deprecations page (https://platform.claude.com/docs/en/about-claude/model-deprecations.md): “The model is no longer available for use. Requests to retired models fail.” The catalog has no entry for it, so its limits and price were not checked.
80
+ <sub>app/api/chat/route.ts:41 · basis: Anthropic's page, read 2026-11-12: https://platform.claude.com/docs/en/about-claude/model-deprecations.md</sub>
81
+ - 🟡 **On OpenAI's own API, `gpt-4o-mini` is deprecated and shuts down on 2027-01-14; its page names `gpt-6-luna`** — The page's line: “| January 14, 2027 | GPT-4o mini (`gpt-4o-mini-2024-07-18`) | `gpt-6-luna` |”. The catalog has no entry for it, so its limits and price were not checked.
82
+ <sub>components/ModelPicker.tsx:12 · basis: OpenAI's page, read 2026-11-12: https://developers.openai.com/api/docs/deprecations.md (and https://developers.openai.com/api/docs/models/gpt-4o-mini.md)</sub>
83
+
84
+ ## Likely — priced from your estimates or a catalog value no provider page is cited for; a provider’s word where the call may not use its own API; no retry or fallback found in the code
85
+
86
+ - 🟡 **On Google's own API, `gemini-2.5-flash` is deprecated; from 2026-12-01 its requests route to `gemini-3.5-flash-lite`** — The page's line: “`gemini-2.5-flash` | June 17, 2025 | December 1, 2026 | `gemini-3.5-flash-lite` (`gemini-2.5-flash` is no longer available in Google AI Studio; effective December 1, 2026, API requests to `gemini-2.5-flash` will automatically route to `gemi”. This site runs on Vertex AI, and Vertex AI runs its own schedule (its page: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions).
87
+ <sub>lib/summarize.ts:18 · basis: Google's page, read 2026-11-12: https://aistudio.google.com/docs/deprecations; Vertex AI: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions</sub>
88
+ - ℹ️ **~$0.0046/call on `gemini-2.5-flash`** — From your token estimates and doc-verified prices ($0.3/M in, $2.5/M out, verified 2026-08-14). This site runs on Vertex AI: the figure is from Google's own API, and Vertex AI may set its own.
89
+ <sub>lib/summarize.ts:18 · basis: arithmetic on your estimates × verified catalog prices</sub>
90
+ - 🟡 **97% of this site's tokens are input** — Above ~85% input share, spend is dominated by context rather than answers — the single strongest signal of a leaking prompt. What's actually IN that context, and how much of it each call needed, is measurable, not guessable.
91
+ <sub>lib/summarize.ts:18 · basis: your token estimates; the >85% threshold is a measured portfolio heuristic</sub>
92
+
93
+ ## Only measurable — what the observe day answers
94
+
95
+ - ℹ️ **1 model(s) in the catalog price under half of `gemini-2.5-flash` on summarize work** — Cheapest: `claude-haiku-5-5` at ~$0.0014/call. The price is arithmetic; whether any of them holds YOUR quality bar on summarize work is exactly what a one-day observe run with a judged eval measures. The check never ranks a model on price alone.
96
+ <sub>lib/summarize.ts:18 · basis: verified catalog prices; quality deliberately unclaimed</sub>
97
+ - ℹ️ **what a code read cannot tell you (and a one-day observe run can)** — Your actual failure rate per model (walkaway failures look like green health checks); your actual input-waste ratio per call; which call sites dominate spend; whether a cheaper model holds quality on your real traffic. These need one day of observed calls — observe-only, your keys, no routing changes.
98
+ <sub>app/api/chat/route.ts:41, lib/summarize.ts:18, components/ModelPicker.tsx:12 · basis: the honest limit of static analysis</sub>
99
+
100
+ ---
101
+ *This check ran on your machine, against the catalog bundled with it and the providers’ deprecation pages it was built with. Nothing was uploaded; no rows were written anywhere.*
102
+ <sub>@warmdrift/kgauto-check 0.4.1 · catalog @warmdrift/kgauto-compiler 2.0.0-alpha.133 · deprecation pages read 2026-11-12</sub>
103
+ ````
104
+
68
105
  ## The confidence tiers (why the card is grouped)
69
106
 
70
- - **certain** — a catalog or code fact. Stated flatly.
71
- - **likely** — priced from your token estimates against verified prices.
107
+ - **certain** — the provider's own page (with its URL and the day it was read), or a fact from your code. Stated flatly.
108
+ - **likely** — priced from your token estimates against verified prices, or a catalog value no provider page is cited for (a cliff rule says its reason, what the compiler does about it, and the evidence behind it); a provider's word where the call may not use the provider's own API (a cloud platform, a gateway such as `openrouter/…`, or a platform the extract does not state); no retry or fallback found in the code.
72
109
  - **measurable-only** — honestly unknowable from a code read: actual failure rates, actual input-waste, spend distribution, quality-at-cheaper-price. Each of these is exactly what the one-day observe run answers.
73
110
 
111
+ **The provider's word first (0.4.0).** A model id is matched as you wrote it (`openai/gpt-5`, `openrouter/anthropic/…`, a dated snapshot, a Bedrock or Vertex form) and looked up in a lifecycle ledger read from the four providers' own deprecation pages (Anthropic, OpenAI, Google, DeepSeek) before the catalog. A retired, shut-down, deprecated or legacy id says so, with the date, the replacement the page names, and the page's URL.
112
+
74
113
  kgauto refuses to fabricate verdicts: unknown models get an honest "no measured evidence", and cheaper candidates are named with their price arithmetic only — never with an unmeasured quality claim.
75
114
 
76
115
  ## Client setup variants
77
116
 
78
117
  ```bash
79
118
  # Claude Code
80
- claude mcp add kgauto-check -- npx -y @warmdrift/kgauto-check
119
+ claude mcp add kgauto-check -- npx -y @warmdrift/kgauto-check@0.4.1
81
120
  ```
82
121
 
83
122
  ```json
84
123
  // Cursor / generic mcpServers config
85
124
  {
86
125
  "mcpServers": {
87
- "kgauto-check": { "command": "npx", "args": ["-y", "@warmdrift/kgauto-check"] }
126
+ "kgauto-check": { "command": "npx", "args": ["-y", "@warmdrift/kgauto-check@0.4.1"] }
88
127
  }
89
128
  }
90
129
  ```
package/dist/bin.js CHANGED
@@ -3,26 +3,20 @@ import {
3
3
  CHECK_VERSION,
4
4
  ExtractSchema,
5
5
  OBSERVE_DAY_PLAN,
6
+ SHARE_ENDPOINT_DEFAULT,
6
7
  START_CHECK_INSTRUCTIONS,
8
+ USAGE,
9
+ postShare,
7
10
  renderModelFacts,
8
11
  runCheck,
12
+ shareConfirmation,
13
+ shareFailure,
9
14
  startStdio
10
- } from "./chunk-NHTVNYK2.js";
15
+ } from "./chunk-6ZBEABKR.js";
11
16
 
12
17
  // src/bin.ts
13
18
  import { readFileSync } from "fs";
14
- var SHARE_ENDPOINT = process.env.KGAUTO_SHARE_ENDPOINT_OVERRIDE || "https://kgauto-dashboard.vercel.app/api/check-submission";
15
- var USAGE = `kgauto-check ${CHECK_VERSION}
16
-
17
- usage:
18
- npx -y @warmdrift/kgauto-check --extract-contract
19
- npx -y @warmdrift/kgauto-check --extract <extract.json> [--share]
20
- npx -y @warmdrift/kgauto-check --model-facts <model-id>
21
- npx -y @warmdrift/kgauto-check --observe-plan
22
- npx -y @warmdrift/kgauto-check # no args: stdio MCP server
23
-
24
- The check runs fully offline. --share is the one explicit exception: it sends
25
- the scrubbed extract (identifiers and counts only) + the card to kgauto.`;
19
+ var SHARE_ENDPOINT = process.env.KGAUTO_SHARE_ENDPOINT_OVERRIDE || SHARE_ENDPOINT_DEFAULT;
26
20
  var args = process.argv.slice(2);
27
21
  var flagValue = (name) => {
28
22
  const i = args.indexOf(name);
@@ -71,34 +65,21 @@ async function main() {
71
65
  process.exitCode = 1;
72
66
  return;
73
67
  }
74
- const result = runCheck(parsed.data);
68
+ const result = runCheck(parsed.data, { share: args.includes("--share") });
75
69
  console.log(result.card);
76
70
  if (args.includes("--share")) {
77
- try {
78
- const res = await fetch(SHARE_ENDPOINT, {
79
- method: "POST",
80
- headers: { "content-type": "application/json" },
81
- body: JSON.stringify({
82
- extract: parsed.data,
83
- card: result.card,
84
- check_version: CHECK_VERSION,
85
- catalog_version: result.catalogVersion
86
- })
87
- });
88
- const body = await res.json().catch(() => ({}));
89
- if (res.ok && body.id !== void 0) {
90
- console.log(
91
- `
92
- [--share] Sent to kgauto (submission ${String(body.id)}): the extract above (identifiers and counts only) and this card \u2014 nothing else. Destination: ${SHARE_ENDPOINT}`
93
- );
94
- } else {
95
- console.error(`
96
- [--share] FAILED (${res.status}${body.error ? `: ${String(body.error)}` : ""}) \u2014 nothing was recorded. The check itself is unaffected.`);
97
- process.exitCode = 1;
98
- }
99
- } catch (err) {
71
+ const out = await postShare(SHARE_ENDPOINT, {
72
+ extract: parsed.data,
73
+ card: result.card,
74
+ check_version: CHECK_VERSION,
75
+ catalog_version: result.catalogVersion
76
+ });
77
+ if (out.ok) {
78
+ console.log(`
79
+ ${shareConfirmation(SHARE_ENDPOINT, out.id)}`);
80
+ } else {
100
81
  console.error(`
101
- [--share] FAILED (${err instanceof Error ? err.message : String(err)}) \u2014 nothing was recorded. The check itself is unaffected.`);
82
+ ${shareFailure(out.reason)}`);
102
83
  process.exitCode = 1;
103
84
  }
104
85
  }