real integrations: implementation elicitation, INTEGRATION, fidelity + repair
Anchor the product premise at the top of AGENTS.md: semif-agent is an end-user app that does the user's task for real against their actual service, asking a few questions and learning when it doesn't know how. Elicitation now asks implementation questions (service/account, how to connect, credential source, expected result) and is on by default. The REPL asks inline; the dashboard defers via a question queue the worker waits on (/api/questions + panel). Answers ride every body attempt and persist in the registry so restart doesn't re-ask. SKILL.md requires real actions via stdlib transports with values from ctx.config and a module-level INTEGRATION declaration (service/transport/config_vars). TESTGEN.md scopes tests as hermetic mechanics checks (loopback http.server in-test, never fixture addresses in bodies) that never certify the live integration. After the body lands a fidelity review (small LLM + static declaration findings) regenerates a simulated body once, then accepts it traced and badged unverified. A failed real run logs a SemIf repair choice (retry/repair_skill/ask_user/no_repair), surfaced in REPL and dashboard, bounded by codegen.repair.max_attempts and user-confirmed. Dev unit suite: 191 passed. Jarvis integration run still pending.
This commit is contained in:
1 parent
06ccfb77c6
commit
dde034f1b4
16 files changed
+2263
-255
No files matched your search
@@ -511,6 +511,34 @@ async function restartSkill(category, name) {
|
||||
await refreshAll();
|
||||
}
|
||||
|
||||
async function answerQuestion(id, text) {
|
||||
try {
|
||||
const res = await getJSON("/api/questions", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ id, text }),
|
||||
});
|
||||
flash(`[${res.status}] ${res.detail}`);
|
||||
} catch (err) {
|
||||
flash(`answer failed: ${err.message}`);
|
||||
}
|
||||
await refreshAll();
|
||||
}
|
||||
|
||||
async function resolveRepair(id, action) {
|
||||
try {
|
||||
const res = await getJSON("/api/repair", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ id, action }),
|
||||
});
|
||||
flash(`[${res.status}] ${res.detail}`);
|
||||
} catch (err) {
|
||||
flash(`repair failed: ${err.message}`);
|
||||
}
|
||||
await refreshAll();
|
||||
}
|
||||
|
||||
function skillStatusBadge(status, category, name) {
|
||||
const span = document.createElement("span");
|
||||
if (status === "writing") {
|
||||
@@ -550,6 +578,19 @@ function renderTree() {
|
||||
desc.textContent = skill.description;
|
||||
row.appendChild(nm);
|
||||
row.appendChild(desc);
|
||||
if (skill.integration && skill.integration.service && skill.integration.service !== "unknown") {
|
||||
const ig = document.createElement("span");
|
||||
ig.className = "sdesc";
|
||||
ig.textContent = `${skill.integration.service} · ${skill.integration.transport}`;
|
||||
row.appendChild(ig);
|
||||
}
|
||||
if (skill.status === "ready" && skill.integration_source && skill.integration_source !== "declared") {
|
||||
const un = document.createElement("span");
|
||||
un.className = "sbadge stub";
|
||||
un.textContent = "unverified";
|
||||
un.title = "no valid INTEGRATION declaration; the body was inferred";
|
||||
row.appendChild(un);
|
||||
}
|
||||
row.appendChild(skillStatusBadge(skill.status, cat, skill.name));
|
||||
div.appendChild(row);
|
||||
}
|
||||
@@ -599,9 +640,55 @@ function renderStatus() {
|
||||
p.textContent = `awaiting input (${pending.run_id || pending.skill}): ${pending.question}`;
|
||||
el.appendChild(p);
|
||||
}
|
||||
renderQuestions();
|
||||
renderAnswerFeedback();
|
||||
}
|
||||
|
||||
function renderQuestions() {
|
||||
const el = $("#status");
|
||||
for (const q of state.status.questions || []) {
|
||||
const box = document.createElement("div");
|
||||
box.className = "pending-line";
|
||||
const label = document.createElement("div");
|
||||
label.textContent = `? ${q.skill}: ${q.question}`;
|
||||
const form = document.createElement("form");
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.placeholder = "answer (empty to skip)";
|
||||
const btn = document.createElement("button");
|
||||
btn.type = "submit";
|
||||
btn.textContent = "answer";
|
||||
form.appendChild(input);
|
||||
form.appendChild(btn);
|
||||
form.addEventListener("submit", (e) => {
|
||||
e.preventDefault();
|
||||
answerQuestion(q.id, input.value.trim());
|
||||
input.value = "";
|
||||
});
|
||||
box.appendChild(label);
|
||||
box.appendChild(form);
|
||||
el.appendChild(box);
|
||||
}
|
||||
for (const r of state.status.repairs || []) {
|
||||
const box = document.createElement("div");
|
||||
box.className = "pending-line";
|
||||
const label = document.createElement("div");
|
||||
label.textContent = `repair ${r.skill}: ${r.failure.slice(0, 160)}`;
|
||||
box.appendChild(label);
|
||||
const actions = document.createElement("div");
|
||||
for (const action of ["retry", "repair_skill", "ask_user", "no_repair"]) {
|
||||
const btn = document.createElement("button");
|
||||
btn.type = "button";
|
||||
btn.textContent = action;
|
||||
btn.className = action === r.selected ? "primary" : "";
|
||||
btn.addEventListener("click", () => resolveRepair(r.id, action));
|
||||
actions.appendChild(btn);
|
||||
}
|
||||
box.appendChild(actions);
|
||||
el.appendChild(box);
|
||||
}
|
||||
}
|
||||
|
||||
function renderAnswerFeedback() {
|
||||
const el = $("#answer-feedback");
|
||||
const fb = state.answerFeedback;
|
||||
|
||||
Reference in new issue
Block a user