Merge lane-app2: keep the lane's reviewed work

Combine the reviewed Android work already on main (conversation reading:
markdown, collapsed reasoning, one identity) with the incoming lane's
"answer a waiting human decision from the phone" change (the waiting
run/step sync, HumanDecision/DecisionPrompt, the decide_run envelope and
the waiting RunState) over merge base d48175a.

The only conflicted file, android/README.md, now carries both sections
exactly once ("Conversation reading: markdown, collapsed reasoning, one
identity" and "Answer a waiting human decision from the phone") with no
bullet or paragraph dropped. The auto-merged Kotlin tree carries both
features; no conflict markers, duplicated blocks or dead code remain. The
resolution also restored the blank line between the two README sections.

Verified on the merged tree (JDK 17 from Homebrew openjdk@17,
ANDROID_HOME=/Users/alan/Library/Android/sdk, offline, no daemon):
- gradle :app:testDebugUnitTest --rerun-tasks -> BUILD SUCCESSFUL; JUnit
  XMLs total 58 suites / 525 tests / 0 failures / 0 errors / 0 skipped.
- gradle :app:assembleDebug -> BUILD SUCCESSFUL;
  app/build/outputs/apk/debug/app-debug.apk present (18,519,392 bytes).

Docs check: android/README.md records the resolved change. No packaged
template, README/topic doc or packaged authoring skill reference describes
the Android decision surface or changed as a result, so nothing there
needed updating. Nothing was deliberately left uncommitted.
This commit is contained in:
2026-10-17 15:47:04 +01:00
16 changed files with 979 additions and 66 deletions
+83
View File
@@ -5926,3 +5926,86 @@ and the header on a device — the brief keeps implementation verification to th
build and the unit tests, and visual review owns the operator's Pixel 9 Pro XL
(captures: headings/list/fenced code/table, reasoning collapsed then expanded,
and the header).
## Answer a waiting human decision from the phone (17 Oct 2026)
The last piece of the original goal the app was missing: a run parked on a person
is now answerable from the phone. `android/` only; nothing in the Pipelines
server, its Go source, the installer or the Docker files was touched, no
dependency was added (the new glyph comes from the already-declared
`material-icons-extended`), no run was started from the app and no server field
was added.
- **The same `decide` request the terminal uses.** `Protocol.DECIDE_RUN`
(`decide_run`) with `stage`, `option` and optional `feedback`, exactly the fields
`internal/protocol/message.go` carries and the TUI's Enter builds
(`internal/tui/decision.go`); `PipelinesRepository.decideRun` sends them and
returns the resumed run's detail. There is no second mechanism.
- **Surfaced through the existing push path, with no server change.** A waiting
transition already arrives as a `run_event` with `status: waiting` and a waiting
step delta. The compact delta omits the waiting step's `output` — where the
author's options and instructions are recorded — so `runDetailNeedsFullSync` now
also fetches the full run on a waiting run/step; that fetch fills the recorded
evidence and the decision appears live, with no refresh. `RunState` gained
`Waiting` (violet, `FrontHand`, its own label) so the runs list and the run
summary show "waiting" instead of the unknown fallback. `lastWaitingStep`,
`waitingOptions`, `waitingPrompt` and `humanOptions` mirror `tui.lastWaitingStep`,
`protocol.WaitingOptions`/`WaitingPrompt` and `stage.HumanOptions`.
- **Where it is reachable.** A prominent "Waiting for your decision" card with a
Decide action sits above the run detail's tabs (on any tab — opening the run is
enough) and at the top of the waiting stage's pane; both open the same sheet. It
is not wired to a submenu, and an attention surface (another item) renders the
same shared `DecisionPrompt`/`pendingDecision` component.
- **The sheet.** It shows the run and the waiting stage, the author's recorded
instructions, every option exactly as written (its edge key) with the label it
routes to (`deploy → SUCCESS`), an optional feedback field and a deliberate
`Confirm decision` button. Selecting an option only selects it; the button stays
disabled until one is chosen, so a stray tap cannot answer by accident.
Answering applies the returned run immediately, so the run's new stage is shown
without a manual refresh.
- **Refusals are honest.** A refusal (the run moved on, the stage changed, another
client answered first) keeps the sheet open with the server's own message
verbatim, and the run is re-read silently so the app stops offering a decision
that is gone — never a silent failure and never a faked success.
Pure helpers: `pendingDecision` (the step's recorded evidence first, the pinned
graph as the fallback), `DecisionOption`, `DecisionDraft` (the deliberate-confirm
gate) and `decisionRefusalMessage`.
Tests (13 new): `HumanDecisionTest` (6 — the recorded options/instructions,
non-string tolerance, the sorted non-error-edge fallback, the last waiting step
and the `decide_run` envelope with its exact wire names) and `DecisionTest` (7 —
the waiting run's stage/options/targets/instructions, non-waiting runs, the graph
fallback, the prompt fallback, stage inference, the confirm gate with optional
feedback, and the verbatim refusal message). `RunEventsTest`'s sync rule gained
the waiting cases and `RunStatusTest` the waiting status mapping.
Evidence (implementer pass, macOS, cached Gradle 8.11.1 at
`~/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/bin/gradle`,
JDK 17 from Homebrew `openjdk@17`,
`ANDROID_HOME=/Users/alan/Library/Android/sdk`, every command
`--no-daemon --offline`):
- `gradle :app:testDebugUnitTest --offline --no-daemon --console=plain` →
`BUILD SUCCESSFUL`; the JUnit XMLs total **57 suites / 518 tests / 0 failures /
0 errors / 0 skipped** (up from 55 suites / 505 tests).
- `gradle :app:assembleDebug --offline --no-daemon --console=plain` →
`BUILD SUCCESSFUL`; `app/build/outputs/apk/debug/app-debug.apk` is 18,519,392
bytes, sha256
`4086e6dab453dba81fd0e2f023b0c6713600a68f78d95ada073e0df785b971a1`
(`--rerun-tasks --no-build-cache`, reproduced byte-for-byte by a second full
rebuild; an incremental package is not byte-reproducible), published to this
run's artifacts directory as `pipelines-debug-wip-d48175a.apk` (`d48175a` =
`git rev-parse --short HEAD`; the tree is uncommitted WIP on top of it) and
served at
`http://10.0.0.75:8080/artifacts/277/1/pipelines-debug-wip-d48175a.apk`
(`HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`,
`Content-Length: 18519392`); `10.0.0.249` served it too.
Not verified in this pass: the on-device sheet/feedback/refusal behaviour and the
screenshots — the brief keeps implementation verification to the build and the
unit tests, and visual review owns the operator's Pixel 9 Pro XL. The "attention
surface" named in the brief is not present in this tree, so the decision is
reachable from the run detail and its stage and the shared component is ready for
it. No packaged skill reference was touched: the decide protocol is unchanged and
already documented, and this is an app-UI change.