Commit Graph
164 Commits
Author SHA1 Message Date
gabby e8d1685177 voice gateway returns skill result only 2026-10-06 05:55:07 +00:00
gabby 172e61e6be voice: add tts volume knob; louder wake cue 2026-10-06 04:52:45 +00:00
gabby d2f9a74bd9 voice: play a beep cue on wake 2026-10-06 04:45:59 +00:00
gabby eeed8407f9 bootstrap: install alsa-utils for voice hosts 2026-10-06 04:42:08 +00:00
gabby d25b3259e4 add voice gateway (wake word, speech-to-text, text-to-speech) 2026-10-06 04:32:21 +00:00
gabby 4496b8eceb update README to include LXMF 2026-10-06 02:36:56 +00:00
gabby 49f67575cf add LXMF gateway 2026-10-05 23:07:57 +00:00
gabby 1d9730bfcb check actionability at the top of navigation
Move the actionability guard (confirm_non_action) to the top of navigate,
before category selection, instead of only firing when the category softmax
proposed response/create_category. A non-request now goes straight to the
closed response tree and never reaches the category softmax, and the category
softmax offers only real categories (the canned response tree is excluded), so
a request can never be canned and a non-request can never be routed into a
real category.

Reword the guard so vague/incomplete fragments ("what") count as non-action:
they previously matched none of the non_action cases and split the decision
(action 0.513 / non_action 0.487), so "what" authored a redundant
"unclear"/"clarify_intent" category. It now lands on the catchall
response.clarify.

Remove the now-dead CreateSkill-for-canned fallback and _canned_fallback.

Update AGENTS.md, the navigation unit tests, the tune_navigation eval set, and
add an integration test for the vague-fragment route.
2026-10-05 21:44:18 +00:00
gabby 80518dcdda route only non-request input into the response tree
The response category scope claimed to cover "inputs the agent cannot act
on", so an actionable request like "what is 255 * 12?" scored as in-scope
and landed in the response.unable canned refusal.

Add the actionability guard (confirm_non_action, phase
navigate:actionability, navigation.action_tau) which arbitrates the
response/create_category boundary whichever side the softmax proposed: the
closed response tree is now reached only when the input is not a request, so
a request no skill covers authors a skill instead. Reword the response scope,
drop the response.unable reply, and update tests/docs.
2026-10-05 09:59:03 +00:00
gabby 9a135f53ab describe/prescribe semif in codegen.md 2026-10-05 09:03:11 +00:00
gabby 07b0e2ff7e add basic clock functions (timer, alarm, date, current time) 2026-10-05 05:30:15 +00:00
gabby 780c9592ed codegen: show imports in CODEGEN.md and reject unimported names
A 4B codegen model wrote a plausible body that called
urllib.request.urlopen and returned ActionResult without importing either.
The contract described imports in prose but never showed one (and the model
only ever sees CODEGEN.md, not the seeds it points at), and parse_skill_body
only compiled the AST — so the body was accepted and failed later at
materialize/run.

- CODEGEN.md: add a complete minimal example (imports first, then
  INTEGRATION/CONTRACT/act), an explicit "import everything you use" note,
  the correct DecisionRequest/Option import path, and a strengthened
  acceptance criterion.
- codegen.py: parse_skill_body now rejects a body that references names it
  never imports or binds, via a scope-aware symtable check (skips locals,
  parameters, closures, builtins, and module dunders). The failure is a
  ValueError, so the existing retry ladder fires with a corrective prompt.
- tests: parse-level coverage (missing imports, closures/locals/builtins,
  module dunders, wrong-but-bound module paths) plus a pipeline test that an
  import-less body fails authoring and leaves a restartable stub.
2026-10-03 21:21:09 +00:00
gabby 8426b85ce0 codegen: share build_codegen_client and fix its integration test
Extract build_codegen_client() from build_scheduler so the codegen client
(provider class plus auth/User-Agent) is constructed in one place, and use it
in test_generate_skill_body_codegen, which previously hardcoded a plain
CodegenClient and 403'd against the Console provider.
2026-10-03 18:07:22 +00:00
gabby e81e6c3a6b seeds: make calendar.create_event the authoritative example
CODEGEN.md now points to seeds/calendar/create_event/ as the worked example,
and the other seeds mirror it: next_event and next_message gain the
configured-default contract var plus create_event's tau -> default ->
weak-winner candidate resolution, and the shared docstring/banner/_now style.
connect_link gets the style alignment only; create_event itself is unchanged.
2026-10-03 18:07:16 +00:00
gabby 63c5fc9903 llm bridge service 2026-10-03 09:05:28 +00:00
gabby f21baa7ebd remove worked example, refactor calendar create_event seed 2026-10-03 07:14:46 +00:00
gabby 18f3d6fee5 codegen: steer skill bodies to derive query arguments and return real output
CODEGEN.md was strong on real integrations and config plumbing but silent on
the two things that make a skill turn a query into an output: reading
request.text for per-request arguments and returning the real result. Bodies
(and the old query-agnostic health-check example) were free to ignore the
request and return a generic string.

