Commit Graph
139 Commits
Author SHA1 Message Date
gabby f1ea9f0c2c seeds: ship simplex.send_message (promoted from the runtime store)
Move the authored simplex.send_simplex_message skill out of data/skills/ into
the committed simplex seed folder as send_message. Expand its CONTRACT to cover
every declared config var (SimpleX bridge + LLM bridge) so it satisfies the seed
contract test, add its manifest.json, and update the navigation tuning labels,
the seed-existence test, the committed-seed tree assertions, the docs, and the
bridge backlog (item 3 shipped).
2026-10-09 00:32:07 +00:00
gabby b8f86849ea seeds: merge calendar and productivity_management into nextcloud
Consolidate the calendar and productivity_management seed categories into one
nextcloud category: create_event/next_event move from calendar, and
create_nextcloud_task becomes create_task (dropping the redundant prefix).
Replace the two CATEGORY_DESCRIPTIONS entries with a single nextcloud
description and update every reference across the repo (docs, bridge comments,
tests, navigation tuning labels, seed docstrings).
2026-10-09 00:23:32 +00:00
gabby e434b9fbe5 bridges: add an Outlook (Microsoft Graph) bridge + seeds
A standalone Outlook bridge in front of Microsoft Graph — mail, calendar
events, Microsoft To Do tasks, contacts, and OneDrive files — so skill
bodies never speak Graph or OAuth directly. Stdlib-only, no daemon (like
Nextcloud), and registered in CATALOG so describe_bridges() feeds it into
every codegen prompt.

Authorization is the OAuth2 device code flow: scripts/outlook-auth.py runs
it once and stores the refresh token 0600 under .runtime/outlook/token.json;
outlook_client.py refreshes on expiry/401, follows @odata.nextLink paging,
and backs off on 429/Retry-After. An unauthenticated route is a 503 (run the
helper), a real Graph failure a 502.

