From 206953e0674291687c13eaf438361ca54ea68378 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 16 Oct 2026 00:54:22 +0100 Subject: [PATCH] Show an Android run stage's Model/Provider in the headline Surface a run stage's recorded Model and Provider configs in the stage pane's always-visible headline instead of leaving them inside the collapsed Definition section, so the operator sees them without expanding anything, and stop rendering them twice. - StageDetailPane.kt gains the pure STAGE_CONFIG_HEADLINE_LABELS ({"Model", "Provider"}), stageConfigHeadlineFields(definition) and remainingDefinitionFields(definition). StageDetailBody renders headlineFields(runFields) + stageConfigHeadlineFields(definition) as the headline and remainingDefinitionFields(definition) inside the collapsed Definition section; both derivations are remember(definition)-keyed and the run-evidence split stays runStepFields/headlineFields/evidenceFields. - The definition-only, never-visited stage keeps its existing look; the Definition section no longer repeats Model/Provider because they are now headline facts, and everything else stays as before. - StageDetailSheetTest adds definitionModelAndProviderArePromotedToTheHeadlineWithoutDuplication and aDefinitionWithNoConfigsPromotesNothing. - android/README.md records the pass: the reported "content lost" symptom is not reproducible at 791d3dd (the run-61 definition-only screenshots are the Pipelines destination), the promoted facts are the real gap, and the unit tests (132/0), assembleDebug, device verification on emulator-5554 and the APK publish are noted with what was not verified. --- android/README.md | 93 +++++++++++++++++++ .../pipelines/ui/graph/StageDetailPane.kt | 30 +++++- .../ui/graph/StageDetailSheetTest.kt | 41 ++++++++ 3 files changed, 161 insertions(+), 3 deletions(-) diff --git a/android/README.md b/android/README.md index f20b1b4a..ef360f7c 100644 --- a/android/README.md +++ b/android/README.md @@ -1066,3 +1066,96 @@ presentation difference the existing `WindowSizeTest`/`DetailTabsTest` still cov where they can. The `after-section-swap.mp4` frame is the only mid-transition sample taken; `before-frame-2.05.png` is the only baseline mid-slide sample. + +## Run stage pane: surface Model/Provider in the headline (16 Oct 2026) + +The report was "the adaptive-panes change lost the stage screen's content: only the +title, the model chip and one collapsed Definition remain". That symptom is the +**definition-only** branch of `StageDetailBody` (`selectedStep == null`, i.e. no +recorded visits). It is what a *pipeline* stage pane (`PipelineStagePane`, level 2 +of the Pipelines destination) legitimately shows, and it is exactly what the run-61 +artifacts (`~/.local/share/pipelines/data/artifacts/61/1/wide-3-levels-stage.png`, +`narrow-3-levels-stage.png`) capture — those screenshots are the Pipelines +destination, not the Runs one, so they are the expected definition-only look and not +the regression. Re-driving the current build from the Runs destination does **not** +reproduce the loss: from a Timeline row (`implementer · visit 2`, run 60) and from a +graph node the pane showed Status/Outcome/Duration/Visit/Target, the visit tab row +(visit 2 selected), and Definition/Input/Output/Artifacts/This run collapsed with +their content on expansion. No regression was present at `791d3dd`. + +The one real gap against the requested headline facts was that the stage's recorded +`Model`/`Provider` configs lived only inside the collapsed Definition section (they +were always visible in the pre-pane sheet). They are now promoted to the +always-visible headline, without duplication: + +- `ui/graph/StageDetailPane.kt` gained the pure `STAGE_CONFIG_HEADLINE_LABELS` + (`{"Model", "Provider"}`), `stageConfigHeadlineFields(definition)` and + `remainingDefinitionFields(definition)`. `StageDetailBody` renders + `headlineFields(runFields) + stageConfigHeadlineFields(definition)` as the + headline and `remainingDefinitionFields(definition)` inside the collapsed + Definition section, so a promoted row is never rendered twice. Both derivations + are `remember(definition)`-keyed; the run-evidence split stays + `runStepFields`/`headlineFields`/`evidenceFields`. +- Deliberate change to account for: the Definition section (collapsed by default) + no longer repeats Model/Provider, because they are now headline facts. Everything + else in Definition is unchanged (`Type`, `Prompt`, `Output`, `Outcomes`, the other + configs, `Tools`, limits, memory, notify). +- `StageDetailSheetTest` gained + `definitionModelAndProviderArePromotedToTheHeadlineWithoutDuplication` and + `aDefinitionWithNoConfigsPromotesNothing`. + +Evidence obtained in this pass (macOS, `ANDROID_HOME=/Users/alan/Library/Android/sdk`; +`gradle :app:testDebugUnitTest :app:assembleDebug` under the default Homebrew JDK 27, +lint under JDK 17 as noted): + +- `gradle :app:testDebugUnitTest :app:assembleDebug` → `BUILD SUCCESSFUL`; the + test-result XMLs aggregate to **132 tests, 0 failures, 0 errors, 0 skipped**. + `app/build/outputs/apk/debug/app-debug.apk` is 17,991,256 bytes, sha256 + `2252e6964cd73f1d666da24f3684bd8e0b79cf3e07e0fdc018842a4f1cab2ccf`. +- `gradle :app:lintDebug` under JDK 17 fails only on the two **pre-existing** + `NewApi` errors for `android:windowLightNavigationBar` in + `res/values/themes.xml` and `res/values-night/themes.xml` (unchanged by this + pass); under the default Homebrew JDK 27 the lint worker crashes at dispose + (`NoClassDefFoundError: org.jetbrains.uast.UastFacade`), so JDK 17 is required. +- On `emulator-5554` (narrow 1080x1920/density 480 ≈ 360dp; wide 2076x2152/density + 390 ≈ 852dp; **never** the attached Pixel) against the live server + `ws://10.0.0.75:8080/connect`, driven with `adb shell input`, screenshots in + `~/.local/share/pipelines/data/artifacts/64/2/`: + - `narrow_run61_facts_collapsed.png` / `wide_facts_collapsed.png`: the headline + (Status/Outcome/Duration/Visit/Target/Model/Provider) unexpanded and all five + sections collapsed. + - `narrow_run61_artifacts_expanded.png` / `wide_facts_artifacts_expanded.png`: + Artifacts expanded to `Artifacts · 8 recorded · partial capture`, the capture + note and the thumbnail grid. + - `wide_facts_definition_expanded.png`: Definition expanded with no duplicated + Model/Provider row. + - `narrow_run60_visit_tabs_facts.png` / + `narrow_run60_graph_node_stage.png`: a multi-visit stage (`visit 1`/`visit 2` + tabs, starting on the tapped/most-recent visit) opened from a Timeline row and + from a graph node, with the promoted Model/Provider. + - `previous_behaviour_nav_timeline_pass_05.png` is the pre-pane sheet + (`android/captures/nav_timeline_pass/05_sheet_from_timeline_visits.png`) for + comparison. The run-60/4 artifact _files_ used by its gallery are corrupt (their + `.png` bytes begin with the `adb screencap` "Multiple displays" warning), so its + thumbnails correctly show the `!` decode-error placeholder; run 61's valid + artifacts render normally. + - `adb -s emulator-5554 logcat -d | grep -c 'FATAL EXCEPTION'` and + `… | grep -c 'E AndroidRuntime'` each returned 0; no run was started from the + app. +- **APK publish.** `app-debug.apk` was copied to + `~/.local/share/pipelines/data/artifacts/64/1/pipelines-debug-wip-791d3dd.apk` + (`791d3dd` = `git rev-parse --short HEAD`); `shasum -a 256` matched. `curl -I + http://10.0.0.249:8080/artifacts/64/1/pipelines-debug-wip-791d3dd.apk` (LAN + address from `ipconfig getifaddr en0`, never `localhost`/`10.0.2.2`) returned + `HTTP/1.1 200 OK`, `Content-Type: application/vnd.android.package-archive`, + `Content-Length: 17991256`; a streamed `GET | shasum -a 256` returned + `2252e6964cd73f1d666da24f3684bd8e0b79cf3e07e0fdc018842a4f1cab2ccf`, equal to the + local file. + +Not verified in this pass: the reported "content lost" symptom could not be +reproduced at `791d3dd`, so there is no before/after diff of a fixed regression; +the "definition-only, never-visited stage" and blank status/outcome edge cases are +covered by the existing unit tests (`StageDetailSheetTest`, `FormatTest`) rather than +driven on the device; the narrow/wide gallery thumbnail failure for run 60's corrupt +artifacts is a data issue in that run, not re-tested against a repaired copy. + diff --git a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt index 44827f2a..804fe27f 100644 --- a/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt +++ b/android/app/src/main/java/net/awan/pipelines/ui/graph/StageDetailPane.kt @@ -156,6 +156,26 @@ internal fun headlineFields(fields: List): List = internal fun evidenceFields(fields: List): List = fields.filter { it.label !in STAGE_HEADLINE_LABELS && it.label != "Input" && it.label != "Output" } +/** + * The definition configs promoted to the always-visible headline so the operator + * sees the recorded model and provider without expanding Definition. Only these + * two labels are promoted; the rest of the definition stays collapsible. Pure, + * so the promotion is unit-tested without the Compose runtime. + */ +internal val STAGE_CONFIG_HEADLINE_LABELS: Set = setOf("Model", "Provider") + +/** The non-blank Model/Provider config rows of [definition], in definition order. */ +internal fun stageConfigHeadlineFields(definition: List): List = + definition.filter { it.label in STAGE_CONFIG_HEADLINE_LABELS } + +/** + * The definition rows that stay in the collapsed Definition section: everything + * except the configs [stageConfigHeadlineFields] already promoted to the + * headline, so a promoted fact is never rendered twice. + */ +internal fun remainingDefinitionFields(definition: List): List = + definition.filter { it.label !in STAGE_CONFIG_HEADLINE_LABELS } + /** * The pure run view of one [RunStep] for the selected stage: status, outcome, * duration, visit against the control's max_visits, target, session id, @@ -325,8 +345,12 @@ private fun StageDetailBody( val selectedStep = runSteps.getOrNull(clampedVisit) // Derived once per selected step, not per recomposition. val runFields = remember(selectedStep) { selectedStep?.let(::runStepFields).orEmpty() } - val headline = headlineFields(runFields) + // The identity/result facts, plus the stage's recorded Model/Provider, are + // visible without expanding anything; nothing is derived per frame. + val configHeadline = remember(definition) { stageConfigHeadlineFields(definition) } + val headline = headlineFields(runFields) + configHeadline val evidence = evidenceFields(runFields) + val definitionRows = remember(definition) { remainingDefinitionFields(definition) } val expansion = rememberSectionExpansion(stageKey) DetailTabBody(wide, modifier) { columnModifier -> @@ -365,11 +389,11 @@ private fun StageDetailBody( Text("No details recorded for this node.", style = text.meta) } - if (definition.isNotEmpty()) { + if (definitionRows.isNotEmpty()) { val key = "definition" SectionHeader(key.capitalized(), expansion.isExpanded(key), { expansion.toggle(key) }) if (expansion.isExpanded(key)) { - definition.forEach { field -> StageFieldRow(field) } + definitionRows.forEach { field -> StageFieldRow(field) } } } diff --git a/android/app/src/test/java/net/awan/pipelines/ui/graph/StageDetailSheetTest.kt b/android/app/src/test/java/net/awan/pipelines/ui/graph/StageDetailSheetTest.kt index 460e58cb..b5bc04bd 100644 --- a/android/app/src/test/java/net/awan/pipelines/ui/graph/StageDetailSheetTest.kt +++ b/android/app/src/test/java/net/awan/pipelines/ui/graph/StageDetailSheetTest.kt @@ -163,4 +163,45 @@ class StageDetailSheetTest { // Input/output are surfaced as their own sections, not the evidence block. assertTrue(evidence.none { it == "Input" || it == "Output" }) } + + @Test + fun definitionModelAndProviderArePromotedToTheHeadlineWithoutDuplication() { + val stage = Stage( + key = "implementer", + type = "model", + prompt = "do the thing", + configs = mapOf( + "model" to "deepseek-v4.1-flash", + "provider" to "opencode-go", + "retries" to "2", + ), + ) + val definition = stageDefinitionFields(stage) + val promoted = stageConfigHeadlineFields(definition).map { it.label } + assertEquals(listOf("Model", "Provider"), promoted) + // The promoted facts stay in the always-visible headline... + val step = RunStep( + status = "completed", + outcome = "success", + target = "reviewer", + control = ControlEvidence(visit = 1, maxVisits = 5, modelTarget = "deepseek-v4.1-flash"), + ) + val headline = headlineFields(runStepFields(step)) + stageConfigHeadlineFields(definition) + val labels = headline.map { it.label } + assertEquals(listOf("Status", "Outcome", "Visit", "Model target", "Target", "Model", "Provider"), labels) + assertEquals("deepseek-v4.1-flash", headline.first { it.label == "Model" }.value) + assertEquals("opencode-go", headline.first { it.label == "Provider" }.value) + // ...and are never rendered a second time in the collapsed Definition. + val remaining = remainingDefinitionFields(definition).map { it.label } + assertTrue(remaining.none { it == "Model" || it == "Provider" }) + // The rest of the definition is untouched and still needs no expansion to exist. + assertTrue(remaining.containsAll(listOf("Type", "Prompt", "Retries"))) + } + + @Test + fun aDefinitionWithNoConfigsPromotesNothing() { + val fields = stageDefinitionFields(Stage(key = "planner")) + assertTrue(stageConfigHeadlineFields(fields).isEmpty()) + assertEquals(fields, remainingDefinitionFields(fields)) + } }