# Jcode 1.0.3 receipt (#888)

Date: 2026-11-22. Refs #888. Installed release build, read through `--quiet version --json`: `semver` 1.0.3, `version` `v1.0.3 (a0ae514c4)`, from [1jehuang/jcode](https://github.com/1jehuang/jcode) tag v1.0.3. Host macOS arm64, Bun 1.4.4.

This repeats the ACP, serve and MCP contract legs of [the 0.99.1 receipt](2026-10-26-jcode-0.99.1.md) and its steering leg, and adds a delivery leg: one hub envelope reaching a jcode session and being acknowledged. Every leg passed, so 1.0.3 is added to jcode `verified` in `src/adapters/compat.ts` in the same change, and the compatible line is widened to cover the 1.0.x line.

## Isolation

- Every process ran under an isolated `HOME` and `JCODE_HOME` (fresh directories under `/tmp/ahub-jc103`, an empty `mcp.json`, no credentials, no account), with `JCODE_NO_TELEMETRY=1` and `JCODE_DISABLE_CLAUDE_MCP=1` as the adapter sets them. The real `~/.jcode` was never the home.
- The hub home was isolated with `AGENTHUB_HOME` (a scratch directory), because `hubHome()` reads that variable or `homedir()` (`src/hub/project.ts:89-91`). The delivery leg's trust record was written there; the person's real `~/.agenthub/agent-compat.json` was hashed before and after the leg and is unchanged. That held for the run recorded here, not for the first delivery run, which wrote the real hub home; see the incident below. The recorded run asserts `hubHome()` resolves under the scratch root before it writes anything, and writes the record through the policy's own `writeTrust`.
- SHA-256 of the four real config files that sit directly in `~/.jcode` (`auth.json`, `auth-refresh-state.json`, `config.toml` and `mcp.json`) was taken before the first leg and compared after the last: unchanged.
- The probes built every argv with the adapter's own `jcodeCommand` and spawned `serve` with `JCODE_SOCKET` and `JCODE_READY_FD=3` the way `JcodePeer` does. After each run `pgrep` found no process whose command line named the sandbox.

## Incident during verification

The first delivery run set only `HOME` to a scratch directory, then wrote the trust record with plain `fs` at `trustFile()`. `hubHome()` reads `AGENTHUB_HOME` or `homedir()`, and `homedir()` did not follow the mutated `HOME` in that process, so the path resolved to the person's `~/.agenthub/agent-compat.json` and replaced it with one row (`jcode` 1.0.3). The delivery result itself stands: the acknowledgement was measured from the peer, not from where the record lived.

- Overwritten: the whole file, by a single-record write. It is rewritten whole (atomic rename) and the hub keeps no copy, and this Mac had no `tmutil` snapshot, so the previous bytes could not be read back.
- Rebuilt: `schemaVersion` 1 with the two `jcode` rows the project's own hub log named as in use before the incident (`jcode` 1.0.1, 19 log lines; `jcode` 1.0.3, 2), written mode `600`. The log also named `pi` 1.5.2 (6 lines); that row was not restored, because `1.5.2` is in `COMPAT.pi.verified`, so no version gate read a trust record for it.
- The two `at` values are reconstructed, not recovered: `1795311008023` and `1795350081023` are the timestamps of those hub log lines, so they are as accurate as the log line and are not the original write times.
- Not touched: the real `~/.jcode`, whose four config hashes are equal before and after every leg. What the probe wrote there was checked against its mtime as well: `mcp.json` last changed before this task started.
- After the restore the run was repeated with the guard above, and the guard was shown to bite: the same probe with the `AGENTHUB_HOME` line removed stops at `refusing to run: hubHome() is outside the scratch dir` naming the person's own `~/.agenthub` before it writes, and the real record's hash is unchanged (`5c7a9fbc...`).

## Contract legs (idle server, no model)

