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

+47 -1
View File
@@ -175,10 +175,37 @@ def try_warm(scheduler: Scheduler) -> str:
return f"decision engine unavailable: {exc}"
def _answer_questions(scheduler: Scheduler) -> None:
"""Ask any deferred authoring/repair questions at the REPL."""
while True:
pending = scheduler.pending_questions()
if not pending:
return
question = pending[0]
answer = input(
f"[{question['skill']}] {question['question']}\n"
"answer (empty to skip): "
)
status, detail = scheduler.answer_question(question["id"], answer)
print(f"[{status}] {detail}")
def _print_repairs(scheduler: Scheduler) -> None:
for offer in scheduler.pending_repairs():
print(
f"[repair] {offer['id']} {offer['category']}.{offer['skill']} "
f"suggested={offer['selected']} {offer['failure'][:120]}"
)
def repl(scheduler: Scheduler, config: dict) -> None:
scheduler.asker = lambda question: input(f"{question} ")
print(try_warm(scheduler))
print("type a request, or one of: busy <text> | idle | status | skills | dream | relabel <id> <outcome> | restart <category> <skill> | quit")
print(
"type a request, or one of: busy <text> | idle | status | skills | dream | "
"relabel <id> <outcome> | restart <category> <skill> | "
"repairs | repair <offer-id> [action] | quit"
)
while True:
try:
line = input("> ").strip()
@@ -199,6 +226,22 @@ def repl(scheduler: Scheduler, config: dict) -> None:
if lower == "dream":
print(run_dream(scheduler.log).render())
continue
if lower == "repairs":
_print_repairs(scheduler)
continue
if lower.startswith(("repair ", "/repair ")):
parts = line.lstrip("/").split()
if len(parts) not in (2, 3):
print("usage: repair <offer-id> [retry|repair_skill|ask_user|no_repair]")
continue
status, detail = scheduler.resolve_repair(
parts[1], parts[2] if len(parts) == 3 else None
)
print(f"[{status}] {detail}")
_answer_questions(scheduler)
for result_status, result_detail in scheduler.run_queue():
print(f"[{result_status}] {result_detail}")
continue
if lower.startswith("relabel "):
parts = line.split()
if len(parts) != 3:
@@ -231,6 +274,8 @@ def repl(scheduler: Scheduler, config: dict) -> None:
print(f"[{status}] {detail}")
for result_status, result_detail in scheduler.run_queue():
print(f"[{result_status}] {result_detail}")
_answer_questions(scheduler)
_print_repairs(scheduler)
def scripted(scheduler: Scheduler, path: str) -> None:
@@ -292,6 +337,7 @@ def main(argv: list[str] | None = None) -> int:
elif args.command == "dashboard":
from .dashboard import serve
scheduler.defer_questions = True
if args.replay:
print("replay mode: reading decision log + trace; engine not warmed.")
serve(scheduler, port=args.port, host=args.host)