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:
Denton Social committed 2026-09-26 01:42:00 -05:00
1 parent 06ccfb77c6
commit dde034f1b4
16 files changed
+2263 -255

No files matched your search

+42 -2
View File
@@ -3,8 +3,10 @@
A pure-stdlib HTTP server on localhost serving a Redux-DevTools-style
inspector over the agent's decision flow. Reads the decision log
(`decisions.jsonl`) plus the run lifecycle trace (`runs.jsonl`), exposes the
static skill tree, the dream cost report, and three write endpoints: submit a
request, answer a run paused for input, and relabel a decision (human override).
static skill tree, the dream cost report, and the write endpoints: submit a
request, answer a run paused for input, answer a deferred authoring question,
resolve a repair offer, restart a skill write, and relabel a decision (human
override).
The scheduler's engine and LLM are built lazily, so the dashboard runs on the
thin dev box in replay mode (reads logs; submit degrades to a JSON error) and
@@ -114,12 +116,16 @@ def build_status(scheduler: Scheduler) -> dict:
]
tau = scheduler.tau
queue_max = scheduler.queue.max_size
questions = scheduler.pending_questions()
repairs = scheduler.pending_repairs()
return {
"current": current,
"pending": pending,
"queue": queue,
"tau": tau,
"queue_max": queue_max,
"questions": questions,
"repairs": repairs,
}
@@ -135,6 +141,8 @@ def build_tree_payload(scheduler: Scheduler) -> dict:
"name": skill.name,
"description": skill.description,
"status": skill.status,
"integration": skill.integration or None,
"integration_source": skill.integration_source,
}
for skill in skills
]
@@ -214,6 +222,12 @@ class DashboardHandler(BaseHTTPRequestHandler):
if path == "/api/status":
self._send(200, build_status(self.scheduler))
return
if path == "/api/questions":
self._send(200, {"questions": self.scheduler.pending_questions()})
return
if path == "/api/repairs":
self._send(200, {"repairs": self.scheduler.pending_repairs()})
return
self._send_error(404, "no such endpoint")
def do_POST(self):
@@ -262,6 +276,32 @@ class DashboardHandler(BaseHTTPRequestHandler):
return
self._send(200, {"status": status, "detail": detail})
return
if path == "/api/questions":
with self.lock:
try:
body = self._read_json()
status, detail = self.scheduler.answer_question(
str(body.get("id", "")), str(body.get("text", ""))
)
except Exception as exc:
self._send_error(500, str(exc))
return
self._send(200, {"status": status, "detail": detail})
return
if path == "/api/repair":
with self.lock:
try:
body = self._read_json()
action = body.get("action")
status, detail = self.scheduler.resolve_repair(
str(body.get("id", "")),
None if action is None else str(action),
)
except Exception as exc:
self._send_error(500, str(exc))
return
self._send(200, {"status": status, "detail": detail})
return
self._send_error(404, "no such endpoint")
def log_message(self, format, *args):