Commit Graph
107 Commits
Author SHA1 Message Date
Denton Social c92aff5038 gateway: run simplex-chat bot under a PTY so it pumps WS events
Plain bot mode under systemd has no controlling terminal, so the CLI accepts
the WebSocket socket but never emits receivedContactRequest/newChatItems —
contact requests hung unaccepted. Wrap ExecStart in script(1) to allocate a
PTY; the events then flow and the gateway auto-accepts. Add util-linux to
bootstrap prereqs.
2026-09-26 18:45:19 -05:00
Denton Social 6059bec1e4 gateway: run simplex-chat in bot mode, not relay/headless
In v7 --headless means "chat relay" (requires --relay) and yields a relay
address, not a user contact address, so the bot could not be added as a
contact. Run bot mode instead (-p PORT --create-bot-display-name), which needs
no TTY and is restart-safe. simplex-address.py now creates the user contact
address on first run (/_address + /_show_address), and bootstrap invokes it
after the services start and prints the link.
2026-09-26 18:33:57 -05:00
Denton Social 5ee3905aec AGENTS: mark guppy's box install layout legacy 2026-09-26 17:30:11 -05:00
Denton Social 756d4b47b7 gateway: add simplex-address helper for onboarding
The daemon does not print its contact address; query /_show_address over the
WebSocket API. scripts/simplex-address.py reads ws_url from config.json and
prints the bot's short/full contact link so a human can add it in their
SimpleX app. bootstrap.sh points at it in the next-steps hint.
2026-09-26 17:29:40 -05:00
Denton Social 5df560a922 bootstrap: put simplex profile under .runtime/simplex/, apply changed units
-d is a path prefix, so pass .runtime/simplex/simplex_v1 to keep the daemon
DBs inside the profile dir. Also detect a changed rendered unit and restart
already-running services so a rerun applies template changes.
2026-09-26 17:27:47 -05:00
Denton Social a6f46b735d bootstrap: simplex-chat v7 headless requires --relay
The pinned v7.0.3 daemon exits with '--headless option requires --relay'.
Add --relay to semif-simplex.service (hermes' daemon already uses both).
2026-09-26 17:26:14 -05:00
Denton Social 483c51f559 bootstrap: contain install artifacts in .runtime/, provision SimpleX gateway
Move every installed artifact into a gitignored .runtime/ tree inside the
checkout (venv, SemIf engine, GGUF, HF cache, simplex-chat binary/profile,
rendered systemd units) so an end user can find and debug the whole stack in
one place. Pin simplex-chat v7.0.3 in config.example.json (url+sha256) and
have bootstrap download it, render semif-simplex.service + semif-gateway.service
from scripts/systemd/ templates, symlink them into the user unit dir, and
enable them. Add --simplex-allowed-users/--simplex-home-channel/--simplex-display-name
flags and write the gateway block into config.json. Add the AGENTS.md
containment rule.
2026-09-26 17:23:37 -05:00
Denton Social 6ab4d94423 gateway: SimpleX messenger intake/reply
Add a gateway adapter contract plus a SimpleX adapter (lazy websockets,
default-deny allowlist, batching, structured /_send) and a GatewayService
that maps chats onto the single-slot scheduler: submit_request, owner maps,
pending-run ownership, queue drain, and authoring questions/repairs routed
back to the origin chat. Wire `cli gateway [--platform simplex] [--dashboard]`
and the gateway.simplex config block. Scheduler gains submit_request() and an
on_request_requeued hook. DMs only for the first cut.
2026-09-26 10:14:09 -05:00
Denton Social a627f59a67 surface skill result, not LLM assessment, to the user
The user-facing output was the self-assessment model's brief summary, so a
skill that returned real data (e.g. calendar.next_event) only reported that
it found something. Display the skill's action_log instead; keep the
assessment text on the assessed trace (assessment_summary) for diagnostics.
2026-09-26 06:16:13 -05:00
Denton Social de2c1a73f2 gate: stop dropping lookups by carrying expectation + skills in the state
The binary gate asked "Does this input contain an actionable request?" over
the raw text alone, so the model read information requests as small talk:
"tell me the next event in my nextcloud calendar" scored 0.599 (under tau
0.6) and "what is the next event...?" scored 0.191, both dropped. The state
now states that the user expects handling, that looking values up in a
configured service is a real task, and lists the available skills; the
question/options say handle/ignore. On the real model every lookup variant
scores 0.9998+ while chatter stays at 0.016-0.125, and the new jarvis
integration battery pins both sides.
2026-09-26 06:04:39 -05:00
Denton Social b66d1e325a real seed skills: replace fake email/tracking built-ins with calendar.next_event
email.compose and tracking.check were hardcoded fakes (draft files / local
JSON, no real service) that shadowed the authoring path for real skills.
Remove them, delete their data fixtures and config keys, and ship a real
starter integration instead: seeds/calendar/next_event, a Nextcloud CalDAV
body in the SKILL.md folder format (PROPFIND calendar discovery + SemIf
calendar choice, calendar-query REPORT with server-side recurrence
expansion, all-day/TZID parsing, honest failures) with a hermetic
skill.test.py. merge_seed_store loads seeds into every tree at startup;
recorded config lands in gitignored data/skills/, and generated bodies
replace seeds of the same name. Only service-free response.reject stays
built-in.
2026-09-26 03:17:11 -05:00
Denton Social dde034f1b4 real integrations: implementation elicitation, INTEGRATION, fidelity + repair
Anchor the product premise at the top of AGENTS.md: semif-agent is an
end-user app that does the user's task for real against their actual
service, asking a few questions and learning when it doesn't know how.

Elicitation now asks implementation questions (service/account, how to
connect, credential source, expected result) and is on by default. The
REPL asks inline; the dashboard defers via a question queue the worker
waits on (/api/questions + panel). Answers ride every body attempt and
persist in the registry so restart doesn't re-ask.

SKILL.md requires real actions via stdlib transports with values from
ctx.config and a module-level INTEGRATION declaration
(service/transport/config_vars). TESTGEN.md scopes tests as hermetic
mechanics checks (loopback http.server in-test, never fixture addresses
in bodies) that never certify the live integration.

After the body lands a fidelity review (small LLM + static declaration
findings) regenerates a simulated body once, then accepts it traced and
badged unverified. A failed real run logs a SemIf repair choice
(retry/repair_skill/ask_user/no_repair), surfaced in REPL and dashboard,
bounded by codegen.repair.max_attempts and user-confirmed.

Dev unit suite: 191 passed. Jarvis integration run still pending.
2026-09-26 01:42:00 -05:00
Denton Social 06ccfb77c6 drop mock_data.json: embed fixtures inline in skill.test.py
The testgen call now replies with plain Python (no JSON envelope), so the
model can no longer confuse the envelope with the artifact. skill.test.py
carries its fixture data inline as Python literals; the folder layout is
now skill.py, skill.test.py, contract.json, config.json. The regen ladder
drops the mock option (3-option: code/contract/test) since a fixture fix
is a test regen.
2026-09-26 00:04:23 -05:00
Denton Social ddd2495f81 ship BRAINSTORM item 1: folder skill store, contract+testgen, config tiering
Skill leaves become folders (skill.py, skill.test.py, contract.json,
mock_data.json, config.json); clean switch, old single-file layout ignored.
SKILL.md owns the runner-data doctrine (no mock data); TESTGEN.md owns
mocking/testing. Async authoring pipeline: codegen body -> decoupled contract
gen -> shared-context testgen -> subprocess auto-run test with a 4-option SemIf
regen ladder (trace-only). Opt-in requirements elicitation (REPL asker) with
anti-pattern guardrails. Config search auto-populates skill config via SemIf
(global -> category); runner resolves tiers into ctx.config and pauses
pre-predict for unresolved contract vars with record/ask-again choices.
2026-09-25 22:46:07 -05:00
Denton Social 927f66b696 dashboard: show answer feedback and auto-select the resumed run
The answer flow ran the whole resume + LLM assessment synchronously before
the frontend cleared the input or flashed anything, so a slow answer looked
like a no-op. Make it optimistic: clear input, disable the button, and show
an in-flight 'answering…' state immediately; then persist a consumed-feedback
line (with a hint when the skill re-asks the same question) and auto-select
the run in the timeline so the answered/assessed/needs_input events are
visible. build_status now carries the pending run_id to drive that selection.
2026-09-25 12:10:40 -05:00
Denton Social 87438c881a async skill-body authoring: single-slot codegen worker, restart, re-dispatch
create_skill now authors the stub synchronously and returns immediately;
the runnable body is written by a single-slot background worker (the gate
stays free for new input). On success the body is materialized and
hot-merged, the leaf's writing flag clears, and the original request is
re-queued at its scored weight and re-runs navigation onto the new leaf.
On failure the leaf stays a restartable stub and the user is notified.

- scheduler: _dispatch_skill launches the async write instead of blocking;
  _run_skill guards writing/stub leaves (no silent no-op); restart_skill
  re-kicks a write for an empty not-in-progress leaf (reuses the stored
  request_text); RLock guards tree/queue/current across worker and main
  thread; awaiting_skill_body meta guard stops a re-dispatched request
  from authoring a second skill.
- skills: Skill.writing + status/is_noop via module-level no-op sentinels;
  registry entries persist the originating request_text.
- engine: call/generate serialized with a Lock so the worker's degeneration
  checks never race main-thread navigation/scoring on one llama.cpp context.
- cli: restart <category> <skill> command; REPL drains the queue after input.
- dashboard: POST /api/restart; /api/tree carries per-skill status; tree
  rows + skill_write_failed flow nodes get restart buttons; reads snapshotted.
- tests: async end-to-end (real CodegenClient vs fake SSE endpoint), restart,
  loop guard, status derivation, dashboard endpoint/status; integration chain
  test rewritten to poll for async completion + assessed.
2026-09-25 03:08:33 -05:00
Denton Social db35cb66dc bootstrap: write /v1 base_url for peer llm/codegen; probe the OpenAI-compat path 2026-09-25 02:23:13 -05:00
Denton Social 2297bbd6aa centralize staging engine deps in a committed requirements manifest 2026-09-25 01:58:39 -05:00
Denton Social 72af30f449 bootstrap: reuse the running checkout instead of re-cloning semif-agent 2026-09-25 01:44:29 -05:00
Denton Social 67027ecc20 add jarvis bootstrap script with pinned engine deps; guppy becomes ollama-only 2026-09-25 01:40:03 -05:00
Denton Social d866d94d04 record revivable SKILL.md git-ref provenance on skill_writing (guardrail item 7) 2026-09-25 00:20:32 -05:00
Denton Social f91f86742e document codegen token budget, sampler, and degeneration config in AGENTS.md (guardrail item 8) 2026-09-24 23:59:36 -05:00
Denton Social 90fda9f2a4 teach codegen that skills are reusable modules with self-owned data (guardrail item 9) 2026-09-24 23:45:52 -05:00
Denton Social db7d431976 ship exact token accounting via include_usage (codegen guardrail item 3) 2026-09-24 23:12:12 -05:00
Denton Social 340520d630 mark codegen guardrail items 4-6 box-verified; add reuse/mock-data + roadmap tasks
Box verified (2026-09-24): the SemIf degeneration watchdog fired 16 trace-only
codegen events during a real write (max stop_prob 0.693 < 0.9, no false abort)
and both codegen bodies converged with the card sampler — no loop. Notes the
new binding constraint: the sampler made qwen38-iq3s verbose (25-45 min
writes), so the box config.json sets codegen.timeout 3600. Adds backlog item 9
(codegen prompt: code-for-reuse + self-generated mock data; REPL input for
clarifying questions only) and roadmap tasks for data-contract tiered lookup,
post-codegen mock-data testing, and skill-code inspection.
2026-09-24 22:57:36 -05:00
Denton Social d18f0ccdb6 ship codegen sampler params + escalation ladder per Qwen3.8 card
CodegenClient now sends temperature/top_p/presence_penalty/frequency_penalty
(card-endorsed high presence_penalty, temp 0.7 instead of greedy 0.0) and
generate_skill_body escalates on invalid parse with an escalated sampler
(temp 0.5/presence 2.0) and a fresh short corrective prompt, up to max_attempts.
Degeneration aborts are a distinct DegenerationError(CodegenError) that
propagates without retry; retry-on-degeneration is left open. Marks guardrail
items 5/6 per the model card.
2026-09-24 20:24:20 -05:00
Denton Social 7c5cd2b685 add SemIf degeneration watchdog for codegen streams
CodegenClient accepts a per-chat degeneration_check callback polled every
interval chars against the last window chars of content+reasoning (bounded
rolling buffer); a non-None return aborts the stream. build_scheduler wires a
2-option SemIf continue/stop decision (P(stop) >= threshold aborts) recorded
as a trace-only codegen event, degrading to keep-going when the engine is
unavailable.
2026-09-24 19:38:01 -05:00
Denton Social bd99735283 document item 2 findings: /api/show string parameters, relaxed budget defaults 2026-09-24 19:25:55 -05:00
Denton Social 9c2d41d984 relax codegen budget defaults to qwen38-iq3s verbosity 2026-09-24 19:04:56 -05:00
Denton Social 3661443184 parse ollama /api/show parameters string 2026-09-24 18:38:42 -05:00
Denton Social 71abc0f762 mark guardrail item 1 done in AGENTS.md 2026-09-24 18:21:02 -05:00
Denton Social 0076b3d0f9 auto-detect context window and enforce layered token budget 2026-09-24 18:20:44 -05:00
Denton Social fcb0f0f988 backlog codegen refinement 2026-09-24 17:34:55 -05:00
Denton Social 9152c47a5d enforce total budget on streaming codegen 2026-09-24 17:33:41 -05:00
Denton Social 63922c1fad REPL when skill_create needs user input 2026-09-24 05:46:23 -05:00
Denton Social e92b3e7228 idle timeout for codegen 2026-09-24 04:53:06 -05:00
Denton Social 0a9b602ec7 print reasoning tokens to console during testing 2026-09-24 04:09:24 -05:00
Denton Social 8c10a94c32 codegen output token stream prints to console in testing 2026-09-24 03:48:03 -05:00
Denton Social bb97a09caa fix codegen timeout 2026-09-24 03:39:48 -05:00
Denton Social 300c20714b deterministically execute create_skill from create_category, execute skill after creation 2026-09-24 02:31:12 -05:00
Denton Social 5bdfa1d91d Fix integration test: assign generated body to draft.code before materializing 2026-09-24 01:29:18 -05:00
Denton Social 9e365446a3 Drop max_tokens cap on codegen; qwen3 reasoning truncation left content empty
qwen38-iq3s reasons extensively before emitting the skill body. A max_tokens
cap truncated the hidden reasoning (finish_reason: length) leaving content
empty, so the body write failed with 'skill body is empty'. Omit max_tokens
so the model runs to completion (~7 min); reasoning is filtered automatically
since only content is read. Client timeout default raised to 1200s.
2026-09-24 01:20:18 -05:00
Denton Social 440e49e76e Author runnable skill bodies via OpenAI-compatible codegen model
create_skill now writes a real predict/act body: the small decision model
still authors title + description (engine.generate), then a larger
OpenAI-compatible model (default qwen38-iq3s) writes the runnable code
against the SKILL.md contract. Bodies persist to data/skills/<cat>/<name>.py,
are hot-loaded via importlib, merged into the running tree, and the request
re-dispatches to the new leaf. The dashboard decision-flow view shows the
title/description with a writing badge while the body is being written.
Codegen failure degrades to a navigable stub.
2026-09-24 00:36:35 -05:00
Denton Social 789ed4ae25 Allow dotted skill titles (category.skill) in create_skill drafts
The model follows the repo's existing dotted naming (email.compose,
tracking.check) and proposed titles like tracking.status_lookup, which the
strict alnum-only check rejected. Accept dotted snake_case names.
2026-09-23 23:45:52 -05:00
Denton Social e68c56dca4 Fix create_skill wedge: short-circuit single-option navigation, never leave scheduler busy
An empty category produced a one-option SemIf leaf decision; the backend rejects
<2 options, the ValueError unwound past the current-process reset, and every
later request queued forever behind a phantom current. Navigation now
short-circuits empty trees/categories straight to the create branch (no SemIf
decision when there's nothing to choose), and the scheduler clears its current
process even when dispatch raises. Authoring generation is capped at 128 tokens.
2026-09-23 23:41:38 -05:00
Denton Social 225b4df959 Make create_skill author a skill leaf stub like create_category 2026-09-23 23:02:59 -05:00
Denton Social f5419183bc Encode generation prompt via tokenizer.encode (apply_chat_template returns Encodings) 2026-09-23 22:36:08 -05:00
Denton Social fcefb971f8 Fix SemIfEngine.generate: sample from the low-level llama.cpp backend 2026-09-23 22:32:48 -05:00
Denton Social 6c980efec0 Document dashboard systemd service and editable install on the box 2026-09-23 22:20:00 -05:00
Denton Social ea2e5b8045 Automate create_category via normal-mode generation of the decision model 2026-09-23 20:45:28 -05:00