While a reply is speaking the wake word is still scored, so the user can
interrupt it. On a wake the daemon aborts the playback, mutes further
speech while the interrupt is captured/handled, and hands the following
command to the front end. A bare "stop"/"cancel" aborts the reply and
drops anything queued behind it; anything else runs as a new command.
- voice_transport: AudioIO.play(pcm, rate, stop_event); SoundDeviceAudio
streams in ~50 ms chunks and aborts the output stream on a stop.
VoiceDaemon gains barge_in.{enabled,wait_s,threshold} and the
on_barge_in(active) callback; speak() drops text while muted and plays
through the interruptible path.
- gateway/voice: tags the interrupt utterance (raw["barge_in"]),
classifies stop vs new command (_is_stop_command), drops queued replies
on stop, and unmutes once handled.
- config: gateway.voice.barge_in block; config.example.json regenerated.
- tests: wake-abort, mute release, threshold gate, stop/new-command
classification, sentinel preservation.
The startup announce fires before AutoInterface finishes its peering
handshake, so it reaches no peer; a peer discovered later (or a link that
recovers) would otherwise wait out the whole `announce_interval`.
Replace the blocking `_stop.wait(interval)` announce loop with a tick loop
that announces on the interval, and also immediately after an interface scan
sees a new online transition (AutoInterface reports `online` only after its
peering wait, and every discovered peer is a fresh interface). Each announce
records its time and a `reason` (startup / interval / peer discovered) on the
`lxmf_announced` trace event; a scan error is traced, never fatal.
An ordinary skill body may not reach into the agent (`ctx.admin` is the
housekeeping-only mutation surface), but a body that reports the agent's own
capabilities legitimately needs to see the tree. Add that sanctioned surface:
- `SkillCatalog` (skills.py): a read-only view — `categories()` (id -> scope
description) and `skills(category)` (leaf names) — over a live provider.
- `ActionContext.catalog`: supplied by the scheduler as a locked tree snapshot,
passed to every body.
- The runner now passes `admin` only to the `housekeeping` category (it was
previously handed to every body despite the documented rule); ordinary bodies
get `catalog` instead.
Consumed by the essentials pack's new `skills.list_categories` /
`skills.list_skills` seeds. Docs (CODEGEN.md, AGENTS.md, README.md) updated;
tests cover the catalog, the catalog/admin split on the run context, and the
new pack seeds.
The LXMF gateway now handles Sideband push-to-talk voice messages end to end.
Inbound: a PTT message carries its audio in LXMF.FIELD_AUDIO
(`[audio_mode, bytes]`); `lxmf_transport.parse_audio_field` normalizes it and
the adapter transcribes it into an ordinary command when
`gateway.lxmf.voice.enabled` is set. HQ Opus/OGG goes through faster-whisper
(requirements/transcribe.txt); non-HQ Codec2 through the optional pycodec2
bindings (requirements/codec2.txt). No microphone stack is needed.
Outbound: a chat that last messaged by voice is answered with a synthesized
voice message when `gateway.lxmf.voice.reply_with_voice` is on (the default).
`voice_transport.build_synthesizer` speaks the reply with Piper and
`voice_transport.pcm_to_opus_ogg` encodes it to OGG/Opus (48 kHz, PyAV's
libopus); `lxmf_transport.audio_fields` attaches it as a Sideband HQ PTT
message, with the reply text as the content so a text-only client still sees
it. The reply mode follows the chat's most recent inbound message. A missing
synthesizer or any synthesis/encode failure is traced and the reply falls back
to text. Deps: requirements/tts.txt (piper-tts + PyAV), still no microphone.
Also make LXMF replies result-only (`LxmfAdapter.result_only`, overridable via
`gateway.lxmf.result_only: false`): send the skill's result line, dropping
scheduler bookkeeping and the `<skill>: ok —` wrapper.
Wiring: new config keys under `gateway.lxmf` (result_only) and
`gateway.lxmf.voice` (reply_with_voice, max_speak_chars, reply_bitrate, tts);
regenerated config.example.json; the setup interview asks how to handle voice
messages and the install plan adds `install_lxmf_tts` (bootstrap installs
requirements/tts.txt and downloads the reply voice); cli anchors the LXMF
voice_dir to .runtime/voice/tts.
Tests cover the audio field shape, the outbound queue, the adapter's
voice-chat tracking and synthesis fallbacks, result-only routing, the
synthesis/encode helpers, and the setup plan. Docs updated.
A pack now owns the python deps its skills/bridge need, at
packs/<name>/requirements.txt (standard pip format). SkillPack.requirements_file
resolves it; the install plan lists the selected/enabled packs that ship one
(setup.build_plan / plan_from_config -> pack_requirements); bootstrap installs
each into .runtime/venv, so a host that never enables a pack installs nothing
for it.
Move the browser deps (Playwright) out of the agent repo's requirements/ into
packs/browser/requirements.txt; the Playwright binary download stays a
browser-specific bootstrap stage. --browser force-adds the pack's deps.
Docs (PACKGEN.md, AGENTS.md, README.md) describe the pattern; tests keep every
pack requirements.txt pinned and consistent with the manifest's requires.
The set of packs is now owned by a dedicated pack index repo (semif-packs) instead of the agent-repo packs.json + the hardcoded setup PACK_CHOICES.
- bootstrap.sh fetches the index, then runs setup in two passes (--answers-out, then clone the selected packs, then write config) so it never clones a pack the user did not choose. essentials is always cloned; +simplex for the simplex gateway's address script; +browser for --browser. Reruns clone only the packs the config references.
- setup gains --answers-out and --pack-index; the interview's pack choices come from the index. PACK_CHOICES removed.
- delete packs.json; update README, PACKGEN.md, the packgen skill, and AGENTS.md.
The two skills declared the account as flat contract vars
(nextcloud_url/username/app_password/default_calendar), which bootstrap no
longer writes — it stores the account under bridges.nextcloud — so the
runner asked for the URL and credentials on every first fire.
Rewrite both to call the Nextcloud bridge (GET /calendars, POST
/calendars/events, GET /calendars/events) like create_task, so their only
contract vars are the derived nextcloud_bridge_url/_token (+ the LLM bridge
for create_event). Docs and the seed-integration test updated to match.
Bootstrap now asks the questions that make a fresh machine work and installs
only what the answers require. `cli setup` (new `semif_agent/setup.py`) runs
the interview — decision engine (local SemIf 4B or remote Winnow), new-skill
authoring mode (+ llm/codegen endpoints/keys when enabled), capability packs,
gateways, timezone — and writes the split config + secrets.json from the
answers, plus a machine-readable install plan.
Both ends of the spectrum work end to end: the minimum is the local SemIf 4B
engine + the essentials pack (canned replies, time/timers, calculator) with no
gateway, authoring, or heavy downloads; the maximum enables every pack, a
remote engine, remote llm/codegen, and all gateways. `--yes` takes the minimum
unattended; `--answers FILE` replays a saved answer set; a rerun skips the
interview and `--reconfigure` re-runs it.
The plan drives the conditional stages: engine clone/GGUF/tokenizer and
requirements/engine.txt only for a local engine; requirements/transports.txt
only when a SimpleX/LXMF transport is selected; the simplex-chat binary,
Playwright, and the voice stack only when their pack/gateway is on; and only
the systemd units the answers need (a reconfigure retires dropped ones).
Also fixed:
- `config-init`/`setup` could never run on a fresh machine: main() loaded
config before parsing the subcommand. Config-independent subcommands now run
before the config is required.
- codegen was mandatory at startup even with authoring disabled (SystemExit on
an empty model); build_codegen_client now returns None, and the scheduler
guards every create door. build_llm_client likewise returns None for a
non-semif provider with no model.
- the gateway unit ran `--platform all`, which would try the foreground-only
voice platform in a headless service; it now runs the explicit daemon list.
requirements/ is split by concern (core/engine/transports + voice/browser);
staging.txt is the union. Docs updated (README, AGENTS). New
tests/test_setup.py covers both paths, interview branching, secrets merge, and
the plan round-trip.
Update the packgen skill workflow, the browser requirements comment, and the
remaining prose to match bridges shipping with their packs (no core CATALOG).
The core no longer owns concrete bridge implementations. A bridge now ships
inside the pack that declares it (packs/<name>/bridge/<name>.py, plus its
package marker, optional client module, and hermetic test), and the core
registry imports it by convention from the pack's `bridges`.
Core keeps only:
- bridges/base.py: BridgeInfo + BridgeService (shared HTTP/JSON/auth layer),
plus a new BridgeService.from_config build hook (a bridge that needs the
scheduler's `llm` client or top-level fallback values declares that itself,
replacing build_bridge's per-name special-casing) and checkout_root() so a
pack-relative bridge can still anchor .runtime/ paths;
- bridges/inbox.py: the generic MessagingInbox;
- bridges/llm.py: the one shared, pack-less LLMBridge (CORE_BRIDGES);
- bridges/registry.py: discovery (discover_bridge_classes/known_infos/
describe_bridges/derived_config_vars/build_bridge/run_bridges) scanning each
pack's bridge/ dir, plus load_pack_bridge_module/package for tests.
Moved to their packs: simplex, nextcloud (+client), outlook (+client), browser
(+client) — each with its hermetic test. tests/test_bridges.py now covers the
core (shared LLM bridge + registry); tests/test_packs.py runs every pack's
bridge test. Docs (AGENTS.md, PACKGEN.md, README.md) updated.
Packs pushed separately to pack.<name>.
scripts/outlook-auth.py, playwright-browsers.py, and simplex-address.py now
live in pack.outlook/pack.browser/pack.simplex under scripts/. bootstrap.sh,
the Outlook bridge hints, and the docs reference packs/<name>/scripts/; the
Outlook auth helper locates the checkout (and its default token path) by
walking up to the semif_agent package.
scripts/bootstrap.sh now clones each pack (pack.<name>, listed in the new
committed packs.json) into the gitignored packs/ BEFORE seeding config, so
config-init still generates the pack config fragments; --pack-base overrides
the base derived from the checkout's origin remote. README/AGENTS/PACKGEN/
CODEGEN and the packgen skill describe the per-pack repositories.
Each pack (browser, essentials, nextcloud, outlook, simplex) now lives in its
own repository and is cloned into the gitignored packs/ directory at setup.
packs/ is no longer tracked here.
Reframe bridges as a deliberate choice rather than the mandatory path to
any third-party system. A skill body may call a service's own HTTP API
directly with a stdlib transport; a bridge is warranted only when a
simple, repeatable skill file would be inconsistent, inconvenient, or
unsafe — state (especially auth state), sanitized connectivity, or a
native/heavy protocol. When a bridge fronts a service, the body calls the
bridge and must never reach around it.
Updates CODEGEN.md, PACKGEN.md, TESTGEN.md, README.md, AGENTS.md, the
bridges/__init__.py docstring, the codegen BODY_DIRECTIVES + describe_
bridges() prompt strings, and the tests pinning their wording.
PACKGEN.md is the authoritative spec for a new pack, the sibling of
CODEGEN.md (body) and TESTGEN.md (test): the pack.json manifest, its
config schema and how it maps onto bridges.<name>/packs.<name>, the
enable switch, referencing a bridge by name, authoring a new bridge
(BridgeService + CATALOG + build_bridge + the optional-dep 503 rule),
acceptance criteria, a worked example, and a checklist.
Add a thin OpenCode skill (.opencode/skills/packgen/SKILL.md) that walks
the workflow and points at PACKGEN.md, and cross-link the contract from
AGENTS.md, README.md, CODEGEN.md, and TESTGEN.md.
A host now leans on the committed packs: `new_skill_creation` defaults to
`deny` (core schema, generated config.example.json, and the scheduler's unset
fallback), so a fresh bootstrap does not author skills at runtime. A host with
the resources opts in with `allow` (or `ask`).
Under deny, an unmatched request no longer exposes the authoring machinery:
`_blocked_create` answers with a plain refusal (`skills.UNABLE_MESSAGE`, "I'm
sorry, I'm not able to help with that.") instead of an error naming
`new_skill_creation`/`config.json`, and a leftover empty/in-progress leaf in a
denied category refuses the same way rather than telling the user to `restart`
the body write. The block is still traced (`category_create_blocked` /
`skill_create_blocked`) for operators. Routing, decision logging, and the
allow/ask paths are unchanged.
Tests: authoring-mechanics helpers opt in explicitly; the default-deny and
silent-refusal cases are asserted.
Group committed starter skills into packs (semif_agent/packs.py) that bind a
concern to its categories, bridge(s), requirements, and config schema:
- seeds/ -> packs/<name>/ with a pack.json manifest + skills/<category>/<leaf>/.
Shipped: nextcloud, simplex, outlook, browser (each owning its bridge) and
essentials (time + calculator, no bridge).
- PackRegistry discovers packs (a root with no manifest is one implicit pack);
merge_packs loads every enabled pack. Pack enable is one switch
(packs.<name>.enabled -> bridges.<bridge>.enabled -> enabled_by_default);
disabling a pack drops its categories (incl. generated bodies) and its bridge.
- CATEGORY_DESCRIPTIONS now comes from the pack manifests (built-ins stay).
Adopt a Home-Assistant-style layered config (semif_agent/config.py):
- config.json is a thin index ({"include": [...]}) over config/core.json,
config/gateway.json, config/bridges.json, config/packs/*.json, deep-merged.
- Secrets live in the gitignored secrets.json, referenced as "!secret <key>";
api_key_env is removed.
- CORE_SCHEMA + each pack's config schema own defaults and GENERATE the
committed config.example.json; new `check-config` (validate + --write-example)
and `config-init` (seed the split layout) commands.
- scripts/config_merge.py (stdlib) lets bootstrap read the merged config.
Tests: tests/test_packs.py (renamed from test_seed_skills, +enable/merge),
new tests/test_config.py. All unit tests pass (772).
A skill-body write or a draft authoring call that fails only printed to
stdout. On the voice gateway that goes to the journal, so the user heard
"authoring a new skill in the background; the request will re-run when it
is ready" and then nothing — the creation had failed silently.
Buffer a user-facing notice on the scheduler outbox (the same path a
post-authoring re-run uses), keyed by the originating run id, so a front
end's drain_outbox() routes it to the chat. Add _brief_error to collapse
and bound the exception text for speech.
Tests assert the notice is routable with the right run id for both the
draft_failed and skill_write_failed paths.
New-skill authoring via the voice gateway never completed: STT emits
"Approve." / "Yes." / "retry." with sentence punctuation, but the
approval/repair maps were matched with an exact lookup, so a spoken
answer fell through to submit_request while the pending approval timed
out and nothing was registered.
- gateway/service: normalize the reply before the action lookup
(`_normalize_action`: lowercase, strip edge punctuation, first-word
fallback) and broaden the approval/repair vocabularies, so a spoken
"Approve." / "Yes." / "retry." matches like a typed one.
- scheduler: buffer the replies of a background drain (the codegen
worker's post-authoring re-run, a repair retry) in an outbox instead
of returning them into a thread that discards them; a front end's
`drain_outbox()` routes them, so the answer to the user's own request
is no longer swallowed.
- cli/dashboard: drain the outbox alongside the queue.
- tests: normalization + spoken approval/repair routing, outbox
routing, and the async requeue assertion.
Add `bridges.browser.channel` and `bridges.browser.executable_path` so a host
can point the bridge at an already-installed Chrome/Chromium (a Playwright
channel such as `chrome`/`msedge`, or a specific binary) instead of Playwright's
managed build. `executable_path` wins when both are set. This is the no-download
escape hatch for hosts where the browser CDN is unreachable or unusable.
- `BrowserDriver` carries `channel`/`executable_path` and passes them to
`launch_persistent_context` when set, so the managed download is skipped.
- `BrowserBridge` reads both from its config block; `config.example.json`
documents them.
- Verified live: launching an installed Chromium via `executable_path` with an
empty browsers path drives a real page with no managed download.
`playwright install chromium` failed on this host even though the CDN is
reachable. Root cause is Node, not the network: Playwright's bundled downloader
forces `autoSelectFamily` with a custom dual-stack resolver that resolves
`[6, 4]` and interleaves IPv6 first, and this box has an IPv6 address (a ULA)
with no global IPv6 route, so the first IPv6 connection blackholes and Node never
falls back to IPv4 -- the download stalls to the socket timeout. Raising
`PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT` only moved the hang from 30s to 600s;
`curl -4` fetches the same artifact at ~6 MB/s.
Playwright skips a browser whose directory holds an `INSTALLATION_COMPLETE`
marker, so prime the cache over IPv4 and the normal install becomes a no-op.
- `scripts/playwright-browsers.py`: reads the chromium/headless-shell/ffmpeg
revisions and Chrome-for-Testing versions from Playwright's own
`browsers.json`, downloads those exact artifacts with `curl -4`, extracts them
into `PLAYWRIGHT_BROWSERS_PATH/<name>-<revision>/`, and writes the marker.
Idempotent; prefers `unzip`, falls back to `zipfile` + chmod.
- `bootstrap.sh --browser`: if `playwright install` fails for chromium, fall
back to the helper (firefox/webkit just warn).
Verified live: after priming, `playwright install chromium` exits 0 and the
browser bridge drives a real Chromium (goto/content/text/links/fill/select/
screenshot) over HTTP.
Add a `browser` bridge: real browser automation behind the standard
token-guarded localhost JSON surface, so a codegen-authored skill body never
bundles a browser stack. It opens a URL, reads a page's text or links, takes a
screenshot, and clicks/fills/presses/selects to complete a flow.
Unlike the stdlib-only Nextcloud/Outlook bridges this one owns a browser and
needs a heavy optional dependency, so it is disabled by default and installed
with `scripts/bootstrap.sh --browser` (Playwright pinned in
requirements/browser.txt; the browser binary lands under the checkout's
.runtime/browser, which the driver points PLAYWRIGHT_BROWSERS_PATH at).
- `BrowserBridge` (`bridges/browser.py`) + `BrowserDriver`
(`bridges/browser_client.py`). A real navigation/timeout/selector failure is a
502, a missing package/browser a 503 install hint, bad input a 400 -- never a
fabricated success.
- `check_requirements()` deliberately never blocks: `run_bridges()` aborts all
bridges when one fails, and this dependency is optional, so a missing
Playwright must degrade to a per-call 503, not take down the others.
- Playwright's sync API is bound to its creating thread while the bridge serves
each request on a new one, so the driver runs the async API on one dedicated
event-loop thread and serializes whole operations behind an asyncio.Lock
(submitted with run_coroutine_threadsafe).
- Persistent profile under .runtime/browser/profile so logins/cookies survive
across calls and restarts; POST /reset with purge=true wipes it, and
headless=false shows the window for a first sign-in. Route set: /health,
/state, /content, /text, /links, /screenshot, /goto, /click, /fill, /press,
/select, /wait, /back, /forward, /reset. No arbitrary JS evaluate (out of
scope for this cut).
- Seeds: `seeds/browser/{open_page,read_page,screenshot}`, each hermetically
tested against a loopback bridge. A `browser` category description is seeded
so the leaf softmax has signal.
- `tests/test_browser_bridge.py` exercises the routes over a loopback HTTP
server with an injected fake driver (no browser or Playwright needed). The
live browser is a provisioned-host concern: this box could not reach the
Playwright CDN, so no real-browser run backs it yet.
A `continue` assessment re-dispatches the next step onto the queue rather than
running it inline, so a multi-step request only finishes when a front end drains
`Scheduler.run_queue()` -- as the CLI and gateway already do. The dashboard ran
only the first step and left the child stranded in the queue, so a compound
request looked finished when it was not.
- `DashboardHandler._complete` runs the returned reply through `_drain_chain`
and returns the last reply (intermediate steps are hidden at `result`
verbosity); `/api/submit` and `/api/answer` use it.
- `/api/answer` now also returns `request_id` (`SchedulerReply.run_id`) so a
front end can cross-link the resumed run.
- `test_submit_completes_a_multi_step_chain` drives a deterministic two-step
chain and asserts both steps ran, the reply is the final step, nothing is left
in the queue, and the runs are linked.
The fidelity gate truncated the body to 4000 chars, so a body whose real
action sat after its helpers (the common shape) was judged on a prefix with
no action and wrongly returned `reconsider` -- a false reject that wasted a
rewrite and mislabeled a working skill. Live-engine probe: the truncated
state scored reconsider 0.96; the whole body scores accept 0.98.
- Fidelity gate: feed the whole body plus a deterministic operation
inventory and the de-identified goal; drop the raw request from the state
(a remote-engine PII path that added no signal). Ask the positive question
("is there a concrete operation that realizes the goal?") and give the gate
its own `codegen.fidelity.tau` instead of the run-assessment tau.
- Artifact size budget: a decision ingests a generated artifact whole, so
bound it. `parse_skill_body`/`parse_skill_test` reject an over-budget
artifact (`ArtifactTooLong`); the codegen retry ladder asks for a shorter
one. The ceiling derives from the active engine's context
(`DecisionEngine.context_tokens`: `engine.context_tokens` for the local
GGUF, `engine.winnow.context_tokens` for Winnow) minus
`codegen.decision_reserve_tokens`; `codegen.max_body_tokens` /
`max_test_tokens` override (separate limits).
- `codegen.operation_inventory()`: static HTTP-verb/path, CLI, mail, file,
and timer inventory, resolving the verb at the call site so a thin-helper
body's real endpoint is visible.
- Docs: AGENTS.md, README.md, CODEGEN.md, config.example.json.
- Tests: unit coverage for the budget, inventory, retry-shortening, and the
gate state; integration regression `test_fidelity_gate_reads_the_whole_body`
(real engine) guards the truncation bug.
Codegen is the primarily-cloud model, so it must receive only a de-identified,
reusable spec. The trusted local `llm` now authors a `goal` (plus a generic
service/transport) with every user-specific value stripped, and that is the only
task data any codegen prompt ever carries.
- skills: SkillDraft carries `goal` (not `requirements`); generate_skill ->
generate_skill_spec; the spec prompt/parser ask for a de-identified goal +
generic service/transport; registry persists `goal`, never request_text.
- codegen: every prompt builder (body, retry, regen, testgen) drops the
Request/requirements parameters and builds from the spec alone; the whole
elicitation surface is removed.
- scheduler: the codegen worker runs body -> fidelity -> contract -> test only;
repair and fidelity evidence bundles are de-identified (failure_kind +
integration + goal + previous body); approval gate moved to
codegen.approval.wait_timeout; the question queue is now the repair ask_user
path only.
- config: drop the codegen.elicitation block; add codegen.approval.
- docs/assets: update AGENTS.md, CODEGEN.md, README.md, docs/flow.md,
bootstrap comment, static app.js; regenerate docs/flow-authoring.svg.
- tests: add tests/test_codegen_privacy.py (structural + behavioural sentinel
checks, de-identified repair evidence, registry goal); update/remove the rest.
Purged (no migration): data/decisions.jsonl, data/runs.jsonl, data/categories.json.
A completed real-skill run's ledger is held in memory per origin source
for query_recall_window seconds (default 30, 0 disables). A follow-up
request in the same chat arrives with it as prior_ledger -- rendered as a
'previous request' context block in navigation/assessment state and
exposed to bodies via last_result -- so a reference like 'send it to Sam'
resolves against what the agent just did.
Kept separate from run_ledger: recall is not an in-flight continuation,
so it never skips the actionability guard nor feeds the monotonic-progress
guard. Only terminal real-skill runs are remembered (canned responses and
housekeeping meta skills excluded); the final step is synthesized as a
ledger entry since a single-step run's own run_ledger is empty.
Add the run-ledger chained-run path and make a compound request run its
known skills in order instead of authoring one monolithic skill.
- scheduler/skill: `assess:outcome` gains a `continue` verdict; a continued
step is re-dispatched with a bounded run ledger (max_reentries + a
monotonic-progress guard), and the ledger is rendered into the routing and
assessment state.
- navigation leaf guard (`confirm_skill_fit`) becomes same/part/different and
is ledger-aware, so the first step of a compound request runs instead of
being rejected into `create_skill` (a real run picked calculator.calculate
at 0.99 and was rejected into create_skill).
- results flow forward through `request.run_ledger` (`last_result` helper);
`simplex.send_message` sends the prior step's result rather than asking the
LLM bridge to recompute it. Documented in CODEGEN.md.
- `assess:outcome` stays the sole continuation authority: the guard only
decides whether a skill contributes, never forces a continuation (a forced
continue on `part` overrode a correct `done` on the final step and authored
a spurious category).
- verbosity levels, structured SchedulerReply fields, and a send_message
hermetic test for the chained-result path.
- scheduler: remove the creation_approval and locks.new_skill backward-compat
reads (and the locks cleanup in set_category_mode). The tri-state
new_skill_creation mode is now the only source of truth.
- pins.json: simplex_chat now carries an assets map (x86_64 + aarch64) with
per-arch bin_url/sha256; bootstrap selects by uname -m (arm64 -> aarch64).
Fixes the Pi (aarch64) fetching the x86_64 binary.
- docs/tests updated.
Replace the boolean creation_approval and the per-category boolean
locks.new_skill with a single tri-state new_skill_creation mode: a global
default (allow | deny | ask) with a per-category override in the category
config. allow authors immediately, deny blocks creation, ask gates on human
approval (the old approval path). housekeeping/response stay denied in code.
Surfaces updated: config.example.json, REPL /mode, dashboard
/api/new-skill-modes + /api/new-skill-mode, static UI. The retired booleans
creation_approval (true->ask) and locks.new_skill (true->deny) are still read
as fallbacks so an existing deployment keeps its behaviour.
Docs (AGENTS.md, docs/flow.md) and tests updated.
Gate the wake word on the scheduler's single slot being free: a wake that
fires while the current request is still running is ignored (traced
voice_wake_blocked), so a second command cannot start mid-run. The gate is
GatewayService.input_ready (False while a run executes, True when idle or
paused for the user's answer), handed to adapters via set_input_ready; the
voice adapter passes it to VoiceDaemon.input_ready.
Drop the post-reply follow-up window: capture no longer accepts an utterance
without the wake word after a result, so the front end never keeps listening
on its own. Removes follow_up_window_s from the config/README/AGENTS/bootstrap
docs and updates the tests (a reply no longer arms capture).
Add a configurable cue.submit_notes sequence ([frequency_hz, duration_ms],
spaced by note_gap_ms) played after STT returns text, falling back to the
single submit_frequency beep when empty. Two-note chime shipped as the
default in config.example.json; README + tests updated.
A local-arithmetic seed bounded to two operands and one operator. The
operator is a SemIf choice over addition, subtraction, multiplication,
division, exponents, squares, cubes, square roots, cube roots, fractions,
and percentages; SemIf also picks the operands when the request writes
more numbers than the operation consumes, and the body asks for missing
numbers and resumes. Results are spelled out in words for the ear, with
inexact results announced as "approximately ...".
Pure local compute (`compute` transport, empty contract). Adds the
`calculator` category description for navigation, the seed's hermetic
test, a tune_navigation example, and README/AGENTS docs.
The bridge only read the daemon's unread state (/_get chats, /_get chat);
nothing wrote the read state, so a persistent-unread message was re-reported
on every call and simplex.next_message never advanced.
v7.0.3 does expose /_read chat @<id> and /_read chat items @<id> <ids>
(the earlier "v7 has no mark-read command" note was wrong). Added:
- SimplexDaemon.mark_read / request_mark_read plus read_command /
parse_read_response; parse_direct_text_item now carries item_id.
- SimpleX bridge POST /read {"contact","item_ids"} marks exactly the listed
items read on the bridge's own daemon, reporting ok/error honestly.
- The live inbox entry keeps item_id so /inbox/next hands back the
consumable id.
- simplex.next_message consumes exactly the item it reported (a failed
consume is surfaced as an honest note, never a fabricated read failure).
Precise per-item reading leaves the rest of the chat unread.
Endpointing fix. The wake detector usually fires inside the wake phrase,
so the first speech captured after it is the phrase's tail (plus the cue
beep echoing back through the mic), not the command. A fixed 500 ms
trailing-silence endpoint then ended the capture during the natural pause
before the command: the utterance held 240-400 ms of speech and STT
returned empty. In a recorded session 18 of 30 wakes dropped the command
that way (only 10 transcribed).
The endpoint now uses a longer silence tolerance (vad.initial_silence_ms,
default 1500) until vad.min_command_ms (default 700) of speech is in
hand, then reverts to vad.silence_ms, so a pause before the command is
tolerated while a real command still ends promptly.
Front-end hardening (the ways it was silently dying or losing work):
- Utterances run on a worker thread, not the audio thread, and a task
error is traced and spoken rather than propagated, so one bad command
cannot stop the mic or take the front end down.
- Capture-stream watchdog: read with a timeout and close/reopen the input
after a sustained stall, so a wedged PortAudio/ALSA callback recovers
instead of hanging the gateway (traced voice_stream_stalled/reopened).
- faulthandler enabled (CLI + unit) so a fatal signal dumps every
thread's stack to the journal.
- The scheduler's answer-side entry points (answer, answer_question,
resolve_repair, answer_approval) are guarded like submit_request: an
EngineUnavailable is fatal-and-reported and any other resume/repair
error returns a reply instead of propagating into a front end.
The machine-descriptor rule matched the Harvard-sentence recording
prompts (scripts/voice-prompts-en.txt: "The box was thrown beside the
parked truck."), where 'the box' is a literal box, not a colloquial dev
machine. Drop the bare phrase; keep the explicit dev/staging markers that
are never generic English.
PortAudio has no volume control, so a muted ALSA Master silences the voice
gateway's cue and replies, and the mixer resets whenever a sound device is
added/removed. scripts/audio-baseline.sh sets the analog speaker (found by its
'Speaker' control, so a shifting card index does not matter) to 100% unmuted;
scripts/audio-baseline-watch.sh re-applies it on every sound udev event. Both
are driven by systemd user services (audio-baseline.service / -watch.service)
so they run at startup and on hotplug.
openWakeWord ships no "computer" model, so pin a community
openWakeWord-compatible ONNX (Apache-2.0, sha256 in pins.json `wake_word`) and
fetch it into .runtime/voice/wake from scripts/voice-models.py. Its scores run
lower than the official models (~0.26-0.82 on the phrase, <0.02 on negatives),
so the seeded wake.threshold is 0.2 (the official models score ~0.99 at 0.5).
Also fix command capture: after the wake word the daemon now waits
listen_timeout_s (default 3s) for the command's speech to begin instead of
assuming it is glued to the wake word, so a natural pause while the cue beep
plays no longer truncates the command.
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).
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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`.
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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
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.
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).
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.
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.
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.