Commit Graph

92 Commits

Author SHA1 Message Date
Dash
5246c47588 ci(host): typecheck the Host and document the shared-code convention
- host-regressions now also runs `pnpm --filter @cindy/host typecheck` once (on
  Linux; types are platform independent) inside the change-selected job that
  verify already requires. A shared desktop body that gains a port wired only
  in the desktop assembly passes the desktop checks but is caught here instead
  of at runtime in the Host.
- architecture-invariants §5 records the convention for bodies shared by the
  desktop and the Node Host: no direct Electron dependency, desktop assembly
  in *.desktop.ts, factory port injection, wire a new dependency into both
  launchers, run the Host test and typecheck. AGENTS.md and the dev-rules
  README point to it.
- headless-runtime-plan.md: the merged batches no longer say "local,
  unpublished".

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-11 00:09:46 +13:00
Dash
74a5f237dd docs(host): record desktop publication verification and limits
Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 15:32:55 +13:00
Dash
883fca865f fix(desktop): preserve startup and OAuth evaluation order
Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 15:23:45 +13:00
Dash
75d6c79c57 fix(host): connect task controls and preserve desktop plugin behavior
Keep queued message display separate from stored payloads, share tags and search with Host, and preserve desktop plugin setup and commit semantics.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 14:58:19 +13:00
Dash
0494c9235d fix(host): embed raw package assets and expose startup readiness
Validate the standalone artifact outside the checkout and record isolated trial limits.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 13:36:05 +13:00
Dash
d72e2a1daa test(host): preserve scheduler coverage across shared service extraction
Point existing wiring guards at the shared snapshot service and desktop
assembly. Verify accepted callback commit, cancellation rollback and discard
through observable behavior. Add a repeatable isolated scheduler command
and record the actual scope and limits of desktop and plugin verification.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 12:58:23 +13:00
Dash
b465adf684 refactor(host): share scheduler services without changing desktop ownership
Keep scheduler business modules at their original paths and inject desktop
services through explicit assemblies. Reuse scheduler queue admission and
accepted callback handling in the Host durable queue, including Stop races.
Exercise script execution, capability denial and restart persistence with
an isolated SQLite integration fixture. Preserve the six remaining shared
module paths so upstream changes continue to land in the common bodies.

Full Host startup wiring, companion/IM ownership and Linux credential
deployment remain pending and are recorded in the implementation plan.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 12:38:03 +13:00
Dash
c48ee1cea6 Merge main into the headless runtime and restore desktop initialization
Preserve upstream behavior while sharing platform-independent runtime services.
Repair eager desktop port capture and settle silent startup owner boundaries.
Keep the ongoing headless work local; full confirmation is recorded separately.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 11:54:40 +13:00
Dash
2c230ea21f WIP: share headless runtime services with desktop adapters
Preserve the implemented task, Device Link, plugin and model runtime work locally before integrating main. Full multi-client, automation and platform acceptance remains incomplete.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 11:11:41 +13:00
Dash
36ef5cb15a ci(host): select cross-platform regressions by changed paths
Skip the Host matrix for unrelated changes while retaining fail-closed verification for PRs, merge groups and main pushes.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 13:40:12 +13:00
Dash
39de3ba3e7 docs(host): record review convergence and desktop regression evidence
Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 01:18:25 +13:00
Dash
1176c53019 fix(host): finish account and session recovery and preserve desktop tests
Restore stored settings on both task entrypoints, synchronize explicit Host
client owners, route logout to the Host, reject mismatched startup accounts,
and invalidate local setting snapshots. Remove the unused permissive relay
prototype. Update desktop test fixtures to inject extracted runtime ports.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 01:16:10 +13:00
Dash
c846f2f586 fix(host): apply live session settings, keep tool-turn messages, make CI pass
- updateSession applies permission mode and model to a live Session before
  persisting; a runtime refusal fails the request instead of reporting success.
