Fix the three reading problems in the chat conversation view. Android only;
no new dependency (the declared material-icons-extended only); no server,
Go, installer or Docker file touched and no run started from the app.
- Markdown reaches the transcript. Assistant text already went through
MarkdownText inside a private composable; name the decision as the pure
ChatFormat.partRendering(part) (MARKDOWN/REASONING/PLAIN/HIDDEN) and have
MessagePart consume it. Text outside the renderer's documented subset and
unknown part kinds still render as their own text (PLAIN); blank parts
render nothing (HIDDEN).
- Reasoning collapsed by default. ReasoningBlock is now one compact, muted
line per part (icon, label, chevron) that expands on tap to the muted
text. Expansion is hoisted to the conversation pane as the pure
ReasoningExpansion set keyed per stable part key, so a part keeps its
state across scroll/disposal and every part starts collapsed in a newly
opened chat. A running turn's streaming reasoning stays collapsed under a
live "Thinking…" label, signalling progress without competing with the
answer.
- One identity in the header. ChatFormat.conversationHeader(thread) builds
the app-bar title plus only context (labelled kind chip from the server
tag, activity, directory, model); the app bar and the context line read
the same value. openChatsBeside drops the active chat from the open-chat
strip so its title is shown once; every other open chat stays one tap
away and the session list is unchanged.
Tests: new ChatTranscriptTest (7 cases) plus the existing ChatFormatTest —
the markdown subset reaches the renderer from a ChatPart, text outside the
subset and an unknown kind still render, reasoning starts collapsed and
toggles per part, the header names the session once, and the strip offers
only the other open chats.
Checked, and none needs an update: the packaged templates carry no Android
chat surface; the repository guidelines (README, docs/) document the server
and CLI, whose behaviour is unchanged — docs/cli.md's note that Android
rendering of the tag is out of scope for the server change still holds; and
the packaged authoring skill references (internal/author/skill/references/)
describe delivery/verification generally, none of which this UI change
alters. android/README.md records the new behaviour.
Verified: `gradle :app:testDebugUnitTest :app:assembleDebug --no-daemon
--offline --rerun-tasks` → BUILD SUCCESSFUL; JUnit XMLs total 508 tests, 0
failures, 0 errors, 0 skipped. app-debug.apk sha256
0df6899429a8f5632ec568340dddb63a5617b1a04af19f52c6ebb793470a0b23.
Treat a failure to reach the harness before any prompt or tool call is
admitted (connecting or creating the session) as a distinct retryable
reach failure, so a transport blip at the first stage no longer ends a
mutating run; keep post-admission readback/poll/agent failures retried
only on an explicit read-only stage and never replay admitted tool work.
Preserve the true cause when the context is already done (join ctx.Err
with the typed transport error) and report a sanitized unknown provider
error name/status instead of a blanket summary.
Make the isolated format-repair deadline proportional to the stage
timeout (floored, capped and clamped to remaining minus a margin) so a
slow-but-repairable result is recovered without ever extending the stage
deadline; the bounded ladder, value guard, deny-all formatter session,
cumulative usage accounting and no-tool-replay rule are unchanged.
Update docs/model-results.md, docs/pipeline-performance-review.md and the
packaged skill references; add stage, opencode and server fixtures.
With a day's sessions the list was a flat, unsearchable wall in recency
order, so the chat the operator wanted was the one that could not be
found, and sessions of one repository were scattered through it.
Narrow the list as the operator types and keep same-repository chats
together, using the control and empty-state patterns the other lists
already use:
- ChatListFilter.kt adds the one pure derivation: sessionMatchesQuery /
filterChatSessions match a case-insensitive substring over a session's
title and directory, a blank query narrows nothing, and the survivors
keep their incoming (recency) order. groupChatSessionsByDirectory groups
the narrowed list by directory, each group keeping that order and the
groups ordered by their first (most recent) session, so the top still
leads with the newest activity.
- ChatState.sessionQuery (set through ChatStore.searchSessions /
AppViewModel.setChatSessionQuery) is a display narrowing only: the
server's list, open conversations and the activity marks are untouched.
filteredSessions is visibleSessions narrowed by the query.
- ChatListPane renders the existing FilterMenu with one OutlinedTextField
and a Clear search reset (the pipelines/runs filter pattern), shows a
directory heading per group only when more than one directory is
present, and renders the shared EmptyState ("No chats match ...") with
a Clear search action when nothing matches. The trailing New chat
action is never hidden while the list is narrowed, and every row still
shows its directory.
Tests (ChatListFilterTest, 9 cases): the match rule over title and
directory, that a narrowing preserves the recency order, grouping by
directory (order by the first session, order kept inside a group, a
single directory yields one group, a blank directory groups too), and
through the store that searching narrows filteredSessions, clearing
restores the full list, the server's list is untouched and a filtered
session still reports its activity mark.
Checked before commit: android/README.md was updated in this change with
the behaviour, tests and evidence. The packaged authoring skill references
(internal/author/skill/references/) document the Pipelines server, its
chat_* protocol surface and authoring, none of which changed - this is a
client-side narrowing over the already-listed sessions - so none needed
updating, and the internal/author/install.go managed reference inventory
is unchanged. No repository template or root/topic doc describes the
Android session list, so none was stale.
android/ only; no dependency added beyond the already-declared
material-icons-extended; no run is started from the app.
With several operator sessions the list gave no sign of where a reply
arrived: an idle chat and one streaming a reply right now looked the same,
so the operator lost the conversation they were in.
Add a per-session read state that the session list derives from data it
already receives, and render it as a three-state activity badge:
- ChatSeenState (ui/chat/ChatSeen.kt) keeps a per-session recency watermark
(the newest updated_at the operator has read) plus the ids that moved on
while the app was open. It is persisted as one opaque JSON preference
(SettingsRepository chat_seen, observed by AppViewModel.observeChatSeen),
the same way ChatSessionOverrides is, so the marks survive a restart and
not only a reconnect.
- ChatState.isUnseen marks a background session that carried a live mark
(a pushed chat_event/permission frame) or, if never opened here, is newer
than its stored watermark; first sight of a session is seeded to its
current recency so a pre-existing chat is not reported as new. Opening,
activating and closing a conversation reads it and clears the mark;
history for the active chat advances the watermark to the newest server
message. No server request is added.
- ChatFormat.sessionActivity(running, unseen) is the one pure derivation
(streaming outranks finished-unseen, which outranks idle) and
SessionActivityBadge renders it as Streaming/New/Open beside the
unchanged kind chip and directory line. Most-recently-used order is
untouched.
Tests (ChatActivityTest): unseen is marked, opening clears it including in
the persisted state, the derivation distinguishes streaming/finished-unseen/
idle, and the seen state survives an encode/decode into a fresh store.
Checked before commit: android/README.md was updated in this change with the
behaviour, tests and evidence. The packaged authoring skill references
(internal/author/skill/references/) describe the Pipelines server and its
chat_* protocol surface, neither of which changed - this is a client-side
derivation over existing frames - so none needed updating, and the
internal/author/install.go managed reference inventory is unchanged. No
repository template or root/topic doc describes the Android session list,
so none was stale.
android/ only; no dependency added; no run is started from the app.
Let the operator attach one or more files to the next chat message and send
them with it. The platform multi-document picker returns content URIs; the app
resolves only each file's name, size and MIME (confirming it can be opened) and
holds the attachments per chat, exactly like the draft. Nothing is read or
transmitted until the message is sent.
- Composer: an attach action, a strip of removable chips (image thumbnail or
file glyph, name, size, remove), and a send that is blocked while any
attachment is flagged.
- Wire: one shared builder, ChatProtocol.promptRequest(sessionId, text, files),
carries the attached URIs on the chat_prompt frame, in attachment order and
omitted for a text-only prompt so that shape is unchanged.
PipelinesRepository.chatPrompt takes the same list.
- Transcript: a sent turn carries each attachment as a ChatProtocol.PART_FILE
part, drawn through the existing UserParts -> FilePart display path rather
than a second rendering.
- Honest failures: an unreadable or over-24-MiB file is attached with its reason
and blocks the send; a server rejection takes the optimistic bubble back out
and returns the files flagged with the server's message. Attaching never
transmits on its own, and attachments clear once the message is sent.
Review follow-ups in the same slice: the composer now uses ui/Format.kt's
humanBytes instead of a duplicate formatter; optimistic user-turn ids come from a
monotonic counter so removing a rejected turn cannot re-mint a live key;
restoreAttachments keeps a file attached between send and rejection; the
thumbnail decode catches Exception rather than Throwable.
Checks made for this commit:
- The change is android/ only; the server, its Go source, the installer and the
Docker files are untouched, no run is started from the app, and no dependency
was added beyond the already-declared material-icons-extended.
- Packaged authoring skill references (internal/author/skill/references/): no
update needed. operations.md documents the brokered chat server, which this
change does not alter; the server still stores user turns as text and ignores
the prompt's files, so that reference stays accurate.
- Packaged templates (internal/tui, internal/server) and the root README/topic
docs: no update needed; none describes the Android chat composer. The
Android-facing documentation lives in android/README.md, which this change
updates with the attachment slice, its known server-side gap and its tests.
Tests: ChatAttachmentTest (5 cases), ChatAttachmentStateTest (5 cases) and a new
ChatProtocolTest case cover building the request with attachments (and omitting
them for a text-only prompt), removing one, the unreadable and oversized paths,
which files travel with the prompt, the optimistic turn's file parts, clearing
after send, and the rejected path restoring the files flagged. Verified by the
review stage with gradle --offline --no-daemon :app:testDebugUnitTest
:app:assembleDebug -> BUILD SUCCESSFUL, 487 tests / 0 failures / 0 errors /
0 skipped.
Opening a conversation used to start at the top, so the operator first had to
scroll down past everything already said to find the current turn. The
transcript now opens at its newest message, follows it while the operator reads
the newest part, and offers a jump-to-latest affordance when they have
deliberately scrolled up instead.
- Opening at the newest message. The transcript's list state is created the
moment the conversation first has content, with its first visible item set by
chatFirstScroll (ui/chat/ChatScroll.kt): a position the operator left is
restored and clamped with the app's shared rule (restoredScrollAnchor), and
every other conversation starts at its newest item. "A position of their own"
is explicit now: ChatThread.scroll is nullable, null meaning the operator has
never left a position here, so a chat left at the very top
(ChatScrollPosition(0, 0)) is restored rather than mistaken for "new", and a
list state that never held content saves nothing. Placement is unanimated, on
the list's first measure, and goes through the one scroll path below.
- One scroll path, changed deliberately. The existing follow scroll, the app
bar's approval jump and the new jump-to-latest all go through
LazyListState.scrollToEnd(itemCount, animated); when the newest item sits
entirely below the fold it is brought in first, and any part still below is
then closed by exactly that distance (closeBottomGap). An item already partly
visible is only gap-closed, so following a growing stream never bounces. The
distance is measured against the transcript's content count
(chatBottomDistancePx), not the layout's stale count, so an item appended
ahead of the measure that shows it actually arrives in view.
- Follow while reading the newest part. Only the operator's own drag changes
following (a DragInteraction.Start stops it, a settling Stop/Cancel resumes it
at or within the threshold, chatFollowsAt); while it holds, an arriving
message, a streamed delta, a tool chip, a freshly arrived approval card, a
grown composer or the appearing keyboard re-follows smoothly. The item count
is read at use time (rememberUpdatedState) so a captured count cannot go
stale. Programmatic scrolls never touch the list's interactionSource.
- Threshold. CHAT_FOLLOW_THRESHOLD_DP (ui/theme/Dimens.kt) is 32dp: about one
comfortable line of text.
- Jump to latest. A small Material 3 SmallFloatingActionButton (the
already-declared KeyboardArrowDown icon, on the shared gutter token) is offered
only while the view is not following and there is genuinely something below the
fold (chatShowJumpToLatest), hidden at the bottom or for an empty transcript;
tapping it re-engages the follow. A pending permission/approval is still
brought into view as the existing code did - it is the transcript's last item,
so the follow brings it in while the operator reads the newest part, and the
app bar's approval action still jumps straight to it.
android/ only: no dependency added beyond the already-declared
material-icons-extended, no run is started from the app, and no Pipelines
server, Go source, installer or Docker file is touched.
Checks: the packaged authoring skill references need no update - they document
the Pipelines server's own contract, not the Android client, and this change is
app-side only, so nothing in them became stale. There are no packaged templates
in this repository. The repository's topic doc for the client, android/README.md,
is updated in this change with the flow, the threshold, the one scroll path and
what remains unverified on a device.
Verified by the review stage on this tree: gradle --no-daemon
:app:testDebugUnitTest :app:assembleDebug -> BUILD SUCCESSFUL, 50 suites / 458
tests / 0 failures / 0 errors / 0 skipped (including the new ChatScrollTest, 11
cases), and the published APK matches the freshly built app-debug.apk
byte-for-byte.
Both sides are reviewed work and both are kept:
- android/app/.../ui/AppViewModel.kt: HEAD's live-run push wiring
(RunStreamState/_runStream, combine(connectionState, settings.workspace),
subscribeRuns/streamDown/resync, applyRunEvent, scheduleRunsResync/
scheduleRunDetailSync, observeRunEvents) together with lane-chat2's chat
management (ChatStore overrides, observeChatOverrides, refreshChatDirectories,
startNewChat/selectChatDirectory/cancelNewChat/createNewChat,
renameChat/removeChat/undoRemoveChat). The only textual conflict was the
import list; combine (HEAD) plus map and ui.chat.ChatSessionOverrides (lane)
are all kept and all used. No duplicated definitions.
- android/README.md: HEAD's "Live run updates from the socket" section and
lane-chat2's "Operator chat sessions: choose the directory, list only your
own" section are both present once, in file order.
- The rest of lane-chat2's chat files (ChatDirectories.kt, ChatOverrides.kt,
ChatStore.kt, ChatScreen.kt, ChatFormat.kt, protocol Chat/Message, repositories,
tests) merge cleanly on top of HEAD's work.
Documentation check: android/README.md is updated by this merge and its new
section is consistent with HEAD's. docs/cli.md and
internal/author/skill/references/operations.md already describe the server's
chat_sessions/chat_create/chat_directories surface this client builds on, and
the authoring skill (SKILL.md, references/) contains no Android-client behaviour
to stale, so nothing there needed changing and no packaged reference or
inventory entry was touched. No server, installer or template change is part of
this merge.
Checks (android/, Gradle 8.11.1, --offline):
- gradle :app:testDebugUnitTest --offline --rerun-tasks -> BUILD SUCCESSFUL;
test-results report 463 tests, 0 failures, 0 errors across 50 suites
(including ChatDirectoriesTest and ChatSessionManagementTest).
- gradle :app:assembleDebug --offline -> BUILD SUCCESSFUL (debug APK built).
Not verified here: on-device picker/rendering, which the visual-review stage owns.
Starting a chat now asks where first, and the session list is the operator's
own chats alone, told apart by the server's own tag.
- The create flow is a normal pane of the chat stack, not a modal: it loads
the server's chat_directories (home first, then the directories of previous
operator sessions, most recently used first) into the shared ListRow, each
with its full path, and starts on the operator's home
(directoryChoices/defaultDirectoryChoice). Back, the app-bar back control,
the footer Cancel and predictive back all leave it without creating
anything. chat_create is always sent the chosen directory (HOME_DIRECTORY
"~" for home, the absolute path for a recent), so a session is never
created in the server's working directory; the server resolves or rejects
it and its error is shown in the pane.
- The list renders ChatState.visibleSessions: exactly the server's
chat_sessions (operator sessions only) with the operator's own local
changes applied; the app adds no ownership guessing. Each row shows its
directory and the kind chip derived from the server's tag
(sessionTagLabel, "operator" -> "Operator"); another tag shows verbatim,
an untagged session shows no chip.
- The brokered protocol exposes no chat rename or delete (no
chat_rename/chat_delete type and no session endpoint), so both are
device-local and persisted with the other settings
(ChatSessionOverrides, KEY_CHAT_OVERRIDES): rename stores a local title
that wins on later list loads, and "Remove from list" hides the row and
closes its conversation with an Undo snackbar ("Removed from this list;
the chat stays on the server."). Nothing is deleted on the server.
- Messages, streaming replies, tool chips, diff cards, approval cards, stop
and the reconnect path are unchanged.
android/ only: no dependency added beyond the declared
material-icons-extended, no run is started from the app, and no Pipelines
server, Go source, installer or Docker file is touched.
Checks: the packaged authoring skill references need no update - the server
contract this builds on is already documented in
internal/author/skill/references/operations.md ("Brokered OpenCode chat",
committed with lane-chatsrv) and this change is app-side only, so nothing in
it became stale. There are no packaged templates in this repository. The
repository's topic doc for the client, android/README.md, is updated in this
change with the new flow, the honest local rename/removal and what remains
unverified.
Verified: gradle 8.11.1, JDK 17, --offline --no-daemon, from android/;
:app:testDebugUnitTest :app:assembleDebug -> BUILD SUCCESSFUL, 447 tests in
50 suites, 0 failures, 0 errors.
Replace the Android app's one-second run poll with the server's
workspace-scoped run_event pushes. The runs list, each pipeline row's
last-run line, the run header and the run detail (status, timeline,
stages, artifacts) now advance from the socket instead of polling or a
manual refresh.
- Wire: Message.kt mirrors internal/protocol/runevents.go (subscribe,
unsubscribe, run_event; RunEventFrame/RunStepDelta). The frames are
unsolicited and already arrive on the client's events stream;
PipelinesRepository.subscribeRuns/unsubscribeRuns add the typed
command, sent via a new PipelinesClient.sendOnly that does not hold the
send lock waiting for the running server's unreliable subscribe ack.
- One pure fold: ui/RunEvents.kt folds a frame into the list (in place,
order preserved) and the open detail with one shared status ladder and
one shared run-field merge. It is monotonic (a stale or duplicate
delta is dropped whole), reports needsResync for a run the list does
not hold instead of inventing a row, and only requests a full get_run
for a settled step or terminal run.
- Wiring: AppViewModel subscribes once per (re)connect and workspace;
every (re)subscribe re-reads the list and open detail once, because the
deployed server's subscribe snapshot is partial, then folds the pushes
on top. Re-reads are push-driven, coalesced and keyed so no push is
dropped and no timer remains. LiveBadge (RunStream.kt RunStreamState)
shows honestly live/reconnecting/not live, confirmed by the ack, a
push or a successful read and dropped when a read fails.
- ui/RunEventsTest.kt pins the delta sequence as pure cases: created run
not in the list, step started, step finished, run finished, unknown
run, duplicate/out-of-order deltas, and a reconnect resync.
- android/README.md records the change, the wire mapping and the
observed limitation of the running server (partial snapshot, no ack
within 30s), which the client tolerates without inventing a stream.
Checked where the change belongs: android/README.md gained this entry;
docs/cli.md described the Android app as still polling, which this makes
stale, so that sentence now says the app consumes the pushes while the
TUI still polls. The packaged TUI pipeline templates (internal/tui) do
not touch run-state refresh and need no change, and the packaged
authoring skill references (internal/author/skill/references) document
the authoring workflow, not the Android client's run updates, so none of
them needs updating.
Reviewed and approved by the run's review stage (build, unit tests,
Kotlin compile and lint in android/README.md); no merge/rebase/cherry-pick
was in progress and no conflict was present.
chat_sessions used to list exactly the OpenCode sessions the pipelines own,
filtered through pipeline.SessionOwner (run_steps/run_session_owners), so an
operator-created chat was an accident of the run-ownership table and the
operator's working sessions were mixed with the internals of running pipelines.
Add a first-class operator session:
- internal/pipeline/operator_sessions.go: a dedicated operator_sessions table
(session_id PK, directory, title, tag, created_at, last_used_at) with
RecordOperatorSession (upsert preserving created_at), a one-statement
TouchOperatorSession (no-op for a non-operator id), OperatorSessions bounded to
128 rows most-recently-used first, and OperatorDirectories (bounded MRU,
deduped). run_steps/run_session_owners and SessionOwner/OwnedSessions are
untouched.
- internal/server/chat.go: chat_sessions returns operator sessions only - it
reads the registry once, intersects it with one broker session-list call, fills
directory/tag/created/updated from the registry, sets busy for a session held
by another connection, keeps MRU order, and stays fail-closed (empty list, never
the endpoint's whole list). A pipeline stage session and an untagged row can
never be listed. chat_create resolves the directory (empty/'~'/'~/...' ->
operator home; relative or missing rejected before any OpenCode call), calls
broker.Create(title, resolved) and records the row with the operator tag.
chat_directories returns home first then bounded (8) deduped recents. A
successful prompt touches the operator session without affecting pipeline
prompts.
- internal/opencode, internal/protocol, internal/server/websocket.go and
message.go: unscoped session list, Create posts {"title":...,
"location":{"directory":...}} to POST /api/session, additive protocol fields
(omitempty) and the ChatDirectories request/response, plus the OperatorRegistry
option defaulting to the first store. One OpenCode transport per server is
unchanged.
Docs and references: docs/cli.md gains a "Chat sessions" section documenting the
operator-only fail-closed list, directory defaulting/rejection, chat_directories
(home first, deduped, bounded 8) and why a dedicated request was chosen.
internal/author/skill/references/operations.md's stale "Brokered OpenCode chat"
text (chat_create unbrokered, run_steps filtering, "listed the owned scratch
session" evidence) is rewritten to the operator-session registry, the fail-closed
filter, directory defaulting and the corrected live-test wording. No new
reference file, so internal/author/install.go's inventory is unchanged.
Checked for staleness elsewhere: README.md, the docs/ topic pages and the
packaged server/TUI templates carry no chat-session ownership claims, so none
needed updating.
Verified: gofmt -l clean; go vet and go build ./... clean; go test -count=1
./internal/pipeline/... ./internal/protocol/... ./internal/opencode/...
./internal/server/... and the full go test -count=1 ./... pass.
Combine the two reviewed versions of the Android artifact gallery/viewer.
- ArtifactViewer.kt: keep lane-c's gallery-wide paged full-screen viewer
(artifacts/index/configuredServerUrl/onIndexChange overload with paging
gestures, header, page buttons, share action and video-frame support) and
re-add HEAD's single-artifact overload (url/name/fetchBytes/onDismiss/video)
as a thin wrapper so StageVerdict still compiles and works.
- Artifacts.kt: keep lane-c's gallery-owned single viewer + onOpen callback and
compose HEAD's all-artifacts-as-tiles grid (media tiles open the paged viewer,
non-media open externally, selection and per-item share/copy preserved).
Checked: no conflict markers remain in any affected path. android/README.md
already carries the new "Page between artifacts in the full-screen viewer
(17 Oct 2026)" section documenting this change; the packaged templates, the
top-level README and topic docs, and the packaged authoring skill references
are not made stale by this Android-client UI change, so nothing further needs
updating.
The full-screen viewer becomes a pager instead of a single image with no
way to reach its neighbours.
- ArtifactGallery now owns the one viewer instance over pagedArtifacts(groups)
-- the grid's image artifacts in the order the grid draws them -- and each
tile opens the position it holds in that list via viewerIndexByUrl, so the
grid and the viewer derive their index from one source (previously a second,
untested per-tile counter and a per-tile viewer that had no neighbours).
- A horizontal drag or flick in ArtifactViewerBody moves to the previous/next
artifact: pagedIndex moves by one and clamps at both ends without wrapping,
a single-item gallery is inert, and canPageAtScale pages only at fit so a
zoomed image pans via the existing zoomAbout/clampImageOffset as before.
Previous/next IconButtons (disabled at each end) keep both neighbours
reachable without a swipe, and the header shows "N of M · type" while the
open artifact's own content, type icon, name and actions reload per artifact.
- Pure helpers pagedArtifacts, viewerIndexByUrl, pagedIndex, canPageAtScale and
artifactViewerPositionLabel are added to ArtifactViewer.kt; ArtifactViewerTest
covers next/previous, clamping at both ends, a single-item and an empty list,
a zoomed viewer that does not page, the paged order versus the grid's draw
order, and the per-artifact position label.
Placement check: the Android topic doc android/README.md is updated in this
commit with a section describing the pager, its gesture rule and the recorded
build/test checks. No packaged template and no packaged authoring skill
reference (internal/author/skill/references/*, internal/author/install.go's
inventory) documents the app's full-screen artifact viewer, so none needed
updating.
Only the four files this run changed are staged. The unrelated uncommitted
covered-pane statistics and list-load-phase edits (SlidingPaneStack.kt,
States.kt, Dimens.kt, LoadPhaseTest.kt) and the untracked scratch files in the
worktree belong to other changes and are deliberately left uncommitted.
Combine the two reviewed versions of docs/pipeline-performance-review.md.
- Local (main) review: the exact 201939-byte runs.json capture, the three
final_result_validation sub-shapes, and the 5-to-4 unresolved busy-wait
correction.
- Incoming (lane-t2) review: both captures (artifacts/222/2 and
artifacts/222/4), both stat snapshots (134 succeeded / 3 active and
135 succeeded / 2 active), plus the server-side rejection, deploy-wait,
device-lock and refined improvement-ranking analysis.
Checked: no conflict markers remain anywhere in the tree and the two sides are
composed without duplicated headings or dead text. This is a documentation-only
change to a dated analysis document; the packaged templates, the README and
topic docs, and the packaged authoring skill references are not made stale by
it, so nothing further needs updating.
Combines lane-go's typed omni search, launch-time model overrides, TUI
artifacts view, run-state websocket push, and the "reflect the change where
it belongs" committer rule with the Templates gallery, chat/omni-search and
other reviewed work already on main. The 12 files both sides touched keep
both intents composed rather than dropping either side: the omni search keeps
the typed search contract (CLI `pipelines search` and the TUI popup with type
badges and marked snippets) alongside the run-list quick filter; cli.md and
ui-ux-review.md document both the search rework and the artifacts view;
orchestration.md, harnesses.md and operations.md keep the model-override and
reflect-where-it-belongs guidance; and the protocol/CLI/server/TUI code keeps
the new search, run-event, override and artifacts paths alongside the existing
run, title and help surfaces.
Checks before committing:
- go build ./... -- pass
- go vet ./... -- pass
- go test -count=1 ./internal/... ./cmd/... -- all pass
Doc check before committing: nothing needs updating. The lane's own docs and
references (docs/cli.md, docs/ui-ux-review.md, and the orchestration,
harnesses and operations skill references) already carry the new features.
format.md and the packaged templates already describe the line-oriented result
format and the human decision stage from the earlier lane-go merge. The root
README already describes the omni search popup. Model overrides, the search
command, run events and the artifacts view are runtime/CLI/TUI surfaces that
cli.md documents; no template, README or topic-doc edit is required by this
merge.
The installed OpenCode 2.0.20 exposes the authenticated SSE event firehose at
/api/event and the /api HTTP surface, but Detect selects backend "v2" and Open
returned no owned process/URL, so chat stayed disabled and every chat_* request
was answered with "chat is not configured on this server".
Add opencode.OpenStream/OpenChat: for either backend they start the single owned
opencode serve process, discover the loopback URL and verify the backend health
contract (/api/info for v2, /global/health for v1). main and the live test share
OpenChat so the selection cannot drift. Chat now streams real incremental
session.text.delta/session.reasoning.delta frames via the existing
Connection.EventStream + NormalizeChatEvent, with no polling and no fake
streaming.
- Authenticate the owned endpoint with the per-backend user (opencode for v2,
pipelines for v1); the v2 server ignores OPENCODE_SERVER_USERNAME.
- Send the V2 prompt shape {"text":...}, which the v1 translation also accepts.
- Skip firehose event types the adapter does not surface before decoding their
data, so session.instructions.updated (delta is an object) no longer fails the
stream.
Unit tests cover the per-backend user, the prompt shape/auth, the captured real
V2 event shapes and the selection guards. An opt-in live test drives
chat_sessions/chat_messages/a completed chat_prompt/an interrupted chat_prompt
against the installed OpenCode. Update the packaged operations reference with the
realized capability, dated evidence and deployment state.
Checks before commit: the packaged authoring reference
internal/author/skill/references/operations.md is updated in this change; no new
reference file was added, so internal/author/install.go's managed inventory is
unchanged and the internal/author tests pass. No packaged template describes the
brokered chat surface, and neither README.md nor the topic docs under docs/ (nor
web/) document it, so none of them needed updating.
Combines lane-c's Templates gallery and detail view with the chat and omni-search work already on main (lane-t2). The three files both lanes touched keep both intents: AppViewModel.kt keeps refreshTemplates/createFromTemplate alongside the search/chat flows, PipelinesApp.kt keeps both the Templates and Chat destinations, and graph/Artifacts.kt adopts the shared galleryGrid fitting while keeping the tile-gallery refactor.
Doc check before committing: nothing needs updating. This is an android/-only merge. The app's topic doc (android/README.md) already documents the Templates destination (lane-c) and the Chat/omni-search work (lane-t2). The root README and docs/ describe the server CLI/TUI (whose :templates catalog is a separate surface) and are unchanged. The packaged authoring skill references (internal/author/skill/references/) mention the Android client only for APK-delivery mechanics, which this change does not alter, and the packaged templates are server-side and untouched.
The server's template catalog (the list_templates command) had no surface in
the app. This adds a Templates destination to the shared SlidingPaneStack: a
measured card gallery (name, short description, stage count and its own glyph;
one column narrow, a fitting grid wide) and a detail pane that reuses the
pipeline detail's Summary/Graph/Source tabs, plus a create-from-template action
that submits a create-only draft. Stage counts come from a source the server
parsed (validate); a source that does not parse is still viewable as raw
markdown.
Added: Templates.kt (TemplateEntry/TemplateCard, the grid-column and
stage-count mapping), components/GalleryGrid.kt (the shared measured-gallery
fitting, extracted from the artifact gallery), graph/SourceView.kt
(PipelineSourceView, the one rendered-definition view, extracted from
PipelineDetailScreen), screens/TemplateGalleryScreen.kt,
screens/TemplateDetailScreen.kt, TemplatesTest.kt.
Changed: PipelinesApp.kt (the Templates destination), AppViewModel.kt
(refreshTemplates/createFromTemplate), data/PipelinesRepository.kt
(listTemplates/validateSource/createPipeline), graph/Artifacts.kt (use the
shared galleryGrid), PipelineDetailScreen.kt (use the shared
PipelineSourceView), ArtifactGalleryTest.kt (exercise galleryGrid).
Doc/state check before committing:
- android/README.md (the app's topic doc): updated. Added a Features bullet for
the Templates destination and a dated "Templates: a gallery and a detail view"
section, matching the per-feature convention every prior android change uses.
- Packaged templates: not touched. The server's templates are Go-side and the
brief forbids touching the Pipelines server; this change only renders the
catalog the server already exposes.
- Packaged authoring skill references (internal/author/skill/references/): not
updated. They document the Pipelines harness, not the Android app, and this
change adds no harness runtime behaviour.
- Root README and docs/: not updated. They document the CLI/TUI/server, which
are unchanged; the Android app is documented in android/README.md.
No conflict was present: no unmerged paths and no unfinished merge, rebase or
cherry-pick, so nothing needed resolving.
Deliberately left uncommitted (other work this run did not touch, not staged):
the worktree's other WIP - components/ListScroll.kt and screens/PaneStats.kt with
their tests, and the uncommitted edits to components/SlidingPaneStack.kt,
components/States.kt, theme/Dimens.kt and components/LoadPhaseTest.kt - plus the
untracked .ui-review-*/ capture artifacts.
Bring the packaged starters and the pipelines skill up to the guidelines the
project now works to.
Templates:
- task and three-stage now end in a committer stage that stages the union of the
runner's captured input.server_changed_files and the producer's declared
changed_files, runs the repository's checks, commits locally and never pushes;
their producers no longer commit.
- Every model/agent prompt states the line-oriented result contract (outcome on the
first non-empty line, "# output" JSON map, other "# <heading>" sections kept
verbatim as evidence) and an "# evidence" section for exact commands and results,
with proportionate verification and no fabricated checks.
- Stages that can write save their reports, logs and screenshots into the runtime
artifacts directory.
- Remove the summary starter: a tool-free single-prompt text transform with no
repository interaction, artifact or commit is a format demonstration, not a
reusable workflow. No starter invents a pretend approval stage; a decision point
is a type=human stage.
Skill:
- references/format.md gains a Result format section (line form, legacy JSON
precedence, result_parse, raw-output.md, artifacts) and a Committer stages
section with the pre-commit checklist; the role-split and envelope notes mention
the line form and the committer.
- orchestration.md points at the checklist and records that a genuine gate is a
human stage; operations.md and the SKILL.md index drop the removed starter and
name the result format and committer. No new reference, so the managed inventory
is unchanged.
Docs/tests: examples/README, README, docs/cli, docs/first-version-testing, the CLI
help example and the smoke script track the four starters; catalog, tool-role,
server, tui and pipeline tests are updated, with a new test pinning the committer
ending and server-captured change set.
Commands run: go build ./...; go vet ./...; go test ./...; python3 -m unittest
discover -s scripts -p 'test_*.py'; python3 scripts/smoke-first-install.py. All
passed. Templates inspected through an isolated CLI server (pipelines templates;
pipelines template KEY --source). No server, service or device was restarted, and
nothing was pushed.
Expanding a stage section drew its rows stacked at the section's origin:
CollapsibleSectionBody passed the section's several field composables straight
into AnimatedVisibility, which lays out a single child, so the rows overlapped at
the top of the section and only the last was visible. The shared body now wraps
its content in one full-width Column, so any multi-row section stacks its rows
under its header.
Every stage section now opens as its own pane rather than growing the stage
screen inline:
- PaneState: add the Section pane level (MAX_PANE_DEPTH = 3) and a saved
sectionKey primitive, with backStep/popTo/encode/decode handling so one Back or
peek pops exactly one level and the open section survives rotation and process
death.
- StageDetailPane: the stage screen keeps a compact collapsed list of its
sections (Artifacts, Output, Input, This run, Stage definition); opening one
shows it as a full-window surface over the stage on a narrow window, or a panel
to the right of the stage pane on a wide one, with its own Scaffold/TopAppBar
title, its own scroll and its own top spacing.
- SectionHeader: a navigation mode for those rows - a static forward chevron
(mirrored for RTL) and an "Open <section>" action instead of a rotating
disclosure chevron and "Expand/Collapse", so assistive tech is not told the row
expands in place. The detail screens' disclosure rows are unchanged.
- DetailTabs: drop the rememberSectionExpansion initiallyExpanded seed, whose
last caller was the inline stage definition.
- Tests: cover the Section level's backStep, popTo, encode/decode and depth, and
the shared stageSectionSpecs order and blank-section cases.
Sections still start collapsed, the operator's choices still persist, and each
section's content is unchanged. android/ only; no dependency was added.
Also in this diff, from the covered-identity statistics work: PipelinesApp passes
compactStats = true on its two stacks (SlidingPaneStack's statistics flag).
The packaged authoring skill's orchestration reference now tells an author
to carry the check from the brief into the pipeline: before committing, the
committer verifies the change is reflected in the packaged templates, the
repository's guidelines (README and topic docs) and the packaged skill
references, updates anything stale, and states in the commit body what was
checked or that nothing needed updating.
- brief-writing section: add a "Where it belongs" item to the brief and
renumber the hard-constraints and publishing items.
- hard-constraints block: add a "Reflect the change where it belongs" bullet.
- Pipeline choice: extend the committer bullet with the same pre-commit
check, keeping the existing rule that the committer stages only the run's
changed files.
Checked before committing: the change is prose in the packaged skill
reference, so no template, README or topic-doc edit was needed; the eight
pipelines carrying a committer stage were republished with the same rule in
their committer prompt (not tracked in this repository); no other reference
is stale.
Add a server-pushed run_event frame so a client no longer has to poll
once a second to notice run changes.
- protocol: RunEventFrame/RunStepDelta compact delta (run id, workspace,
status, outcome, current stage, completed-step count, timestamps and an
optional single step delta), plus subscribe/unsubscribe/run_event types
and the optional RunEvent/RunIDs message fields. All fields optional so
older peers ignore them.
- server: runEventHub with per-connection subscriptions scoped to a
workspace (and optional explicit run ids), one bounded writer goroutine
per subscription, slow-subscriber drop, per-client subscription cap and
a ~220ms per-run coalescer that flushes pending deltas before a terminal
frame.
- runner: emit deltas on created/queued, queued->running and step start,
human waiting, step finish (outcome, target, diagnostic, artifacts and
completed count), terminal finish, cancel of a waiting run and
decide/resume; emitRun is a no-op without a hub.
- websocket: subscribe seeds current state before the ack, unsubscribe and
connection teardown drop subscriptions, and pushed frames reuse the
connection write closure.
- tests: protocol golden-JSON wire shape plus websocket coverage for the
started-run frame sequence, subscribe current-state snapshot, silent
unsubscribed/never-subscribed clients, workspace isolation and a
bounded coalescing frame count.
- docs: note subscribe/unsubscribe/run_event in docs/cli.md; TUI and
Android still poll in this release.
The Artifacts view re-clamped its scroll offset to the selected row on every
render, so the tail of the list - a trailing visit that recorded none (running
or finished) and its capture summary - could never be brought on screen, and
the image marker crowded out artifact names at narrow widths.
- Decouple the scroll offset from the selection: add PgUp/PgDn (and ctrl+u/
ctrl+d) paging, and make G/end select the last artifact and scroll to the
tail so a trailing visit stays reachable.
- Share artifactContent/clampArtifactTop/revealArtifactSelection between
selection and render so both agree on the same page.
- Show the [img] marker only while the width still leaves room for a usable
name, keeping columns aligned either way.
- Advertise the scroll keys in the artifacts footer help.
- Test the omitted-files capture wording, trailing-visit reachability via
G/end and page scroll, and narrow-width no-overflow; render both the top and
the scrolled tail in the env-gated live capture test.
- Update the packaged operations reference for the A artifacts view.
Protocol: replace the loose Query/Kind/Matches/Limit search fields with a Search request object and a SearchResults response, and have the server answer search from Store.Search over the shared run projections (runFrom/runStamps).
CLI: add the read-only 'pipelines search QUERY [--type KIND] [--limit N] [--json]' command with usage/help, and document the typed targets, ranking and bounds in docs/cli.md.
TUI: the '/' popup keeps type-to-search, up/down, Enter and Esc, renders one ranked list with kind badges and a bracketed (non-colour) match snippet, and Enter opens the matched pipeline, run, step, artifact or field; footer text updated to match.
TUI: add a dedicated run artifacts view ('A') with open/copy of recorded files, and move artifacts out of the run-detail File changes section (artifactCaptureNotes).
Tests: add Store.OpenReadOnly for read-only inspection of a live database plus pipeline/server/TUI search tests and artifacts tests, including env-gated live checks.
The committer staged only the implementer's self-declared changed_files,
so an incomplete declaration silently left part of the approved change
uncommitted. The runner already records the run's real changed paths by
comparing the working tree around each step; publish that set to the
committer.
- runState gains an unbounded, deduplicated, first-seen-ordered captured
path accumulator (capturedPaths/capturedSeen), distinct from the bounded
changedPaths sample used only by the UI-surface skip reason.
- recordChanges folds each captured FileChange path into it in the existing
single pass, so no second walk and no new I/O.
- publishServerChangedFiles writes the set into the input memory value as
input.server_changed_files, called before memoryInput so the binding
always resolves (an empty list when nothing was captured) and only stages
that select it receive it. rebuildRunState rebuilds it from persisted
completed steps, so a resumed run hands the committer the same evidence.
- Tests prove the committer receives the captured set distinct from and
additive to the implementer's declared changed_files, that an omitted
path is still present, and that the field is an empty list when nothing
was captured.
- control.md and orchestration.md document the reserved field and instruct
the committer to select input.server_changed_files alongside the declared
changed_files and stage their union.
Commands run: go build ./...; go vet ./...; go test -count=1
./internal/server/... ./internal/stage/...; go test -count=1 ./internal/author/...;
go test -count=1 -run TestCommitterReceivesServerCapturedChangedPaths ./internal/server/.
All passed. go.mod/go.sum unchanged.
A planner had no machine-readable view of the tool set later stages would
have, so it could emit acceptance checks that required tools (shell) the
implementer was not permitted, causing a blocked run.
modelPrompt now emits exactly one authoritative line naming the stage's
permitted tools, derived from the definition via the new effectiveTools
helper. effectiveTools reuses ToolNames: a present tools block, including
an explicit empty one, is returned as parsed; an absent block yields the
legacy mutating read/glob/grep/edit/shell bundle so it is never
misrepresented as empty or read-only. The bundle is declared once as
legacyTools and reused by tools.go, agent.go, pi.go and permissions.go.
The redundant client-side strings.Replace of the tools line is removed
from AgentClient.Generate and PiClient.Generate; the agent-only guidance
sentence is preserved by appending it in agent.go, and Pi appends a short
mapping line derived from piTools. Edit-scope and permitted-shell text,
routing, review, budgets and retries are unchanged.
Adds internal/stage/model_prompt_test.go covering explicit, absent and
explicit-empty blocks plus derivation edge cases, and a guard that the
agent prompt still carries the tools, edit-scope and shell-command text.
Add `pipelines run --model PROVIDER/MODEL` and repeatable
`--stage-model STAGE=PROVIDER/MODEL`, resolved with precedence
per-stage > whole-run > the model pinned in the pipeline version.
- A shared pure resolver (`pipeline.ParseModelOverride` /
`pipeline.EffectiveModels`) owns the precedence and validation: every value
must be a `provider/model` pair (`stage.ValidModel`), every stage key must
exist in the pinned graph, an unknown key fails naming the valid keys, and a
per-stage key that names a non-model stage is refused.
- The server validates against the pinned version before admission (no run row
is ever inserted for an invalid request), persists `model`/`stage_models` on
the run and `provider`/`model` on each step, applies the effective pair to a
clone of the stage definition so the stage and its repair/formatter path share
it, overlays the returned run graph with the effective pair (presentation
only), and reuses the recorded overrides on retry.
- The run record echoes the overrides it was launched with and each step records
the provider/model it actually ran with; the TUI Evidence pane renders that
effective pair. The pinned pipeline version and `show --version N` are never
modified.
- CLI help, `docs/cli.md` and the packaged authoring skill references document
the flags and the precedence. A TUI override picker remains a documented
follow-up; the CLI is the deliverable.
Tests: pure precedence/validation table tests, store round-trip and
request-key-mismatch plus migration, server admission/application/overlay/retry
with a controlled executor, CLI flag/help/malformed-value tests, and a TUI
evidence test.
A stage declaring a `skipped` outcome is short-circuited with no model call
when the run's recorded file changes and artifacts touch no UI surface
(android/, internal/tui/, a presentation extension or an image artifact).
The step is recorded completed/skipped along its declared edge with a
bounded one-line reason, so a backend-only run no longer pays for a
ui_reviewer generation that can only answer ui_applicable=false.
A covered pane's width is spent on the covered region (`identityWidth +
startInset`), and when a second level is covered `coveredEdgesDp` gives the
nearest identity that region less the thin older edge (`startInset + minTouch`;
the leading gesture inset cancels), i.e. `identityWidth - minTouch`. Flooring a
statistics-bearing identity at the full block alone (`MIN_COVERED_PANE_WIDTH_DP +
PEEK_WIDTH_DP`, 168dp) therefore left the nearest edge at 120dp, below the
`paneStatTier` Full boundary, so a pipeline's last-run/age and average lines were
filtered out at every depth a pipeline is ever covered. `coveredIdentityWidthDp`
now floors a statistics-bearing identity one touch target above the block
(`+ minTouch`), so the nearest edge is exactly 168dp and reaches Full, while the
single-covered and title-only cases are unchanged and the active pane width still
does not depend on depth.
The covered title also broke mid-word in a narrow strip ("Complete a Task" ->
"Complet"/"e a Task"). `wholeWordTitle` now packs the title greedily onto
whole-word lines and, once they are full, drops the remaining words and
ellipsizes the last line at a word boundary; a word wider than the whole strip is
the one exception, ellipsized to the width because it has no internal boundary.
It takes an injected `measure`, so the packing rule is unit-testable without a
device, and `PaneIdentity` measures with the same `cardTitle` role it draws with.
`PaneIdentityTest` adds the pure cases: the width-degradation tiers, the
statistics-bearing width floor, the nearest-edge geometry at depth 2 (which fails
without the `+ minTouch` reserve, so it pins the defect), and the whole-word
wrap/ellipsis/oversized-word/no-room cases. `android/README.md` records the
corrected geometry, the fix and the run's build/test evidence.
android/ only; no new dependency, no server field, and no server/Go/installer/
Docker change. Build and unit tests only (no device): 300 tests, 0 failures.
Back the TUI "/" popup with the server's search command and add a matching
pipelines search CLI command.
- protocol: SearchRequest/SearchResponse and per-kind SearchResult payloads,
one shared Label for the six-kind badge dispatch and RuneIndexFold for
case-insensitive matching.
- pipeline: the read-only, ranked, bounded Store.Search implementation.
- cli: search QUERY [--type KIND] [--limit N] [--json], printing the shared
label plus a text-field snippet when present.
- tui: type to search, up/down to choose, Enter to open and Esc to cancel over
one mixed ranked list, with short type badges and a bracketed non-colour
match marker; Enter navigates to the matched pipeline, run, step, field
section or artifact entry.
- tests: protocol and TUI coverage, including an env-gated live test against
the running server.
The soft-input comments in the manifest, PipelinesApp.kt and android/README.md
still described `adjustNothing`, a mode the activity no longer declares. MainActivity
uses `android:windowSoftInputMode="adjustResize"` and the app draws edge-to-edge, so
the Compose window inset (WindowInsets.safeDrawing) is the single source of the IME
geometry and is applied once by the surface that owns it.
- AndroidManifest.xml: rewrite the soft-input comment to describe adjustResize, why
the app is edge-to-edge and reads the IME from Compose window insets, and warn
against changing it without re-checking the chat composer.
- PipelinesApp.kt: correct the bottom search column comment that claimed the activity
declares adjustNothing and the window is never resized for the IME.
- android/README.md: correct the omni-search results-panel section that claimed the
IME inset was counted once because of adjustNothing; now records the declared
adjustResize mode, the edge-to-edge single source of IME geometry, and the chat
composer's imePadding.
Documentation only; no rendered surface or behaviour changes. The omni-search entry
point and pill morph already exist at this HEAD; this reconciles the stale wording
with the committed mode.
Integrates eight commits of reviewed chat work: the Chat destination with
several conversations, markdown transcripts, tool-call chips with an expandable
INPUT/OUTPUT panel, edit diff cards, the composer's stop control, and approval
cards. The automated resolver failed on this merge repeatedly (its own stages kept
dying on the malformed-result defect), so it was integrated by hand.
Integration decisions:
- Pill geometry: main's tokens win. lane-app2 carried private duplicates of
DESTINATION_ITEM_SIZE/GAP and a private DESTINATION_PILL_RESERVE, added before the
geometry-token migration; those duplicates are dropped in favour of the theme
tokens main already exports.
- IME mode: kept lane-app2's adjustResize for the window, because the chat composer
and the search field both raise the keyboard and the chat UI was reviewed with it.
- Protocol and view-model constants: both sides' independent additions are kept.
- ChatScreen now passes the compactLabel main's SlidingPaneStack gained, and the
literals lane-app2 introduced before the token discipline are converted to five
new named tokens (HAIRLINE_DP, ICON_BUTTON_SMALL_DP, TOOL_PANEL_MAX_WIDTH_DP,
CHAT_TITLE_MAX_WIDTH_DP, CHAT_BUBBLE_MAX_WIDTH_DP) rather than allow-listed.
Verified: assembleDebug plus the full Android unit suite (409 tests) pass,
including the geometry enforcement test.
Integrates nine commits of reviewed work from the lane-go branch after the
automated resolver failed on this merge five times (each attempt dying on the
malformed-result defect whose fix is contained in this same merge).
Integration decisions:
- Search: kept main's shipped design (Store.Search + SearchResponse.Results) and
dropped lane-go's parallel, older attempt (an unused Message.Matches field, an
absent runs.search, and two partial TUI plumbing blocks). lane-go itself did not
compile: protocol.SearchMatch was undefined and model.go referenced searchNav,
requestSearch and applyRunNav, which exist nowhere. Those partial TUI blocks are
removed; the queued TUI omni-search item will implement the surface properly on
main's design.
- Both sides' additions are kept where they are independent: run titles and
provenance, the human decision stage and its CLI/TUI surface, the derived stage
verdict, the stale-client guard, the line-oriented result format, and main's
search command.
- The search key's help label is now "/ omni search"; the two tests asserting the
old label are updated rather than the label reverted.
- docs/cli.md and the packaged operations reference carry both sides' text.
Verified: go build ./... , go vet ./... and the full go test ./... suite pass.