caveat-cli 0.19.9 → 0.19.10

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.
@@ -5,12 +5,13 @@ import {
5
5
  __export,
6
6
  findCaveatHome,
7
7
  get,
8
+ listJevObservations,
8
9
  loadConfig,
9
10
  openDb,
10
11
  resolvePaths,
11
12
  search,
12
13
  stderrLogger
13
- } from "./chunk-ITQLGM4K.js";
14
+ } from "./chunk-PFYFYJNS.js";
14
15
 
15
16
  // ../../node_modules/.pnpm/@hono+node-server@2.0.10_hono@4.12.30/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
16
17
  var X_ALREADY_SENT = "x-hono-already-sent";
@@ -3375,6 +3376,15 @@ article code {
3375
3376
  }
3376
3377
  article pre code { background: transparent; padding: 0; }
3377
3378
  article a.wikilink { color: #0a5fff; background: #e6f0ff; padding: 0 0.25rem; border-radius: 2px; }
3379
+ .jev-metrics { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1rem 0; }
3380
+ .jev-metrics div { flex: 1; min-width: 150px; padding: 0.7rem; background: #f4f7fb; border-radius: 4px; }
3381
+ .jev-metrics strong { display: block; font-size: 1.4rem; }
3382
+ .jev-metrics small { display: block; color: #666; }
3383
+ .jev-cases { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
3384
+ .jev-scroll { overflow-x: auto; }
3385
+ .jev-cases th, .jev-cases td { padding: 0.5rem; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
3386
+ .jev-cases code { font-size: 0.75rem; }
3387
+ .jev-cases pre { max-width: 700px; max-height: 420px; overflow: auto; }
3378
3388
  .meta-grid {
3379
3389
  display: grid;
3380
3390
  grid-template-columns: max-content 1fr;
@@ -3417,6 +3427,7 @@ function layout(title, body) {
3417
3427
  <a href="/?source=own">own</a>
3418
3428
  <a href="/?source=community">community</a>
3419
3429
  <a href="/community">community repos</a>
3430
+ <a href="/jev">Jev\u691C\u8A3C</a>
3420
3431
  </nav>
3421
3432
  </header>
3422
3433
  ${body}
@@ -9134,12 +9145,54 @@ ${handles.length > 0 ? `<ul class="entries">${list2}</ul>` : `<div class="empty"
9134
9145
  return app;
9135
9146
  }
9136
9147
 
9148
+ // ../web/dist/routes/jev.js
9149
+ function percent(numerator, denominator) {
9150
+ return denominator === 0 ? "\u2014" : `${Math.round(numerator / denominator * 100)}%`;
9151
+ }
9152
+ function createJevRoute(ctx) {
9153
+ const app = new Hono2();
9154
+ app.get("/jev", (c) => {
9155
+ const cases = listJevObservations(ctx.caveatHome);
9156
+ const advice = cases.filter((item) => item.delivery === "delivered" && item.selectedRef !== null);
9157
+ const adviceReviewed = advice.filter((item) => item.review?.verdict === "correct" || item.review?.verdict === "incorrect");
9158
+ const correct = adviceReviewed.filter((item) => item.review?.verdict === "correct").length;
9159
+ const silentReviewed = cases.filter((item) => item.review?.verdict === "missed" || item.review?.verdict === "none");
9160
+ const missed = silentReviewed.filter((item) => item.review?.verdict === "missed").length;
9161
+ const rows = cases.slice(0, 100).map((item) => {
9162
+ const refs = item.turns.map((turn) => `${turn.originSessionId} #${turn.turnNumber}${turn.truncated ? " (\u7701\u7565\u3042\u308A)" : ""}`).join(" / ");
9163
+ const candidates = item.candidates.map(({ ref, score }) => `${ref} ${score.toFixed(2)}`).join("\u3001") || "\u306A\u3057";
9164
+ return `<tr><td><time>${escapeHtml(item.observedAt)}</time><br><code>${escapeHtml(item.id)}</code></td>
9165
+ <td>${escapeHtml(item.host)}<br>${escapeHtml(refs)}</td>
9166
+ <td>${item.repeatedProblem.toFixed(2)} / ${item.clearlyStuck.toFixed(2)}<br>\u8A9E: ${escapeHtml(item.query || "\u306A\u3057")}</td>
9167
+ <td>FTS ${item.ftsHits.length}\u4EF6<br>${escapeHtml(candidates)}</td>
9168
+ <td>${escapeHtml(item.selectedRef ?? "\u306A\u3057")}<br>${escapeHtml(item.delivery)}</td>
9169
+ <td>${escapeHtml(item.review?.verdict ?? "\u672A\u5224\u5B9A")}</td>
9170
+ <td><details><summary>\u5168\u8A18\u9332</summary><pre>${escapeHtml(JSON.stringify(item, null, 2))}</pre></details></td></tr>`;
9171
+ }).join("");
9172
+ const body = `<h2>Jev\u63D0\u6848\u306E\u691C\u8A3C</h2>
9173
+ <p>\u7D50\u679C\u306E\u89E3\u6C7A\u72B6\u6CC1\u306F\u96C6\u8A08\u3057\u307E\u305B\u3093\u3002\u6B63\u8AA4\u306F\u5143\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u8A72\u5F533\u30BF\u30FC\u30F3\u3068\u77E5\u898B\u672C\u6587\u3092\u7167\u5408\u3057\u3066\u4EBA\u304C\u5224\u5B9A\u3057\u307E\u3059\u3002</p>
9174
+ <div class="jev-metrics">
9175
+ <div>\u5224\u5B9A\u6E08\u307F3\u30BF\u30FC\u30F3<strong>${cases.length}</strong></div>
9176
+ <div>\u77E5\u898B\u3092\u901A\u77E5<strong>${advice.length}</strong></div>
9177
+ <div>\u901A\u77E5\u306E\u6B63\u7B54\u7387<strong>${percent(correct, adviceReviewed.length)}</strong><small>${correct}/${adviceReviewed.length} \u4EF6\u3092\u8A55\u4FA1</small></div>
9178
+ <div>\u53D6\u308A\u3053\u307C\u3057\u7387<strong>${percent(missed, silentReviewed.length)}</strong><small>${missed}/${silentReviewed.length} \u4EF6\u3092\u8A55\u4FA1</small></div>
9179
+ </div>
9180
+ <p>\u5224\u5B9A\u767B\u9332: <code>caveat jev review &lt;\u6848\u4EF6ID&gt; correct|incorrect|missed|none|unclear --note "\u7406\u7531"</code></p>
9181
+ <div class="jev-scroll"><table class="jev-cases"><thead><tr><th>\u65E5\u6642 / \u6848\u4EF6ID</th><th>\u30DB\u30B9\u30C8 / 3\u30BF\u30FC\u30F3</th><th>\u82E6\u6226\u30B9\u30B3\u30A2 / \u691C\u7D22\u8A9E</th><th>\u691C\u7D22\u5019\u88DC</th><th>\u63D0\u6848 / \u914D\u9001</th><th>\u6B63\u8AA4</th><th>\u8A73\u7D30</th></tr></thead>
9182
+ <tbody>${rows || '<tr><td colspan="7">\u8A18\u9332\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093</td></tr>'}</tbody></table></div>
9183
+ ${cases.length > 100 ? `<p>\u6700\u65B0100\u4EF6\u3092\u8868\u793A\u3002\u5168${cases.length}\u4EF6\u306F <code>caveat jev cases --json</code> \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002</p>` : ""}`;
9184
+ return c.html(layout("Jev\u63D0\u6848\u306E\u691C\u8A3C \xB7 Caveat", body));
9185
+ });
9186
+ return app;
9187
+ }
9188
+
9137
9189
  // ../web/dist/app.js
9138
9190
  function createApp(ctx) {
9139
9191
  const app = new Hono2();
9140
9192
  app.route("/", createIndexRoute(ctx));
9141
9193
  app.route("/", createDetailRoute(ctx));
9142
9194
  app.route("/", createCommunityRoute(ctx));
9195
+ app.route("/", createJevRoute(ctx));
9143
9196
  return app;
9144
9197
  }
9145
9198
 
@@ -9173,4 +9226,4 @@ if (import.meta.url === `file://${process.argv[1]?.replace(/\\/g, "/")}`) {
9173
9226
  export {
9174
9227
  startServer
9175
9228
  };
9176
- //# sourceMappingURL=server-H4BWLLZ2.js.map
9229
+ //# sourceMappingURL=server-JXBPTQNU.js.map