Commit Graph
25 Commits
Author SHA1 Message Date
gabby 38cba33bbf remove dev environment references from codebase 2026-10-02 18:07:39 +00:00
gabby 215c22afb8 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).
2026-10-01 23:57:03 +00:00
gabby de78a0e96a tune category selection 2026-10-01 14:16:29 +00:00
gabby 567c280ee2 Remove the predict phase; contract-driven resolution
Skills now have a single `act(ctx, request)` body phase. The free-string
`Prediction.text` handoff, the `Prediction` type, and the predict phase are
gone.

- Resolution is pipeline-owned: the tiered config merge (global -> category ->
  skill) fills contract vars; the authoring-time SemIf search now searches the
  whole cascade; unresolved vars pause pre-act (`pre_act`, renamed from
  `pre_predict`) and are asked of the human one at a time.
- The data contract is a module-level `CONTRACT` constant in the body, parsed by
  `parse_contract`; `contract.json` is a derived mirror. The separate
  `generate_data_contract` codegen call is removed.
- Candidate selection stays in the body: a set of candidates (bridge endpoint,
  direct API, hard-coded list) gets a SemIf query, and the decisions ride back on
  `ActionResult.decisions` to be logged with the run outcome (phase `act`).
- `assess:outcome`/`assess:requeue` state carries the resolved inputs (secrets
  redacted by name) so the decision sees the full query -> resolution -> action
  path.
- Authoring validation enforces: compiles + `act`; `INTEGRATION` flat and valid;
  `CONTRACT` flat str->str; every CONTRACT key actually read from `ctx.config`.
- Test-regen ladder narrowed to code/test (the contract rides in the code).

SKILL.md/TESTGEN.md rewritten; seeds (calendar.next_event, simplex.next_message,
simplex.connect_link) rewritten to act-only + CONTRACT; docs updated.

BREAKING: persisted bodies in data/skills/ must be regenerated.
2026-10-01 10:21:31 +00:00
Denton Social fb5303928b authoring: dedicated llm provider for skill title/description
Move new category/skill draft authoring off SemIfEngine.generate onto a
separate small OpenAI-compatible provider, deliberately distinct from
codegen. Extract the shared transport (SSE/budget/idle/degeneration) into
provider.OpenAICompatClient; LLMClient and CodegenClient subclass it with
their own endpoints, sampler defaults, and error types.

Draft authoring now runs on its own async single-slot worker: a create
request queues, the gate stays free, a category job chains into its skill
job, and the original request re-runs when the body lands. An unreachable
llm endpoint is graceful (draft_failed trace, user notified, no
re-dispatch); only SemIf availability is fatal. Elicitation is deferred on
every front end (REPL included) now that authoring is async.
2026-09-29 22:18:01 -05:00
Denton Social 22f91e0360 response: rebuild as a closed tree of canned replies; drop the gate
There is no up-front handle/ignore filter any more. Every input is scored
and dispatched; inputs that are not tasks fall through navigation into the
closed response category of hardcoded canned lines (greeting/thanks/
acknowledge/farewell/affirm/unable + the catchall response.clarify). The
category is CANNED_CATEGORIES: navigation offers no create_skill there,
dispatch/restart refuse to author it, and the runner skips assessment and
repair for it (a canned line has no side effect to assess).

Removes _contains_request/build_gate_decision and the dropped path.
2026-09-29 03:46:53 -05:00
Denton Social a29371f510 navigation: confidence gate on create_skill/create_category
The create branches share a softmax with the real options, so a weak
plurality win was enough to trigger authoring. Require P(create) to clear
navigation.create_tau and lead the best existing option by
navigation.create_margin; otherwise fall back to the best existing option
(the intent guard remains a second door) and trace create_suppressed.
An empty tree/category still short-circuits straight to create.
2026-09-29 02:47:43 -05:00
Denton Social 13a512cc31 routing: send unlearned actions to codegen, fix gate + repair loop
SemIf routing only sees option descriptions, but the leaf fallback said
'Suggest creating a new skill' (mechanism, not trigger), so a send request
had no verb match and fell through to the read skill that shared the word
'message'. Every send phrasing picked simplex.next_message; create_skill
scored ~0.03 and codegen was never reached.

