t158 重打包(Arcrun@7e631a8):/cypher/search mode 分流——複製路徑回毫秒級

- compile=純編圖零查詢(安裝器/acr push);discover=誠實查詢預設(契約不變)
- /cypher/execute 一律 compile;discover 批次化(registry 新增 /components/catalog)
- 本地實測:compile 8 節點 3ms(迴歸前水準);verify 01/03 9/9 綠

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 13:32:39 +08:00
parent 0bfe37cffb
commit 216d3512c6
3 changed files with 167 additions and 44 deletions
+21
View File
@@ -8123,6 +8123,27 @@ __name(isPlainObject, "isPlainObject");
// src/routes/query.ts
var app4 = new Hono2();
app4.get("/catalog", async (c) => {
const list = await c.env.SUBMISSIONS_KV.list({ prefix: "comp:" });
const seen = /* @__PURE__ */ new Set();
const components = [];
for (const key of list.keys) {
const raw2 = await c.env.SUBMISSIONS_KV.get(key.name);
if (!raw2) continue;
let v;
try {
v = JSON.parse(raw2);
} catch {
continue;
}
if (v.status === "tombstone" || v.visibility !== "public") continue;
const dedup = `${String(v.component_hash_id ?? "")}:${String(v.version ?? "")}`;
if (seen.has(dedup)) continue;
seen.add(dedup);
components.push(toComponentRecord(v));
}
return c.json({ success: true, data: { components, count: components.length } });
});
app4.get("/search", async (c) => {
const q = c.req.query("q");
if (!q || q.trim() === "") {