- **serve** with the adapter's socket name `j.sock`: ready on the private socket in 96 to 97 ms across three runs. It leaves `j-debug.sock`, `j.sock.hash`, `j.sock.server.json` and `j.sock.daemon.lock` beside it, and the server info file carries the same ten keys as on 0.99.1 (`argv`, `debug_socket_path`, `idle_timeout_secs`, `owner_pid`, `pid`, `ppid`, `schema_version`, `scope`, `socket_path`, `started_at`), with `scope` `temporary` and `idle_timeout_secs` 1800. The process exits 0 on SIGTERM and its process group is gone afterwards.
- **ACP** (`acp --mcp-tools eager` against the same private server):
  - `initialize`: `protocolVersion` 1, `agentInfo` `{ name: "jcode", title: "Jcode", version: "1.0.3" }`, `authMethods: []`.
  - `agentCapabilities`: `loadSession` true, `mcpCapabilities` `{ http: false, sse: false }`, `promptCapabilities` `{ audio: false, embeddedContext: true, image: true }`, and `sessionCapabilities` `{ close: {}, resume: {} }`. `loadSession` is the field the adapter's recovery gate reads (`src/adapters/acp.ts:415`); `sessionCapabilities` is new at 1.0.3 and additive.
  - `session/new` returns `configOptions`, `models` and `sessionId`.
  - `session/load` returns `configOptions` and `models` only, with no `sessionId`. The restored identity stays unproven, so `requireLoadSessionEcho` and the withheld automatic recovery are unchanged.
  - `session/set_mode` and `session/request_permission` are still `Unsupported ACP method` (JSON-RPC -32601), as on 0.98.1 and 0.99.1.
- **MCP**: a project `.jcode/mcp.json` entry that names no peer was started by the eager ACP child, and its environment held exactly `AGENTHUB_PEER_ID` and `AGENTHUB_LAUNCH_ID` from the owned process environment (values set on the `acp` child by the probe), next to the entry's own `AGENTHUB_MODE`, `AGENTHUB_DELIVERY_ONLY`, `AGENTHUB_STATE_DIR` and `AGENTHUB_PROJECT_DIR`.
- **Telemetry**: with the adapter's `JCODE_NO_TELEMETRY=1` the serve, ACP, MCP and provider-configuration legs created no telemetry file at all. The steering leg, which runs a model turn, created `telemetry_id` (a UUID) and `telemetry_id.lock`, and did not create `telemetry_usage_outbox`, `telemetry_milestone_first_run_*` or `telemetry_version_sent`; the delivery leg created none of the five. A control `serve` without the variable created all five, `telemetry_usage_outbox` among them. 1.0.3 also writes a native diagnostic log at `<JCODE_HOME>/logs/jcode-<date>.log`; the 0.99.1 receipt's telemetry bullet covered the no-model legs only, so the id file on a model turn is new information rather than a change.

## Steering leg (a running turn)

The 0.99.0 check was established on an idle session; this receipt exercises it on a running turn, still with no account: the isolated home holds one `openai-compatible` profile `fakegw` (written by `jcode provider add` into the isolated `config.toml`, `auth = "none"`) pointing at a local server on `127.0.0.1:18999` that streams a slow, fixed reply and records each request it receives. No real provider, key or model was involved.

- `serve` and `acp` were started with the adapter's argv carrying `--model fake-model --provider-profile fakegw`, a session was created and `session/prompt` started a turn.
- While that turn streamed, a second client on the private socket ran the same steps as `nativeSteer`: `ping` listed `soft_interrupt_ids` in `capabilities`, `subscribe` with `target_session_id` joined the same session (no new session), `state` reported `is_processing: true`, and `soft_interrupt` with `urgent: false` was acknowledged.
- The prompt then ended with `end_turn`, not `cancelled`. The local server saw two requests. The first held only the original prompt. The second held the original prompt, the assistant text streamed so far and the steer text as a new user message, so the steer was injected at the end of the running response and the turn was not cancelled, as the adapter's comment on `nativeSteer` states.
- The idle variant reported `is_processing: false` and the probe stopped there, which is the state `nativeSteer` refuses with "the session has no running turn" without sending anything.

