Repository navigation
fix(html-output-mode): pre-merge review fixes (#1–#16) and final E2E items - #467
Merged
Merged
Conversation
…putFormat An explicit invalid outputFormat (e.g. "htlm") no longer falls through to a PPTX build: the CLI exits 1, sdpm.tools.generate_pptx raises, local and remote run_python report errors.outputFormat and build nothing, remote generate_pptx / get_preview return the error. Absent/null still means PPTX; unreadable deck.json keeps the PPTX path. Verified: uv run pytest tests/test_cli_contract.py tests/test_run_python_semantics.py tests/test_remote_html.py tests/test_entry_tools.py -q (129 passed) SPEC: 20261029-1619_html-output-mode Progress: FEAT-001 item 1 (review #2) done Next: FEAT-001 item 2 (scroll overflow of free-positioned blocks)
…ocks Free-positioned top-level blocks now get the content-larger-than-box overflow finding that placeholders, regions and region children already got. Verified: uv run pytest tests/test_html_layout_judge.py tests/test_html_browser_check.py -q (24 passed, 8 real-browser skipped) SPEC: 20261029-1619_html-output-mode Progress: FEAT-001 item 2 (review #6) done Next: FEAT-001 item 3 (decoration availability by the layouts that need a render)
… that need a render template_html_view counted SVGs against every layout, so a template whose layouts draw only placeholders (blank-light) or a complete cache with such layouts reported decorations as unavailable without LibreOffice. It now uses the converter's predicate, template.decorations_complete (renamed from _svgs_complete, now public). Verified: uv run pytest tests/test_entry_tools.py tests/test_html_template.py -q (57 passed; both new tests fail on the old code) SPEC: 20261029-1619_html-output-mode Progress: FEAT-001 item 3 (review #8) done Next: FEAT-001 item 4 (failed-render memo with a TTL)
…inutes The failed-render memo held for the whole process, so a transient LibreOffice failure in a long-lived server disabled decorations until restart. The memo now stores the failure time and is reused only within FAILED_RENDER_RETRY_S (600 s). Verified: uv run pytest tests/test_html_template.py -q (16 passed) SPEC: 20261029-1619_html-output-mode Progress: FEAT-001 item 4 (review #9) done; FEAT-001 complete Next: FEAT-002 (browser-check egress, real-browser tests, CI)
…lide code runs The browser check blocked http(s)/ws(s) through Fetch, but WebRTC (STUN/TURN) bypasses Fetch and the deck CSP. An egress guard installed with Page.addScriptToEvaluateOnNewDocument (page and auto-attached iframe targets) removes the RTC constructors and WebTransport and makes window.open return null; a probe after the load (top, window[n] of a fresh iframe, contentWindow, srcdoc iframe, window.open) fails the check closed before any slide runs. network_blocked is now set only after the probe. script-external flags RTCPeerConnection and stun:/turn: URLs and carries per-diag kinds. Verified: ruff clean; pytest tests/test_html_check.py tests/test_html_browser_check.py tests/test_remote_html.py: 146 passed, 8 skipped; real-browser suite 8 passed (Chrome); guard removed -> probe fails closed (manual run). SPEC: 20261029-1619_html-output-mode Progress: FEAT-002 item 5 (review #3) done Next: real-browser tests for network block, popups, WebRTC, speaker view
…s, WebRTC and the speaker view New opt-in tests: network requests stopped by the deck CSP and, with the CSP removed, failed by the Fetch block (blocked_requests >= 2); window.open does not stop the check; RTCPeerConnection unreachable from top, window[n], contentWindow and srcdoc frames; overflow of a free-positioned block; the speaker view's hashed script runs under the deck CSP. The real_browser marker now skips only without SDPM_TEST_BROWSER=1, and use_browser fails when no browser is found. Verified: SDPM_TEST_BROWSER=1 pytest -k real_browser: 13 passed (Chrome, macOS); without the variable: 14 passed, 13 skipped; ruff clean. SPEC: 20261029-1619_html-output-mode Progress: FEAT-002 item 6 (review #5, #11) done Next: CI browser job
New `browser` job: ubuntu-latest with the runner's google-chrome, the AppArmor user-namespace restriction lifted for Chrome's sandbox, SDPM_TEST_BROWSER=1, `pytest tests/test_html_browser_check.py -k real_browser -v -rs`. The use_browser fixture fails when Chrome is missing, so the job cannot go green by skipping. Verified: ci.yml parses (yaml.safe_load), jobs include browser. SPEC: 20261029-1619_html-output-mode Progress: FEAT-002 item 7 (review #5) done Next: AgentCore Browser egress canary
scripts/verify_agentcore_browser_egress.py runs the remote server's browser check (AgentCore Browser source + api.refresh_html) on a canary deck that looks for WebRTC in every reachable window, starts ICE gathering against a public STUN server, fetches/loads https://example.com and, with --dns-domain, emits dns-prefetch / preconnect hints to a one-off host. Exit 0 only when network_blocked is true, the rtc slide reported and no WebRTC / srflx was found. Verified (dev account, ap-northeast-1): status issues (CSP refusals of the net slide), network_blocked true, blocked_requests 0, "rtc: probed 5" with no "available"/"srflx", DNS egress not verified, PASS, exit 0. SPEC: 20261029-1619_html-output-mode Progress: FEAT-002 item 8 (review #3) done Next: FEAT-002 full verification
…as one revision Each build's preview/PNG epoch is now a millisecond revision strictly above every listed epoch, so two builds in the same second no longer share or lose keys. A refresh that does not commit (failed preview upload or record update) deletes its own previews and PNGs, as finalize already did. Verified: uv run pytest tests/test_remote_html.py tests/test_html_artifacts.py tests/test_api_html_routes.py -q (66 passed); ruff clean. SPEC: 20261029-1619_html-output-mode Progress: FEAT-003 item 9 (review #1) done Next: FEAT-003 item 10 (clear template-resolution error)
…oes not resolve prepare_html_workspace re-raises a template resolution ValueError naming the deck.json template and pointing at apply_style(deck_id, style, template); refresh_html_deck logs that case at info level without a traceback. Verified: uv run ruff check sdpm/ servers/ shared/ api/ agent/ (clean); uv run pytest tests/ -q (1681 passed, 39 skipped). SPEC: 20261029-1619_html-output-mode Progress: FEAT-003 items 9-10 done Next: FEAT-004 (exfiltration warning surfaced, Web UI fixes)
…scripts reach outside
The static check's script-external findings ({slug, kinds}) are returned by
generate_html / refresh_html as script_external, written to the deck record
as htmlScriptExternal at refresh and finalize (a clean build removes it),
validated and exposed by GET /decks/{id} as scriptWarnings, and shown as an
"External access" badge before Present / PDF / HTML in the cloud Web UI.
The agent-facing run_python result (local and remote) leaves the key out;
the warnings already name these slides.
Verified: uv run ruff check (clean); uv run pytest tests/test_html_api.py
tests/test_remote_html.py tests/test_api_html_routes.py -q (79 passed);
npx vitest run src/components/deck/SlideCarousel.test.tsx (4 passed);
npx tsc --noEmit (clean).
SPEC: 20261029-1619_html-output-mode
Progress: FEAT-004 item 11 (review #4) done
Next: FEAT-004 item 12 (finalize label, compose lanes)
… lanes when the tool completes A DeckFormatContext carries the open deck's outputFormat to the chat; the generate_pptx row (full and compact) reads "Finalizing HTML deck" when the deck or the tool result is HTML. ComposeCard treats tool success as the end of every lane still starting/working, so no lane stays "Queued" and each shows its created count. Verified: npx vitest run src/components/chat (11 files, 79 passed; the new lane test fails without the ComposeCard change); npx tsc --noEmit (clean). SPEC: 20261029-1619_html-output-mode Progress: FEAT-004 item 12 (E2E c, d) done Next: FEAT-004 item 13 (local preview route test)
Node-environment vitest for /api/preview/[...path] against a temp SDPM_DECK_ROOT: output.html gets "sandbox allow-scripts allow-popups allow-popups-to-escape-sandbox", preview/<slug>.html gets "sandbox", both with nosniff and text/html; other .html paths are 404, paths outside the deck 403, a PNG is image/png. Verified: uv run ruff check (clean); uv run pytest tests/ -q (1686 passed, 39 skipped); cd web-ui && npx eslint src/ --quiet && npx tsc --noEmit && npm test (50 files, 406 passed) && npm run build:cloud (ok); i18n parity OK. SPEC: 20261029-1619_html-output-mode Progress: FEAT-004 items 11-13 done Next: FEAT-005 (guidance, vendor manifest, docs, changelog)
Restore "Do not transcribe the material:", "do not substitute — say so and ask", "and the material, not the style" and "Name the form, not the style's pattern or class (...)" with their original wording; the rest stays format-neutral. Verified: uv run pytest tests/test_entry_tools.py tests/test_agent_modes.py -q -> 66 passed SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 14 (review #7) done Next: HTML guidance (template choice, operating steps in notes, icon contrast)
…ps go in the notes html-deck.md: a Template bullet (choose one and pass it to apply_style; deck.json keeps it); visual names the control and its effect, the operating steps go in the speaker notes. composer-html.md: the slide shows the controls, the steps go in <aside class="notes">; the layout pass's frame, regions and deck.css are for what the audience reads. slide-html-spec.md: pick the icon variant (theme_filter) that contrasts with its background. Verified: uv run pytest tests/test_entry_tools.py tests/test_remote_html.py -q -> 85 passed SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 15 (E2E a, b, icon contrast) done Next: sdpm/vendor checksum manifest checked in CI
… in CI sdpm/vendor/SHA256SUMS (sha256sum format, ./ paths) lists every vendored file; tests/test_vendor_checksums.py checks the listed set equals the files on disk and each digest matches; the CI python job runs `sha256sum -c SHA256SUMS`; sdpm/vendor/README.md documents regeneration. Verified: uv run pytest tests/test_vendor_checksums.py -q -> 2 passed; cd sdpm/vendor && shasum -a 256 -c SHA256SUMS -> 14 OK; ci.yml parses. SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 16 (review #12) done Next: HTML Deck Security docs (accepted risks, browser-check egress)
…HTML Deck Security docs/en/architecture.md: the browser check's WebRTC / WebTransport guard and probe, what network_blocked means, the AgentCore canary result (DNS hints not proven blocked); script-external findings kept on the deck record and shown next to Present / Download, shared decks included; Accepted risks: the 4-hour Present bearer URL outliving unsharing and the single bucket origin with the controls that bound it. Verified: proofread against browser_check.py, api/index.py and FEAT-002's canary output; docs only, no code change. SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 17 (review #3, #4, #14, #15) done Next: correct stale comments (#16)
agentcore_browser.py: the runtime role has three browser actions; composer.py: compose_slides writes .json or .html slide files, and the finalize step is generate_pptx (PPTX or output.html); decks route: HTML decks keep browser-check PNGs under preview/png/, so the thumbnail is the static HTML preview. Verified: uv run pytest tests/test_agent_modes.py -q -> 25 passed; cd web-ui && npx tsc --noEmit -> clean SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 18 (review #16) done Next: collapse the [Unreleased] HTML entries in CHANGELOG.md
… the net change One "HTML output mode" Added entry describes what ships (local + cloud, Web UI player / Present / PDF / HTML, CSP, scripts with ECharts / D3, browser_check with WebRTC disabled, PNG previews, external links in new tabs, script-external warning on the deck page, invalid outputFormat stops builds, tool count 20, PPTX unchanged, deploy list). The phase entries, the guidance and js_check Changed entries, the SDPM_JS_CHECK Removed entry and the HTML Fixed entries are gone; runtime role, Python 3.10, Haiku 5.5 and Security entries are kept. Verified: no SDPM_JS_CHECK / js_check in [Unreleased]. SPEC: 20261029-1619_html-output-mode Progress: FEAT-005 item 19 (review #13) done Next: whole-branch verification (item 20)
…d update fails refresh deletes an uncommitted run's previews and PNGs (1e3f5186), but finalize_html_deck only did so for a failed preview upload: a failed record update left the new-revision previews winning the key map over the record's older output.html. finalize now deletes this run's previews before re-raising. Verified: uv run ruff check sdpm/ servers/ shared/ api/ agent/ -> clean; uv run pytest tests/ -q -> 1689 passed, 39 skipped (new test_generate_pptx_record_failure_removes_this_runs_previews fails without the fix). SPEC: 20261029-1619_html-output-mode Progress: integration of FEAT-001..005; finalize matches refresh on uncommitted builds Next: integration review verdict
…ting steps only in the notes Composers still drew operating instructions as captions, hint lines and the starting text of fields a control fills (E2E iteration 1: 4 of 10 scripted slides in fceb8dfc / b861428b). composer-html.md and slide-html-spec.md now say that every visible text, captions, labels and a field's starting text included, names the content, and that how to operate the slide is written only in <aside class="notes">. html-deck.md's review step sends such a slide back to its composer. Ran: uv run pytest -q tests/test_entry_tools.py tests/test_run_python_semantics.py (pass) SPEC: 20261029-1619_html-output-mode Progress: operating-instruction guidance tightened for composer and orchestrator review Next: redeploy to dev and re-run the final E2E
…round in the PNG E2E iteration 1 (9c52ea4c concept) again drew black icons on the dark aws-dark background. The composer's PNG check now names icon contrast and points to search_assets theme_filter for the other variant. Ran: make lint (pass); make test (1687 passed, 39 skipped) SPEC: 20261029-1619_html-output-mode Progress: icon-contrast guidance added to the composer's check step Next: redeploy to dev and re-run the final E2E
…preview route test fixture The CI ASH scan (semgrep, HIGH) flagged path.join(root, rel) in the test's write() helper. root is a mkdtemp directory and rel is a literal fixture path, so annotate it with the same nosemgrep comment the other tmpdir fixtures use. Test-only change; no runtime behaviour changes. Verified: npx vitest run src/app/api/preview -> 5 passed; ash --mode local --fail-on-findings -> exit 0 (semgrep/bandit/checkov/ detect-secrets PASSED). SPEC: 20261029-1619_html-output-mode Progress: CI scan job failure on PR #467 fixed Next: watch PR #467 checks until all green
- Icon guidance: theme_filter picks a light/dark variant; SVG icons without variants
(Material) are recoloured with CSS fill
- Remote _deck_format and tools._is_html_deck treat a non-object deck.json as PPTX
- orchestrator.md: restore main's PPTX wording ("only when", visual definition)
- .gitattributes: sdpm/vendor/** -text so vendor checksums hold on CRLF checkouts
- architecture.md: unproven DNS hints in the cloud browser check as an accepted risk
- template.py: fix the garbled comment above FAILED_RENDER_RETRY_S
SPEC: 20261029-1619_html-output-mode
Progress: PR #467 review low items closed
Next: merge #467, then dev/html-output -> main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the pre-merge review findings for HTML output mode (issues #1–#16) and the four items from the final E2E check, before
dev/html-outputgoes tomain. Review issue #17 (movewebsocketsto an optional extra) is intentionally not done:websocketsstays a required dependency ofsdpm-skill.PPTX decks take the same code path as before. An absent or null
outputFormatstill means PPTX, and the PPTXGET /decks/{id}response is unchanged. The MCP tool count stays at 20.Review issues
outputFormatfalls through to PPTXsdpm.tools.generate_pptxraises, local/remoterun_pythonreturnerrors.outputFormat, remotegenerate_pptx/get_previewreturn the errorPage.addScriptToEvaluateOnNewDocument(page and auto-attached iframes) removes the RTC constructors andWebTransportand makeswindow.openreturn null. A probe after load and before any slide code fails the check closed.network_blockedis set only after the probe passes.script-externalnow flagsRTCPeerConnectionandstun:/turn:URLsscripts/verify_agentcore_browser_egress.py: run against a dev deployment, it showed WebRTC removed and the Fetch block holding. DNS hints were not tested, and the docs say soscript-externalfindings ({slug, kinds}) are written to the deck record ashtmlScriptExternalat refresh/finalize, validated intoscriptWarningsbyGET /decks/{id}, and shown as an "External access" badge before Present / PDF / HTML, shared decks includedbrowserjob (ubuntu + Chrome,SDPM_TEST_BROWSER=1). It fails rather than skips when Chrome is missingfreeis included in the scroll-overflow ruletemplate.decorations_completeFAILED_RENDER_RETRY_S(600 s)output.htmlandpreview/*.html,nosniff, 404 for other.htmlpaths and 403 for paths outside the decksdpm/vendor/SHA256SUMS, checked bytests/test_vendor_checksums.pyandsha256sum -cin CI[Unreleased]documents removed surfacesSDPM_JS_CHECK/js_checkare gone from itdocs/en/architecture.md), with the controls that bound themagentcore_browser.py,agent/modes/composer.pyandweb-ui/src/app/api/decks/route.tscorrectedFinal E2E items
html-deck.md(served asformat_notesbeforeapply_style) now says to choose a template and pass it toapply_style. The remote error for an unresolvable template names the deck.json value andapply_style(deck_id, style, template), and is logged at info level (069daa9, 9a62bce).html-deck.mdandcomposer-html.mdsay that the slide shows the controls and the operating steps go in<aside class="notes">.slide-html-spec.mdsays to pick the icon variant that contrasts with its background (069daa9).DeckFormatContextpasses the deck's format to the chat, and the step reads "Finalizing HTML deck" (6198db2).ComposeCardsettles every lane still starting or working when the tool succeeds (6198db2).Verification
uv run ruff check: cleanuv run pytest tests/: 1689 passed, 39 skippedSDPM_TEST_BROWSER=1, Chrome on macOS): 13 passedtsc --noEmitandeslintclean. en/ja key parity OKbrowserjob runs for the first time on this PRKnown low-severity follow-ups (from review)
_deck_formatand_is_html_deckraiseAttributeErroron a deck.json that is valid JSON but not an object. The local_deck_formatalready returns"pptx"in that case.orchestrator.mdstill differs frommainin two PPTX-facing places: "plain text only when" became "plain text when", and thevisualdefinition lost its examples. No changelog entry mentions this..gitattributesentry forsdpm/vendor/** -text, so a CRLF checkout on Windows would fail the vendor checksum test.FAILED_RENDER_RETRY_Sinsdpm/sdpm/engine/html/template.py.Next
The dev-deploy E2E re-run follows this PR. It checks (a) and (b) in practice and confirms the Web UI changes (badge, finalize label, lane status) on a deployed stack.