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.
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).
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.
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.
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
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.
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).
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.
Move new category/skill draft authoring off SemIfEngine.generate onto a
separate small OpenAI-compatible provider, deliberately distinct from
codegen. Extract the shared transport (SSE/budget/idle/degeneration) into
provider.OpenAICompatClient; LLMClient and CodegenClient subclass it with
their own endpoints, sampler defaults, and error types.
Draft authoring now runs on its own async single-slot worker: a create
request queues, the gate stays free, a category job chains into its skill
job, and the original request re-runs when the body lands. An unreachable
llm endpoint is graceful (draft_failed trace, user notified, no
re-dispatch); only SemIf availability is fatal. Elicitation is deferred on
every front end (REPL included) now that authoring is async.
There is no up-front handle/ignore filter any more. Every input is scored
and dispatched; inputs that are not tasks fall through navigation into the
closed response category of hardcoded canned lines (greeting/thanks/
acknowledge/farewell/affirm/unable + the catchall response.clarify). The
category is CANNED_CATEGORIES: navigation offers no create_skill there,
dispatch/restart refuse to author it, and the runner skips assessment and
repair for it (a canned line has no side effect to assess).
Removes _contains_request/build_gate_decision and the dropped path.
The create branches share a softmax with the real options, so a weak
plurality win was enough to trigger authoring. Require P(create) to clear
navigation.create_tau and lead the best existing option by
navigation.create_margin; otherwise fall back to the best existing option
(the intent guard remains a second door) and trace create_suppressed.
An empty tree/category still short-circuits straight to create.
SemIf routing only sees option descriptions, but the leaf fallback said
'Suggest creating a new skill' (mechanism, not trigger), so a send request
had no verb match and fell through to the read skill that shared the word
'message'. Every send phrasing picked simplex.next_message; create_skill
scored ~0.03 and codegen was never reached.
- navigate: reword the create_skill fallback to the trigger ('No existing
skill performs this action') and make the criterion ask which skill
performs the requested action. Sends now route to create_skill at P~0.93.
- confirm_skill_fit: one action-vs-action SemIf guard (phase navigate:intent)
after routing; a mismatch authors a new leaf instead of silently running the
wrong skill. Wording tuned on the real model (no IM hint: it over-fires).
- gate: imperative tasks are actionable even with no matching skill, so a
casually phrased send is no longer dropped as 'no actionable request'.
- finish_run: a failure whose retry is refused by the reentry budget still
surfaces a repair offer.
Validated on jarvis: gate accepts all tasks/rejects all noise, sends route to
CreateSkill, reads still route to their skills. Dev: 265 passed; jarvis
non-codegen integration: 6 passed.
Assessment was an LLM generation step emitting prose. Move it to SemIf:
- assess:outcome (success/failure @ tau) and assess:requeue (complete/retry,
updated_request = request.text bounded by max_reentries) are logged decisions.
- Run summary is deterministic (category.skill + ok/failed + action_log/new_state).
- Fidelity gate is a real authoring:fidelity accept/reconsider decision plus
static integration findings; it only triggers a rewrite, never a diagnosis.
- Corrective regens receive the raw evidence bundle as-is (render_evidence),
never an LLM paraphrase.
- Every EngineUnavailable is fatal app-wide: Scheduler.fatal is recorded, the
worker stops, and the CLI prints 'decision engine not available' and exits
non-zero. Remove llm.assess/review_skill_body (keep _parse_json).
- Tests: ScriptedEngine double in tests/conftest.py for scheduling mechanics;
replace the review_skill_body integration test with a SemIf fidelity test;
add deterministic-summary and evidence-renderer unit tests.
- cli.load_config anchors skill_seeds/skill_bodies/category_registry/log/trace
to the checkout root, so a fresh clone's committed seeds load from any cwd
(running outside the repo root had an empty tree -> codegen loop).
- `skills` (CLI + REPL) lists scheduler.tree, not a throwaway built-ins tree.
- SimpleX adapter reads the real /_show_address shape
(contactLink.connLinkContact), so simplex.connect_link returns the link
instead of reporting no address.
The gateway now exposes a localhost stdlib HTTP API (bridge.py) that
buffers authorized inbound DMs and forwards outbound sends, so a skill
body never opens a WebSocket to the simplex-chat daemon. Endpoints:
GET /health, /contacts, /inbox (peek), /inbox/next (pop oldest unread),
POST /send (resolve id/display name onto the adapter's outbound queue).
GatewayService gains an observer hook and inbox.dispatch (pull-only mode).
Expose the capability to codegen (SKILL.md, BODY_DIRECTIVES, elicitation,
TESTGEN.md) and add the simplex.next_message seed (SemIf recipient
resolution) with its hermetic loopback test. Config: messaging_bridge_url
plus gateway.simplex.{inbox,bridge}; bootstrap keeps them in sync.
The user-facing output was the self-assessment model's brief summary, so a
skill that returned real data (e.g. calendar.next_event) only reported that
it found something. Display the skill's action_log instead; keep the
assessment text on the assessed trace (assessment_summary) for diagnostics.
The binary gate asked "Does this input contain an actionable request?" over
the raw text alone, so the model read information requests as small talk:
"tell me the next event in my nextcloud calendar" scored 0.599 (under tau
0.6) and "what is the next event...?" scored 0.191, both dropped. The state
now states that the user expects handling, that looking values up in a
configured service is a real task, and lists the available skills; the
question/options say handle/ignore. On the real model every lookup variant
scores 0.9998+ while chatter stays at 0.016-0.125, and the new jarvis
integration battery pins both sides.
email.compose and tracking.check were hardcoded fakes (draft files / local
JSON, no real service) that shadowed the authoring path for real skills.
Remove them, delete their data fixtures and config keys, and ship a real
starter integration instead: seeds/calendar/next_event, a Nextcloud CalDAV
body in the SKILL.md folder format (PROPFIND calendar discovery + SemIf
calendar choice, calendar-query REPORT with server-side recurrence
expansion, all-day/TZID parsing, honest failures) with a hermetic
skill.test.py. merge_seed_store loads seeds into every tree at startup;
recorded config lands in gitignored data/skills/, and generated bodies
replace seeds of the same name. Only service-free response.reject stays
built-in.
Anchor the product premise at the top of AGENTS.md: semif-agent is an
end-user app that does the user's task for real against their actual
service, asking a few questions and learning when it doesn't know how.
Elicitation now asks implementation questions (service/account, how to
connect, credential source, expected result) and is on by default. The
REPL asks inline; the dashboard defers via a question queue the worker
waits on (/api/questions + panel). Answers ride every body attempt and
persist in the registry so restart doesn't re-ask.
SKILL.md requires real actions via stdlib transports with values from
ctx.config and a module-level INTEGRATION declaration
(service/transport/config_vars). TESTGEN.md scopes tests as hermetic
mechanics checks (loopback http.server in-test, never fixture addresses
in bodies) that never certify the live integration.
After the body lands a fidelity review (small LLM + static declaration
findings) regenerates a simulated body once, then accepts it traced and
badged unverified. A failed real run logs a SemIf repair choice
(retry/repair_skill/ask_user/no_repair), surfaced in REPL and dashboard,
bounded by codegen.repair.max_attempts and user-confirmed.
Dev unit suite: 191 passed. Jarvis integration run still pending.
The testgen call now replies with plain Python (no JSON envelope), so the
model can no longer confuse the envelope with the artifact. skill.test.py
carries its fixture data inline as Python literals; the folder layout is
now skill.py, skill.test.py, contract.json, config.json. The regen ladder
drops the mock option (3-option: code/contract/test) since a fixture fix
is a test regen.
create_skill now authors the stub synchronously and returns immediately;
the runnable body is written by a single-slot background worker (the gate
stays free for new input). On success the body is materialized and
hot-merged, the leaf's writing flag clears, and the original request is
re-queued at its scored weight and re-runs navigation onto the new leaf.
On failure the leaf stays a restartable stub and the user is notified.
- scheduler: _dispatch_skill launches the async write instead of blocking;
_run_skill guards writing/stub leaves (no silent no-op); restart_skill
re-kicks a write for an empty not-in-progress leaf (reuses the stored
request_text); RLock guards tree/queue/current across worker and main
thread; awaiting_skill_body meta guard stops a re-dispatched request
from authoring a second skill.
- skills: Skill.writing + status/is_noop via module-level no-op sentinels;
registry entries persist the originating request_text.
- engine: call/generate serialized with a Lock so the worker's degeneration
checks never race main-thread navigation/scoring on one llama.cpp context.
- cli: restart <category> <skill> command; REPL drains the queue after input.
- dashboard: POST /api/restart; /api/tree carries per-skill status; tree
rows + skill_write_failed flow nodes get restart buttons; reads snapshotted.
- tests: async end-to-end (real CodegenClient vs fake SSE endpoint), restart,
loop guard, status derivation, dashboard endpoint/status; integration chain
test rewritten to poll for async completion + assessed.
The model follows the repo's existing dotted naming (email.compose,
tracking.check) and proposed titles like tracking.status_lookup, which the
strict alnum-only check rejected. Accept dotted snake_case names.
An empty category produced a one-option SemIf leaf decision; the backend rejects
<2 options, the ValueError unwound past the current-process reset, and every
later request queued forever behind a phantom current. Navigation now
short-circuits empty trees/categories straight to the create branch (no SemIf
decision when there's nothing to choose), and the scheduler clears its current
process even when dispatch raises. Authoring generation is capped at 128 tokens.