- Store every assistant message of a tool-use turn under its own id (the later
  answer used to collide with the first message's clientId and be dropped);
  error rows use a distinct id.
- Device-link approvals resolve through the interaction broker's respond().
- Declare apps/host in the test-workspaces manifest (it runs in the dedicated
  Host regressions job) so unit shards stop failing on manifest coverage.
- Make Host tests portable to Windows (path separators, POSIX mode bits,
  file URL conversion, tmp dir).

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 00:53:38 +13:00
Dash
cc99b6b059 fix(host): harden browser pairing, credentials and task execution for the experimental web client
Address the open review findings on the Host web client without changing how
the desktop starts: the desktop no longer auto-discovers and joins a running
Host (only an explicit CINDY_HOST_API does).

- pairing: one-time pairing exchanges for a session cookie; the home page no
  longer issues credentials or embeds the API token; Host/Origin checks,
  session expiry closes event streams, logout clears cookies.
- credentials/accounts: provider keys are scoped by account/provider/engine and
  never fall back to the gateway key; model catalog cache is isolated per
  account; logout reuses the desktop saved-account tombstone policy; macOS and
  Windows credentials go through a private Electron safeStorage helper.
- execution: input queue claims its slot before async preparation, keeps input on
  failure, stops cleanly while preserving streamed output, pauses on save
  failure, and deleting a task stops and clears it; SDK session context is
  restored after refresh and Host restart.
- web shim: unsupported actions fail instead of reporting success.
- desktop explicit Host mode: auth, interaction and input-queue events reach the
  existing channels; shared storage cores (project aliases, recent workdirs,
  ghost snapshot worker) are used by both desktop and Host.
- CI: Host regression matrix on macOS, Windows and Linux; fix the task tag
  migration test to use the new migration config.

Out of scope here: a windowless Electron helper and custom MCP storage
extraction. Simulated OS tests do not replace real keychain/DPAPI or
three-platform validation; see docs/host/pr-9246-completion.md.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 00:31:13 +13:00
CHEYAN
5f0ef70406 docs(host): update parity and status ledgers for S0-S8 completion
- Reflect Host runtime single-writer and SQLite exclusive ownership under cindy-host.service
- Document proxied settings, project aliases, and delegated auth refresh channels
- Update electron client mode and feature parity acceptance records

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-06 21:48:44 +09:00
CHEYAN
24c21f2356 docs(host): record A1 baseline and native ABI isolation evidence (S0, S1, S0b)
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-06 19:59:02 +09:00
CHEYAN
9c115af55e fix(host): resolve the renderer bundle per request
A desktop build removes .vite/renderer, which left a running host serving 404
until restarted. The web root is now resolved per request, and the dev launcher
builds the bundle when it is missing.

Verified: host started without a bundle answers 404, then 200 once the bundle
appears, with no restart.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 18:38:40 +09:00
CHEYAN
679aec36f9 docs(host): record the single-runtime and client-mode acceptance evidence
During an Electron client-mode run the host pid held the only runtime lease, the
client never opened the profile database, and the host kept serving after both
the browser tabs and the Electron process went away.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 18:31:44 +09:00
CHEYAN
52661e9f05 feat(desktop): refuse to open the profile database in host client mode
Client mode now sets a flag the local DB respects, so the Electron client never
becomes a second writer on the profile the host owns; the guard has a test. The
web shim also answers the startup-stall report instead of rejecting it.

Records the three acceptance criteria and the residual list (manual OAuth,
plugin execution sandbox, Codex Responses proxy, scheduler, device-link, file
dialogs, history paging) in the status doc.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 18:27:57 +09:00
CHEYAN
426d2389c8 feat(host): run Maker Memory and its cindy_memory MCP in the host
The host now builds the same owner-scoped memory manager Desktop uses (same
settings file, same sqlite factory), enables it before the agents snapshot the
flag, and injects the cindy_memory provider. Verified end to end: a real Claude
turn listed the server's tools, wrote a memory and read it back.

Also passes the manager to the agents, which is what actually enables the
in-process server, and covers the settings reader with a unit test.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 18:09:27 +09:00
CHEYAN
b84c2d68ee fix(codex): skip the memory override when the host has no memory bridge
A bare mcp_servers.cindy_memory.enabled entry without a transport makes Codex
reject the whole thread ('failed to load configuration: invalid transport').
cindy-host registers no MCP bridge, so its Codex threads could not start at all;
the override now requires the server to exist, which Desktop always did.

Verified: cindy-host Codex threads start and stream. The remaining gateway-lane
gap (Responses proxy) is recorded in the parity ledger. maker-core codex suite:
1049 passed / 11 skipped.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 17:29:56 +09:00
CHEYAN
c4400f1b0c fix(host): attach the interaction broker to POST /chat
API turns had no interaction resolver, so every tool call was denied as
no_listener_attached and file access silently failed for API clients. The chat
handler now attaches the broker, and a test drives an approval through the event
hub. Verified end to end: an approved Bash call wrote proof.txt in the session
workdir and the reply echoed it.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 17:13:49 +09:00
CHEYAN
a7a4d112f7 docs(host): record the headless credential-store failure mode
Without a Secret Service entry the login exits with an explicit
CREDENTIAL_STORE_UNAVAILABLE message; records are written 0600 and never in
plaintext.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 17:01:11 +09:00
CHEYAN
c7b7717910 docs(host): record the runtime checks for owner discovery
Single-account profiles initialize to ready without CINDY_HOST_OWNER; a
two-account profile stays uninitialized with an explicit reason.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 17:00:19 +09:00
CHEYAN
f8b1419c0e docs(host): refresh the status page to the verified end state
Replace the stale stage-4 blocker with the resolved root cause and the verified
matrix for browser and Electron clients, and name the remaining host-side gaps.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:58:31 +09:00
CHEYAN
a6070374e9 test(host): cover the hosted-callback polling login path
Polling through pending to a code now has the same end-to-end coverage as the
loopback listener, so both authorization shapes are exercised without a real
account. Host suite: 47/47.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:57:31 +09:00
CHEYAN
f5945c0092 feat(host): add a sanitized status command
cindy-host status [--json] prints only authenticated/realm from the adopted
session record, so the operator and scripts can confirm login state without
handling tokens.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:55:48 +09:00
CHEYAN
8ad60f10d6 test(host): drive the loopback login against a stub identity provider
Cover PKCE challenge derivation, state validation, the code exchange and the
credential write without a real account; a mismatched state must reject without
storing anything. Host suite: 46/46.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:55:02 +09:00
CHEYAN
58cc65ae4c docs(host): spell out the remaining client-mode gaps
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:53:21 +09:00
CHEYAN
a8e9b17382 feat: discover the profile owner and add a dev launcher that keeps a host running
The host now adopts the only account database in a profile instead of requiring
CINDY_HOST_OWNER (multiple accounts are refused rather than guessed). pnpm
dev:host reuses a running host or starts one before launching the desktop, so the
default dev path never falls back to the embedded runtime.

Verified: pnpm dev:host reused the running host and the desktop entered client
mode with the host serving every runtime channel.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:52:37 +09:00
CHEYAN
54f79d3a23 docs(host): record the Electron client-mode evidence
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:35:24 +09:00
CHEYAN
b5dcc42118 feat: let the desktop join a running host automatically
The host publishes host-endpoint.json (pid + loopback URL) on listen; the desktop
validates the pid and enters client mode without any environment variable,
installs the proxies at startup (not behind the splash gate that only the
embedded runtime satisfies), and keeps them authoritative when other modules
register the same channels. With a host running the runtime factory throws, so
the process structurally cannot assemble one.

Verified: client mode auto-selected with no env var, 21 channels proxied, 42
duplicate registrations suppressed, zero errors in the run.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 16:34:57 +09:00
CHEYAN
024ae1f6fa feat(desktop): make client mode structurally unable to assemble a runtime
setMakerClientMode makes every getMaker() call throw, so no lazy path (scheduler,
device-link, tray probe, MCP refresh) can build a second runtime in the client
process.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 15:22:30 +09:00
CHEYAN
3e142abd4c refactor(turn-change-set): drop the electron dependency and serve it from the host
The store now reads userData through the existing path port and takes its window
fan-out via an injected broadcaster (wired in bootstrap), so the host can reuse
the same implementation. Expose /api/turn-change-sets/list and proxy the desktop
channel in client mode. Change-set tests: 43 passed.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 15:14:49 +09:00
CHEYAN
7d6d5d2e4c feat(host): list installed plugins through the shared GhostManager
The host constructs the desktop's own GhostManager with owner-scoped roots
instead of maintaining a second plugin registry, serves it at /api/ghosts, feeds
the web client's synchronous list channel from a boot prefetch, and replays it
for Electron client mode. Host suite: 43/43.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:56:06 +09:00
CHEYAN
cbaec6fa39 docs(host): add the host documentation index and quick start
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:36:32 +09:00
CHEYAN
29523912a8 docs(host): record the verified permission-prompt round trip
A real turn with permissionMode=ask published interaction_request, accepted the
HTTP response and continued to a file write and final reply.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:35:07 +09:00
CHEYAN
b03a083bac feat(host): answer permission prompts through the shared API
Add an interaction broker that publishes requests on the event stream, resolves
them from an HTTP response and denies on abort; expose pending/respond routes,
route interaction events to their preload channels in the web shim, and proxy the
two desktop channels in client mode. Host suite: 42/42.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:32:05 +09:00
CHEYAN
c11b579cef feat(host): support task metadata updates over the shared API
Add /api/sessions/update with an explicit field allowlist (title, status, pin,
mute, model/effort/permission/fast/plan), route it from the web client and proxy
the desktop channel in client mode. Verified by renaming a stored task through
the host and reading it back.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:14:37 +09:00
CHEYAN
04cb4134d7 feat(desktop): proxy the agent surface into client mode
Cover list-available-agents, list-agent-commands and list-agent-skills with the
host endpoints that already serve them.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:04:07 +09:00
CHEYAN
cff557d20b feat(web): expose the login-state query and local-mode entry
Serve the desktop login entry state and local-mode switches so a host profile
without an account session reaches the normal sign-in screen instead of a
channel error; local mode itself still stops at the startup gate (documented).

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 13:45:14 +09:00
CHEYAN
ae8ea2fe3d fix(host): claim the legacy renderer namespace it already owns
A fresh client could never finish its first-run visibility migration while the
claim said another owner held the namespace, so the catalog stayed pending.
Report the claim for the owner that actually holds the profile lease; the
Electron client-mode catalog then refreshes through the proxied channels.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 13:40:11 +09:00
CHEYAN
e5766c68db feat(host): serve the visibility claim and proxy pricing into client mode
Add the claim endpoint, prefetch it in the desktop and replay it for the
renderer's synchronous read, and proxy the pricing channels. With a separate
Electron-ABI native binding the desktop and host can run together; the task,
provider and capability reads now come from the host, while the renderer's
catalog snapshot still degrades (tracked in docs).

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 13:32:40 +09:00
CHEYAN
d7087c2a6d fix(desktop): install client-mode proxies after the desktop registrations
Installing them earlier made the later maker:* registration throw on a duplicate
handler and skip every subsequent channel (remote-ssh, project-automation). The
dev launch now prints the delegation target and the proxied channel list and the
renderer reads tasks, providers and capabilities through the host.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 13:13:09 +09:00
CHEYAN
6baf5b0a12 docs(host): record the Electron launch attempts and their environment limits
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 12:49:19 +09:00
CHEYAN
1fd722a66b feat(desktop): extend client-mode proxies to task creation and usage
Cover local-db:sessions:create, messages:estimated-value, maker:input:remove and
model-access:get-status with the host endpoints that already exist.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 12:46:21 +09:00
CHEYAN
6c238e1f5f feat(desktop): proxy the legacy send path and active-task list
Map maker:send onto the host input queue (reporting acceptance while the answer
arrives on the event stream) and serve maker:list-active from the host task list.
Record the reachable stage-2 evidence: the login entry point issues a real PKCE
authorize URL and a restart reuses the adopted session without re-authorising.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 12:07:48 +09:00
CHEYAN
a04ff07985 docs(host): record the failed headless Electron launch attempt
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 12:03:50 +09:00
CHEYAN
e8196bf470 feat(desktop): run Electron as a client of cindy-host
With CINDY_HOST_API set, the desktop skips assembling its runtime and proxies
tasks, task messages, providers, agent capabilities and the composer input queue
to the host, relaying the host event stream into the same push channel. Loopback
and profile-token requirements are enforced; channels outside the allowlist fail
loudly instead of starting a second runtime.

Verified: the delegation unit tests pass and the desktop typecheck is clean; a
real Electron launch with the remaining channels is still outstanding.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 12:01:22 +09:00
CHEYAN
ff508f3b1c docs(host): finish the feature-parity audit
Record the plugin page evidence, the remaining stage-5 work list and the current
verdict on the three acceptance criteria.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 11:30:41 +09:00