## Delivery leg (new)

jcode went offline after its 1.0.1 upgrade, so the delivery path had no recent evidence. This leg drives it through the production peer with no live hub daemon:

- One envelope was published by a bare `Bus` to the production `JcodePeer` (`newEnvelope("user", …, { to: ["jcode"] })`), with the fake gateway as the model.
- The peer reached `idle` in 107 to 109 ms. The published envelope's id then appeared in `bus.lastDeliveredTo("jcode")`, the provider request carried the delivered text verbatim, `session/prompt` returned `end_turn`, and the peer published its answer as jcode's own envelope (`"Acknowledged: hub delivery reached the jcode session."`). On `stop` the peer went to `offline` with its owned server and ACP child gone.
- 1.0.3 is admitted by the current policy only through a person's local trust record (`assessVersion` → `trusted`), which this leg wrote under the isolated `AGENTHUB_HOME`. The same change that records this receipt turns that into `verified`.

## Source comparison v0.99.1..v1.0.3

1,648 commits; 1,883 of the 3,312 paths in the v1.0.3 tree differ from v0.99.1, read only through the GitHub trees and compare APIs (nothing built). The whole protocol crate is 16 files, 8 of them source: five changed and two are new (`protocol_memory.rs`, `screen.rs`).

- **ACP**: the method dispatch set is the same eleven names at both tags (`initialize`, `session/new`, `session/load`, `session/prompt`, `session/cancel`, `session/close`, `session/resume`, `session/set_config_option`, `session/set_model`, `session/set_reasoning_effort`, `session/update`). `src/cli/acp.rs` is +250/-522 because validation and prompt-content handling moved into two modules that did not exist at 0.99.1 (`src/cli/acp_parameter_validation.rs`, `src/cli/acp_prompt_content.rs`); `validate_acp_mcp_servers` is written the same way in its new home, so an empty or a non-empty `mcpServers` array is still tolerated. Of the 522 removed lines, six match an ACP identifier and all six are those moved blocks.
- **Protocol**: `crates/jcode-protocol/src/{wire.rs, wire/events.rs, comm_format.rs, lib.rs, notifications.rs}` are +348/-17. None of the 17 removed lines removes a request, field, capability or message: they are doc comments, one `#[derive]` attribute, a re-export line that was widened, and two small formatting/constructor edits. The socket message set (`ping`, `pong`, `subscribe`, `session`, `state`, `soft_interrupt`, `ack`, `error`) is identical at both tags.
- **MCP**: `crates/jcode-app-core/src/tool/mcp.rs` is +2/-2; both removed lines are in remote MCP management (the transport `enum` schema and a `manager.connect` call), not the eager stdio child the hub uses, which the MCP leg above starts.
- Read: those six ACP and protocol files and `tool/mcp.rs`. Not read: the other ~1,870 changed paths; the 1.0.x release is mostly native work behind the same contract (provider, auth, TUI, sandbox).

## Not verified

- A real account, provider or model, and a model turn that calls a hub tool through the project MCP entry, as in every earlier jcode receipt. The steering and delivery legs prove delivery to the provider request, not how a real model reacts to it.
- The TUI form (`jcode --resume`), covered separately for 0.98.1 in [the TUI receipt](2026-10-20-jcode-tui-0.98.1.md), was not repeated.
- A second instance running beside the base peer, and Linux or Intel macOS builds.
- The source comparison covers the ACP, protocol and MCP definition files named above, not the rest of the release.

## Decision

Every leg passed and no request, field, capability or socket message the adapter uses was removed or renamed, so `1.0.3` joins `verified`, and the compatible line moves from "0.98.0 up to 1.0.0" to "0.98.0 up to 1.1.0" so that the 1.0.x line is trusted as well. A failed leg, or a removed contract member, would have meant 1.0.3 exact and no line change, as the task requires.
