Repository navigation
docs: replace ASCII diagrams with images and align tool/spec names with code - #1
Merged
Merged
Conversation
added 3 commits
April 6, 2026 01:56
- list_examples → list_styles (matches server.py) - code_block → code_to_slide (matches mcp-local/server.py) - Remove example_search (not registered as MCP tool) - Remove code_to_slide from Layer 3 additional tools (exists in Layer 2) - narrative.md/design.md → brief.md/art-direction.html (matches workflow files)
ShotaroKataoka
added a commit
that referenced
this pull request
Apr 21, 2026
* 📋 spec(local-desktop-app): add requirements, design, tasks, notes
* ✨ feat(local-desktop-app): Task 1-2 prompt extraction + kiro-cli agent configs
- Extract system prompt to prompts/system-prompt.md
- agent/basic_agent.py reads from prompts/ with inline fallback
- Add .kiro/agents/sdpm-spec.json (SPEC agent with subagent + hooks)
- Add .kiro/agents/sdpm-composer.json (Composer agent, no user interaction)
- Add desktop/scripts/auto-build.py (postToolUse hook for slide edit)
* ✨ feat(local-desktop-app): Task 3 Tauri project shell
- Tauri 2 + Vite + React project in desktop/
- Shell plugin with spawn/stdin-write permissions for kiro-cli acp
- Vite alias @ → web-ui/src/ for shared component imports
- Minimal App placeholder with globals.css import
* ✨ feat(local-desktop-app): Task 4 ACP bridge service
- acpAgentService.ts: spawn kiro-cli acp, JSON-RPC over stdin/stdout
- Same invokeAgent() signature as agentCoreService.js for ChatPanel compat
- ACP notifications → onStreamUpdate/onToolUse callbacks
- session/new, session/prompt, session/cancel support
* ✨ feat(local-desktop-app): Task 5-6 local deck + upload services
- localDeckService.ts: filesystem CRUD, convertFileSrc for preview URLs
- localUploadService.ts: local file copy to deck workspace
- Web-only features stubbed as no-ops (share, public, search)
* ✨ feat(local-desktop-app): Task 7 service provider + desktop entry point
- ServiceProvider: resolves local services for desktop app
- main.tsx: loads DecksPage with ServiceProvider instead of AuthProvider
- Notes: identified useAuth() shim need and service import aliasing challenge
* 🔧 fix(local-desktop-app): Vite alias for auth shim + service overrides
- authShim.ts: replaces react-oidc-context (useAuth, useAutoSignin)
- useAuthShim.ts: replaces @/hooks/useAuth (AppShell wrapper)
- vite.config.ts: alias order — specific service/auth overrides before @ catch-all
- Web version completely unaffected — all changes in desktop/
* ✨ feat(local-desktop-app): Task 8-9 LibreOffice install + Tauri build CI
- install-libreoffice.sh/ps1: auto-install via brew/apt/choco/winget
- lib.rs: startup LibreOffice check with warning
- build-desktop.yml: GitHub Actions for macOS/Linux/Windows builds
- Triggered on desktop-v* tags or manual dispatch
* 🐛 fix(local-desktop-app): Tailwind CSS + PostCSS setup for desktop
- Add postcss.config.mjs with @tailwindcss/postcss
- app.css: @source directives for web-ui + desktop component scanning
- main.tsx: import both app.css (source) and globals.css (styles)
- Install shared web-ui dependencies (sonner, lucide-react, radix, etc.)
- Fix localUploadService circular re-export
- Fix acpAgentService export names (invokeAgentCore alias)
- Generate Tauri icons from web-ui/public/icon-512.png
* 🐛 fix(local-desktop-app): merge globals.css into app.css for single Tailwind context
- @import tailwindcss + @source + theme + custom styles all in one file
- Fixes utility classes (flex, grid, gap) not being generated
- CSS output: 26KB → 107KB (full Tailwind utilities now included)
* 📝 notes: document globals.css duplication trade-off
* 🐛 fix(local-desktop-app): fix file:// prompt path in agent configs
* 🔧 fix(local-desktop-app): add Tauri FS plugin + permissions
- Add tauri-plugin-fs to Cargo.toml and lib.rs
- Add FS permissions scoped to ~/Documents/SDPM-Presentations/
* 🐛 fix(local-desktop-app): add dummy aws-exports.json + fix FS permissions
- ChatPanel requires /aws-exports.json to set configLoaded=true
- Add desktop/public/aws-exports.json with local dummy values
- Simplify Tauri FS permissions (scope-home-recursive)
* 🐛 fix(local-desktop-app): add mcpServers:[] to session/new + fix cwd path
- session/new requires mcpServers field (array, not object)
- Fix homeDir trailing slash handling
- Add cwd option to spawn kiro-cli from project root
* ✨ feat(local-desktop-app): ACP chat working end-to-end
- Fix session/update event parsing (sessionUpdate field, not type)
- Fix prompt format (array, not string)
- Fix mcpServers required in session/new
- Fix turnEnd: use rpcRequest resolution instead of separate promise
- Chat with kiro-cli agent now works in Tauri desktop app
* 📝 notes: document ACP protocol field names and gotchas
* 🐛 fix(local-desktop-app): resolve project root via Tauri command
- Add get_project_root Rust command that finds project root by looking for prompts/ or .kiro/agents/
- kiro-cli spawned with cwd=project root so .kiro/agents/sdpm-spec.json is found
* 🐛 fix(local-desktop-app): fix ACP tool event field names
- tool_call (not tool_use), toolCallId (not toolUseId), title (not name)
- Handle tool_call_update with correct field mapping
* 🐛 fix(local-desktop-app): add mcp-local as MCP server to agent configs
- sdpm MCP server provides init_presentation, read_workflows, run_python,
generate_pptx, measure, preview etc.
- Agent can now follow the same workflow as web version
- Both sdpm-spec and sdpm-composer connect to mcp-local/server.py
* 📝 checkpoint: ACP chat + mcp-local working, UI integration pending
* 🐛 fix(local-desktop-app): tool completion detection + presentation.json support
- Parse ACP tool_call_update rawOutput to extract result
- Derive deckId from output_dir for onDeckCreated callback
- Support both deck.json and presentation.json in localDeckService
- listDecks scans directories directly instead of requiring decks.json index
- patchDeck supports both file formats
* 📝 notes: document mcp-local/mcp-server tool parity gap as blocker
- run_python missing in mcp-local (critical)
- get_preview API mismatch
- save_web_image, apply_style, read_uploaded_file missing
- Plan: separate branch feat/mcp-local-parity from main
* ✨ feat(mcp-local): add run_python tool for local code execution
- Execute Python code with cwd set to deck directory
- No sandbox (direct subprocess execution)
- measure_slides support via existing measure tool
- API compatible with mcp-server's run_python (deck_id, save, measure_slides, purpose)
* 🐛 fix(mcp-local): align instructions with mcp-server
- Add run_python architecture guidance to MCP instructions
- Agent now knows to use run_python for file editing, not fs_write
- Match mcp-server's single workflow entry point
* 🐛 fix(local-desktop-app): fix infinite re-render + stable collaborators ref
- Add stable empty array/object refs for collaborators in getDeck
- Prevents DeckActions useEffect infinite loop
- Support presentation.json in getDeck/patchDeck/listDecks
* 🔍 debug: add tool completion log for deckId detection
* 🐛 fix(local-desktop-app): disable Vite browser open + read art-direction.md fallback
* ✨ feat(local-desktop-app): implement fetchStyles from local style HTML files
- Read style HTML from skill/references/examples/styles/
- fetchStyleHtml returns full HTML for style preview
- Art direction step now shows style candidates in SpecStepNav
* 🐛 fix(local-desktop-app): keep isLoading=true until turn ends
- Don't await rpcRequest for session/prompt (it resolves on stopReason)
- Use turnEnd promise to keep invokeAgent pending until agent finishes
- Stop button now visible during agent execution
- Fix beforeDevCommand to prevent browser auto-open
* 🐛 fix: disable vite auto-open in package.json dev script
* 🐛 fix: prevent agent from opening files in external browser
- Add instruction to not use open/xdg-open/start commands
- Art direction HTML should be displayed in UI, not opened externally
* 🐛 fix: move no-open rule to kiro agent config only
- Revert system-prompt.md (shared with web version)
- Add desktop-only rule to sdpm-spec.json prompt
* 🐛 fix(mcp-local): remove open_styles_gallery from list_styles
- Was opening browser with styles HTML gallery
- Desktop app displays styles in UI instead
* 🐛 fix(local-desktop-app): only resolve turnEnd on end_turn, not tool_use
- stopReason 'tool_use' means agent will continue after tool result
- Only 'end_turn' means the agent is done
- Keeps isLoading=true during multi-tool agent turns
* 🐛 fix: remove --open false from vite CLI (was parsed as URL)
* 🐛 fix(local-desktop-app): catch end_turn from both pending and unmatched responses
- Check stopReason on pending response resolution too
- Handles case where kiro-cli reuses/increments response ids
* 🐛 fix(local-desktop-app): send session/cancel as notification, not request
- cancel was consuming a request id, causing prompt response to be missed
- Send cancel directly without id (fire-and-forget)
* 🐛 fix(local-desktop-app): treat cancelled as turn end
- stopReason 'cancelled' also resolves turnEnd promise
- Allows chat to continue after stopping agent
* 🐛 fix(local-desktop-app): restrict agent tools to @sdpm MCP only
- Remove fs_read, fs_write, execute_bash, grep, glob from agent tools
- Agent can only use MCP tools → forced to follow workflow like web version
- Prevents agent from bypassing workflow with generic file tools
* 🐛 fix(local-desktop-app): enforce workflow-first in agent prompt
- Add MANDATORY First Step: read_workflows before any other tool
- Matches web version behavior where workflow is always read first
* 🐛 fix(local-desktop-app): embed MCP instructions in agent prompt
- Web version injects MCP instructions into system prompt directly
- kiro-cli treats MCP instructions as lower priority
- Embed the same instructions in agent prompt for equal priority
* ✨ feat(local-desktop-app): reset ACP session on New Chat
- Track currentChatSessionId to detect when UI creates new chat
- Create new ACP session (session/new) while reusing same kiro-cli process
- Agent context is fresh for each new chat
* ✨ feat(local-desktop-app): auto-approve permission requests from kiro-cli
- Handle session/request_permission by replying allow_always
- Subagent and tool permissions auto-approved
* 🐛 fix(local-desktop-app): clarify agent role - do Phase 1 yourself, don't delegate
- Explicitly state 'You ARE the SPEC agent'
- Only use subagent for Phase 2 after user approval
- Enforce read_workflows as first action
* 🐛 fix(local-desktop-app): simplify agent prompt to match web version
- Remove all custom instructions from prompt
- Use only system-prompt.md (same as web version)
- Let MCP instructions be handled by kiro-cli natively
* 🐛 fix(local-desktop-app): inline web version's effective prompt
- Embed system-prompt.md + MCP instructions directly in agent prompt
- Matches exactly what web version's agent sees as system prompt
- kiro-cli doesn't inject MCP instructions into system prompt like web version does
* 🐛 fix(local-desktop-app): normalize tool_call name + pass rawInput as input
- Strip 'Running: @sdpm/' prefix from tool_call title
- Pass rawInput as input for workflow phase detection
- Enables onWorkflowPhase to detect briefing/outline/art-direction transitions
* ✨ feat(mcp-local): add apply_style tool + document dual maintenance
- apply_style copies style HTML to deck's specs/art-direction.html
- Matches mcp-server's apply_style functionality
- Document unavoidable dual maintenance (prompt, CSS) in notes
* 🐛 fix(local-desktop-app): filter session/update by sessionId
- Only process messages from our ACP session
- Ignore subagent session messages (different sessionId)
- Prevents subagent output from appearing in parent chat
* ✨ feat(local-desktop-app): forward subagent tool events to parent ToolCard
- Track subagentToolCallId when 'Spawning agent crew' starts
- Forward subagent tool_call/tool_call_update as toolStream to parent
- Shows subagent progress (run_python, grid, measure) in compose ToolCard
* ✨ feat(local-desktop-app): add parallel subagent instructions to SPEC agent
- Instruct SPEC agent to split slides into groups (max 4)
- Provide InvokeSubagents JSON example with multiple sdpm-composer entries
- Group assignment rules from feat/agent-separation-spec-composer branch
* 📝 checkpoint: E2E flow working — agent creates slides, UI integration pending
Working:
- ACP chat with kiro-cli
- sdpm-spec agent with MCP instructions
- mcp-local with run_python, apply_style
- subagent (sdpm-composer) execution
- subagent progress forwarding to ToolCard
- permission auto-approve
- session reset on New Chat
Remaining:
- SVG compose not generated (mcp-local run_python lacks post-processing)
- PNG preview not generated (need generate_pptx + preview call)
- Slide carousel empty (no preview images)
- Parallel subagent (agent sends 1 stage, not multiple)
- LibreOffice auto-install prompt
* ✨ feat(mcp-local): add PPTX build + SVG compose post-processing to run_python
- After save=True: generate PPTX → LibreOffice SVG export → compose split
- Copy compose.py from mcp-server (lxml + Pillow deps)
- Add lxml, Pillow to pyproject.toml
- Detect LibreOffice on macOS (/Applications/LibreOffice.app)
- Compose generates defs.json + per-slide JSON in deck/compose/
* Split mcp-local into thin (server.py) and thick (server_acp.py)
- server.py: restore main's full instructions (Workflow A/B/C/D), remove run_python,
restore open_styles_gallery in list_styles. Standalone users unaffected.
- server_acp.py: ACP entry point with run_python, ACP-specific instructions,
list_styles without browser opening. Used by .kiro/agents/*.json.
- Agent configs updated to use server_acp.py
* Zero diff: restore mcp-local server.py/tools.py/pyproject.toml to main
- apply_style moved from server.py to server_acp.py
- lxml/Pillow deps removed from pyproject.toml (ACP uses them at runtime via skill/.venv)
* Require LibreOffice 25.8.6+ for multi-slide SVG export (macOS fix)
25.8.4.2 on macOS only exported first slide to SVG due to current-frame
fallback in filterImpressOrDraw(). 25.8.6 adds ConversionRequestOrigin check
that bypasses this path for CLI/headless invocations.
- install-libreoffice.sh/.ps1: check version, reject <25.8.6
- desktop/src-tauri/src/lib.rs: version-aware check_libreoffice()
- mcp-local/server_acp.py: re-enable SVG compose post-processing
- notes.md: update blocker entry (resolved) + LOK impossibility
* Adapt run_python to new deck structure (deck.json + slides/*.json + outline.md)
- Pass deck directory to sdpm.api (new format auto-detected)
- Map measure_slides slugs → page numbers via parse_outline_slugs
- Legacy presentation.json still supported as fallback
- Aligns with mcp-server/server.py behavior from feat/agent-separation-spec-composer
* Update agent JSON configs for subagent branch + new deck format
- sdpm-spec.json: inline prompt (kiro-cli doesn't substitute Strands placeholders).
Adapted _SPEC_AGENT_PROMPT_TEMPLATE to use use_subagent instead of compose_slides.
Added deck.json + slides/{slug}.json format notes.
- sdpm-composer.json: inline prompt, specifies deck_id passed via query,
emphasizes writing only assigned slugs for parallel safety.
- Resources updated to new workflow files.
Note: prompts/*.md remain as the Strands-side canonical source. ACP duplicates
because kiro-cli file:// loader doesn't process {now}/{mcp_instructions}/{deck_id}
placeholders and compose_slides is Strands-specific.
* Align ACP subagent/compose events with Web UI (subagent branch)
subagent progress events:
- Group subagent sessions by arrival order (Group 1..N)
- Parse use_subagent queries to extract slide slugs per group
- Emit {group, total_groups, slugs, status:'starting'} on first event
- Emit {group, slugs, tool, toolUseId, input} for tool_call
- Emit {group, slugs, toolResult, toolStatus} for tool_call_update completion
- Emit {group, slugs, status:'done'} on subagent turn_end
This matches Web UI's ToolCard group rendering expectations.
compose naming:
- server_acp writes compose/{slug}_{epoch}.json and defs_{epoch}.json
(matching api/index.py convention from feat/agent-separation-spec-composer)
- localDeckService picks latest epoch per slug for composeUrl
* Fix broken toolCallback firing: remove duplicate if block + stray brace
Previous commit left a stale 'if (title === "Spawning agent crew" || name === "subagent")'
without a closing brace, causing toolCallback to never execute for regular tool_call events.
This broke ToolCard display, deck navigation (onDeckCreated), and workflow tab switching
(onWorkflowPhase) in the UI.
* Per-slug compose with diff + changed flag (animation support)
Matches mcp-server implementation:
- Regenerate compose for measure_slides + missing slugs + slides modified since last compose
- Compute per-component 'changed' flag via diff against previous compose
- On first build, regenerate all slugs
- Surface LibreOffice version warning when SVG export is single-slide (requires 25.8.6+)
Frontend AnimatedSlidePreview uses 'changed: true' flag to drive slide animation.
* Show in-progress tool state in UI
Previously, tool_call_update with status != 'completed' was sent as stream event,
which ChatPanel silently dropped if the toolUseId wasn't already registered.
Now we register the toolUse (status unset) for in-progress updates too, so the
ToolCard shows spinner/active state before completion.
* Fix slide previews: map page{NN}-*.png to slug via outline.md order
skill/sdpm.api.preview outputs files as 'page{NN}-{title}.png' (not {slug}.png),
so the previous lookup ({slug}.png) found nothing. Now we parse outline.md for
slug order and match page{NN}-*.png by index.
* Rename subagent parent tool to compose_slides
- tool_call: when title is 'Spawning agent crew' / name is 'subagent', emit
toolCallback with name='compose_slides' so Web UI TOOL_META resolves to
'Composing slides' label + Package icon.
- tool_call_update: same rename when toolCallId matches tracked subagent,
so the completion event updates the same toolUse.
- Subagent stream events (from nested sessions) already used 'compose_slides' —
they now attach to the correct parent toolUse and render as Group 1/N progress.
* Fix preview + pptx paths in run_python save=True
- sdpm.api.generate auto-derives output path from input_path.with_suffix(.pptx);
when input is a directory, this resolves to parent_dir/deck_name.pptx.
Force output_path=deck_dir/output.pptx so PPTX stays in the deck workspace.
- sdpm.api.preview writes to fixed /tmp/pptx-preview. Clear it before each
build to avoid stale PNGs from previous decks.
- Clear deck/preview/ before copying so stale files from old slide sets
don't linger.
* Workaround kiro-cli UTF-8 crash + handle _kiro.dev notifications
Two issues:
1. kiro-cli crashes on multi-byte subagent queries (agent_crew.rs:181 uses
byte-index slicing, breaking UTF-8 boundaries). Warn SPEC agent to keep
subagent queries ASCII-only. Japanese content belongs in specs/brief.md.
2. kiro-cli sends 'tool_call_chunk' via '_kiro.dev/session/update' extension
notification. Previously ignored. Now handled as a tool_call event so
sub-tool activity in subagents shows up in the ToolCard progress stream.
* Override init_presentation for subagent-branch deck format
skill/sdpm.api.init() still creates the legacy presentation.json format,
but subagent branch expects deck.json + slides/ + specs/ layout.
Override in server_acp.py so new decks match the format that sdpm.api.generate
(directory input) and sdpm.api.parse_outline_slugs expect, and that the
composer workflow writes per-slide files into slides/{slug}.json.
* Enable Tauri assetProtocol for SDPM-Presentations dir
convertFileSrc returns 'asset://localhost/...' URLs. Without assetProtocol.enable
and a scope allowlist, the webview cannot load these assets — all previewUrl /
composeUrl / defsUrl images and JSON stay empty in the UI.
Scope: $HOME/Documents/SDPM-Presentations/** covers all deck workspace files.
* Measure report uses slug names instead of page numbers
Previously passed int page numbers to sdpm.api.measure, so the report read
'Slide 3:' which subagent couldn't map back to the slug it edited.
Now pass slug strings directly; sdpm.api.measure resolves slug→page and
format_measure_report(page_to_slug=...) outputs 'Slide title:' / 'Slide agenda:'
etc. Matches mcp-server behavior from feat/agent-separation-spec-composer.
* Align ACP tool signatures with mcp-server (Web) for subagent parity
Override signatures so subagent prompts written for Web work in ACP unchanged:
- generate_pptx(deck_id) — was (slides_json_path, output_path); now accepts deck dir and forces output.pptx inside
- get_preview(deck_id, slide_numbers: list[int]) — was (slides_json_path, pages: str)
- code_to_slide(deck_id, code, name, ...) — now saves includes/{name}.json and returns include_path (Web behavior)
- pptx_to_json(pptx_path) — doc clarifies ACP uses local path (Web uses deck_id + upload_id)
- analyze_template(template, layout) — param name from template_path to template (matches Web)
Remaining intentional differences:
- measure_slides tool: ACP only (Web exposes via run_python.measure_slides)
- init_presentation(name, template): ACP accepts template upfront; Web sets later via run_python
- read_uploaded_file, save_web_image, search_slides: Web only (S3/KB deps); ACP uses run_python for file I/O and urllib
* Fix first-compose animation trigger for new decks
hadSlidesOnMount was initialized from slides.length > 0, which treated
new decks with outline-populated slide stubs (no composeUrl) as 'existing
decks' and suppressed the first compose animation.
Change: detect existing decks by checking if any slide has composeUrl at
mount. New decks (outline-only or empty) fall through to animation-on-first-
compose path.
Applies to both Web (new deck creation flow) and ACP (desktop).
* Await document.fonts.ready before SVG render
WebKit (Tauri wry on macOS) computes textLength against default metrics
if fonts aren't loaded yet, producing horizontally compressed text until
a layout recalc is forced (e.g. by toggling view mode).
Add a one-shot await document.fonts.ready before fetching compose data.
Harmless on other webviews since the promise resolves immediately once
fonts are loaded.
* Apply 3s settled cooldown only to existing decks
skipAnimation had two suppression paths:
1. !settled (3s cooldown after slides tab becomes visible)
2. hadSlidesOnMount AND !firstComposeSeen (first batch of existing deck)
Path 1 applied universally, blocking animations for new decks when compose
arrives within 3 seconds of mount. Path 1 is meant to prevent flicker on tab
switch of existing decks — not relevant for new deck creation where user
expects to watch each slide animate in.
Guard path 1 with hadSlidesOnMount so new decks animate immediately on first
compose arrival.
* Drop textLength restoration after typewriter animation
typewrite() temporarily removed textLength/lengthAdjust attrs during typing
and restored them when the span completed. WebKit (Tauri wry on macOS)
reapplies spacingAndGlyphs length adjustment after all glyphs are present,
compressing the text horizontally.
The attributes are LibreOffice-calibrated hints for exact width matching —
dropping them lets the browser use natural glyph widths. Difference is
visually minor and the compression artifact disappears.
* Strip textLength/lengthAdjust from compose SVG at generation time
Regex for removing text-length attributes had \s+ (requires space BEFORE attr)
which didn't match when lxml emits 'size=".." lengthAdjust=".."' (single
space separator). Relaxed to \s.
Also add mount-time debug log in SlideCarousel so we can verify
hadSlidesOnMount decision when checking why first-compose animation
doesn't trigger.
* Fix duplicate/missing slide previews
Two bugs caused preview mismatches:
1. skill/sdpm/api.py sanitised slide titles for filenames but didn't collapse
whitespace. Titles containing line breaks produced filenames like
'page06-Storage\nClasses\n—\n6\nつの使い分け.png'. These broke the
preview regex matching in localDeckService and caused readDir to fail
for some entries. Now collapse \s+ to underscore.
2. localDeckService used outline index (i+1) as PPTX page number. When the
outline contained slugs without matching slides/*.json files, the PPTX
builder skipped them but the outline iteration still incremented its
counter, causing previewByPage.get(i+1) to fetch wrong-indexed PNGs.
Now track pageNum separately, incrementing only for slugs with a slide
file present.
* Fix PPTX spam in parent directory
sdpm.api.preview() and sdpm.api.generate() derive their PPTX output path
from input_path.with_suffix(.pptx) when output_path is empty. For directory
inputs (deck_dir), this resolves to parent_dir/deck_name.pptx — flooding
~/Documents/SDPM-Presentations/ with a timestamped PPTX on every run.
Pass output_path=deck_dir/output.pptx explicitly to:
- get_preview tool
- run_python save=True preview call
Also delete the existing spam PPTX manually if desired.
* Restart kiro-cli acp process on new chat
Reusing the same kiro-cli acp process and calling session/new alone dropped
the --agent sdpm-spec context, so the new chat fell back to the default
agent (full bash/fs access, no @sdpm/use_subagent guidance). The agent
then tried to run bash and failed because allowedTools only includes @sdpm.
Fix: stopAgent() + startAgent() on new chat. Also clear all module state
(pending requests, subagent tracking) on stop so the fresh process doesn't
inherit stale callbacks.
* Remove mtime-based compose auto-detection (aligned with mcp-server)
Parallel composers share the deck workspace. Composer A writing slide-a
triggers save=True, then mtime check would catch slide-b written by
Composer B (in-flight), composing both together. Effect: UI shows multi-
slide batch animations instead of one-at-a-time progress.
Only regenerate compose for:
- measure_slides (explicit target from save=True call)
- slugs without any existing compose (first build or new slides)
- full regen on first build (no prior compose at all)
Matches mcp-server logic from feat/agent-separation-spec-composer. Each
composer's save=True targets its own slug via measure_slides.
* Align get_preview with mcp-server: return Image content, not paths
Web version's get_preview returns actual Image objects that the model can
visually inspect (post-compose design review). ACP version was returning
JSON paths, which the model cannot 'see'.
Changed:
- Read existing preview/*.png (don't regenerate — assumes run_python(save=True)
or generate_pptx was called first, matching Web behavior)
- Resize to max_edge 800/1280 by quality
- Convert RGBA → RGB, encode as JPEG q=85
- Return list of str labels + Image(data, format='jpeg') for MCP serialization
* Fix compose index→slug mapping when slides/ is incomplete
When outline has slugs without matching slides/*.json, the PPTX builder
skips them. Previous code indexed into the FULL outline list using the
SVG slide number, so every compose file after a missing slide got the
wrong slug. Affected slides ended up with no compose on UI (SVG animation
falls back to PNG).
Fix: build pptx_slugs = [s for s in outline if slides/s.json exists] and
index into that list. Now SVG slide N maps to the Nth present slug.
* Align compose targeting with mcp-server: empty measure_slides → all
Web version composes all slugs when measure_slides is empty (broad rebuild
scenario, e.g. from generate_pptx or manual save without explicit slug list).
ACP was only composing missing ones, so a save=True call without measure_slides
would leave existing compose files unchanged (stale diffs).
* Strict compose targeting: measure_slides only after first build
User reported 8 slides appearing at once without animation. Root cause:
composer wrote multiple slides then called save=True once. Previous logic
included 'all slugs missing compose' on every save, so a late save from
one composer catches everything written by other parallel composers that
hadn't been composed yet.
Now:
- First build (prev_by_slug empty): compose all slugs (bootstrap)
- Subsequent: compose only measure_slides, nothing else
Trade-off: if a composer writes a slide and forgets measure_slides, that
slide won't have compose until next explicit save targets it. This matches
the intended contract — the composer prompt mandates measure_slides on
every slide edit.
* Mandate per-slide save in composer prompt
Add explicit 'Per-Slide Save (MANDATORY)' section to prevent composer from
batch-writing multiple slides before a single save=True call. Each slide
must be written → saved (with measure_slides=[slug]) → moved on.
Server-side fix alone is insufficient — if composer batches writes, save
only captures the last slide, leaving others with no compose. The prompt
change makes the contract explicit.
* Revert skipAnimation overcomplication; add debug log
Revert the complex skipAnimation expression to the original:
skipAnimation={hadSlidesOnMount && !firstComposeSeen}
Add null-safe composeUrl access in AnimatedSlidePreview.check() and a
one-line debug log 'AnimPrev <slideId> new url, skip=<bool>' so we can
observe which slides trigger animation vs skip when user reports no
first-load animation.
* Log animTargets + reducedMotion to diagnose no-animation path
* Add diagnostic logs: setError trigger + slidesWithPreview contents
* Add true mount/unmount log to distinguish from re-render
* Hide share/visibility/favorite buttons in Tauri desktop app
Detect Tauri via globalThis.__TAURI_INTERNALS__ (injected by Tauri v2).
These actions depend on server-side APIs (DynamoDB visibility, share
endpoints) that don't exist in the local desktop version.
* Hide My Decks/Favorites/Shared/Internal tabs in Tauri desktop app
Local version has no server-side deck ownership, sharing, or favorites.
All decks are local files — tabs are meaningless.
* Tauri: hide server-dependent UI, open files instead of download
DeckCard: hide Copy URL, Make Private/Internal, Share, visibility badge,
collaborators badge. Download PPTX → Open PPTX.
SlideCarousel: PPTX button opens file with default app (LibreOffice/
Keynote). JSON button opens deck directory in Finder/Explorer.
Uses __TAURI_INTERNALS__.invoke('plugin:shell|open') to avoid importing
@tauri-apps/plugin-shell in shared web-ui code (not in web-ui node_modules).
Adds shell:allow-open capability for Tauri shell open permission.
* Use Rust open_path command for file open in Tauri
shell:allow-open scope only permits URLs (http/mailto/tel). Instead of
fighting the scope regex, add a simple Rust command using the 'open' crate
that calls the OS default handler for any file path.
- SlideCarousel PPTX/JSON buttons: invoke open_path
- DeckCard Download PPTX: invoke open_path (was window.open)
- Remove shell:allow-open from capabilities (not needed)
* Fix JSON button: resolve full deck path before open_path
deckId is a directory name (e.g. 20260418-0213-redshift-overview), not
a full path. Resolve via plugin:path|resolve_directory(Home) + Documents/
SDPM-Presentations/{deckId} to get the absolute path for open.
* Add model selector to desktop chat header
Dropdown in chat header (Tauri only) lets user pick Bedrock model:
- Default, Claude Sonnet 4, Claude Opus 4, cross-region variants
- Stored in sessionStorage, read by acpAgentService on startAgent
- Takes effect on next new chat (process restart)
- Web version unaffected (isTauri guard)
* Dynamic model selector from ACP session/new response
Replace hardcoded model list with dynamic list from kiro-cli ACP.
session/new returns models.availableModels + models.currentModelId.
- ChatPanelShell: ModelSelector reads from globalThis.__sdpmModels
- acpAgentService: populates __sdpmModels on session/new response
- Filters out [Internal] and [Deprecated] models
- Selection stored in sessionStorage, applied via --model on next start
- Auto-updates when kiro-cli adds new models (no code change needed)
* Start ACP agent on mount so model list appears immediately
- ensureAgent() exported from acpAgentService (idempotent startAgent)
- Registered on globalThis via serviceProvider.tsx (avoids cross-module import)
- ChatPanelShell calls __sdpmEnsureAgent on mount (Tauri only)
- Model dropdown now populated before first message
* Fix race condition: deduplicate concurrent startAgent calls
ensureAgent now tracks the in-flight startPromise so concurrent callers
(ChatPanelShell mount + invokeAgent) share the same promise instead of
both entering startAgent with child=null.
* Align with ACP spec: fs capability false, model switch via set_config_option
- Set fs.readTextFile/writeTextFile to false (no handler implemented,
advertising true would cause deadlock if agent requests file ops)
- Remove --model flag from process args; use session/set_config_option
to change model after session/new (ACP standard method)
- ModelSelector onChange sends set_config_option immediately (no restart)
- Stored model preference applied on session creation via set_config_option
- Model switch now works mid-session without process restart
* Fix animation missing: disable StrictMode + per-deck compose seen tracking
StrictMode double-invoke in Tauri dev caused AnimatedSlidePreview fetches
to be cancelled (useEffect cleanup fires between 1st and 2nd invoke),
triggering setError(true) and falling back to WebP. Web production build
doesn't double-invoke, so this only affected desktop dev/prod.
Also track compose-seen state per deck in globalThis so SlideCarousel
remounts (poll cycle re-renders) don't re-trigger 'existing deck' skip
logic when the deck was originally new.
* Revert globalSeen compose tracking — caused 2-stage animation bug
After remount post-compose-arrival, globalSeen=true made hadSlidesOnMount=true,
so skipAnimation was true on first fetch. Then when composeUrl updated (new
epoch), second fetch triggered with skipAnimation=false → full slide shown
first, then animation played.
Revert to pure mount-time detection. StrictMode disable already prevents
spurious unmount/remount issues.
* Add Preview Review section to composer prompt (ACP + web)
Explicitly instruct composer to call get_preview after composing slides,
visually inspect the returned images (Claude models are multimodal so
images flow through MCP → ACP ContentBlock without transformation), and
iterate until clean.
Without this, composer was composing slides but skipping visual review.
* Revert "Add Preview Review section to composer prompt (ACP + web)"
This reverts commit 4094e70664278615e1d65fe859d36c0ca1a7d787.
* Align with ACP spec: configOptions fallback + session/new on new chat
2. Agent config: kept kiro-cli --agent (tauri shell capability limitation)
3. Model list: prefer ACP-standard configOptions, fall back to kiro-cli models
4. _kiro.dev/session/update: already handled (both method names)
5. New chat: try standard session/new first, fall back to process restart
if kiro-cli loses agent identity
ASCII-only query constraint remains (kiro-cli-specific UTF-8 boundary crash)
but only matters for use_subagent which is kiro-cli-exclusive anyway.
* Add ACP agent adapter layer (kiro-cli / claude / opencode)
ACP spec has no subagent concept — each agent implements it as a tool:
- kiro-cli: use_subagent (array of {query, agent_name})
- claude: Task (subagent_type + prompt)
- opencode: task (description + prompt)
Adapter abstracts:
- process spawn command/args
- subagent tool name detection
- subagent query extraction (rawInput shape differs)
- new-chat behavior (kiro-cli needs restart, others use session/new)
Switch via VITE_SDPM_ACP_AGENT env (default: kiro-cli).
SPEC prompt still specifies kiro-cli syntax; switching agents requires
updating the prompt accordingly (per-agent SPEC prompt variants could
be added later).
* Inject adapter-specific subagent instruction into SPEC prompt at startup
New file: prompts/spec-agent-acp.md — agent-agnostic SPEC prompt with
{subagent_instruction} placeholder.
On startAgent(), read the template, substitute with adapter's
subagentInstruction (kiro-cli: use_subagent / claude: Task / opencode:
task), and update .kiro/agents/sdpm-spec.json.
Switching VITE_SDPM_ACP_AGENT=claude now produces a SPEC prompt that
tells the agent to use Claude Code's Task tool syntax.
* Add Agent Settings dialog (Obsidian-style ACP agent registration)
Users can register custom ACP agents via UI:
- Display Name, Agent ID, Path, Arguments, Subagent Tool, Prompt Inject
- Active agent selected via radio button
- Saved to localStorage
- 'Save & Restart' reloads the app
Presets: kiro-cli, Claude Code
Users can Add Agent for custom entries (gemini, opencode, etc.)
Adapter now reads from localStorage instead of env var.
Note: Tauri shell capability currently whitelists kiro-cli/claude/opencode/
gemini by name. Other binaries or full paths may need capability updates.
* Add environment variables + multi-line args to agent settings
Align with Obsidian Agent Client plugin's field layout:
- Arguments: one per line (textarea) instead of space-separated
- Environment variables: KEY=VALUE per line (for API keys, etc.)
Env passed to Command.create for the spawned ACP process.
Remaining Obsidian parity gap: Auto-detect button (needs Rust 'which'
command via tauri command). Skipped for now — user can paste full path
manually.
* Move ACP Agents settings to user menu (top-right)
Relocated from chat panel header to the user dropdown menu alongside
'Send with Enter'. Fits natural settings placement pattern.
Tauri: shows 'ACP Agents' menu item + hides 'Sign out' (no auth locally)
Web: keeps Sign out unchanged
Removed the standalone settings button in ChatPanelShell header.
* Fix z-index stacking for header menu + dialog
- Header: relative z-[70] so user menu (z-[60] absolute child) appears
above ChatPanel (z-50) and its children
- AgentSettingsDialog: z-[100] to sit on top of everything
Fixes:
- User menu items (Send with Enter, ACP Agents) now clickable when chat
panel is open
- New Deck button no longer obscures the settings dialog
* Add Python CLI distribution — sdpm_app with FastAPI + static web-ui
Enables no-signing distribution on macOS:
brew install uv
uv tool install sdpm-app
sdpm start # opens http://localhost:8765
sdpm install-shortcut # creates ~/Applications/SDPM.app
Structure:
- sdpm_app/__main__.py — CLI (start / install-shortcut)
- sdpm_app/server.py — FastAPI + /acp WebSocket proxy to kiro-cli
- sdpm_app/web/ — bundled static web-ui (built via build-web.sh)
- sdpm_app/pyproject.toml — hatchling package, includes web/ via force-include
web-ui/src/services/browserAgentService.ts:
- WebSocket client talks to /acp endpoint (server spawns kiro-cli subprocess)
- Drop-in replacement for Tauri acpAgentService
- Activated when not running under Tauri (future work: wire into service provider)
macOS signing: install-shortcut generates .app locally — no quarantine
attribute, Gatekeeper allows execution. Apple Developer Program not required.
* Revert "Add Python CLI distribution — sdpm_app with FastAPI + static web-ui"
This reverts commit 6ff3da34d7e2a2854806b92dc5779fb61a114055.
* Auto-install LibreOffice on first launch
On app startup:
1. Rust check_libreoffice_cmd() verifies LibreOffice 25.8.6+ present
2. If missing/old: show dialog asking user to install
3. On confirm: invoke install_libreoffice tauri command
4. install_libreoffice runs desktop/scripts/install-libreoffice.sh (or .ps1)
Added tauri-plugin-dialog + capability permissions for ask/message dialogs.
User experience: no manual setup — just launch the app, approve, done.
* Tauri: filter deck list by name instead of Bedrock KB slide search
searchSlides (Bedrock Knowledge Base) returns [] in Tauri since there's
no server-side index. Instead, filter the visible deck list by deck name
(case-insensitive substring match) when the search box has input.
Web unchanged — still uses SearchResultsGrid with server-side search.
* Centralize isTauri detection in lib/platform.ts
Remove 6 inline copies of '!!(globalThis).__TAURI_INTERNALS__' scattered
across AppShell, ChatPanelShell, DeckListView, DeckCard, SlideCarousel,
decks/page.tsx.
Single source of truth at web-ui/src/lib/platform.ts exports isTauri and
isBrowser constants. Matches the dual-mode pattern from Scribe and other
Tauri+Web dual-target apps.
Runtime behavior unchanged.
* Add file attachment handling to SPEC agent prompt
Files uploaded via chat + menu are saved to {deck_id}/uploads/.
SPEC agent now knows how to read them via run_python (open for text,
PyPDF2/Pillow for PDFs/images, pptx_to_json for PPTX import).
No dedicated read_uploaded_file MCP tool needed — run_python covers all
file types.
* Match Web UI animation: slides.length > 0 detection + defer slides until compose
Restore original SlideCarousel logic:
const hadSlidesOnMount = useRef(slides.length > 0)
And align localDeckService with Web API behavior: don't return slides
until at least one compose exists. Before: outline.md drove slides even
with composeUrl=null, which triggered 'existing deck' skip path.
Fresh deck: slides=[] → mount → hadSlidesOnMount=false → compose arrives
→ slides populated → new deck path → animate.
Existing deck: slides arrive with composeUrl populated → mount →
hadSlidesOnMount=true → skip animation.
* Remove AnimatedSlidePreview debug console.log
* Add minimal animation debug log
* Remove verbose ACP logs (raw/pending id/permission/tool completed)
* localDeckService: skip slides without compose to avoid WebP flash
Previously all slides with slides/*.json were included, with composeUrl
set to null if compose wasn't ready. The UI then showed WebP (SlideThumbnail)
for those until compose arrived.
Now: only include slides that have compose. Slides appear one-by-one as
their compose is generated — each already triggers AnimatedSlidePreview
immediately, no WebP intermediate.
* Add self-review (Phase 3) instruction to ACP composer prompt
Web version: composer reads create-new-3-review workflow which says
'Read preview images with fs_read Image mode'. That relies on fs_read
Image capability, which we disabled in ACP (capability=false).
ACP version: use get_preview MCP tool instead. Composer visually inspects
its assigned slides' preview images before returning to SPEC agent.
* Desktop: defer SlideCarousel mount until deck data loads
Desktop-only guard — renders empty div instead of SlideCarousel while
deck is null. This ensures hadSlidesOnMount captures slides.length > 0
at mount time for existing decks (isTauri && !isNew && !ws.deck).
Web version path unchanged.
* AnimatedSlidePreview: snapshot skipRef at detection time
Parent's setState flips firstComposeSeenRef → skipRef during the async
fetch, causing animation to fire even when skipAnimation was true at
detection time. Capture once at the top of check() before any await.
* Move first-URL skip detection into AnimatedSlidePreview
Parent's firstComposeSeenRef logic was fragile in Desktop (React batching
differed from Web). Instead:
- SlideCarousel passes skipAnimation = hadSlidesOnMount.current (stable)
- AnimatedSlidePreview's check() skips only if skipAnimation=true AND
this is the first URL it's seen (lastComposeUrlRef is empty)
- Subsequent URL changes (user edits) always animate regardless
* Remove animation debug log; log subagent get_preview calls
Tracks whether each composer subagent invokes get_preview and with which
slide_numbers so we can verify per-slide visual review.
* Remove subagent get_preview log and duplicate slug debug log
* Allow fs read/write anywhere (for SPEC prompt regen in project dir)
prompt regen writes to .kiro/agents/sdpm-spec.json in the project path,
which is outside $HOME/Documents/SDPM-Presentations. Expand fs scope.
* Attach {path: **} scope to each fs:allow-* permission
Tauri v2 requires per-permission scope — setting scope at identifier
level didn't apply to allow-read-text-file. Move scope into each
permission's allow list.
* Use fs:scope with path **/* (correct Tauri v2 syntax)
path: '**' didn't work; '**/*' is the recommended pattern. Applying
globally via fs:scope instead of per-permission.
* Move prompt regen to Rust command (bypass fs scope restriction)
Tauri v2's fs plugin scope refused read-text-file on the project path
outside $HOME/Documents. Instead, implement regen_spec_prompt as a Rust
tauri command using std::fs directly. Rust side has unrestricted file
access; capability system only gates plugin commands.
* Fix restart race: stale 'close' from old process clearing new state
During new chat restart, old process's close event arrives async after
the new process spawned, wiping child/sessionId refs. Guard the close
handler to only clear state when it matches the currently active child.
* Require composer to call read_workflows at start
resources 'skill://...' in agent config are not served by the MCP
server (no @mcp.resource implementation), so preload doesn't work.
Composer needs to explicitly call read_workflows to get compose + review
workflow details.
* Add README + DISTRIBUTION docs, remove subagent tool_call log
- desktop/README.md: setup, dependencies, ACP agent config, architecture,
troubleshooting
- desktop/DISTRIBUTION.md: signing options analysis (Apple Dev Program
vs unsigned DMG vs build-from-source vs Python CLI), decision record
- Remove [subagent N] console log now that workflow loading is verified
Duplicate slug diagnostic logs kept in SlideCarousel (for ongoing #1 task).
* Show ACP agent errors via toast notifications
- setAgentErrorCallback registered on app mount → routes agent failures
to Sonner toasts (10s duration for readability)
- spawn failure: 'Failed to start <cmd>: <error>. Check PATH.'
- unexpected close during active session: 'ACP agent exited unexpectedly.'
- process error event: 'ACP agent error: <err>'
Common scenarios covered:
- kiro-cli not installed / not on PATH → toast with install hint
- kiro-cli crashes mid-session → toast with restart suggestion
* Trigger compose re-check immediately on composeUrl prop change
The 1s interval in AnimatedSlidePreview was causing up to 1s lag
between composeUrl prop update and the actual re-render. During
realtime slide generation (composer writing multiple slide JSONs
and compose files rapidly), slides could briefly render stale
content from neighboring slides before the interval caught up.
Fix: expose check() via ref and invoke it from a useEffect keyed on
composeUrl. Interval remains as a safety net for edge cases.
Also add [SlideCarousel] slug→url diagnostic log (kept for ongoing
investigation of rare duplicate-slide rendering).
* Serialize concurrent saves per deck via file lock
Root cause diagnosis of duplicate slide content:
- Multiple subagent composers can call run_python(save=True) concurrently,
each triggering full PPTX build → LibreOffice SVG conversion → compose
extraction in parallel.
- PPTX writes to deck_dir/output.pptx are not atomic; parallel builds can
interleave, producing an inconsistent PPTX when a subsequent SVG export
reads it.
- Result: compose JSON for slug X contains slide Y's content because the
PPTX was partially overwritten when LibreOffice loaded it for
subagent A's build.
Fix: file lock on deck_dir/.save.lock for the duration of build+preview+
compose. Serializes the heavy post-processing step. Read-only run_python
calls (save=False) are not affected.
Also add [compose] svg slide→slug diagnostic log to stderr for future
investigation if any drift remains.
* WIP: current desktop app state for review
Includes:
- gitignore output/ and auto-generated Tauri schemas
- remove sdpm_app/ leftover from reverted Python CLI experiment
- sync capabilities.json with latest fs:scope config
- sdpm-spec.json and AnimatedSlidePreview.tsx in-progress changes
Shared as-is for review before rebase + cleanup onto
feat/agent-separation-spec-composer.
* 🧹 cleanup: untrack .kiro/agents and .kiro/specs (local-only assets)
These files were force-committed but should be excluded per .gitignore.
Files remain on disk but are no longer git-tracked.
* ♻️ refactor(web-first-local-mode): replace isTauri with CloudOnly/LocalOnly
SPEC: 20260421-1605_web-first-local-mode-no-tauri
Phase 1: UI conditional rendering migration
- Add web-ui/src/lib/mode.tsx (CloudOnly, LocalOnly, IS_LOCAL)
- Replace all isTauri branches (8 files) with declarative wrappers
- Remove web-ui/src/lib/platform.ts (no longer needed)
- Remove __TAURI_INTERNALS__ references from SlideCarousel, useDeckList
- Stub local-only handlers (handleJsonOpen, handlePptxOpen) for Phase 3
- Web build passes with zero behavioral change (IS_LOCAL=false by default)
* ✨ feat(web-first-local-mode): add local API routes and service layer branching
SPEC: 20260421-1605_web-first-local-mode-no-tauri
Phase 2+3: Local mode infrastructure
- Add API routes (local only): agent/invoke, agent/stop, decks, decks/[id], preview/[...path]
- agent/invoke: spawns kiro-cli acp, bridges JSON-RPC stdin/stdout to SSE
- decks routes: scan ~/Documents/SDPM-Presentations/ filesystem
- preview route: serve PNG/JSON/PPTX from local deck directories
- agentCoreService.js: IS_LOCAL branch calls /api/agent/invoke instead of AgentCore
- deckService.ts: IS_LOCAL branch calls /api/decks instead of API Gateway
- AuthProvider: skip Cognito in local mode (children rendered directly)
- next.config.ts: conditional output:export (disabled in local mode)
- package.json: add dev:local script, build script moves api/ out for static export
- Cloud build passes (npm run build) — API routes excluded via mv during build
* ♻️ refactor(web-first-local-mode): improve code quality and standards compliance
SPEC: 20260421-1605_web-first-local-mode-no-tauri
- Extract acp-process.ts: singleton process manager with subscribe pattern
- Extract sse-bridge.ts: JSON-RPC → SSE translation (strandsParser-compatible)
- Rewrite invoke/route.ts to compose the two modules (~30 lines vs ~200)
- Fix concurrent request support: Set<NotifyListener> with unsubscribe
- Fix IS_LOCAL: remove unnecessary typeof window check (build-time constant)
- Fix build scripts: build:cloud with trap for safe api/ restore
- Update deploy_webui.sh to use build:cloud
* 🐛 fix(web-first-local-mode): use build:cloud in all deployment paths
SPEC: 20260421-1605_web-first-local-mode-no-tauri
- buildspec.yml: CodeBuild now uses build:cloud (was build, would fail with API routes)
- ci.yml: GitHub Actions uses build:cloud for static export validation
* 🧹 cleanup(web-first-local-mode): remove TODO stubs, implement local file handlers
SPEC: 20260421-1605_web-first-local-mode-no-tauri
- SlideCarousel: handleJsonOpen/handlePptxOpen now use API route URLs
- useDeckList: remove Phase 3 TODO comment (already functional)
- Zero TODO/FIXME remaining in web-ui/src/
* 🧹 cleanup(web-first-local-mode): remove desktop/ and globalThis hacks
SPEC: 20260421-1605_web-first-local-mode-no-tauri
Phase 5: Tauri removal
- Delete desktop/ directory (Tauri app, ~50 files)
- Delete .github/workflows/build-desktop.yml
- Delete prompts/spec-agent-acp.md (desktop-only template)
- Replace globalThis.__sdpmModels with /api/agent/models API route
- Replace globalThis.__sdpmSetConfigOption with PUT /api/agent/models
- Replace globalThis.__sdpmEnsureAgent with fetch /api/agent/models
- Extract model info from session/new response in acp-process.ts
- Zero globalThis hacks remaining in web-ui/src/
* 🐛 fix(web-first-local-mode): fix local mode runtime errors
SPEC: 20260421-1605_web-first-local-mode-no-tauri
- useAuth: return LOCAL_AUTH in local mode (try-catch around useOidcAuth)
- Fix 4 files importing useAuth from react-oidc-context directly instead of @/hooks/useAuth
- deckService: guard getApiBaseUrl() to return /api/ in local mode (prevents aws-exports.json 404)
- deckService: add IS_LOCAL guards to listPublicDecks, listSharedDecks, listFavorites, getChatHistory
- deckService: add trailing slash to local API fetch URLs (trailingSlash config)
- ChatPanel: skip aws-exports.json fetch in local mode
- acp-process: fix syntax error (extra closing brace)
---------
Co-authored-by: Naohito Yoshikawa <naohitoa@amazon.com>
Co-authored-by: ShotaroKataoka <shotaro.kata@gmail.com>
ShotaroKataoka
added a commit
that referenced
this pull request
Oct 31, 2026
…E items (#467) * 🐛 fix(html-output-mode): stop every build on an invalid deck.json outputFormat 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) * 🐛 fix(html-output-mode): report scroll overflow of free-positioned blocks 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) * 🐛 fix(html-output-mode): judge decoration availability by the layouts 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) * 🐛 fix(html-output-mode): retry a failed decoration render after ten minutes 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) * 🔒 fix(html-output-mode): disable WebRTC in the browser check before slide 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 * ✅ test(html-output-mode): real-browser tests for network block, popups, 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 * 👷 ci(html-output-mode): run the real-browser tests on ubuntu with Chrome 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 * ✅ test(html-output-mode): 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 * 🐛 fix(html-output-mode): publish an HTML refresh's previews and PNGs 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) * 🐛 fix(html-output-mode): say how to fix an HTML deck whose template does 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) * ✨ feat(html-output-mode): warn next to Present / Download when slide 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) * 🐛 fix(html-output-mode): label the HTML finalize step, settle compose 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) * ✅ test(html-output-mode): sandbox headers of the local preview route 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) * 📚 docs(html-output-mode): restore the PPTX orchestrator instructions 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) * 📚 docs(html-output-mode): HTML decks choose a template; operating steps 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 * 🔒 chore(html-output-mode): checksum manifest for sdpm/vendor, checked 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) * 📚 docs(html-output-mode): accepted risks and browser-check egress in 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) * 💡 docs(html-output-mode): correct comments left from earlier phases 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 * 📚 docs(html-output-mode): collapse the [Unreleased] HTML entries into 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) * 🐛 fix(html-output-mode): finalize removes its previews when the record 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 * 📚 docs(html-output-mode): every visible text names the content; operating 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 * 📚 docs(html-output-mode): composer checks each icon against its background 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 * 🔒 chore(html-output-mode): suppress semgrep path-join finding in the 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 * 🐛 fix(html-output-mode): last low review items before merge - 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
ShotaroKataoka
added a commit
that referenced
this pull request
Nov 9, 2026
…pening; message_composer bounds (#563) * fix(local-webui): replay a period until its chat is saved; no doubled replies; message_composer bounds The non-blocking findings of the web-1 review (1-3) and the web-2 review (1-2), R5 of the pre-0.14 polish. web-1 #1, a replay without its opening turn duplicated the reply: - chat.ts buffers consecutive text deltas as one event under the last one's id (kiro-cli sends one per chunk), so MAX_BUFFERED_EVENTS (2000) drops a period's beginning much later. `bufferedAfter` gives a Last-Event-ID inside a merged run only the text after it. - useChatStream: a replay whose first message or output comes before any prompt turn cuts the history with `cutHistory(null)`; cutLocalAtPrompt(null) keeps the messages through the last user message. Cloud's cut returns undefined for null (unchanged behaviour). web-1 #2, delivered before saved: - The stream's end only records `endWritten`; the period is delivered (`markDelivered`) when the page's save after the stream's end reaches /api/agent/chat with `delivered: <session>` and `.chat.json` was written (saveChatToDeck now returns whether it wrote). Until then /api/agent/stream replays it. onSendComplete passes the session id the run streamed. web-1 #3, a failed /stream settled running tasks: - resumeLocalAgent rejects unless the answer is SSE or a JSON `{running: false}`; resumeLocal maps a failure to undefined, so settleStaleTasks runs only on the server's "nothing runs". web-2 #1, message_composer relayed past the tool's checks: - compose-run routes only input within the tool's bounds (group >= 1, text 1..10 000 code points); out-of-bounds input sends nothing, shows the tool's own refusal as an error and sends no <message_composer_error>. web-2 #2, finish() read isDropped before dropped() set it: - finish({dropped: true}): a drop ends the task cancelled, also after the 60-minute timeout. CHANGELOG [Unreleased] / Fixed: two entries. Checks run (worktree, this commit's tree): - web-ui: npx eslint src/ e2e/ --quiet: ok; npx tsc --noEmit: ok; npm test: 111 files / 1350 tests passed; npm run build:cloud: ok; npx playwright test: 28 passed; en/ja key parity: OK; package-lock.json unchanged - make lint: ok - make test: 2813 passed, 18 skipped, 1 failed: tests/test_html_assemble.py:: test_svg_icon_is_inlined_with_prefixed_ids ("asset not found: assets:aws/ Arch_AWS-Lambda_48"), from this machine's installed asset catalog; this commit changes no Python, test or asset file - ash scan --mode local --fail-on-findings: exit 0 - New tests fail on the old code (compose-run bounds and drop-after-timeout checked by stashing compose-run.ts) * fix(local-webui): keep a period's opening in the replay buffer; route coerced message_composer input as not delivered Review of 66e51de2 (review.json, CHANGES_REQUESTED), findings 1-4. 1. message_composer input the tool accepts but toolUse does not route (blocker): messageEnded shows the tool's own result as an error only when the tool refused (end.status "error" or result.status "error"). Other out-of-bounds input, such as a numeric-string group the tool coerces and answers "Sent", goes down the not-delivered path again: an error card and a <message_composer_error>, as on main. 2. A prompt-less replay dropped the saved head of a reply or still duplicated it. Chosen outcome: chat.ts never drops a period's opening (its events through the first turn, Period.opening). Past MAX_BUFFERED_EVENTS the oldest event after the opening goes, so a Local replay always starts with its prompt and the page cuts its history there. A saved reply or steer is never shown twice. What the buffer dropped is not replayed, so the reopened chat shows that reply from the oldest part kept. The cutHistory(null) path (HistoryCut, cutWithoutPrompt, cutLocalAtPrompt(null)) is removed because nothing reaches it now. 3. Style chat periods were never delivered: a stream that writes the end of a period of a chat no deck holds (savedDecks empty) delivers it at once, since no page can reopen it. 4. CHANGELOG: names only the empty and over-long text cases as delivered; describes the buffer outcome. Tests: compose-run case {group: "1", text: "x"} with a success result asserts the <message_composer_error>; chat.test pins the opening past the cap; useChatStream test pins a truncated replay against a saved full reply and a saved steer (no copy, head gone); acp-process case for a deck-less chat's delivery; the replay-until-saved cases bind a deck. The three new server-side tests fail on 66e51de2's code. Checks run (worktree, this commit's tree): - web-ui: npx eslint src/ e2e/ --quiet: ok; npx tsc --noEmit: ok; npm test: 111 files / 1351 tests passed; npm run build:cloud: ok (after removing a stale gitignored build/dev from an earlier dev server); npx playwright test: 28 passed; en/ja key parity: OK; package-lock.json unchanged - make lint: ok - make test: 2813 passed, 18 skipped, 1 failed: tests/test_html_assemble.py:: test_svg_icon_is_inlined_with_prefixed_ids ("asset not found: assets:aws/ Arch_AWS-Lambda_48"), from this machine's asset catalog; no Python, test or asset file changed - ash scan --mode local --fail-on-findings: exit 0
naohito2000
pushed a commit
that referenced
this pull request
Dec 1, 2026
…ot take Every role document says a guide of the user's own does not override the slide format or `verify`'s checks. Nothing enforced it. Resolution is user-first for reading as well as for listing, and `_shadowing_loss` only warns when the winner drops a tag — so a faithful copy of `slide-json-spec` carrying the same tags was silent, won the name, and was what the role's own mandatory read then returned. A stale copy would have outranked every later correction to the format the build enforces, on the one read a role cannot skip. `deck-json-spec`, `slide-html-spec`, `slide-json-spec` and `verify` are now refused from any source but `builtin`: reported `reserved-name` in the listing, and refused at write time by the API so the author hears it while they can still choose another name. The line is the one the role documents already drew — the deck and slide formats, and the checks. Replacing taste is untouched, `story-line` included: it is mandatory for the orchestrator and a user who disagrees about how a deck should be structured may still say so. Found by a four-axis review of the collection (structure #1, confidence 100). `TestTheReservedNames` covers the case no warning could: the same text with the same tags on both sides, which produces no shadowing warning at all. Mutation-checked — disabling the branch fails 6 of its 9. Two existing shadowing tests used `verify` as their example and now use `table`, which is the same shape and is taste a user may legitimately replace.
naohito2000
pushed a commit
that referenced
this pull request
Dec 1, 2026
…te where both modes see it The taste/engine line this branch drew held in two places and not in ten more. A four-axis review of the collection found them (structure #5-11,13 · duplication #1,4,5 · tags #1,2,3). **A slide-JSON contract behind `composer`.** `table`, `arch-elements` and `arch-layout-engine` describe a slide-JSON element or the `arch_diagram` tool's input, under descriptions that match any HTML table or diagram, and `composer` is both composer modes. An HTML composer reading `table`'s 287 lines gets `colWidths` and `cellOverrides` for a slide that has neither. All three are `composer-pptx` now, with descriptions that say which format they are for. **The mirror image in the chart guides.** `composer-pptx` hid what is true of any chart: six pie slices, two unstacked area series, one scale per chart, three to eight radar spokes. An HTML deck draws charts with the bundled ECharts and D3, so the HTML composer could produce a valid chart nobody can read. New `chart-choice` (`composer`) owns which chart the data calls for and where a chart stops being readable; the five type guides stay the slide-JSON field reference and point at it. Both composer workflows now name it. **Nine chart fields stated five times, already disagreeing.** `axisColor` and `axisWidth` were listed under area and bar but not line or radar, so a composer could not tell an unsupported field from an uncopied one. Read in the implementation: those nine are taken from `style` with no `chart_type` guard at all, while `gapWidth`/`overlap` are guarded to bar and `lineWidth`/`markerSize` to line and radar. The nine are now in `slide-json-media`, which owns the `chart` element, saying in as many words that a per-type guide lists only its own. **`design-rules` becomes the format-neutral design home.** It no longer says "pt is an absolute unit … No scaling needed" — that is the PPTX build's behaviour, and this guide reaches the HTML composer, where a point token needs `calc(var(--fs-x) * var(--sdpm-pt-scale))`. It gains the table treatment that `table` stated through slide-JSON field names, and the block sizes and vertical fill that `slide-json-spec` was carrying: now that the format spec's name is reserved, a preference stated there is exempt from the precedence rule *and* impossible to replace. **The four rules under any drawn diagram** — along a grid, symmetric where it branches, one spacing value per kind of gap, hierarchy drawn rather than implied — move from `arch-elements` to `visual-forms`, which the HTML composer and the style author also reach. `visual-forms` now says outright that its recipes' geometry holds in either format while their preset names are slide JSON's. **Three more copies removed, each read by the same reader as its original.** `slide-json-effects` recommended a use for every effect beside `design-rules`' own list; `slide-json-media` restated `freeform`'s coordinate system and command set for a reader it then sends to `freeform`; `source-material-guide` restated `attachments`' bundle paths and return fields; `slide-html-spec` restated the interaction policy `composer-html.md` carries on every job, inside a guide whose name is now reserved. Declined, with reasons, in the SPEC notes: splitting `grid` (both its readers need both halves — you call `grid()` because you are deciding a layout) and stripping the actor and timing from `deck-json-spec`'s fields (a field reference saying who writes a field is part of the field's meaning, and its other readers are the importer and the translator).
naohito2000
pushed a commit
that referenced
this pull request
Dec 1, 2026
…when to read it The description is the whole of what a caller sees before spending a read. Nothing in the code picks guides for them — not the deck's language, not its audience, not its template — so a description that misleads costs either a wasted whole-file read or, worse, a guide that is never read when it was needed. A four-axis review of the collection checked all 34 against their bodies (description #1-9). Five that named a situation that cannot happen, or none at all: - `design-rules` and `design-vocabulary` said "read during art direction phase". Only composers can see `design-rules`, and a composer is handed an art direction already frozen — the phase has passed before its only reader exists. A composer following the description skips it on every slide that needs its colour, type, effect or whitespace decisions. `design-vocabulary` is also used while writing an outline's `visual`, which `orchestrator.md` says in as many words. - `hand-edit-sync`: "Phase 4: Sync after hand-editing (only when requested)". The body requires the sync whenever the user hand-edited and then asks for more changes, before any further edit. Read as opt-in, the next build regenerates over their PowerPoint work. - `grid`: "read before placing elements" for a guide that subdivides rectangles. A composer reads 356 lines before a freeform or a radial arrangement it cannot help with. - `attachments`: a list of subjects with no situation, so an orchestrator can take attachment handling as covered by its workflow and miss the byte-offset paging, the immutable bundle path, and the retry an `IMPORT_INCOMPLETE` needs. - `aws-design`: "AWS-specific design conventions" promises the whole topic; the body answers which asset source to search and which category colour to use. `table` and the five `chart-*` descriptions now say which format they are the reference for, which is what their retagging in the previous commit means for a caller reading the listing. `writing-a-guide`'s own text on `management` is rewritten rather than its tags. The reviewer read "No role picks it up … this guide is one" as saying its `orchestrator` tag was a mistake. The sentence was about the tag, which is accurate — no role's set contains `management` — but it reads as being about the guide. `hand-edit-sync` carries the same pair and needs its orchestrator reach, so the rule is that `management` is carried beside the role tags of whoever acts on the guide, and `test_management_is_carried_beside_a_role_tag_never_alone` holds all three to it.
ShotaroKataoka
pushed a commit
that referenced
this pull request
Dec 3, 2026
… what to read (#711) * feat(guides): guide metadata, tag vocabulary, name rule and size cap Guides become one collection classified by role tags, so a guide needs metadata the frontmatter can carry and a single parse every surface shares. guide_meta returns the metadata with a frontmatter-stripped body, or the one category under which the guide is invalid, so an invalid guide is reported rather than silently degraded. is_guide_name is separate from is_style_name, which deliberately admits acme.v2: a guide name is also a payload key. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 1 * feat(guides): resolve guides from the same three layers as styles A user extends the collection by dropping a file in their own directory, so guides need the ordered resolution templates and styles already have. The user's directory is named guides, matching styles/ and templates/ beside it. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 2 * feat(guides): merge the sources into one collection object Listing, read-by-name and automatic hand-over must agree on which guide won a name, so they read one merged object rather than each resolving again. The object is a value the caller builds, which is what lets the remote merge S3 bodies through the same rule the local merges file reads through. An invalid entry is reported with its location and never wins a name, so a broken user guide falls through to the bundled one instead of disabling it. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 3 * feat(guides): select by tag intersection and join the handed-over text One predicate decides both what a caller can list and what it is handed, so a guide tagged for one composer mode cannot be visible in that mode while being invisible to the listing beside it. Selection takes the whole tag set rather than a role string, which is what lets a guide carry every tag it may be called under. The listing deliberately carries no body: it rides inside every start_* return, where 31 bodies would duplicate the prompt the hand-over already supplies. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 4 * feat(guides): one read path, cached only where references cannot change A local server must show an edited guide on the next call, so the collection is built per call and nothing is remembered. The cloud image's bundled references are fixed for the life of its process, so preload_references now warms them here too — but only the bundled ones: a user's guides live in a store that keeps changing under a running process. The guide cache is separate from _reference_cache because that one holds frontmatter-stripped content, and a guide's metadata has to survive the read. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 5 * feat(guides)!: delete the setup guide Nothing referenced it, and it told the reader to cd into a skill/ directory this repository does not contain. The install instructions readers actually need are in README.md and docs/en/getting-started.md. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 6 * feat(guides)!: storytelling-vocabulary becomes story-line, structure first "Structure" did not say what was being structured, and the guide buried the decision it exists to support: the five backbones a slide sequence can take, each with the audience condition that chooses it. Those now open the document and the vocabulary sits behind them, because the orchestrator is handed this guide on every deck and reads the opening every time. The published name storytelling-vocabulary is gone; callers use story-line. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 7 * feat(guides): add verify, the rules a slide owes whatever its style says Every other guide a composer holds carries preferences, and a deck may swap all of them. What a drawing is allowed to assert, and whether the text is true to its evidence, survive that swap — so they needed a guide of their own rather than living inside whichever style happened to be applied. Handed to both composer modes, so it is checked on every slide. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 8 * feat(guides): add writing-a-guide Users can now extend the collection, so the rules their guide has to satisfy need to be written down somewhere they can find them: the frontmatter grammar, the closed tag vocabulary, what always costs, and how to name a guide. The last section works the Japanese-deck case through, because that is where a reader would otherwise expect sdpm to select by language. Selection is by tag alone, so a conditional guide carries its condition in its description. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 9 * feat(guides): rewrite source-material-guide for the deck workspace It still described output under /tmp/sdpm/{name}/ and a "Phase 1 (art direction)" that no longer exists, which is part of why nothing referenced it. Its subject has no other home: import-pptx covers turning a PPTX into the deck, and nothing covered reusing parts of one as material for a new deck. Rewritten against the import bundle, and extended with how a reuse decision reaches a composer — through the brief's Sources and the outline's evidence, since a composer sees nothing else. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 10 * feat(guides): tag every bundled guide, and drop the dead frontmatter keys Tags are how a guide reaches a role now, so every bundled guide carries the full set it may be called under — a guide tagged for one composer mode only is invisible to the other, including in its listing. category: and name: went with them. Thirteen guides carried one or both and nothing had ever read either, so they only misled an author writing a guide of their own. writing-ja now leads its description with the condition that selects it, since no code looks at the deck's language: the reader checks the first clause. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 11 * test(guides): pin the bundled collection by equality A tag added or dropped by accident changes a role's prompt silently, and sampling would not catch it. The map here is the contract: a new guide needs a row, which is the moment somebody has to think about its tags. Content is asserted structurally only — a section exists, a condition is stated. What a guide says is judged by a person, so HUMAN_REVIEW records the reviewer, the criterion and where the receipt goes, and is itself checked for rows nobody could act on. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 12 * feat(guides): the user's guides in the cloud Third instance of the per-user S3 prefix styles and templates already use, so "same as styles" holds on the remote too. The text always comes back: unlike a style, whose description is its <title>, a guide's description and tags live in the frontmatter, so there is nothing to list without reading the object. An object that cannot be read comes back empty rather than being skipped, so the merge reports it against its key. A guide that disappears silently is the failure this collection exists to prevent. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 13 * feat(agent): a prompt part may call one tool with what another returned Which guides a role must read is decided by the collection, and a user extends that collection, so the prompt configuration cannot name them. It can now name the question instead: read whatever the entry tool reported as mandatory. A Source inside another Source's args is resolved first and substituted, sharing the run's memo so a sibling pick of the same tool does not fetch it twice. _process_cache_key's classification rule is untouched; it only gains a representation for args that hold a nested source, so two parts differing in the inner source cannot share a cache entry. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 14 * feat(guides)!: list_guides, and read_guides over the collection Nothing enumerated the guides: the only list anywhere was a FileNotFoundError message, so a guide was reachable only by being named. list_guides answers which guides exist, what each decides, and which ones a role must read. read_guides keeps its name and its names parameter — no role or mode selector — but resolves through the merged collection, so a user's guide is readable by the identifier the listing showed. Its return becomes {"guides_text": str}: one representation rather than a list that carries each body once more, and a single string is what a system prompt can hold, since a picked list of objects reaches it as JSON with the newlines escaped. The block headings carry what documents' name carried. The 30-guide catalogue leaves read_guides' description with it. A description fixed at import time could never have carried a user's own guides. Both surfaces expose the same guide tools, parameters and return shapes; the remote binds its own pair so they read the caller's S3 guides. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 16 * feat(guides)!: the entry payload names its mandatory guides, not their text static.slide_spec and static.deck_spec are gone. A start_* success return now carries must_read — the names the collection says this role has to read — and listing, and nothing else about guides. The payload is a tool result, and a client files a result past 30,000 characters and shows the model only its ends. Carrying the bodies made that limit depend on the collection's contents: about 4,000 characters per guide, on a payload whose deck part already takes 14,000, which put a composer with three slides at 30,750. A name costs 15, so it stops growing. The AWS stack still receives the bodies up front, because a system prompt has no such limit: its parts ask read_guides for whatever that role's entry call called mandatory, naming no guide, so a user's own always guide reaches it too. An interactive client reads must_read and calls read_guides itself; the four role documents now say so. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 15 * feat(guides): create, rename and delete your own guides on the hosted service "Same relationship as styles" has to include making one, so guides get the same four endpoints the styles have, minus the pin they do not have. A guide is validated when it is written, which styles do not need: a style that fails to parse degrades one deck's look, while a guide that fails to parse is left out of every hand-over, so the author would not find out until they inspected a listing. One guide_meta call covers the name, the frontmatter and the 64 KiB cap in the order the engine defines, and the write is refused with the cause named. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 17 * feat(guides): reach the guide endpoints from the Web UI The three places the style endpoints are reached from, for guides: a route under api/guides/ for local mode, client functions in deckService for the hosted service, and a row in the cross-site registry so the POST refuses another site before touching the disk. The name rule is the engine's, not the style route's: a guide name admits any single path component without a dot, so 社内標準 works where the style route's [a-zA-Z0-9_-]+ would refuse it, and acme.v2 does not, because a guide name is also the key a caller passes back from a listing. No pin functions. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 18 * feat(guides): the outline opens with why that structure was chosen A reader of specs/outline.md had to reverse-engineer the sequence from the slides. The orchestrator now names the backbone it took from story-line, the audience condition that chose it, and what it decided against. The instruction lives in orchestrator.md, where the outline's content is specified, so it holds whichever structure guide is in use. It has to be prose or a heading before the first slide line: an indented `- key: value` line is read by _SUB_ITEM_RE as a slide's sub-item. No parser changes — the three outline readers already tolerate leading prose. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 19 * test(guides): pin what this design deliberately did not build The superseded design made structure and writing resource types of their own, each with a directory, an environment variable, a listing tool, a default and a copy written into the deck. A second way to reach a guide is how the tool surface grew last time, so every symbol, state key, environment variable and endpoint of that design is asserted absent — across the Python sources and the Web UI both. Also pinned: no role document is a collection member, selection carries no language anywhere, and a deck's specs/ gains nothing from any start_* call. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 20 * docs(guides): record the feature and its three breaking changes Three published surfaces change at once — static.slide_spec and static.deck_spec are gone, read_guides returns one text instead of a document list, and the guide storytelling-vocabulary is now story-line — and a caller finds that out from here. Each removal is recorded beside its replacement, and a test parses ## [Unreleased] and asserts so, including that writing-ja keeps its name and that no line still presents a removed key as current. The deck-json-spec entry of the same section said start_presentation returns it as static.deck_spec; it names it in must_read now. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 22 * fix(guides): address the cumulative review's blocking findings The nested source was resolved through the process cache, which is written before the outer call. A failed read_guides left the names behind, so the next turn asked for guides the collection no longer held, resolve_parts aborted the whole part list, and the agent ran with an empty system prompt. It resolves uncached now; the outer source's own entry still covers the repeat call. GET /guides ignored ?role=, so a role-filtered listing returned everything. A description had no length cap, and one 60,000-character description would have blown the listing the entry payload was restructured to protect. The TypeScript name rule was weaker than the engine's, so the UI could create a guide that never applied. The CLI still read only the bundled directory, which left a user's own guide invisible to it and made SKILL.md's claim that the subcommands match the tool names false; it reads the collection now and list_guides is a subcommand. Also: the remote checks deck access before building the collection, the composer payload is built after the four failure branches, and a guide name is trimmed, bounded and free of control characters on both sides. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: review round 1 * feat(guides): writing-a-guide covers add-vs-replace, and bringing a document in Nothing in code compares a new always guide against the ones a role already carries. Name shadowing is the only automatic resolution; two guides with different names and always on one tag both load, and the per-role mandatory text has no cap — the 64 KiB cap is per guide, not per set. The sum arrives in one read_guides call that a client stops showing in full past about 30,000 characters, and the bundled sets already use 8,000 to 12,500 of that. So the author needs the step and the numbers: read the role's mandatory set from list_guides, then decide whether to add a name or take an existing one. The new section covers the other direction — one document the user already has, written for a human or another agent, that has to become several guides. The split test is the one already in the document: mark each part with who reads it and when. Plus what not to carry over, which is where a migrated document otherwise adds a paragraph that contradicts the slide format a release later. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 23 * fix(guides): verify keeps only the claims that can be false It had collected preferences, which is the one thing it exists not to do. "A decoration that asserts nothing is noise" is minimalism, and it calls the bundled neo-brutalist, duotone and bento styles wrong. The icon paragraph was the same in the other direction. The colour-count row is design-rules' subject, the connector-endpoint row is already in visual-forms' Checks, and the alignment row was taste with a truth-shaped sentence around it. Every form rule is now conditional on the slide actually encoding that thing, and the section ends by saying so: where the content encodes none of them, the shape is free and the style decides how far to take it. The claim rule no longer assumes the headline carries the claim — writing-ja describes styles that put a topic there and the claim in a lead line, so it reads "whatever carries the slide's claim" and leaves which to the style. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 23 (review of the authored content) * feat(guides): story-line carries the outline design, not just the backbone verify checks a slide; nothing checked the sequence. The outline had no check of its own, and that was the gap the two sources exposed. The checks read in the same sitting as the backbone, so they belong here rather than in a guide of their own. Added, in the order the work happens: who to write for — the six gaps between presenter and audience, and the instruction to design for the least attentive audience the brief admits; how many slides, with the three bands, the 30-second floor and why both bounds matter; what the opening owes, including that it has to carry the deck's point on its own; six ordered outline checks, where a failure high on the list is not fixed by anything lower; and four destinations for material the line left out. Sources: 森畑明昌「良い発表をするために」(graco.c.u-tokyo.ac.jp) and 久松英治 「パワポ外科医が教えるスライドデザインのコツ」日児腎誌 2024;37:111-116. Every point was checked against the bundled guides first — whitespace, colour count, WCAG contrast, not relying on colour alone, type hierarchy and size floors are already in design-rules, and the real font names are in workflows/style.md. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 24 * 📝 docs(guides-as-one-tagged-collection): say where a Japanese line may break Japanese slides broke in the wrong places and writing-ja had no rule about it. The builder already sets lang="ja-JP" on every CJK run, so kinsoku is automatic; what the author controls is the length of a line and the breaks they insert, and that is what the new section states. A manual break is tied to the font size and box width it was written against, so it is sent to measure_slides. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 25 * 🔒 fix(guides-as-one-tagged-collection): mark the retired-path assert as not a /tmp use The ASH scan job failed on this branch while passing on main. bandit B108 read `assert "/tmp/sdpm" not in text` as hardcoded temp-directory usage; the line asserts the path is absent from the guide. Inline nosec, as the repo does in 39 other places, keeps the suppression on the one line instead of the whole file. Red: uvx bandit -q -r tests/test_bundled_guides_contract.py -f json -> B108 MEDIUM/MEDIUM at line 363; after: 0 non-B101 findings SPEC: 20261127-1707_guides-as-one-tagged-collection * 🔒 fix(guides-as-one-tagged-collection): keep a guide read inside the result budget A guide bigger than one tool result was reported valid and then arrived truncated, because the per-guide cap (64 KiB) was chosen without reference to the budget (25,000) and the budget lived only in a test. Two routes hit it: a user guide claiming always, and read_guides called with any big name — that function had no size check at all. The budget is now the engine's own constant and the per-guide cap is derived from it, so a guide that passes validation fits one read by construction. The read fills to the budget in spec-first order and names what it left, so a caller can ask again instead of silently losing the format spec. One function carries the rule for the local tools, the CLI and the remote server. Red: read_guides(['grid','table','verify']) -> 2 guides + table deferred, 18,756 chars; before: 3 guides, over 25,000 and filed away by the client SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 26 * 📝 docs(guides-as-one-tagged-collection): say what the size cap is for, and cut vs split The cap was documented as 64 KiB "because its body goes into a system prompt", which does not explain the number: the composing surfaces have no result limit, the read does. The real reason is that a guide has to arrive in one read_guides result, and stating it makes the number self-explaining. Length also needed an answer. Cursor and Claude Code both answer it with "split", and both have a cheap first read through progressive disclosure that a guide does not: a guide is handed over whole. So here length is a reason to cut, and an author arriving from either tool needs that difference said out loud. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 27 * 🔒 fix(guides-as-one-tagged-collection): warn on a lossy shadow, bound the read, refuse a bad body Three gaps in code this SPEC added, all reachable from the user's own directory or request. Shadowing was the one way to make a role lose a guide with no error anywhere: taking a bundled name without its always or one of its tags leaves the role reading that name and no longer receiving what it asked for. The merge now parses the shadowed entry to compare and reports what no role gets any more. Saying the same thing differently, which is the point of the feature, stays silent. The reader took whole files before the size check saw them, so a stray file of any size in the guides directory was read on every start_*. It now takes one character past the cap, which is enough to reject it on size and reports the same cause. POST /guides/user read name and text off whatever arrived, so a JSON array or string raised AttributeError and came back as a 500 instead of a 400. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 28 * 📝 docs(guides-as-one-tagged-collection): document user-local guides The feature shipped with no user-facing documentation: a reader had no way to learn where to put a guide, what the frontmatter accepts, or why one of theirs was not being read. It goes beside User-local styles and User-local templates, in the same shape, so it reads as a sibling rather than a new dialect: the three-step search order, both platforms' config directory, and shadowing by name. Three things nothing else will tell a reader get their own space. An unrecognised frontmatter key is an error here, which is the opposite of what a reader arriving from a tool that ignores unknown keys expects. A field table with required/default per key, because the closest comparable docs omit one and leave the reader to infer it. And a table of always x tags against what the role actually does, since those two keys are the whole loading rule. A test pins the numbers and the tag vocabulary to the engine's own constants. The cap moved once already in this branch, and a documented cap that is not the cap is worse than none. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 29 * 📝 docs(guides-as-one-tagged-collection): record the size rule and the shadow warning The CHANGELOG described the feature as reviewed, without the two rules the review added: what bounds a guide's size and what happens when a shadow loses something. SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 29 * 🔒 fix(guides-as-one-tagged-collection): carry what the budget shed into the text itself The Agent surface composes a system prompt and keeps only guides_text, so the note naming a shed guide reached that model as nothing at all. Before the read had a budget it got every mandatory guide whole, so this round introduced it: a model told to read a guide it never receives, with nothing saying so, is the silence the budget work exists to end. What was left out is now said twice — under not_included for a caller reading the keys, and at the end of guides_text, so it travels wherever the text does. The fill measures the complete payload, so the note is inside the budget it reports. Two more of the same class, both in code this SPEC added. A start_* listing built its own dict and so never carried the shadow warning, which is the only place that warning is ever seen: a role has no reason to call list_guides. And the non-object body check was not enough for POST /guides/user, because guide_meta works on the text, so a non-string field still reached it. Red: composer-pptx prompt with a 13,400-byte always user guide -> house-rules absent from guides_text and unmentioned; after: named under # Not included SPEC: 20261127-1707_guides-as-one-tagged-collection Task: 30 * ✨ feat(guides-role-declares-what-to-read): declare each role's mandatory guides in its workflow document A guide's frontmatter is a file a user can replace by taking its name, so "every composer must read slide-json-spec" was a statement the project made in a place the user owns. The workflow documents are static and user-independent, so the declaration moves there, in one exact form a test can read and tell apart from the conditional read_guides pointers the same documents already carry. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 1 * ♻️ refactor(guides-role-declares-what-to-read): read guides on the Agent surface the way a client does This surface used to resolve guide bodies into the system prompt from the names start_* called mandatory, so a guide reached a hosted model as prompt text and an interactive client as a tool result. The role document now names what to read, so one mechanism serves both; the listing stays, because it is the only thing that can name a guide the user wrote today. read_guides joins the style role's tools: without the pre-load it was the one role with no route to a guide at all. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 2 * 🔥 refactor(guides-role-declares-what-to-read): drop the nested-source support with its only caller A Source.mcp's args could hold another Source, which existed so the Agent surface could call read_guides with the names start_* reported mandatory. That caller is gone, and nothing else in the tree nests a Source, so the resolution, its cache-key branch and the use_process_cache escape hatch go with it. The inner call also had to opt out of the process cache, or a failed outer call pinned stale names; that hazard leaves too. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 3 * 💥 feat(guides-role-declares-what-to-read)!: stop returning must_read from start_* BREAKING CHANGE: start_presentation, start_composing, start_style and start_translation no longer return must_read. Their guide payload is listing alone. What a role must read is named in its workflow document, which arrives under static.workflow in the same return. always_guides is deleted with it: nothing computes a mandatory set from the collection any more, so a user guide cannot gain or lose that status by taking a bundled name. context_size.py stops reporting a separate mandatory-bodies item, because no role's prompt holds those bodies. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 4 * 💥 feat(guides-role-declares-what-to-read)!: remove always from the guide frontmatter contract BREAKING CHANGE: a guide's frontmatter keys are description and tags. A guide carrying always is invalid under unknown-key, so the author is told rather than having the line silently ignored. Nothing was released with it. Setting always on a bundled guide meant copying the whole file into your own directory, which froze its body: one frontmatter line cost every upstream change to that guide. With the key gone, the only reason left to take a bundled name is to replace what it says. read_guides fills by source instead: bundled guides first, then the user's, each in name order. The reason is the one the always flag used to carry — a bundled guide is the project's document and a user's is their preference, so a preference is what sheds. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 5 * 💥 feat(guides-role-declares-what-to-read)!: show the user's own guides in their own listing block BREAKING CHANGE: a listing returns user_guides and bundled_guides instead of one guides list, and an entry no longer carries source — the block it is in says it. list_guides, GET /guides and every start_* listing change shape. A role reading 31 entries in name order could not see at a glance which three were the user's, and those are the only ones no role document can name. The user's block comes first for that reason. Dropping source also takes a field off all 31 entries in a payload that rides inside every start_* return. The CLI prints the two blocks under their own headings, with a test: nothing covered that function before, so the field change would have broken it with every other check still green. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 6 * 📝 docs(guides-role-declares-what-to-read): say how a guide of yours gets read writing-a-guide pushed the opposite way: it told an author to take a bundled guide's name rather than add a second name beside it. That is the expensive move now — it replaces the text and every later change to it stops arriving, with nothing reporting the fact. Both halves are stated, including the half that does not freeze: the set of guides is recomputed every call, so a guide the project adds later still arrives. What makes a guide of yours reach a role is its description, so the section says to write the condition into that line rather than only the subject. docs/en drops the always row and the always behaviour table, and says where a role's mandatory reading is declared instead — a reader who finds no flag would otherwise go looking for the missing key. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 7 * 📝 docs(guides-role-declares-what-to-read): describe the shipped design in the tools and the CHANGELOG read_guides told the reader its names come from a start_* call's must_read, which no longer exists; they come from the role document or list_guides. list_guides says it returns the user's guides first, which is what the two blocks are for. The CHANGELOG entry is rewritten rather than corrected, because none of this was released. always and must_read now appear only under Changed, as keys that are gone: a Breaking note has to name a key to say so, while a key named in Added would read as part of the design. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 8 * 🔒 fix(guides-role-declares-what-to-read): close the cumulative code review compliance and craft between them found seven places where the work did not hold itself to its own design. The declaration line was the worst: all four documents appended prose to it and the regex had no end anchor, so the contract test could not enforce the form it existed to enforce. The declaration now ends its line and the regex is anchored at both ends. _declared also accepted unquoted names, which is not a call any caller could copy, so it parses the list as JSON now. The REQ-2.2 mapping had been copied into two more test modules, which is the second source of truth design.md declines; both copies now read the real declaration. _bundled_first's name tie-break was unpinned. The Agent fixtures still returned the one-block listing, and one test asserted the obsolete key reaches the prompt. Six contract statements still described the hand-over this SPEC removed. Every fix is verified by the mutation that exposed it: see fixes-code.md. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 8 * 🔒 fix(guides-role-declares-what-to-read): make the declaration one literal line, with no optional part The adjudicator was right that round 1 only half-closed this. The prose moved off the line, but two documents kept the `- ` list marker and the regex still accepted it — so the pattern had an optional part REQ-2.4 does not define, and the contract test went on accepting a form outside the recorded decision. The declaration is now a standalone paragraph leading its section in all four documents, and the regex is anchored start to end with nothing optional. Verified: putting the marker back makes the contract test fail. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 8 * 📝 fix(guides-role-declares-what-to-read): stop describing the hand-over in writing-a-guide's own description Its description still read "when a guide is handed over automatically" — the mechanism this SPEC removed, in the frontmatter of the guide that teaches the frontmatter. The body was rewritten in task 7; its own description was not. Found by reading the 31 descriptions for the same stale references the code review caught in the docstrings. No other description mentions must_read, always or the hand-over. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 7 * ✨ feat(guides): put taste and engine facts on the right side of the line, and say which guide wins Four things the design made visible once `always` was gone. **Which guide wins was stated nowhere.** A bundled taste guide and a guide of the user's own are both read, so a model reconciled a direct conflict with nothing to go on — measured: `writing-ja` says to use 「。」 and a user guide saying not to arrived in the same read_guides call. All five role documents now say to follow the user's, excepting the slide format and verify's checks, which are not preferences. Identical wording in all five, asserted. **Note writing was taste inside the format spec.** "Use conversational language", "include questions and calls to the audience" are preferences, and they sat in `slide-json-spec` — 11 commits in 90 days — so disagreeing meant taking that name and freezing the slide format. Worse, the HTML composer never reads that guide, so an HTML deck got no note guidance at all. Now a `speaker-notes` guide tagged composer and translate: both modes get it, and replacing it costs nothing else. The spec keeps the two layers and the field. **The wrapping facts were the same mistake pointing the other way.** Kinsoku being the build's job and measuring a hand-written break are statements about the code, and they sat in `writing-ja`, the guide that exists to be replaced. They move to each format guide's **Where a line breaks**; the Japanese guide keeps where to cut. **An HTML deck did not carry its language.** `assemble_deck` has a `lang` parameter and no caller passed it, so every HTML deck was emitted as `<html>` whatever `deck.json` said — while the PPTX build sets a run's language for CJK text. deck.json's `language` now becomes `<html lang>`. writing-a-guide gains the step it never had: read the guides that cover your ground, in full, before writing one — the listing's one line per guide is written to help a caller decide whether to read, not to tell an author whether the rule already exists. It also gains the case `always: true` used to serve (a guide that applies to every deck gives no condition) and loses four stale references to the hand-over. SPEC: 20261201-0903_guides-role-declares-what-to-read Task: 10 * 🐛 fix(guides): correct the facts a four-axis collection review found wrong A review of the 32-guide collection on four axes — structure, duplication, description and tags — returned 37 candidates. These are the factual errors among them; the ones that ask for content to move between guides are a decision, not a correction, and are not in this commit. Two were introduced by the taste/engine split in 59d0d12a: - `deck-json-spec` still said `language` was PPTX-only, one commit after the same branch wired it to `<html lang>`. The orchestrator writes that field and reads that guide, so an HTML deck in Japanese would have been emitted with no language for the browser to break lines by — the exact case the change was made for. - `writing-ja` kept the generic "notes are a script read aloud" rule that `speaker-notes` now owns, in its opening and again under 文体. It keeps the Japanese narrowing (常体 / 敬体, the spoken register) and points at `speaker-notes` for what notes are. - `slide-json-elements` redefines `autoWidth` and `\n` that the new **Where a line breaks** section owns, in different words ("word_wrap disabled" against "the box grows instead"). It now names the fields and points there. `verify` was named by every role document's precedence paragraph as non-overridable, including translation's, while being tagged `composer` — which no translate listing intersects. A translation can change a number, reword a quote or drop a hedge and still build, so it is now on the translate role's mandatory line and tagged for it. `test_a_role_can_reach_what_it_declares_mandatory` closes that hole: the declaration and the tags live in different files, and nothing compared them. `writing-ja` is listed for translation for the same reason. The role is told that measurement does not catch unnatural line breaks in the target language, and the collection's rules for where Japanese may break were unreachable from it. `design-rules` put the 16:9 content area at y=143 where `grid` and `slide-json-spec` both derive y=173 (title bottom 142 + margin 31). A composer reading the design guide placed content 30px into the title margin. * ✨ feat(guides): reserve the four names a guide of the user's own cannot take Every role document says a guide of the user's own does not override the slide format or `verify`'s checks. Nothing enforced it. Resolution is user-first for reading as well as for listing, and `_shadowing_loss` only warns when the winner drops a tag — so a faithful copy of `slide-json-spec` carrying the same tags was silent, won the name, and was what the role's own mandatory read then returned. A stale copy would have outranked every later correction to the format the build enforces, on the one read a role cannot skip. `deck-json-spec`, `slide-html-spec`, `slide-json-spec` and `verify` are now refused from any source but `builtin`: reported `reserved-name` in the listing, and refused at write time by the API so the author hears it while they can still choose another name. The line is the one the role documents already drew — the deck and slide formats, and the checks. Replacing taste is untouched, `story-line` included: it is mandatory for the orchestrator and a user who disagrees about how a deck should be structured may still say so. Found by a four-axis review of the collection (structure #1, confidence 100). `TestTheReservedNames` covers the case no warning could: the same text with the same tags on both sides, which produces no shadowing warning at all. Mutation-checked — disabling the branch fails 6 of its 9. Two existing shadowing tests used `verify` as their example and now use `table`, which is the same shape and is taste a user may legitimately replace. * ♻️ refactor(guides): give reading a style off a PPTX its own guide `style.md` sent the style author to `read_guides(["import-pptx"])` "when the reference deck should be inspected slide by slide". `import-pptx` opens by telling exactly that reader to stop: it is the edit branch, and for reference material it says to go back to the briefing flow. The lenses they actually needed sat 258 lines past that refusal. And the style contract restated around them had drifted. Step 5 asked for "5-6 demonstration slides (cover, palette / type ramp / component swatches)" with placeholder copy like `Cover Title` / `Body sample`, while `style.md` requires Cover, Rules, Message & Outline, seven named Patterns, a divider and Closing, and says in as many words that nothing in a style is a specimen sheet. The same guide contradicted itself: its own 5-3 already said not to write that placeholder copy. Following the parts a reader met first produced the wrong `art-direction.html`. New `style-from-pptx` (tags `style, orchestrator`) owns the part that is genuinely about reading somebody else's deck: Lens B for what the theme declares, Lens A for what each thing is for, Lens C for what the deck spends its surface on, and the table saying which lens a given token may come from. Rewritten rather than moved — the extracted text referred to "Step 2" and "Step 4" of a workflow its new reader never runs, and still called the style's slides demonstration slides. `import-pptx` Step 5 is now the two pointers and what is import-specific about them (the bundle's template for Lens B, the previews Step 4 already built for A and C). It restates none of the style contract, which took it from 22,375 bytes — 93% of the 24,000-byte per-guide cap, with 1,625 to spare — to 11,645, and its tags drop `style`. Found by a four-axis review of the collection (structure #4 ≡ duplication #8, both at confidence 100). * ♻️ refactor(guides): put each guide where its format applies, and taste where both modes see it The taste/engine line this branch drew held in two places and not in ten more. A four-axis review of the collection found them (structure #5-11,13 · duplication #1,4,5 · tags #1,2,3). **A slide-JSON contract behind `composer`.** `table`, `arch-elements` and `arch-layout-engine` describe a slide-JSON element or the `arch_diagram` tool's input, under descriptions that match any HTML table or diagram, and `composer` is both composer modes. An HTML composer reading `table`'s 287 lines gets `colWidths` and `cellOverrides` for a slide that has neither. All three are `composer-pptx` now, with descriptions that say which format they are for. **The mirror image in the chart guides.** `composer-pptx` hid what is true of any chart: six pie slices, two unstacked area series, one scale per chart, three to eight radar spokes. An HTML deck draws charts with the bundled ECharts and D3, so the HTML composer could produce a valid chart nobody can read. New `chart-choice` (`composer`) owns which chart the data calls for and where a chart stops being readable; the five type guides stay the slide-JSON field reference and point at it. Both composer workflows now name it. **Nine chart fields stated five times, already disagreeing.** `axisColor` and `axisWidth` were listed under area and bar but not line or radar, so a composer could not tell an unsupported field from an uncopied one. Read in the implementation: those nine are taken from `style` with no `chart_type` guard at all, while `gapWidth`/`overlap` are guarded to bar and `lineWidth`/`markerSize` to line and radar. The nine are now in `slide-json-media`, which owns the `chart` element, saying in as many words that a per-type guide lists only its own. **`design-rules` becomes the format-neutral design home.** It no longer says "pt is an absolute unit … No scaling needed" — that is the PPTX build's behaviour, and this guide reaches the HTML composer, where a point token needs `calc(var(--fs-x) * var(--sdpm-pt-scale))`. It gains the table treatment that `table` stated through slide-JSON field names, and the block sizes and vertical fill that `slide-json-spec` was carrying: now that the format spec's name is reserved, a preference stated there is exempt from the precedence rule *and* impossible to replace. **The four rules under any drawn diagram** — along a grid, symmetric where it branches, one spacing value per kind of gap, hierarchy drawn rather than implied — move from `arch-elements` to `visual-forms`, which the HTML composer and the style author also reach. `visual-forms` now says outright that its recipes' geometry holds in either format while their preset names are slide JSON's. **Three more copies removed, each read by the same reader as its original.** `slide-json-effects` recommended a use for every effect beside `design-rules`' own list; `slide-json-media` restated `freeform`'s coordinate system and command set for a reader it then sends to `freeform`; `source-material-guide` restated `attachments`' bundle paths and return fields; `slide-html-spec` restated the interaction policy `composer-html.md` carries on every job, inside a guide whose name is now reserved. Declined, with reasons, in the SPEC notes: splitting `grid` (both its readers need both halves — you call `grid()` because you are deciding a layout) and stripping the actor and timing from `deck-json-spec`'s fields (a field reference saying who writes a field is part of the field's meaning, and its other readers are the importer and the translator). * 📝 docs(guides): make each description say what the guide decides and when to read it The description is the whole of what a caller sees before spending a read. Nothing in the code picks guides for them — not the deck's language, not its audience, not its template — so a description that misleads costs either a wasted whole-file read or, worse, a guide that is never read when it was needed. A four-axis review of the collection checked all 34 against their bodies (description #1-9). Five that named a situation that cannot happen, or none at all: - `design-rules` and `design-vocabulary` said "read during art direction phase". Only composers can see `design-rules`, and a composer is handed an art direction already frozen — the phase has passed before its only reader exists. A composer following the description skips it on every slide that needs its colour, type, effect or whitespace decisions. `design-vocabulary` is also used while writing an outline's `visual`, which `orchestrator.md` says in as many words. - `hand-edit-sync`: "Phase 4: Sync after hand-editing (only when requested)". The body requires the sync whenever the user hand-edited and then asks for more changes, before any further edit. Read as opt-in, the next build regenerates over their PowerPoint work. - `grid`: "read before placing elements" for a guide that subdivides rectangles. A composer reads 356 lines before a freeform or a radial arrangement it cannot help with. - `attachments`: a list of subjects with no situation, so an orchestrator can take attachment handling as covered by its workflow and miss the byte-offset paging, the immutable bundle path, and the retry an `IMPORT_INCOMPLETE` needs. - `aws-design`: "AWS-specific design conventions" promises the whole topic; the body answers which asset source to search and which category colour to use. `table` and the five `chart-*` descriptions now say which format they are the reference for, which is what their retagging in the previous commit means for a caller reading the listing. `writing-a-guide`'s own text on `management` is rewritten rather than its tags. The reviewer read "No role picks it up … this guide is one" as saying its `orchestrator` tag was a mistake. The sentence was about the tag, which is accurate — no role's set contains `management` — but it reads as being about the guide. `hand-edit-sync` carries the same pair and needs its orchestrator reach, so the rule is that `management` is carried beside the role tags of whoever acts on the guide, and `test_management_is_carried_beside_a_role_tag_never_alone` holds all three to it. * 🐛 fix(guides): finish the moves the first review's fixes left half-done A second four-axis review of the collection returned 21 findings, 18 of them marked REGRESSION — introduced by round one's own fixes. That is the shape the SPEC review of this branch took too, where all seven round-two findings were regressions. Every claim below was checked against the file or the implementation before acting on it. **The HTML composer could not reach what was moved for it.** The four diagram rules went into `visual-forms` so both modes would see them, but that guide's description still said "in slide JSON" and `composer-html.md` never named it, while `composer.md` did. A non-mandatory guide is found by its description or by a pointer, so the one reader the move was for had both routes closed. Description rewritten, pointer added. **Retagging `arch-elements` to `composer-pptx` stranded rules that are not the format's.** Two reviewers found it independently. Scale by node count, orthogonal-only routing, and a label beside the connector rather than on it are about how a diagram reads; the AWS Cloud boundary, its flush logo and the disc under a boundary-straddling icon are AWS conventions. An HTML composer draws the same diagram in HTML and SVG and had none of them. The first two groups are in `visual-forms` now, the AWS ones in `aws-design`, and `arch-elements` keeps the slide-JSON form of each. Two of the four rules it had already handed over were still asserted in its own text and checklist; those are gone. **The chart extraction stopped halfway.** Every type guide still opened by choosing the chart ("Bar charts … for comparison data") for a reader who has just read `chart-choice`, and still held the renderer-independent treatment: series order on an area, the small-segment threshold on a stacked bar, whether a trend is smoothed, shares against amounts on a pie, the donut's total, the radar's rings against the scoring scale. `chart-bar` claimed the readable limits were in the guide HTML can reach while stating one itself. All six are in `chart-choice`; each type guide now opens `Fields for chartType: "…"`. `title`, `titleFontSize`, `titleFontColor` and `numberFormat` were copied into all five type guides. Read in `sdpm/sdpm/engine/builder/elements/chart.py:86,217-218`: no `chart_type` guard, exactly like the nine in `style`. Stated once in `slide-json-media`. **`chart-choice` reaches the orchestrator now.** It writes the outline's `visual` naming the chart — "a bar chart of X by Y" — so it makes this decision before any composer sees the slide, and could prescribe a nine-slice pie. Its pointer for exact row-wise values said "the format's table guide"; there is only one, tagged `composer-pptx`, so an HTML reader was sent to a guide its listing does not contain. Now named per format. **Reserving four names made two preferences unreplaceable.** "Write `notes` before `elements`" is a way of working — key order means nothing to the build and `notes` is optional — and it sat in `slide-json-spec`. Whether an audience handout carries the notes is the user's call, and it sat in `deck-json-spec`. Both are in `speaker-notes`, which is tagged `composer` and `translate` and can be replaced. The reviewer also named the test that was holding the first one in place: `test_the_pptx_spec_keeps_the_two_layers_and_drops_the_writing_advice` asserted the sentence was there. It now asserts the layers without the method, and two new tests assert each preference is where it can be disagreed with. **`grid`'s first step was PPTX-only** inside a guide that reaches both modes and the style author. It said to call `analyze_template`; an HTML composer already holds `template_html`, whose layout names are its source of truth, and a style author has a 1920×1080 canvas and no deck template at all. Step 1 now branches three ways; steps 2 and 3 are unchanged, because once you have an area its division is arithmetic. **Four residues of the earlier moves, each read by the same reader as its original.** `writing-ja` kept "notes are written in spoken sentences only, with no Markdown" — language- neutral, and already contradicting `speaker-notes`, which requires a `---` separator before the reference URLs, so a Japanese deck had to break one of the two. `slide-json-elements` kept statement-plus-pointer where a pointer was the point. `import-pptx` restated `style.md`'s skeleton and its save order, and restated `--color-bg`'s provenance **disagreeing** with `style-from-pptx` (Lens A + C against Lens B confirmed by C) for a reader it sends to that guide. `design-rules`' rewrite added a sixth copy of the user-guide precedence rule that the five role documents own and a contract test holds identical; it now states only that the applied style outranks it. `slide-json-media`'s description still promised the freeform contract it had handed over and said nothing about the chart fields it had taken on. **One factual correction on the way.** `composer.md` said "the renderer has no emoji fonts". Commit `1cd551cf` says the opposite in its own message: the built file keeps the character and the host rendering the preview is the one with no emoji face. Both that line and `design-rules`' "render inconsistently across platforms" now say what was measured. The rule stays where it is — a style's call, defaulting to none — which is the ownership already settled in `39b49aee`. Declined, with the reason in the SPEC notes: moving the no-emoji rule out of `design-rules` into the role documents or the format specs (duplication #9). Its premise is that this is a renderer limit; it is not, and that ownership question was settled against exactly this change. * 🐛 fix(guides): close the write paths and the body path the reservation missed A code review of the reserved-names change found 7 problems, 6 Major. Three were demonstrated by mutations that survived the whole suite at 4,178 passed, which is the only kind of test finding worth acting on without argument. All three now fail. **The reservation covered one write path of four.** Cloud `POST /guides/user` refused a reserved name; cloud `PATCH /guides/user/<name>` did not, and it put the new key and then deleted the old one. Measured: renaming `mine` to `slide-json-spec` returned `{"renamed": {...}}`, the working key was gone, and what was left was reported `reserved-name` by every collection and read by none — a call that said it worked destroyed the guide. The local Web UI's POST and PATCH accepted all four names the same way, and that surface has no caller rendering the collection's `invalid` list, so the author heard nothing at write time and nothing afterwards either. All four paths refuse it now. The Web UI keeps its own list of the four, mirrored the way `guideName.ts` already mirrors `is_guide_name` and compared against the Python tuple by `TestTheWebUiMirrorsTheReservedList` — two lists that must agree with nothing comparing them is how they come apart. **`format_notes` was a guide-body read that bypassed the collection.** `init_deck_workspace` returns the `html-deck` body as `format_notes`, read straight out of the bundled directory. Measured with a user `html-deck` installed: `read_guides` returned theirs, `collection_source` was `user`, and the init payload returned the bundled body. One payload handed the orchestrator a body no other surface would give it, and nothing reported the disagreement — the user-first rule this whole branch rests on, broken in the one place nobody looked. It resolves through the caller's collection now. The collection is passed as a callable, not as a value. Building one on the remote is an S3 listing, and a PPTX deck has no format notes at all; built as an argument it ran on every init and broke seven remote tests that never touch guides, which is the same waste showing up as a failure. **The source label was trusted with no boundary.** `build_collection` refuses a reserved name unless the group is labelled `"builtin"`, and `select_guides` shows a group as the user's unless it is labelled `"user"` — two rules reading one free-form string. The demonstrated mutation relabelled the remote's user group `"builtin"`, which makes the user's copy of the slide format win, and the suite stayed green. `GUIDE_SOURCES` now bounds the label, and `TestTheProductionBuildersLabelTheirGroups` asserts the three production builders label their user group `"user"` and that a reserved name in a user's S3 prefix loses to the bundled body. **Two of the tests this branch added proved nothing.** `test_a_role_can_reach_what_it_declares_mandatory` intersected `BUNDLED` with `_ROLE_TAGS`, so it showed only that two constants agree: a mutation excluding `verify` inside `_selected` itself — the actual listing path — passed the whole suite, which is exactly the failure the test's own docstring describes. It asserts against the real `guide_payload` listing now. `test_management_is_carried_beside_a_role_tag_never_alone` never looked at a role's tags, so adding `management` to the orchestrator's set left it green; the premise is asserted first. **Minor:** three statements still said 33 bundled guides against 34 on disk. The CHANGELOG and the exact listing test keep the number, because there it is a release fact and a contract. The authoring guide and two selector comments lose it — a role's listing is filtered anyway, so a fixed count was never the right thing to say there. * 🔒 fix(web-ui): assert on the directory listing instead of a built path The two reserved-name route tests failed the `scan` gate, both at HIGH: `javascript.lang.security.audit.path-traversal.path-join-resolve-traversal` on `path.join(dir, `${name}.md`)`. The name comes from `RESERVED_GUIDES`, a hardcoded tuple, so there is nothing to traverse — but the rule reads an interpolated `path.join` and the gate is the gate. Asserting on `fs.readdirSync(dir)` is outside the rule and says more than the original did: that no file appeared under that name, rather than that one particular path is absent. `toContain` rather than `toEqual` because `beforeAll` leaves the symlink fixtures in that directory for the containment tests. * 🐛 fix(guides): hand each moved rule over completely, and stop testing for old wording A third four-axis review of the collection returned 21 content findings, 18 of them marked REGRESSION. Round 1's fixes caused 18 of round 2's; round 2's caused these. The shape is the same every time and it is now clear what causes it: **a move that rewrites the old home's assertion as statement-plus-pointer leaves the rule in two places, and a test that rejects the old sentence passes against the same rule in new words.** Both are fixed here, the second by rewriting five tests to assert ownership instead of phrasing. **The notes-first method was in three places, not one.** Three reviewers found it independently. `slide-json-spec` — a reserved name — still endorsed an order ("why it is *usually* the notes"), and `slide-json-elements` still gave it as an instruction ("In actual slides, write them before `elements`"). So replacing `speaker-notes` to work the other way round left a PPTX composer ordered anyway, by two guides it cannot replace. Both are gone, and the test now sweeps every slide-JSON guide rather than the one reserved spec. **The handout choice reached every role except the one that can act on it.** `speakerNotes` lives in `deck.json`, which the orchestrator writes, and `speaker-notes` was tagged `composer, translate`. Measured by the reviewer against the live collection: `speaker-notes=False` for `orchestrator`. It carries `orchestrator` now and its description names the delivery decision, because the description is all a caller sees before spending a read. **The `flipV` workaround landed in the guide that forbids it.** `slide-json-elements` says "Labeled shapes — use `text`, never overlay a textbox", "**Do NOT** add a separate `textbox`", and that the build warns when it finds one. Round 2 moved the funnel workaround — which is exactly that — into it. The exception is stated in the rule now, including why the inset box is not what the warning detects. **"Never diagonally" stopped being true when it moved.** It was an architecture-diagram rule in `arch-elements`; in `visual-forms` it governs every form, and that guide's own cycle recipe is an arc and its hub recipe places spokes along the centre-to-satellite vector. Readers could not follow both. Scoped to forms laid out on rows and columns, with radial forms named as the opposite case. The contract test required the unconditional phrase, so it was holding the contradiction in place. **The AWS convention was in both homes, and the two already disagreed.** `aws-design` says the boundary takes the slide's text colour; `arch-elements` hard-coded `"line": "#FFFFFF"`, so a light slide got two different diagrams. The logo offset and the disc's 72→66 sizing were duplicated too. `arch-elements` keeps the field mapping and names the owner; its description no longer promises the boundary or the scale that also moved out. **Three more residues**, each the same shape: the donut-hole total still recommended in `chart-pie`; the bar-legend rationale added to `slide-json-media` beside `chart-choice`'s copy — and overstated there as every single-series chart, where the implementation guards it to bar and honours an explicit `legend: true` (`chart.py:353-355`); `style-from-pptx` restating `style.md`'s skeleton in a five-part summary that is already incomplete beside its seven required patterns. **`grid`'s worked example contradicted the branch above it.** Round 2 made Step 1 name a different source per mode, including "Do not call `analyze_template` for this" for HTML. Forty lines later the Gantt example told every reader to call it. **And the emoji correction missed the disjoint copy.** Round 2 fixed the composer's rationale; `style.md` still said "the PPTX renderer has no emoji fonts" — the claim `1cd551cf` measured false — and required every style to state "no emoji", which contradicts the ownership `39b49aee` settled, where emoji are the style's call. Corrected to the measured mechanism and to a position the style states rather than a prohibition it inherits. Five tests rewritten to assert ownership: each had been passing against the exact defect its name describes. Mutation-checked — restoring the `arch-elements` paraphrase, the `chart-pie` recommendation and the unscoped routing rule each now fails the test that named it. Declined and raised with the owner instead: splitting `visual-forms` into a form-choice guide for the orchestrator and a drawing guide for composers (structure #7, 95). The `tags` reviewer argued the opposite case in the same round — `orchestrator.md` already carries the content-shape-to-form decision — so it is a design question, not a correction. * 🐛 fix(guides): close the last body bypass, order the fallible call, and test the call sites A second code review of this work returned 5 Major and 1 Minor, four of them demonstrated by mutations that survived the suite. Every one is a consequence of the previous round's fixes. **The `format_notes` fallback was the bypass the fix existed to close.** Round 2 routed it through the caller's collection and then added `except FileNotFoundError: return _read_reference(_GUIDES_DIR, name)`. Measured by the reviewer: an empty collection still returned the 1,520-character bundled body. The comment's justification was false too — it said an invalid user guide under that name could hide the valid bundled one, and an invalid entry never wins a name. So there is no case for a fallback: the bundled guide is always in the collection, and a collection without it is a broken invariant that should surface. Removed. **The fallible lookup ran after the deck was already written.** Making `format_notes` resolve through the collection made it fail on the remote, where it reads the user's guide store — and `init_deck_workspace` called it after the deck record, `deck.json`, `specs/brief.md` and `specs/outline.md` were all persisted. Demonstrated with a raising callable: all four writes happened, then the exception escaped, so the tool reports an error having created a deck and a retry creates a second one. It now resolves beside `new_deck_json`, before anything is created. The zero-call PPTX path and the at-most-once HTML path are unchanged. **Three tests asserted the right things about the wrong layer.** `TestTheProductionBuildersLabelTheirGroups` asserted that `"user"` appeared among the labels and that every label was one of the two. Swapped labels satisfy both: mutating the remote's bundled group to `("user", bundled_guide_entries())` left it green, and that makes all four reserved guides invalid on that surface — the other half of the regression the test was added for. It now binds each label to the expression it labels, and a companion case asserts the consequence: a bundled group keeps the reserved names readable. `test_a_role_can_reach_what_it_declares_mandatory` reached the selector in round 2 but not the five `guide_payload(collection, _ROLE_TAGS[...])` expressions in `entry.py`. Mutating `start_translation` to pass `_ROLE_TAGS["style"]` left the whole suite passing. New `TestEachEntryPointAsksForItsOwnRole` in `tests/test_entry_tools.py` asserts the key at each call site and then exercises the real `start_presentation` and both `start_composing` modes, including that neither composer mode is handed the other format's spec. `test_management_is_carried_beside_a_role_tag_never_alone` read `_ROLE_TAGS` and the guides' tags, never the selector between them. Addi…
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.
Summary
list_examples→list_styles(matches server.py)code_block→code_to_slide(matches mcp-local/server.py)example_search(not registered as MCP tool in server.py)code_to_slidefrom Layer 3 additional tools (already in Layer 2)narrative.md/design.md→brief.md/art-direction.html(matches workflow files)Changed Files
README.md/README_ja.mddocs/en/architecture.md/docs/ja/architecture.md