Skip to content

Commit 33b0d4f

Browse files
committed
console: show CAL warnings on the Query page
Every other surface honours the contract that silence means the query did what you asked (docs/cal-reference.md §5): the bindings and the MCP tool return `warnings`, the CLI prints them to stderr. The console received them from POST /api/cal and dropped them on the floor -- all seventeen, W001 through W017, not just the new one. That is the worst surface to lose them on. It is where a person reads an answer, and a warning is precisely the news that the answer is a window rather than the whole match. The result this commit's own CAL-W017 describes -- 70 of 200 grains -- rendered as a plain "70 memories" with nothing to say the other 130 existed. Shown above the result, in the console's existing warning style. The CAL-Wnnn code is stripped in plain mode and kept in Developer mode: the code is developer chrome, but "130 of 200 grains dropped" is news for whoever is reading. A query that warns about nothing still shows nothing, so silence keeps its meaning here too. No README screenshot is affected -- the five shots are graph, workflow, runs, suggestions and analytics; the Query page is not among them. Claude-Session: https://claude.ai/code/session_01JEcv3k8mMwZ5YAa26jdLc2
1 parent 85df2ac commit 33b0d4f

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3939
would publish a number produced from a truncated prompt and never know.
4040
`RECALL` has announced the same kind of cut as `CAL-W015` since 1.5.1.
4141

42+
- **The console shows CAL warnings.** Every other surface honoured the
43+
"silence means the query did what you asked" contract — the bindings and the
44+
MCP tool return `warnings`, the CLI prints them to stderr — but the console
45+
received them from `POST /api/cal` and dropped them on the floor. That was
46+
the worst place for it: this is the surface a person reads an answer from,
47+
and a warning is exactly the news that the answer is a window rather than
48+
the whole match. All seventeen (`CAL-W001`–`W017`) now appear above the
49+
result on the Query page, in plain language, with the `CAL-Wnnn` code shown
50+
only in Developer mode.
51+
4252
## [1.7.3] — 2026-09-07
4353

4454
### Added

‎crates/areev-server/src/console.html‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5965,6 +5965,36 @@
59655965
const h = el('div', 'h', head + ' ');
59665966
h.appendChild(el('em', '', describeQuery(Q.text)));
59675967
box.appendChild(h);
5968+
/* Warnings, above everything else the summary says.
5969+
5970+
CAL's contract is that silence means the query did what you asked
5971+
(docs/cal-reference.md §5), and every other surface honours it — the
5972+
bindings and the MCP tool return `warnings`, the CLI prints them to
5973+
stderr. The console was the one place that received them from
5974+
/api/cal and dropped them on the floor, which is worst here: this is
5975+
the surface a person reads an answer from, and a warning is precisely
5976+
the news that the answer is a window rather than the whole match.
5977+
5978+
Shown in plain language by default — the code prefix is developer
5979+
chrome, but "149 of 229 memories were left out" is not. */
5980+
const warns = (res.warnings || []).filter(Boolean);
5981+
if (warns.length) {
5982+
const dev = document.documentElement.classList.contains('dev');
5983+
const b = el('div', 'banner');
5984+
b.style.margin = '10px 0 2px';
5985+
const body = el('div', 'grow');
5986+
warns.forEach((w, i) => {
5987+
/* `CAL-W017: text` → keep the code only in developer mode. */
5988+
const m = /^([A-Z]{3}-W\d{3}):\s*(.*)$/s.exec(w);
5989+
const line = el('div', i ? 'tiny' : '');
5990+
if (m && !dev) line.textContent = m[2];
5991+
else line.textContent = w;
5992+
if (i) line.style.marginTop = '4px';
5993+
body.appendChild(line);
5994+
});
5995+
b.appendChild(body);
5996+
box.appendChild(b);
5997+
}
59685998
const sup = gs.filter(g => g.superseded_by || rgFields(g).superseded_by).length;
59695999
if (sup) box.appendChild(el('div', 'tiny', sup + (sup === 1 ? ' has' : ' have')
59706000
+ ' been superseded since it was written — the older wording is kept so the change stays auditable'));

‎docs/cal-reference.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,11 @@ Warnings reach you as a `warnings` array of `CAL-Wnnn` strings in the result
849849
payload from `cal()` in Python and Node and from the MCP `areev_cal` tool, and
850850
alongside the payload on `POST /api/cal`. The key is present only when there is
851851
something to report, so a clean query returns the shape it always had. The
852-
`areev cal` CLI prints them to stderr instead, keeping stdout pure JSON.
852+
`areev cal` CLI prints them to stderr instead, keeping stdout pure JSON. The
853+
console shows them above the result on the Query page — in plain language, with
854+
the `CAL-Wnnn` code itself shown only in Developer mode, because "130 of 200
855+
memories were left out" is news for whoever is reading the answer while the
856+
code is developer chrome.
853857

854858
`DESCRIBE`'s `with_options` lists the options that actually change a `RECALL`
855859
result, so a client can introspect rather than guess.

0 commit comments

Comments
 (0)