- add "Turning the request into arguments": read request.text, keep
  per-request arguments out of CONTRACT, resolve targets with a SemIf
  sub-decision, needs_input only for genuine ambiguity
- add "Producing the result (output)": action_log/new_state must carry the
  fetched data or the service's real response, never a placeholder
- replace the worked example with a task-shaped body (extract tracking number
  from the query, real HTTP lookup, real result) that passes the parser
- add import-time-safety and single-phase-resume rules + acceptance criteria
- mirror the two requirements into BODY_DIRECTIVES so first/retry/regen
  prompts carry them, with tests asserting both
2026-10-02 22:12:44 +00:00
gabby 341eb9f8a0 change all references from SKILL.md to CODEGEN.md to avoid ambiguity 2026-10-02 21:35:01 +00:00
gabby 43ece0cfd6 bootstrap: seed config.json once; move refs to committed pins.json
config.json is now per-machine USER config that no code writes: bootstrap
seeds it from config.example.json only when absent, then reads every
per-machine value from it. Flags override those values for the run only and
are never written back.

External refs (engine commit, GGUF url+sha256, HF tokenizer revision,
simplex-chat version/url+sha256) move out of config into a committed,
code-owned pins.json, so a git pull bump propagates on the next bootstrap
run instead of being frozen per machine. The agent reads engine
source/revision from pins.json and derives the GGUF path from engine.gguf_url
under .runtime/models/ (an explicit engine.gguf in config.json overrides it).

- config.example.json: drop all refs; ship the provisioned defaults
  (codegen.timeout 3600, gateway/bridge enabled, dashboard 127.0.0.1)
- scripts/bootstrap.sh: seed config.json if absent, read pins from pins.json
  and per-machine values from config.json, never write config.json; drop the
  flags that only existed to populate config.json; US-delimit read fields so
  empty values do not shift later fields
- semif_agent/cli.py: add load_pins / build_engine_config; load_config
  hard-errors when config.json is missing
- tests/integration + README/AGENTS updated
2026-10-02 19:47:56 +00:00
gabby 38cba33bbf remove dev environment references from codebase 2026-10-02 18:07:39 +00:00
gabby 5747ad2fa6 Make provider sampler params opt-in; drop escalation preset
Sampler parameters (temperature/top_p/presence_penalty/frequency_penalty)
now default to None and are omitted from the request payload when unset, so
the server's model/Modelfile default applies. The provider no longer guesses
values on the user's behalf; callers opt in via config or a per-chat override.

- provider.OpenAICompatClient / llm.LLMClient: default the four params to None
  and only include them in the payload when set (max_tokens/reasoning_effort
  already behaved this way).
- cli.build_scheduler: pass None when the config key is absent via _opt_float,
  instead of hardcoded numeric fallbacks.
- codegen: remove ESCALATED_SAMPLER and its use on retries (body, elicitation,
  testgen, regen). The retry ladder keeps the fresh short prompt but reuses the
  configured/omitted sampler; appropriate values can't be known in advance for
  arbitrary user models.
- console: no functional change; the hosted Console API now receives no sampler
  params by default.
- Tests cover omit-by-default, send-when-configured, per-call override, and the
  no-escalation retry.
- Docs: config.example.json comments, provider/llm/codegen/console docstrings,
  AGENTS.md.
2026-10-02 13:00:50 +00:00
gabby 8afb488dc4 svg flow diagrams 2026-10-02 00:32:08 +00:00
gabby 159112b8fb input -> output flow chart 2026-10-02 00:19:48 +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 25ade160df simplex gateway produces link for user to connect to service 2026-10-01 22:27:50 +00:00
gabby 8751e7c08e dashboard: show a pending submit while its run spins up; retune codegen defaults
Submitting from the dashboard cleared the input and then showed nothing until
the next poll, so a slow submit looked like a no-op. POST /api/submit now
returns the new request_id alongside status/detail (Scheduler.submit_request),
and the front end keeps a `pendingSubmit` entry: it immediately renders a
synthetic "submitted" node plus an in-flight spinner, then swaps to the real
run once its trace row appears (matching by request_id) and clears the pending
state. A run that has landed but has no decisions yet also gets the spinner
instead of an empty flow. Adds a test asserting the returned request_id matches
a trace run.

Also flip config.example.json codegen defaults to stream:true and
temperature 1 / top_p 0.95 / presence_penalty 0 / frequency_penalty 1.
2026-10-01 20:35:38 +00:00
gabby da53e1eefc Merge remote-tracking branch 'origin/main' into main
Resolve the navigate() leaf conflict: keep the local two-stage navigation
refactor (descriptions, confirm_category_fit, create_skill removed from the
leaf softmax) and apply origin's compose_state intent on top.

origin/main (857ad1a) was not runnable as pushed:
- compose_state renamed its param to additional_context but its body still
  read `current` (NameError) and _navigate_canned called it with a stray
  `additional_context:` annotation (SyntaxError).
- the rename was not propagated to scheduler.py's two callers (TypeError).

