session export: write only session.html, retire the markdown export
A stage's session was exported twice, as session.md and session.html, and both files were presented. It is now one html file; the markdown export is retired. - internal/stage/session_export.go: ExportSession renders and writes exactly one file, session.html, via writeSessionFile; renderSessionMarkdown and its helpers are gone; SessionExportResult carries HTML/HTMLBytes only. The source read, the 8 MiB source / 2 MiB rendered bounds, the truncation banner, the never-overwrite rule and the honest empty-session handling are unchanged. - internal/protocol/runs.go: SessionExport drops markdown/markdown_bytes (a record written before the change still decodes; unknown fields are ignored), and adds LegacySessionMarkdownArtifact with RunStep.PresentedArtifacts(), the one Go rule that hides the retired session.md from every artifact listing. - internal/server/runner.go: evidence.Markdown/MarkdownBytes are no longer copied. - internal/tui: the artifacts panel, the recorded count and the per-visit summary derive from PresentedArtifacts(), so the terminal never lists session.md. - web/src/app.js: the spike's renderArtifacts applies the same filter. - android: the Session section is the html export alone in a WebView — SessionView, the Markdown/HTML toggle and the session markdown path are removed; presentedArtifacts(step) filters the retired session.md out of the per-visit gallery, the run gallery and its count, the verdict/selection lists and the timeline indicator; data/protocol SessionExport drops the markdown fields. - Tests pin the single html file, prove no session.md is written and that a pre-existing one is neither overwritten nor presented, and prove a legacy export record still loads and its session.md is hidden. The legacy session.md of an older run stays on disk (dated evidence); it is only no longer produced and no longer presented. Checks (macOS, Go 1.24, Android Gradle 8.11.1, 18 Oct 2026): gofmt -l . prints nothing; go build ./... && go vet ./... clean; go test ./internal/... ./cmd/... -> 19 packages ok, 0 failures; node --check web/src/app.js ok and node --test web/test -> 20/20; gradle --offline --no-daemon :app:assembleDebug :app:testDebugUnitTest -> BUILD SUCCESSFUL. Packaged references checked: internal/author/skill/references/delivery.md and operations.md both described the session.md+session.html pair, so both are updated here to describe the single session.html export and the retired, hidden session.md. README.md and internal/author/skill/SKILL.md carry no session.md reference and install.go's managed inventory is unchanged (no reference added or removed). docs/notes/session-html-only.md records the remaining stale shared documentation (docs/stage-artifacts.md, docs/app-integration-verification.md) for the docs-fold writer; shared docs are not edited by this item.
This commit is contained in:
+10
-1
@@ -7,6 +7,15 @@ import { validateServerUrl, resolveArtifactUrl } from "./serverUrl.js";
|
||||
|
||||
const STORAGE_KEY = "pipelines.web.serverUrl.v2";
|
||||
|
||||
/**
|
||||
* The retired markdown session export. The server no longer writes it, but a run
|
||||
* recorded before the HTML-only change still lists session.md among its stored
|
||||
* artifacts. It is dated evidence the operator never sees, so every artifact
|
||||
* listing hides it rather than showing it beside the session html (mirroring the
|
||||
* app's presentedArtifacts).
|
||||
*/
|
||||
const LEGACY_SESSION_MARKDOWN_ARTIFACT = "session.md";
|
||||
|
||||
/**
|
||||
* The page is normally served by serve.mjs, which also proxies /connect to the
|
||||
* Pipelines server. Defaulting to this page's own origin therefore points at
|
||||
@@ -369,7 +378,7 @@ function renderRunDetail() {
|
||||
}
|
||||
|
||||
function renderArtifacts(step) {
|
||||
const artifacts = step.artifacts ?? [];
|
||||
const artifacts = (step.artifacts ?? []).filter((a) => a.name !== LEGACY_SESSION_MARKDOWN_ARTIFACT);
|
||||
if (!artifacts.length) return null;
|
||||
const wrap = h("div", { class: "artifacts" }, h("span", { class: "muted", text: "Artifacts: " }));
|
||||
for (const a of artifacts) {
|
||||
|
||||
Reference in New Issue
Block a user