Seven seeds/outlook/* starter skills (next_message, send_message — compose
via the LLM bridge and confirm before sending — next_event, create_event,
create_task, list_contacts, list_files), a bridges.outlook config block, and
tests/test_outlook_bridge.py driving the real client over a loopback server
faking the token endpoint and Graph shapes.
2026-10-08 22:57:18 +00:00
gabby b7d405454a voice: add custom Piper voice training pipeline
Record an LJSpeech dataset from the microphone, fine-tune a Piper voice
from the pinned base checkpoint on a GPU host, and verify every take
against its prompt with Whisper before training.

- semif_agent/voice_train.py: neutral, stdlib-only recording helpers
  (LJSpeech dataset writer, prompt loading, WAV I/O, mic-check level
  math, silence-endpointing capture loop) plus transcript-fidelity
  helpers (normalize_text, word_error_rate, compare_transcript).
- scripts/voice-record.py: interactive + hands-free (--speak-prompts /
  --read-prompts) recording; resumes by prompt id and announces how many
  of the 720 prompts remain, so a resume is never mistaken for a rerun.
- scripts/voice-train.sh: piper1-gpl checkout + venv, warmstart
  fine-tune of the pinned medium checkpoint, ONNX export. Handles
  torch>=2.6 weights_only (PosixPath allowlist), the older checkpoint's
  hyperparameters (--model.warmstart_ckpt, not --ckpt_path), the
  espeakbridge in-place dev build, and piper's validation/test splits
  (needed for the default checkpoint callbacks).
- scripts/voice-verify.py: transcribe-and-compare fidelity check
  (empty/mismatch/review/ok), --json report, --from-json + --prune to
  mark bad takes for re-recording without deleting them.
- pins.json: voice block (piper1-gpl ref + medium base checkpoint).
- voice_transport.py: WhisperTranscriber beam_size/vad_filter knobs;
  SoundDeviceAudio.read(timeout=) so a dropped device ends a take
  instead of hanging.
- AGENTS.md: architecture map + roadmap entries; docs/VOICE-TRAIN.md
  the end-to-end guide; tests/test_voice_record.py the helper tests.
2026-10-08 22:37:34 +00:00
gabby aa25693091 remove unnecessary llm refusal guard 2026-10-08 17:22:57 +00:00
gabby 912417792f seeds: ship create_nextcloud_task as a starter skill
Turn the generated productivity_management.create_nextcloud_task body into
a committed seed in the CODEGEN.md folder format. It goes through the
Nextcloud bridge: GET /tasklists picks a VTODO-capable target (never an
event-only calendar or a Deck board) and POST /tasks creates the task; the
LLM bridge phrases the summary/description. The CONTRACT mirrors the four
bridge config vars the body reads, so the seed passes the integration and
contract checks.

Register productivity_management in CATEGORY_DESCRIPTIONS so the seed's
category is described for navigation, and list the seed in
tests/test_seed_skills.py.
2026-10-08 02:05:31 +00:00
gabby 0005d8f7ee bridges: resolve Nextcloud tasks to VTODO-capable lists
Task operations used the same calendar resolver as events, so a request
that named (or defaulted to) an event-only calendar like "personal" put a
VTODO into a collection that rejects it. Read each collection's CalDAV
supported-calendar-component-set, expose it as `components` on
/calendars, and add GET /tasklists (VTODO-capable calendars, minus
Nextcloud Deck boards).

_resolve_calendar is now component-aware: task routes only target a
VTODO-capable list and reject an event-only calendar with a clear 400;
with no name they try default_task_calendar, then default_calendar when
it also accepts VTODO, then the sole user task list. Add the
default_task_calendar config (top-level nextcloud_default_task_calendar
fallback) and document the routes in the bridge catalog.
2026-10-08 01:56:22 +00:00
gabby 228886f7cd bridges: derive skill config vars from the bridge block
Bridge listener addresses were hand-maintained duplicates of
bridges.<name>.host/port at the top level (simplex_bridge_url,
llm_bridge_url, nextcloud_bridge_url, plus their _token). A host
provisioned before a bridge was added never gained the key, so a skill
for that bridge could not resolve its URL: the contract config search
fell back to 'ask' and a front end captured an unrelated reply as the
value (a voice task request was recorded as nextcloud_bridge_url).

Add bridges.registry.derived_config_vars(config): for every catalog
bridge, derive <name>_bridge_url/<name>_bridge_token from its own
bridges.<name> host/port/token. build_scheduler injects these into the
config the scheduler and ctx.config expose, so the contract config
search finds them and skills read them with no top-level duplicate.
A block with no port contributes no URL, leaving an unconfigured bridge
as an unresolved variable the operator is asked for. Bind-all hosts
normalize to 127.0.0.1.

Remove the six redundant top-level keys from config.example.json and
update README/AGENTS/bootstrap notes. Tests cover derivation, bind-all
normalization, and the unconfigured-bridge skip.
2026-10-08 00:17:53 +00:00
gabby d9cc7e4fed bridges: add a Nextcloud bridge (files, calendars, tasks, contacts, notes)
A standalone bridge wrapping the account's native protocols — WebDAV files,
CalDAV events and tasks, CardDAV contacts, and the OCS Notes API — behind one
token-guarded localhost JSON surface, so a codegen-authored body never speaks
DAV/OCS directly.

- nextcloud_client.py: stdlib-only client (urllib + xml.etree + ssl + base64)
  with Basic auth, DAV/OCS request bodies, and minimal iCalendar/vCard build +
  parse; every failure is a NextcloudError carrying the HTTP status.
- nextcloud.py: NextcloudBridge with no service daemon (check_requirements is
  always (True, None)), ~35 routes (GET reads, POST mutations). Event/task
  updates edit the stored iCalendar in place (preserving VALARM/ATTENDEE) behind
  If-Match; creates use If-None-Match. Missing connection is 503; a real
  Nextcloud failure is 502, never a fabricated success.
- registry: CATALOG entry + build_bridge passes the top-level nextcloud_* values
  as a fallback so the account the calendar seeds collect is configured once.
- config.example.json: bridges.nextcloud block + nextcloud_bridge_url/token.
- docs: README, AGENTS, bridges/__init__, bootstrap closing notes.

Tests drive the real client over a loopback http.server faking Nextcloud's
DAV/OCS shapes. One codegen test's context window was raised because the bridge
catalog injected into every prompt grew the baseline prompt.
2026-10-07 12:17:39 +00:00
gabby e64354e78d docs: align CODEGEN.md/TESTGEN.md with the codebase
CODEGEN.md:
- replace the stale "Manifest schema" (allowed_inputs/actions/cost_budget/
  decision_log_ref, a dotted leaf name) with the real registry shape and note
  the body writer does not author it
- document ctx.timers (and that ctx.admin is built-in-only) and the
  request.meta resume cache, both used by the authoritative seed set
- correct acceptance criteria: INTEGRATION is not hard-rejected (inferred /
  fidelity-gated); note which items the parser actually enforces; compile ->
  ast.parse
- fix the SemIf URL, the structured-state claim (state is a string here), the
  config_vars/CONTRACT relationship, and defer llm_bridge_* names to the catalog

TESTGEN.md:
- separate the only static check (ast.parse) from execution (exit 0); state
  that stdlib-only/inline-fixtures/hermeticity are required but not verified
- clarify contract.json is handed to the test writer as context

README.md: fix the same stale manifest field list.

tests/test_codegen.py: add guards for the runtime surface and against the
stale manifest fields returning.
2026-10-07 11:30:58 +00:00
gabby dff4849947 simplex: honest forwarding — verify sends, disambiguate contacts, read persistent unread
The SimpleX forwarding path could report a failed send as success and could
route to the wrong peer:

- contact_entry dropped the daemon's unique localDisplayName, so two peers
  sharing a profile name ("pepper" / "pepper_1") were indistinguishable; the
  agent's SemIf choice then picked the stale one.
- The bridge's POST /send enqueued the message fire-and-forget and returned
  ok:true; the daemon later marked it sndError (auth), yet the agent reported
  "sent" and assessed success.
- next_message read only the live buffer, missing messages that arrived before
  the bridge started.

Fixes:
- simplex_ws: contact_entry exposes local_name + connected/auth_errors;
  parse_chat_item surfaces the agentError; parse_send_response normalizes a
  /_send reply; add correlated send()/request_send().
- bridges/simplex: resolve disambiguates by id -> local_name/display_name and
  prefers the healthiest peer; send() confirms the real terminal status
  (sndSent/sndRcvd ok, sndError with reason) instead of a false ok; /unread
  carries cached connection health; catalog documents the new fields/status.
- bridges/inbox: carry local_name/connected/auth_errors through the cache.
- seeds/simplex/next_message: fall back to /unread + /history and prefer the
  healthy conversation.
- tests: updated shapes + new coverage for resolution and send verification.
2026-10-07 09:47:26 +00:00
gabby 0efbf218c5 docs: regenerate flow-main.svg (leaf intent guard never bypassed)
Rendered from docs/flow.md with @mermaid-js/mermaid-cli v12 (Chrome
headless): the main pipeline diagram drops the INTENTBYP node and the
leaf_softmax_prob label, matching the navigation change. flow-authoring.svg
is content-identical and was left untouched to avoid a cosmetic re-render
diff.
2026-10-07 09:10:28 +00:00
gabby f1e0de33ca navigation: never bypass the leaf intent guard
The leaf softmax offers only existing skills (create_skill is deliberately
not an option), so a confident winner is "the closest existing skill", never
a statement that it matches. Skipping the intent guard on a confident leaf
softmax winner therefore made codegen unreachable for an unmatched request:
with Winnow as the engine, "send a message to pepper on SimpleX" picked
connect_link (0.86) / next_message (0.995), bypassed the guard, and ran a
read skill instead of authoring simplex.send_message.

Always run confirm_skill_fit at the leaf — it is the sole leaf-level create
door. The category scope bypass stays (create_category is one of its
options, so a confident category winner is meaningful). Drop the now-unused
leaf_softmax_prob meta plumbing; update the docs and the regression test.

Also fix a deployment-hostname leak ("guppy") in winnow.py's docstring that
tripped test_no_env_leaks.
2026-10-07 09:08:13 +00:00
gabby ee7700275c add remote winnow support 2026-10-07 08:12:45 +00:00
gabby 17f16a6bfc engine: opt-in GPU offload for the decision engine
Let the SemIf decision engine run on a GPU via llama.cpp. SemIf's llamacpp
backend is CPU-only by construction (it hardcodes n_gpu_layers=0), so the
agent wraps `_cpu_model_params` for the duration of the load and restores it
after — no patch to the re-cloned engine source.

- `engine.gpu_layers` / `gpu_device` / `gpu_split` in config (default 0 = CPU).
- On the GPU path, force a full cache reset (`llama_memory_clear(mem, True)`):
  SemIf's metadata-only clear leaves stale hybrid-attention state on Vulkan,
  so repeated scores drift (0.08 -> 0.36 -> 0.43) and return wrong
  probabilities.
- Fail loudly when `gpu_layers` is set but the build has no GPU backend.
- bootstrap.sh: opt-in `--gpu auto|vulkan|rocm|cuda|cpu`. A GPU build is
  opt-in because llama.cpp's Vulkan backend splits the graph across CPU and
  Vulkan even at `n_gpu_layers=0`, roughly halving CPU throughput, so a CPU-only
  host must keep the CPU wheel. Detects the backend, installs the Vulkan build
  prereqs, and rebuilds when offload support disagrees (pip's wheel cache
  otherwise serves the CPU wheel back).
- Bump the SemIf pin 1f2dea3 -> 23cf1f3.
- Tests: unit coverage for the config mapping + loader patches; an integration
  test asserting GPU determinism and CPU parity.
- Offload needs the accelerator to itself (~2.9 GiB for the 4B Q4 model): a GPU
  already holding another model makes the engine slower than CPU and can abort
  with `vk::DeviceLostError`.
2026-10-07 05:21:21 +00:00
gabby 4e70a5889e docs: update flow diagrams to current state
flow-main.svg and flow-authoring.svg were stale (authoring from Oct 2,
main predating the actionability guard and the Oct 6-7 changes).

flow-main:
- intake names all front ends (REPL, gateway DM: SimpleX/LXMF/voice,
  dashboard)
- deterministic meta-command route (parse_meta_command -> housekeeping)
  ahead of navigation
- actionability guard at the top of navigation; the category softmax
  offers only real categories + create_category (response is no longer
  an option)
- confident-winner bypass of the scope/intent confirms
  (softmax_bypass_tau)
- intent guard, hard-locked category shortcut, new-skill lock gate,
  awaiting_skill_body guard
- empty/definitive result counts as success; canned and deterministic
  categories skip assessment; act-raises -> repair
- structured SchedulerReply output

flow-authoring:
- split entries: create (draft worker) vs repair/regen/restart (straight
  to the codegen worker)
- approval "no front end" aborts; registration seeds locks.new_skill
- skill_writing/skill_ready traces, regen reason kinds, cancel_build path

flow.md source, prose, and reading-path table updated to match.
2026-10-07 04:02:37 +00:00
gabby e9a7fc73ee scheduler/gateway: carry skill identity structurally, not in action_log
Skill bodies prefixed their own `category.name` into `ActionResult.action_log`,
which duplicated the runner's deterministic summary prefix and leaked the name
into the text the gateways speak. Identity is not data for the output string.

- bodies (seeds, canned replies, housekeeping meta skills) write only the real
  result; the runner already owns the `category.name:` summary prefix
- `run_queue`/`submit_request`/`answer` now return a structured `SchedulerReply`
  (status, text, run_id, skill_ref, result); the gateway reads `skill_ref` and
  `result` from it instead of regex-parsing them back out of the summary
- drop the gateway's `_SKILL_REF`/`_LEADING_RUN_ID` parsing helpers
- fix a latent double-prefix when a failed run had an empty action_log
- CODEGEN.md: generated bodies must not prefix the skill name
2026-10-07 00:30:37 +00:00
gabby d0c1dccffd navigation: skip confirms on a confident softmax; per-skill humanize; 500ms VAD
Four latency/ergonomics changes from the voice-gateway diagnosis:

1. Per-skill humanize override. A skill's own recorded config
   (data/skills/<cat>/<name>/config.json -> {"humanize": bool}) now wins over
   the per-platform and global defaults, so an already-speakable result
   (time.now) can skip the rewrite. The gateway resolves the skill ref from the
   result summary; `_finish_run` now emits `category.name: ok — …` (matching the
   assessment summary) so the ref is available. Missing store/config/key and
   test doubles degrade to the existing platform/global behavior.

2. Example voice endpointing: vad.silence_ms 1000 -> 500 (config.example.json).

3. Confident softmax winners skip their confirm guard. New
   navigation.softmax_bypass_tau (default 0.5): a category winner at/above it
   skips confirm_category_fit (trace `category_scope_bypassed`); a leaf winner
   at/above it is handed to dispatch and skips confirm_skill_fit (trace
   `intent_bypass`). Below the threshold the two-stage confirm is unchanged.
   Assumption tested first on the decision log: 28/28 category and 28/28 leaf
   winners >= 0.5 agreed with their guard.

4. Engine-throughput investigation saved to AGENTS.md "Later / open questions"
   (routing/assessment compute dominates; profile the engine, not the audio).

Tests updated for the bypass threshold and added for the skill-level humanize
override and bypass paths. Full suite: 486 passed, 1 skipped.
2026-10-06 22:33:38 +00:00
gabby 5bb0e9d21d voice gateway: instrument end-to-end latency
Add trace boundaries and timings so the last-word -> first-audio latency can
be split by section:

- voice_transport: emit `voice_speech_end` (the last VAD-speech frame, i.e. the
  true "last word"), `voice_speak_start`, `voice_tts_synth` (Piper duration +
  audio length), and `voice_playback_start` (the instant the first reply
  samples reach the device).
- trace: `TraceLog.append` accepts an explicit `ts` so an event records when it
  happened, not when it was written.
- gateway/voice: trace `gateway_reply_dequeued` at the outbound pump.
- gateway/service: trace `humanize` (duration) and `gateway_reply_queued`; a
  best-effort `_trace` helper tolerates test doubles with no trace log.
- log: persist the engine's per-decision `input_tokens`/`forward_seconds`/
  `total_seconds` (already computed by the backend, previously discarded) into
  the decision row's `extra.timing`.

scripts/voice-latency.py reads data/runs.jsonl and prints a per-interaction
breakdown (endpointing, STT, each SemIf guard, act/assess, humanize, TTS,
playback) plus aggregates.
2026-10-06 22:01:32 +00:00
gabby e426998cf7 llm: add the loaded semif engine as a text-generation provider
Restore SemIfEngine.generate (autoregressive sampling from the loaded
llama.cpp context) and wrap it in provider.SemIfEngineClient, a non-HTTP
sibling of OpenAICompatClient with the same chat() surface. llm.SemIfLLMClient
keeps the LLMError contract so the scheduler's graceful draft_failed path and
the LLM bridge's 502 path are unchanged.

llm.provider now selects "semif" (the in-process decision model, no endpoint
or model needed), "opencode", or the default "ollama"; build_llm_client owns
the choice (build_scheduler delegates). Knobs live under llm.semif
(temperature 0 = greedy, max_tokens). bootstrap skips the ollama llm
warn/pull/probe when provider is semif.

Only the llm task supports it; codegen still needs a real code model.
2026-10-06 21:35:21 +00:00
gabby 1dc0550659 replace urgency priority queue with strict FIFO
Drop the urgency score and interrupt/preempt decisions: intake is now
idle -> dispatch, busy -> append to a bounded FIFO queue (RequestQueue).
The running process always finishes before the next queued request.

- queue.py: UrgencyQueue -> RequestQueue (deque, no weight/age/recency)
- scheduler.py: remove _priority_score, _interrupt_choice, urgency
  constants, and the weight threaded through dispatch/authoring/requeue
- dashboard/static/gateway: drop weight + preempted handling
- tests + docs updated; flow-main.svg regenerated
2026-10-06 20:38:49 +00:00
gabby a354958599 time seeds: report the configured timezone, not the host's
The time seeds resolved "local" via datetime.now().astimezone(), which
returns the host's local zone. On a UTC host that is UTC, so "what time is
it?" answered in UTC. Decouple from the host: add a top-level `timezone`
config value (an IANA name; empty/unknown falls back to host local) and
resolve it through zoneinfo.

- timers.py: add resolve_timezone/local_now; TimerService takes a
  timezone and formats due/fired times in it (Timer carries the tzinfo).
- scheduler.py: pass config["timezone"] into TimerService.
- seeds/time/{now,date,set_alarm}: use local_now(ctx.config).
- seeds/calendar/{create_event,next_event}: derive "now" the same way, so
  a requested time is parsed in the user's zone.
- config.example.json: add `timezone` (empty = host local).
- tests: cover resolve_timezone, local_now, and zone-formatted timers.
- AGENTS.md: document the timezone value.

config.json (gitignored, per-machine) sets timezone to America/Chicago.
2026-10-06 11:26:11 +00:00
gabby 85cdb94dc9 humanize ouputs at gateway 2026-10-06 10:29:57 +00:00
gabby ddbe5f167d assess empty query results as success, not failure
A query skill whose correct answer is "nothing" (no unread SimpleX
messages, no upcoming events) was marked failed by assess:outcome: the
option text framed the decision as literal goal-achievement, so the
model read "no messages" as the goal not being met. The run then
offered a repair and could rewrite a working skill.

Reword the assess:outcome options so a definitive "nothing found /
nothing to do" result counts as success and only an error, refusal, or
unresolved action is failure. Option ids and the question are unchanged,
so the decision-log schema, dream labels, and existing unit tests are
unaffected. Real-engine scores: empty inbox 0.145 -> 0.969, no events
0.132 -> 0.959, while unreachable/HTTP-401/discovery failures stay
failure.

Add an integration regression test and a CODEGEN.md note that an
explicit empty/none result is a successful run.
2026-10-06 09:36:00 +00:00
gabby 7ee200d921 add meta skills for housekeeping (delete skill, clear config, etc.) 2026-10-06 08:40:50 +00:00
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