Phase 28-36 body of work

Accumulated since a6f12e2 (Phase 21 Rust port + Phase 27 versioning):

- Phase 36: embed_semaphore on VectorState (permits=1) serializes
  seed embed calls — prevents sidecar socket collisions under
  concurrent /seed stress load
- Phase 31+: run_stress.ts 6-task diverse stress scaffolding;
  run_e2e_rated.ts + orchestrator.ts tightening
- Catalog dedupe cleanup: 16 duplicate manifests removed; canonical
  candidates.parquet (10.5MB -> 76KB) + placements.parquet (1.2MB ->
  11KB) regenerated post-dedupe; fresh manifests for active datasets
- vectord: harness EvalSet refinements (+181), agent portfolio
  rotation + ingest triggers (+158), autotune + rag adjustments
- catalogd/storaged/ingestd/mcp-server: misc tightening
- docs: Phase 28-36 PRD entries + DECISIONS ADR additions;
  control-plane pivot banner added to top of docs/PRD.md (pointing
  at docs/CONTROL_PLANE_PRD.md which lands in next commit)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
profit
2026-04-22 02:41:15 -05:00
co-authored by Claude Opus 4.7
parent a6f12e2609
commit 5b1fcf6d27
52 changed files with 2575 additions and 1012 deletions
+25 -11
View File
@@ -26,17 +26,31 @@ const MODE = process.env.MCP_TRANSPORT || "http"; // "stdio" or "http"
// Active trace for the current request — set per-request in the HTTP handler
let activeTrace: ReturnType<typeof startTrace> | null = null;
async function api(method: string, path: string, body?: any) {
const t0 = Date.now();
const resp = await fetch(`${BASE}${path}`, {
method,
headers: body ? { "Content-Type": "application/json" } : {},
body: body ? JSON.stringify(body) : undefined,
});
const text = await resp.text();
const ms = Date.now() - t0;
let parsed: any;
try { parsed = JSON.parse(text); } catch { parsed = { raw: text, status: resp.status }; }
async function api(method: string, path: string, body?: any, retries = 2) {
for (let attempt = 0; attempt <= retries; attempt++) {
try {
const t0 = Date.now();
const resp = await fetch(`${BASE}${path}`, {
method,
headers: body ? { "Content-Type": "application/json" } : {},
body: body ? JSON.stringify(body) : undefined,
});
const text = await resp.text();
const ms = Date.now() - t0;
let parsed: any;
try { parsed = JSON.parse(text); } catch { parsed = { raw: text, status: resp.status }; }
return parsed;
} catch (e: any) {
if (attempt === retries) throw e;
if (e.message?.includes("socket connection was closed") || e.message?.includes("ECONNREFUSED")) {
await Bun.sleep(500 * (attempt + 1));
continue;
}
throw e;
}
}
throw new Error("unreachable");
}
// Trace the call if we have an active trace
if (activeTrace) {