Resolution:
- compose_state(request, additional_context=None) renders `({additional_context})`.
- canned + navigate leaf decisions pass
  additional_context=f"all choices are within the {category} category".
- scheduler.py builds its state inline to keep the exact
  `[current process: …]` wording for the interrupt/priority decisions.
2026-10-01 20:16:43 +00:00
Denton Social 857ad1ac39 declare category as category in prompt for skill selection 2026-10-01 15:05:05 -05: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
gabby 4a62e794a5 implement opencode provider 2026-10-01 06:00:45 +00:00
gabby 375d37d1f1 change drone tacking test to simplex create message test 2026-10-01 04:44:37 +00:00
gabby 65c5899393 remove reasoning from llm calls for title and description generation 2026-10-01 01:43:36 +00:00
Denton Social 50c83c61fd edit documentation for clarity, add table for per-query context composition 2026-09-30 15:01:47 -05:00
Denton Social e93db6ec09 bridges: daemon-backed message history + true unread
The in-memory inbox is a receive buffer, not the daemon's read state, so
the bridge could not see messages that arrived while it was down. Query
/_get chats <userId> count=<n> with a ChatListQuery unread filter
(chatStats{unreadCount, minUnreadItemId} + chatItem.meta.itemStatus
rcvNew/rcvRead) and /_get chat @<id> count=<n> over the existing
corrId->Future path, and expose GET /unread and GET /history?contact=<id>.
Both are read-only (v7 has no mark-read command) and degrade like
/address: 503 not connected, 502 lookup failure, 400 without a contact.
The live /inbox buffer is unchanged.
2026-09-30 12:10:34 -05:00
Denton Social 4a4fe850e0 bridges: refresh SimpleX contact list from the daemon
The bridge only learned contacts from observed inbound senders, so /send
could not address a contact it had never received from. Query /_contacts
<userId> (active user from /user, cached) over the existing corrId->Future
path, merge into the inbox on (re)connect via an on_connected hook and on
demand (GET /contacts, send-resolution miss). Best-effort: a disconnected
daemon keeps the cached set.
2026-09-30 11:39:28 -05: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 ea3d79be99 remove brainstorm and idea files from repo. init readme 2026-09-29 16:29:02 -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 5a6f220e79 navigation: calibrate create gate defaults from jarvis runs
Real engine on the seed tree: genuine creates lead by 0.42-0.93 while the
weak-plurality cases ('any new messages?', 'unread messages', 'calendar
today', 'get invite link') lead the best existing skill by 0.14-0.34.
Set create_tau=0.5, create_margin=0.35 so those ambiguous reads fall back
to the existing skill; the send regression (0.87 margin) is unaffected.
2026-09-29 03:00:30 -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 6e197596c8 remove explicit mentions of forwarding bridge to ensure that implementation prescriptions come from single source of truth 2026-09-29 00:05:23 -05:00
Denton Social 8eb4541f19 prompts tell title gen to make generic, reusable titles ad description that mention benefit to user 2026-09-28 23:32:39 -05:00
Denton Social 98ec4ee5e2 codegen: move bridge specifics into the catalog
Bridge specifics (service, base-URL config var, auth header/token var,
config-var docs, endpoints with error shapes) now live in BridgeInfo and
render through describe_bridges(), which is injected into body, retry,
regen, elicitation, and testgen prompts. SKILL.md/TESTGEN.md carry only
the generic pattern.

- regen prompt regains the catalog (was a dangling reference)
- elicitation integration hint rides body/retry/regen as an advisory
- top-level simplex_bridge_token config var; bootstrap syncs it
- simplex seeds read the token and send X-Semif-Token when set
2026-09-28 23:30:44 -05:00
Denton Social d0df6f16c4 ignore local setup files 2026-09-28 20:35:25 -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 5589358de2 tests: isolate integration runtime artifacts from the box's persisted state 2026-09-28 18:04:18 -05:00
Denton Social 42b2472328 tests: keep codegen configured in the SemIf fidelity integration test 2026-09-28 17:54:46 -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 ddc5cb66c8 bridges: standalone third-party API bridges; isolate the command gateway
Split messaging UX (invite links, read, send) out of the command gateway into a
new `semif_agent.bridges` layer. Each bridge is its own process (`cli bridge`)
against its own service daemon/profile; the SimpleX bridge owns a second
simplex-chat daemon and buffers every inbound DM, so a message sent to the
connect-link address shows up in `simplex.next_message`.

- new: bridges/{base,inbox,registry,simplex}.py + neutral semif_agent/simplex_ws.py
- gateway: delete bridge.py; drop address/observer/pull-mode from the command path
- codegen: inject the bridge catalog (describe_bridges) into body + elicitation prompts
- seeds: repoint simplex.next_message/connect_link to top-level `simplex_bridge_url`
- config/bootstrap: new top-level `bridges` block + `simplex_bridge_url`; render
  semif-simplex-forward + semif-bridge units; gateway config loses bridge/inbox
- docs: AGENTS.md gateway isolation is non-negotiable
2026-09-28 15:24:44 -05:00