Merge branch 'main' into large-chat-history

This commit is contained in:
2026-10-18 15:03:22 +01:00
27 changed files with 2371 additions and 30 deletions
+37
View File
@@ -0,0 +1,37 @@
# Background shell visibility
The chat server now opens the broker stream for read-only subscribers and reconciles verified running shell operations from OpenCode's authoritative `/api/shell` readback. The packaged OpenCode skill references and chat documentation should describe that shell visibility survives reconnects only when OpenCode reports explicit `metadata.sessionID` ownership; shared working directories are not ownership evidence.
## Current source behavior
Observers share one initial readback per room/stream attachment. The adapter and hub
fold bounded lifecycle journals over each snapshot, so a stale read cannot resurrect
an exited shell or erase a concurrent create. Shell replay and live delivery enqueue
in fold order. Cancellation rejects old-room callbacks and releases local identity
state before reconnect. Journals retain at most 256 identities and 1 MiB of id/command
text; capacity/read failures surface stable limited-visibility text, never broker
response bodies. No shell polling was added. OpenCode's terminal `timeout` and
`killed` statuses are excluded from retained running operations as well as `exited`.
## Verification evidence — 2026-10-18
`opencode api get /openapi.json` authenticated through supported service discovery.
The live schema advertises shell list/detail/output and generic `metadata`; it does
not type `metadata.sessionID`. A throwaway session
`ses_eb12ab7b3ffe0ZAle7PHpftHMG` and its own `sleep 1` shell
`sh_14ed57134001e6fuYqvn62pKit` verified actual create/detail readback preserving
explicit `metadata.sessionID`, status `running`, subsequent `exited`/exit 0, and
absence from the running list. This verifies explicit API metadata, not automatic
agent-tool ownership injection. The CLI event attempt yielded no captured events;
live-provider event ordering is **not tested**. Forced ordering evidence comes from
channel/barrier regressions, including a real WebSocket handler on a loopback scratch
server with fresh SQLite, not from the deployed service.
## Documentation follow-up / deployment
`docs/chat-verification.md` and the chat subscribe/replay section of `docs/cli.md`
are stale: docs-fold should describe authoritative ownership/readback, coalesced
observation, bounded reconciliation and limited-visibility errors, distinguishing
fixture ordering evidence from the live readback above. Shared docs and packaged
skill references were not edited here. No deployment, installation, service restart
or physical-phone/UI verification was performed; this changes no rendered layout.
+47
View File
@@ -0,0 +1,47 @@
# Delivery stabilization
Date: 2026-10-18.
The server now has draft-only `delivery=true` support for OpenCode model stages.
At run time it derives the canonical `main` worktree and linked-worktree Git
metadata from Git rather than accepting paths from a stage prompt. It verifies
the committed item tree in a disposable candidate worktree before fast-forwarding
canonical `main`; declared checks are bounded configuration, not proof that any
deployed definition has used them. It is denied for Pi (until equivalent
capability enforcement exists), foreign repositories, missing main worktrees,
and malformed capabilities. This item does not publish or deploy a definition.
The source also supports an optional controlled-fixture verification declaration
(`backend`, `revision`, `capability`, and `fixture`). Ordinary server setup wires
an explicit, bounded `reconnect-foreground` HTTP fixture registry when
`PIPELINES_VERIFICATION_RECONNECT_FOREGROUND_URL` and its expected `BACKEND`,
`REVISION`, `CAPABILITY`, and `STATE` values are configured. There is no default
remote URL. The server, not the model, probes that registered endpoint and
collects its returned backend identity, build revision, capability, fixture ID,
and state before comparing provenance. Unknown fixtures, incomplete setup,
wrong backend/revision/capability/state, non-200 responses, cancellation, and
oversized or malformed responses fail closed. A model result's labels are not
evidence. This is controlled local/backend fixture infrastructure, not evidence
of a rendered layout or a live Android device.
Definitions must be scratch-validated against the deployed server only after
the server support is deployed; no future delivery or verification definition
is activated by this source change.
`internal/author/skill/references/format.md` and
`internal/author/skill/references/queue.md` are stale: a later docs fold should
describe `delivery=true`, OpenCode-only availability, candidate verification,
and the required activation order (deploy server support before scratch-validating
and then publishing a definition).
OpenCode V2 resolves external resources at a containing directory, so delivery
uses the verified repository metadata directory rather than an impossible
single-lock-file scope. It does not grant a parent, home, foreign repository,
or global policy. Unrestricted shell permissions are not an OS sandbox.
Activation remains draft-only: deploy compatible server support, configure the
controlled fixture endpoint and matching provenance, scratch-validate the
fixture, then publish a definition. No definition is activated by this source
change.
Recovery checklist: retain `connection-reconnect` and unfinished feature
branches; merge only complete committed trees that pass mapped checks; do not
infer delivery from a dirty worktree or an old deployed-backend capture.