- navigate: reword the create_skill fallback to the trigger ('No existing
  skill performs this action') and make the criterion ask which skill
  performs the requested action. Sends now route to create_skill at P~0.93.
- confirm_skill_fit: one action-vs-action SemIf guard (phase navigate:intent)
  after routing; a mismatch authors a new leaf instead of silently running the
  wrong skill. Wording tuned on the real model (no IM hint: it over-fires).
- gate: imperative tasks are actionable even with no matching skill, so a
  casually phrased send is no longer dropped as 'no actionable request'.
- finish_run: a failure whose retry is refused by the reentry budget still
  surfaces a repair offer.

Validated on jarvis: gate accepts all tasks/rejects all noise, sends route to
CreateSkill, reads still route to their skills. Dev: 265 passed; jarvis
non-codegen integration: 6 passed.
2026-09-28 20:34:59 -05:00
Denton Social 3d0cff325c assessment: make assess/fidelity SemIf decisions, drop LLM from decision path
Assessment was an LLM generation step emitting prose. Move it to SemIf:
- assess:outcome (success/failure @ tau) and assess:requeue (complete/retry,
  updated_request = request.text bounded by max_reentries) are logged decisions.
- Run summary is deterministic (category.skill + ok/failed + action_log/new_state).
- Fidelity gate is a real authoring:fidelity accept/reconsider decision plus
  static integration findings; it only triggers a rewrite, never a diagnosis.
- Corrective regens receive the raw evidence bundle as-is (render_evidence),
  never an LLM paraphrase.
- Every EngineUnavailable is fatal app-wide: Scheduler.fatal is recorded, the
  worker stops, and the CLI prints 'decision engine not available' and exits
  non-zero. Remove llm.assess/review_skill_body (keep _parse_json).
- Tests: ScriptedEngine double in tests/conftest.py for scheduling mechanics;
  replace the review_skill_body integration test with a SemIf fidelity test;
  add deterministic-summary and evidence-renderer unit tests.
2026-09-28 17:49:26 -05:00
Denton Social d46fbdca19 load committed seeds regardless of cwd; fix skills listing + SimpleX link
- cli.load_config anchors skill_seeds/skill_bodies/category_registry/log/trace
  to the checkout root, so a fresh clone's committed seeds load from any cwd
  (running outside the repo root had an empty tree -> codegen loop).
- `skills` (CLI + REPL) lists scheduler.tree, not a throwaway built-ins tree.
- SimpleX adapter reads the real /_show_address shape
  (contactLink.connLinkContact), so simplex.connect_link returns the link
  instead of reporting no address.
2026-09-28 13:52:00 -05:00
Denton Social 08d6bb23e2 gateway: serve a local messaging bridge so skills can send/read SimpleX
The gateway now exposes a localhost stdlib HTTP API (bridge.py) that
buffers authorized inbound DMs and forwards outbound sends, so a skill
body never opens a WebSocket to the simplex-chat daemon. Endpoints:
GET /health, /contacts, /inbox (peek), /inbox/next (pop oldest unread),
POST /send (resolve id/display name onto the adapter's outbound queue).
GatewayService gains an observer hook and inbox.dispatch (pull-only mode).

Expose the capability to codegen (SKILL.md, BODY_DIRECTIVES, elicitation,
TESTGEN.md) and add the simplex.next_message seed (SemIf recipient
resolution) with its hermetic loopback test. Config: messaging_bridge_url
plus gateway.simplex.{inbox,bridge}; bootstrap keeps them in sync.
2026-09-26 21:39:39 -05:00
Denton Social a627f59a67 surface skill result, not LLM assessment, to the user
The user-facing output was the self-assessment model's brief summary, so a
skill that returned real data (e.g. calendar.next_event) only reported that
it found something. Display the skill's action_log instead; keep the
assessment text on the assessed trace (assessment_summary) for diagnostics.
2026-09-26 06:16:13 -05:00
Denton Social de2c1a73f2 gate: stop dropping lookups by carrying expectation + skills in the state
The binary gate asked "Does this input contain an actionable request?" over
the raw text alone, so the model read information requests as small talk:
"tell me the next event in my nextcloud calendar" scored 0.599 (under tau
0.6) and "what is the next event...?" scored 0.191, both dropped. The state
now states that the user expects handling, that looking values up in a
configured service is a real task, and lists the available skills; the
question/options say handle/ignore. On the real model every lookup variant
scores 0.9998+ while chatter stays at 0.016-0.125, and the new jarvis
integration battery pins both sides.
2026-09-26 06:04:39 -05:00
Denton Social b66d1e325a real seed skills: replace fake email/tracking built-ins with calendar.next_event
email.compose and tracking.check were hardcoded fakes (draft files / local
JSON, no real service) that shadowed the authoring path for real skills.
Remove them, delete their data fixtures and config keys, and ship a real
starter integration instead: seeds/calendar/next_event, a Nextcloud CalDAV
body in the SKILL.md folder format (PROPFIND calendar discovery + SemIf
calendar choice, calendar-query REPORT with server-side recurrence
expansion, all-day/TZID parsing, honest failures) with a hermetic
skill.test.py. merge_seed_store loads seeds into every tree at startup;
recorded config lands in gitignored data/skills/, and generated bodies
replace seeds of the same name. Only service-free response.reject stays
built-in.
2026-09-26 03:17:11 -05:00
Denton Social dde034f1b4 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.
2026-09-26 01:42:00 -05:00
Denton Social 06ccfb77c6 drop mock_data.json: embed fixtures inline in skill.test.py
The testgen call now replies with plain Python (no JSON envelope), so the
model can no longer confuse the envelope with the artifact. skill.test.py
carries its fixture data inline as Python literals; the folder layout is
now skill.py, skill.test.py, contract.json, config.json. The regen ladder
drops the mock option (3-option: code/contract/test) since a fixture fix
is a test regen.
2026-09-26 00:04:23 -05:00
Denton Social ddd2495f81 ship BRAINSTORM item 1: folder skill store, contract+testgen, config tiering
Skill leaves become folders (skill.py, skill.test.py, contract.json,
mock_data.json, config.json); clean switch, old single-file layout ignored.
SKILL.md owns the runner-data doctrine (no mock data); TESTGEN.md owns
mocking/testing. Async authoring pipeline: codegen body -> decoupled contract
gen -> shared-context testgen -> subprocess auto-run test with a 4-option SemIf
regen ladder (trace-only). Opt-in requirements elicitation (REPL asker) with
anti-pattern guardrails. Config search auto-populates skill config via SemIf
(global -> category); runner resolves tiers into ctx.config and pauses
pre-predict for unresolved contract vars with record/ask-again choices.
2026-09-25 22:46:07 -05:00
Denton Social 87438c881a async skill-body authoring: single-slot codegen worker, restart, re-dispatch
create_skill now authors the stub synchronously and returns immediately;
the runnable body is written by a single-slot background worker (the gate
stays free for new input). On success the body is materialized and
hot-merged, the leaf's writing flag clears, and the original request is
re-queued at its scored weight and re-runs navigation onto the new leaf.
On failure the leaf stays a restartable stub and the user is notified.

- scheduler: _dispatch_skill launches the async write instead of blocking;
  _run_skill guards writing/stub leaves (no silent no-op); restart_skill
  re-kicks a write for an empty not-in-progress leaf (reuses the stored
  request_text); RLock guards tree/queue/current across worker and main
  thread; awaiting_skill_body meta guard stops a re-dispatched request
  from authoring a second skill.
- skills: Skill.writing + status/is_noop via module-level no-op sentinels;
  registry entries persist the originating request_text.
- engine: call/generate serialized with a Lock so the worker's degeneration
  checks never race main-thread navigation/scoring on one llama.cpp context.
- cli: restart <category> <skill> command; REPL drains the queue after input.
- dashboard: POST /api/restart; /api/tree carries per-skill status; tree
  rows + skill_write_failed flow nodes get restart buttons; reads snapshotted.
- tests: async end-to-end (real CodegenClient vs fake SSE endpoint), restart,
  loop guard, status derivation, dashboard endpoint/status; integration chain
  test rewritten to poll for async completion + assessed.
2026-09-25 03:08:33 -05:00
Denton Social 63922c1fad REPL when skill_create needs user input 2026-09-24 05:46:23 -05:00
Denton Social 300c20714b deterministically execute create_skill from create_category, execute skill after creation 2026-09-24 02:31:12 -05:00
Denton Social 789ed4ae25 Allow dotted skill titles (category.skill) in create_skill drafts
The model follows the repo's existing dotted naming (email.compose,
tracking.check) and proposed titles like tracking.status_lookup, which the
strict alnum-only check rejected. Accept dotted snake_case names.
2026-09-23 23:45:52 -05:00
Denton Social e68c56dca4 Fix create_skill wedge: short-circuit single-option navigation, never leave scheduler busy
An empty category produced a one-option SemIf leaf decision; the backend rejects
<2 options, the ValueError unwound past the current-process reset, and every
later request queued forever behind a phantom current. Navigation now
short-circuits empty trees/categories straight to the create branch (no SemIf
decision when there's nothing to choose), and the scheduler clears its current
process even when dispatch raises. Authoring generation is capped at 128 tokens.
2026-09-23 23:41:38 -05:00
Denton Social 225b4df959 Make create_skill author a skill leaf stub like create_category 2026-09-23 23:02:59 -05:00
Denton Social fcefb971f8 Fix SemIfEngine.generate: sample from the low-level llama.cpp backend 2026-09-23 22:32:48 -05:00
Denton Social ea2e5b8045 Automate create_category via normal-mode generation of the decision model 2026-09-23 20:45:28 -05:00