authoring UX: sequential elicitation questions + optional creation approval

Elicitation now asks one question at a time: only one PendingQuestion is
live, and the next is posted only after the current is answered (an empty
answer is accepted) or skipped. Each question gets a fresh
codegen.elicitation.answer_timeout (default 30s) that resets on every answer
submit; a timeout stops the sequence. questions_timeout is now traced only on
a real timeout. Front ends need no change — they read pending_questions().

Add opt-in creation_approval: the single-slot llm draft worker blocks after
authoring a proposal and before anything is registered; approve/deny via the
REPL, dashboard (/api/approvals + UI), or a gateway chat reply (yes/no). One
prompt per creation request (a category approval covers its chained skill);
denial or timeout aborts creation. Off by default.

Tests updated for both; full stdlib suite passes (337).
This commit is contained in:
gabby committed 2026-10-01 23:57:03 +00:00
1 parent 25ade160df
commit 215c22afb8
10 files changed
+684 -67

No files matched your search

+36
View File
@@ -590,6 +590,20 @@ async function resolveRepair(id, action) {
await refreshAll();
}
async function resolveApproval(id, approve) {
try {
const res = await getJSON("/api/approvals", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id, approve }),
});
flash(`[${res.status}] ${res.detail}`);
} catch (err) {
flash(`approval failed: ${err.message}`);
}
await refreshAll();
}
function skillStatusBadge(status, category, name) {
const span = document.createElement("span");
if (status === "writing") {
@@ -738,6 +752,28 @@ function renderQuestions() {
box.appendChild(actions);
el.appendChild(box);
}
for (const a of state.status.approvals || []) {
const box = document.createElement("div");
box.className = "pending-line";
const target = a.kind === "category" ? a.category : `${a.category}.${a.skill}`;
const label = document.createElement("div");
label.textContent = `approve new ${a.kind} ${target}: ${a.description}`;
box.appendChild(label);
const actions = document.createElement("div");
const yes = document.createElement("button");
yes.type = "button";
yes.textContent = "approve";
yes.className = "primary";
yes.addEventListener("click", () => resolveApproval(a.id, true));
const no = document.createElement("button");
no.type = "button";
no.textContent = "deny";
no.addEventListener("click", () => resolveApproval(a.id, false));
actions.appendChild(yes);
actions.appendChild(no);
box.appendChild(actions);
el.appendChild(box);
}
}
function renderAnswerFeedback() {