docs(svglide): document preview and run evidence workflow

This commit is contained in:
songtianyi.theo
2026-07-07 19:45:01 +08:00
parent 092f2d3d9a
commit 78770368e1
5 changed files with 97 additions and 21 deletions

View File

@@ -41,6 +41,7 @@ completion_gate:
- `mode_system_prompt_svg.md`: SVG Slides 模式的系统级生成要求。
- `svg_reference.md`: SVG 协议、元素、角色和约束的权威参考。
- `semantic_contract.md`: 本地 semantic gate 使用的机器可读规则实例。
- `slide_font_catalog.md`: Slide canonical 字体和主题 preset 绑定,约束 `typography_contract.json` 的字体选择。
## Tool Prompts

View File

@@ -20,6 +20,7 @@ This file binds native AnyGen SVG Slides concepts to the local SVGlide run direc
| `ToolSlideEdit` | `slides/*.svg` plus a tool-call receipt |
| `ToolFinishSlidesEdit` | lint, preview, quality, semantic, and repair artifacts |
| `show_form` | automatic CLI inference; low confidence writes a blocker before research |
| `plan_research` | local `research/research_plan.json` and `research/queries.json`; required before `research/sources.json` and `research/research_notes.md` |
| `handover` | Go-generated `receipts/delivery.json` |
| `slide_copy_plan` | local `content/slide_copy_plan.json`; only `audience_copy` may enter visible SVG text |
| `image_candidates` | local `assets/image_candidates.json`; searched candidates, selected/rejected decisions, role/format fit, and source URLs |
@@ -28,6 +29,7 @@ This file binds native AnyGen SVG Slides concepts to the local SVGlide run direc
| `visual_quality_contract` | local `request/entity_resolution.json` or `brief/visual_quality_contract.json`; quality gates enforce the visual floor before delivery |
| `visual_receipts.json` | author-side per-slide design decision receipt: layout family, asset role, text carrier, container decision, card budget, chart receipt, fusion spec, QA expectations |
| `receipts/rendered_visual.json` | deterministic rendered visual gate: text-fit, canvas bounds, label collision, and unsafe edge checks |
| parser-safe SVG subset | online slide-parser compatibility gate: 960x540 canvas, no native SVG text, no global CSS, direct XHTML text nodes, and explicit `slide:shape-type` for foreground geometry |
| `receipts/image_usage.json` | deterministic image usage gate: selected ready images must be referenced by slide SVGs and full-bleed hero images must be visually dominant |
| `receipts/chart_render.json` | deterministic Node renderer receipt: Vega-Lite specs are rendered by local `vega-lite` + `vega`, with spec/SVG hashes |
| `receipts/chart_usage.json` | deterministic chart usage gate: standard charts must be embedded as `<rect slide:role="chart">` and not hand-drawn in slide SVG |
@@ -55,30 +57,46 @@ Even when no explicit visual contract is present, the quality gate derives a def
Strict visual contract execution order:
1. Resolve `request/entity_resolution.json.visual_quality_contract`.
2. Write `brief/typography_contract.json` during design brief resolution.
3. Run `ToolResolveImageAssets`: write `assets/image_candidates.json`; if real images are required, download/copy and inventory raster image assets before SVG authoring.
4. If `required_chart_renderer=vega-lite`, write `assets/charts/chart_briefs.json`, `assets/charts/specs/*.vl.json`, and `assets/charts/chart_manifest.json`; StageAssets completion invokes the local Node renderer (`vega-lite` + `vega`) to create `assets/charts/*.svg` and `receipts/chart_render.json`.
5. Author `slides/*.svg` only after required visual artifacts exist.
6. Run lint, preview, rendered visual, image usage, chart render, chart usage, chart quality, semantic, creative, and quality gates.
7. During quality, enforce the visual asset gate: entity-driven decks need real subject imagery and a real cover hero image unless the user explicitly requested chart-only/vector-only output.
8. Do not call delivery ready unless `receipts/rendered_visual.json.status=passed`, `receipts/image_usage.json.status=passed`, `receipts/chart_render.json.status=passed`, `receipts/chart_usage.json.status=passed`, `receipts/chart_quality.json.status=passed`, and `quality_report.json.status=passed`.
9. If any strict gate fails, delivery status is `needs_repair`; do not present the deck as complete.
2. Write `research/research_plan.json` and `research/queries.json`; strong identifiers must map to source ladders before any `sources.json` can be accepted.
3. Fetch/source material and write `research/sources.json`, `research/research_notes.md`, and `research/research_coverage.json`.
4. Write `brief/typography_contract.json` during design brief resolution.
5. Run `ToolResolveImageAssets`: write `assets/image_candidates.json`; if real images are required, download/copy and inventory raster image assets before SVG authoring.
6. If `required_chart_renderer=vega-lite`, write `assets/charts/chart_briefs.json`, `assets/charts/specs/*.vl.json`, and `assets/charts/chart_manifest.json`; StageAssets completion invokes the local Node renderer (`vega-lite` + `vega`) to create `assets/charts/*.svg` and `receipts/chart_render.json`.
7. Author `slides/*.svg` only after required visual artifacts exist.
8. Run lint, preview, rendered visual, image usage, chart render, chart usage, chart quality, semantic, creative, and quality gates.
9. During quality, enforce the visual asset gate: entity-driven decks need real subject imagery and a real cover hero image unless the user explicitly requested chart-only/vector-only output.
10. Do not call delivery ready unless `receipts/rendered_visual.json.status=passed`, `receipts/image_usage.json.status=passed`, `receipts/chart_render.json.status=passed`, `receipts/chart_usage.json.status=passed`, `receipts/chart_quality.json.status=passed`, and `quality_report.json.status=passed`.
11. If any strict gate fails, delivery status is `needs_repair`; do not present the deck as complete.
## Online Parser-Safe SVG Subset
Local preview SVG must be authored in the subset that the online slide parser can preserve:
- Root: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:slide="https://slides.bytedance.com/ns" width="960" height="540" viewBox="0 0 960 540" slide:role="slide">`.
- Text: visible text must be inside `<foreignObject slide:role="shape" slide:shape-type="text">` with direct XHTML `<p>`, `<h1>`, `<h2>`, `<h3>`, `<small>`, `<ul>`, or `<ol>` children.
- Do not use native SVG `<text>` / `<tspan>` for visible labels, numbers, captions, titles, or chart annotations.
- Do not use root `<style>`, CSS classes, or CSS variables such as `var(--font-body)`. Put concrete `font-family`, color, size, weight, and line-height inline on the direct XHTML text element.
- Do not wrap text foreignObjects in `<div>` containers. A text `foreignObject` whose direct child is `<div>` is parser-unsafe.
- Foreground geometry must declare parser shape semantics. Use `<rect slide:role="shape" slide:shape-type="rect">`, rounded rectangles as `slide:shape-type="round-rect"`, `<circle>/<ellipse slide:shape-type="ellipse">`, and custom `<path>/<polygon>/<polyline slide:shape-type="custom" slide:width="..." slide:height="...">`. Do not rely on plain SVG primitives or primitives with only `slide:role="shape"`; online readback may drop them.
- Use `<image slide:role="image" slide:shape-type="image" ...>` for images and `<rect slide:role="chart" href="../assets/charts/*.svg" ...>` for rendered chart assets.
`receipts/lint.json` and `anygen_semantic_report.json.metrics.parser_unsafe_count` enforce this subset. A deck with parser-unsafe structures is not ready for online slide creation even if the local browser preview looks correct.
## Complete Chain Evidence
A complete local SVGlide generation must be launched through the unified runtime entrypoint and must leave a run directory evidence chain:
`request -> research -> design_brief -> outline -> slide_content -> resolve_image_assets/chart_briefs/chart_specs -> node_chart_render -> svg_author -> validate/preview/repair -> rendered_visual -> image_usage -> chart_usage -> chart_quality -> quality_report -> delivery`.
`request -> request_resolution -> research_plan -> queries -> sources -> research_coverage -> design_brief -> outline -> slide_content -> resolve_image_assets/chart_briefs/chart_specs -> node_chart_render -> svg_author -> validate/preview/repair -> rendered_visual -> image_usage -> chart_usage -> chart_quality -> quality_report -> delivery`.
Minimum evidence:
- `run.json` exists and names the local SVG deck route.
- Stage receipts exist for request, request resolution, research, design brief, outline, slide content, assets, SVG authoring, and validate/preview/repair.
- Core artifacts exist: `request/request.json`, `research/sources.json`, `brief/design_brief.json`, `brief/visual_system.json`, `brief/typography_contract.json`, `outline/deck.json`, `content/slide_content.json`, `content/slide_copy_plan.json`, `assets/image_candidates.json`, `assets/assets_manifest.json`, `assets/asset_inventory.json`, `assets/charts/chart_briefs.json`, `assets/charts/chart_manifest.json`, `slides/*.svg`, `preview.html`, `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, `creative_quality_report.json`, `quality_report.json`, `visual_receipts.json`, and `receipts/delivery.json`.
- Core artifacts exist: `request/request.json`, `request/entity_resolution.json`, `request/theme_contract.json`, `research/research_plan.json`, `research/queries.json`, `research/sources.json`, `research/research_coverage.json`, `brief/design_brief.json`, `brief/visual_system.json`, `brief/typography_contract.json`, `outline/deck.json`, `content/slide_content.json`, `content/slide_copy_plan.json`, `assets/image_candidates.json`, `assets/assets_manifest.json`, `assets/asset_inventory.json`, `assets/charts/chart_briefs.json`, `assets/charts/chart_manifest.json`, `slides/*.svg`, `preview.html`, `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, `creative_quality_report.json`, `quality_report.json`, `visual_receipts.json`, and `receipts/delivery.json`.
- Screenshot evidence such as `contact-sheet.png` or `screenshots/slide-*.png` must be present before claiming screenshot-level quality.
- Manual edits are allowed only when delivery evidence marks `manual_patch.applied=true`, lists the touched files, and explains the reason.
Without `run.json`, it is not a complete chain. Without stage receipts, it is not a complete chain. Without `quality_report.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, rendered visual evidence, and screenshot evidence, it is not a complete chain. Manual repairs without `manual_patch` evidence must not be described as an unattended complete-chain result.
Without `run.json`, it is not a complete chain. Without stage receipts, it is not a complete chain. Without `research/research_plan.json` and `research/queries.json`, it is not a complete chain. Without `quality_report.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, rendered visual evidence, and screenshot evidence, it is not a complete chain. Manual repairs without `manual_patch` evidence must not be described as an unattended complete-chain result.
When a user provides a benchmark deck, screenshot, reference site, or previous generated output, treat it as `quality_floor_only`. Extract reusable quality dimensions, but do not copy source HTML, SVG markup, exact coordinates, or proprietary assets.
@@ -96,7 +114,7 @@ When no benchmark exists, the local runtime still expects a default visual floor
- `visual_keywords`: 4-8 topic-specific visual words.
- `palette`: background, surface, accent_primary, accent_secondary, text_primary, text_muted.
- `fonts`: concrete `font_display`, `font_body`, `font_number`, `font_label` stacks.
- `fonts`: concrete `font_display`, `font_body`, `font_number`, `font_label` roles. For online-Slide-safe output, these must resolve to canonical Slide `font_family` values from `<slide_font_catalog>`, not arbitrary CSS stacks.
- `page_family_budget`: max counts for `full_bleed_hero`, `image_text_fusion_split`, `evidence_board`, `timeline_route`, `data_scoreboard`, `character_product_focus`, `quiet_synthesis`.
- `asset_strategy`: required image families, minimum distinct visual subjects, and max reuse per asset.
- `recurring_hero_rationale`: required only when the same real image is intentionally reused more than twice.
@@ -129,7 +147,7 @@ Do not deliver:
- a core chart hand-written as SVG when `required_chart_renderer=vega-lite`;
- a deck that requires typography contract but lacks `brief/typography_contract.json`;
- a deck whose visible pages contain process words: `Sources:`, `source note`, `prompt`, `slide:note`, `接缝`, `取色`, `渐变遮罩`, `素材说明`, `制作说明`;
- a deck where all typography roles resolve to generic browser stacks, or a Chinese deck has no concrete CJK font in visible roles;
- a deck where typography roles use generic/browser stacks, comma-separated CSS stacks, unsupported font names, unknown `selected_moods`, or a Chinese deck has no concrete CJK font in visible roles;
- a deck where the same real photo appears on more than two slides without `recurring_hero_rationale`;
- a deck where a single source URL provides more than 40% of visual assets without `single_source_rationale`;
- an `image_text_fusion_split` page without seam-side color choice, fade width, subject safety judgment, and reduced text density;

View File

@@ -13,20 +13,24 @@ condition: always
trigger:
- after_all_slide_edit_calls
consumes:
- request/theme_contract.json
- slides/*.svg
produces:
- receipts/lint.json
- receipts/preview.json
- receipts/rendered_visual.json
- receipts/image_usage.json
- receipts/media_pressure.json
- receipts/chart_usage.json
- quality_report.json
- anygen_semantic_report.json
- visual_receipts.json
- creative_quality_report.json
- receipts/editorial_quality.json
- receipts/screenshot_evidence.json
- receipts/chart_quality.json
completion_gate:
- validate_preview_rendered_visual_quality_semantic_creative_chart_passed
- validate_preview_rendered_visual_quality_semantic_creative_editorial_screenshot_chart_passed
---
<!--
@@ -43,16 +47,33 @@ Rule: Do not edit semantics without refreshing the local source snapshot first.
```text
Finish slide edit mode. Call this AFTER all slide_edit calls are completed. This restores the original model. The tool will verify that all slides have been edited — if any placeholder slides remain, the call will fail and you must edit them first.
The local SVGlide runtime must include `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, and `receipts/chart_quality.json`. Delivery is blocked when any of these receipts has `status=failed`, even if lint, semantic, creative, and quality reports otherwise pass.
The local SVGlide runtime must include `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/media_pressure.json`, `receipts/screenshot_evidence.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, and `receipts/editorial_quality.json`. Delivery is blocked when any of these receipts has `status=failed`, even if lint, semantic, creative, and quality reports otherwise pass.
Delivery is blocked when parser-safe lint fails. Local browser rendering is not enough: online slide creation must preserve text, assets, and foreground geometry through the slide parser. Reject SVGs with native `<text>/<tspan>`, root `<style>`, `class`, CSS variables, non-960×540 canvas, foreground geometry missing parser `slide:shape-type`, or text `foreignObject` direct `<div>` wrappers. `anygen_semantic_report.json.metrics.parser_unsafe_count` must be `0`.
Delivery is also blocked when `quality_report.json` contains a visual asset issue, such as missing real imagery or a missing real cover hero for an entity-driven deck.
Delivery is blocked when `request/theme_contract.json` is not reflected downstream: `outline/deck.json` must include the required page roles, asset manifests must cover required real-image roles when `asset_needs.requires_real_images=true`, and `visual_receipts.json` must describe how each slide executes the theme contract.
Delivery is blocked when `request/delivery_contract.json` is not satisfied. If `delivery_target=online_slide` or `both`, `publish/online_slide.json.status` must be `passed`; local `preview.html`, screenshots, uploaded HTML, or a PDF file do not count as online slide creation. If `requires_real_images=true`, selected real/evidence image assets must exist in `asset_inventory.json` and be referenced by slide SVGs.
Delivery is blocked when `receipts/image_usage.json` reports:
- a ready selected image asset not referenced by any slide SVG;
- a cover/full-bleed hero image used as a small thumbnail;
- a foreground subject image used only as a decorative background.
Delivery is blocked when `receipts/media_pressure.json` reports:
- too few dominant real-image pages for the topic archetype;
- a missing dominant real cover image when required;
- too many consecutive infographic-only pages;
- too few unique real images.
Delivery is blocked when `receipts/screenshot_evidence.json` is missing or its canvas metadata does not match the SVG viewBox. Screenshot evidence must record per-slide canvas size, viewport size, pixel size, scale, and screenshot path. A loose `contact-sheet.png` alone is not sufficient.
Delivery is blocked when `receipts/editorial_quality.json` fails. This catches decks that pass mechanical checks but still miss the visual floor for the topic.
Before finishing, inspect every slide as an image:
- The SVG source is parser-safe: 960×540 root, text as direct XHTML inside `foreignObject`, no native SVG text, no root CSS, no CSS variables, and foreground geometry has parser `slide:shape-type`.
- No visible text crosses a card, panel, metric box, or image dark-zone boundary.
- Secondary labels and footnotes do not touch borders or sit on unsafe edges.
- The cover has one strong topic-specific visual, not only title text.
@@ -61,9 +82,11 @@ Before finishing, inspect every slide as an image:
- Data charts have units, sources, labels or readable axes, and a conclusion-oriented title.
- Vega-Lite appears only where the slide needs a quantitative relationship; it is not used as a per-page default.
- Standard charts are embedded by `<rect slide:role="chart">`; `<image slide:role="chart">`, `<g slide:role="chart">`, hand-drawn chart primitives, and tiny unreadable chart slots fail chart usage.
- Tactical maps, risk radars, coordinate diagrams, pitch diagrams, and analytical fields have source-bound geometry. If the source only proves a score, biography, or generic context, the diagram is fake analysis and fails.
- Any diagram made only of decorative curves, bubbles, lanes, or axes must be replaced with a real image, sourced timeline, evidence collage, or properly sourced data/geometry visual before delivery.
- Visual receipts include `container_fit_plan`, `container_decision`, `text_carrier`, `card_budget`, and `chart_receipt` for each slide.
If any item fails, edit the SVG and update `visual_receipts.json` before producing `preview.html`.
Completion is not a full local SVGlide chain unless the run directory contains `run.json`, stage receipts, `quality_report.json`, `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, screenshot evidence such as `contact-sheet.png` or `screenshots/slide-*.png`, and `receipts/delivery.json`. If final slides/assets/preview were manually edited, delivery evidence must mark `manual_patch.applied=true` with the file list and reason.
Completion is not a full local SVGlide chain unless the run directory contains `run.json`, stage receipts, `quality_report.json`, `receipts/rendered_visual.json`, `receipts/image_usage.json`, `receipts/media_pressure.json`, `receipts/screenshot_evidence.json`, `receipts/editorial_quality.json`, `receipts/chart_render.json`, `receipts/chart_usage.json`, `receipts/chart_quality.json`, canvas-matched screenshot files referenced by screenshot evidence, and `receipts/delivery.json`. If final slides/assets/preview were manually edited, delivery evidence must mark `manual_patch.applied=true` with the file list and reason.
```

View File

@@ -19,10 +19,12 @@ trigger:
- initial_deck_generation
- slide_revision
consumes:
- request/theme_contract.json
- outline/deck.json
- content/slide_content.json
- content/slide_copy_plan.json
- brief/visual_system.json
- brief/visual_quality_contract.json
- assets/assets_manifest.json
- assets/asset_inventory.json
- assets/image_candidates.json
@@ -68,8 +70,12 @@ A text-only slide with decorative shapes signals skipped preparation. It is rare
- DO NOT wrap with `<presentation>` — each item edits one slide at a time.
- The slide's `id` should match the filename (e.g., `slide_01_cover.svg` uses `id="cover"`).
- Local SVGlide binding: only render `audience_copy` into visible SVG text. Never render `production_instruction`, `Sources:`, `source note`, asset selection rationale, or layout instructions as visible audience copy.
- Local SVGlide content binding: when `content/slide_content.json` contains `central_claim`, `audience_takeaway`, `supporting_points`, `source_bound_facts`, `examples_or_parameters`, `visual_data_items`, or `so_what`, use those structured audience fields as the visible content source. Do not treat the legacy `content` field as final body copy when it is only a label list or compact planning skeleton.
- Local SVGlide online-parser target: author parser-safe SVG only. Root canvas must be 960×540 (`width="960" height="540" viewBox="0 0 960 540"`); visible text must be direct XHTML children inside text `foreignObject`; foreground geometry must declare parser `slide:shape-type`; never use native SVG `<text>/<tspan>`, root `<style>`, `class`, CSS variables, or `<foreignObject><div>...`.
## Image usage
- Read `request/theme_contract.json` before authoring. Each slide must execute its theme page role, asset role, and layout rhythm instead of falling back to a generic card/chart/text page.
- Read `brief/visual_quality_contract.json` before authoring. If `media_pressure` is set, each page's image placement must help satisfy it; registering assets is not enough.
- NEVER reference a non-existent or non-local image. Always use absolute paths for images, fonts, and other resources.
- Consume only images that are registered as ready assets in `assets/assets_manifest.json` and described in `assets/asset_inventory.json`; do not invent paths, download new images, or use unregistered screenshots during SVG authoring.
- Follow `asset_inventory.asset_role` and `fit_role` when placing images:
@@ -79,10 +85,14 @@ A text-only slide with decorative shapes signals skipped preparation. It is rare
- `ui_screenshot`, `product_screen`: preserve readability; do not blur or darken into background decoration.
- Every ready image asset assigned to a slide must be referenced by that slide unless `asset_inventory.avoid_reason` explicitly says it is a backup.
- A `full_bleed` or cover hero image must be visually dominant, not a small thumbnail.
- A dominant real image page must place a real image at or above `media_pressure.dominant_image_min_area_bp` of the SVG canvas. Use the actual SVG `viewBox`, not a fixed canvas assumption.
- If the outline expects a dominant image and no suitable asset exists, stop and return to asset selection rather than authoring a chart/text-only substitute.
- Do not let more pages than `media_pressure.max_consecutive_infographic_only_pages` become chart/table/diagram-only when the contract forbids it.
- Use ONLY the image path(s) prepared for the slide (to avoid duplicates). Place content images with concrete subjects (UI mockups, illustrations) as `<image slide:role="shape" slide:shape-type="image">` in a split or side layout — do not fade them to low opacity and use as full-screen backgrounds, which creates ghost-like visual noise behind foreground content.
- When `assets_plan` contains real image assets for a slide, the SVG must reference them with `<image slide:role="image" slide:shape-type="image" ...>`.
- When the visual contract requires real images, authoring six or more `type:none` slides in an 8-page deck is a quality failure unless the contract explicitly allows text-only output.
- If the deck is about a company, brand, product, person, place, team, event, film, book, or financial-report company, use at least one real, source-traceable subject image in the deck. Charts alone are not sufficient for these subjects.
- If the deck is a technical paper, research report, model analysis, or report deep dive, use registered `paper_screenshot`, `paper_figure`, `source_page_screenshot`, `repo_screenshot`, or `official_logo` assets where they support the claim. A decorative diagram or abstract line system does not satisfy evidence-image requirements.
- For entity-driven decks, the cover must use a real cover hero image or a strong real subject visual. Examples: product/device photo, official company/brand image, venue/place photo, team/event photo, or chip/hardware photo for semiconductor reports.
- A `no_image_reason` is valid only for explicitly chart-only, vector-only, or abstract data requests. Do not use "this is a data report" to bypass real imagery for a named company or brand.
- Resolve image hrefs relative to the SVG file location. If slides live in `slides/*.svg` and assets live in `assets/...`, use `../assets/...` inside each slide SVG.
@@ -94,6 +104,22 @@ A text-only slide with decorative shapes signals skipped preparation. It is rare
- Use a chart only for a real quantitative relationship. Tactical maps, timelines, process diagrams, score bugs, stat callouts, and tables are not `slide:role="chart"` unless they come from a Vega-Lite chart manifest entry.
- Keep the chart large enough to read; default minimum is 480×260 unless the chart brief requires more.
## Analysis diagram discipline
- Tactical maps, risk radars, coordinate/axis diagrams, process diagrams, and analytical fields are evidence objects, not decorative geometry.
- Do not draw lanes, circles, arrows, axes, bubbles, radar zones, or field regions unless `source_evidence` can explain what each geometric relationship means. A source that only proves the final score, team bio, or player career total is not enough to justify tactical geometry.
- A valid tactical/risk/analysis diagram must bind geometry to at least one concrete source-backed event or measurement: minute, zone, channel, pass/shot/touch sequence, heat map, xG, possession, pressure line, or comparable sourced data.
- If that binding is unavailable, use a real match/photo evidence page, score timeline, quote/evidence collage, or open editorial statement instead of a fake tactical diagram.
- In `visual_receipts.json`, write the geometry binding inside `source_evidence` itself, not only in `visual_center` or `data_visual_rationale`.
- In `visual_receipts.json`, write how each page executes `request/theme_contract.json`: the page role, the required asset/evidence role when applicable, the chosen text carrier, and why the layout archetype is visibly different from adjacent pages.
## Diagram visual-form discipline
- For every `visuals[]` item whose `type` is `diagram`, `map`, `icon`, or `illustration`, read and execute its `visual_form`. Valid forms are `four_quadrant`, `spectrum`, `map_route`, `process_flow`, `parameter_matrix`, `sensory_wheel`, `object_callout`, and `generic`.
- Do not silently downgrade different forms into the same node-line diagram. `four_quadrant` must look like a quadrant, `spectrum` like a color/value spectrum, `map_route` like a map/path, `process_flow` like ordered steps, `parameter_matrix` like a matrix/grid, `sensory_wheel` like a radial wheel, and `object_callout` like an annotated object.
- Add `data-svglide-visual-form="<visual_form>"` on the SVG group that implements the diagram. The quality gate uses this marker plus real SVG geometry to detect mismatch and repetition.
- Use `generic` only when the slide truly needs a simple generic mark. In a normal 8-12 slide deck, repeated `generic` diagrams are a quality failure.
- If the requested `visual_form` cannot be implemented with the available evidence or assets, stop and repair `content/slide_content.json` or the asset plan; do not author a substitute generic diagram.
- Use `visual_data_items` to construct diagrams, maps, matrices, charts, and callouts. If `visual_data_items` is empty for a semantic visual form, repair `content/slide_content.json` before drawing; do not invent labels, nodes, routes, or metrics in SVG authoring.
## Incremental processing
- Slides are written and displayed as soon as each one is complete.
- Include up to 5 slides per call (more risks output truncation); split larger decks into multiple calls.
@@ -131,7 +157,10 @@ Content decides the carrier. Do not solve layout by creating a rounded rectangle
- Treat the SVG viewBox as a hard canvas. Keep meaningful text, charts, labels, and non-bleed imagery inside a 48px safe area unless the element is an intentional full-bleed image/background.
- Every title, subtitle, label, and metric must pass text-fit before delivery. If estimated text length exceeds its container, reduce font size, increase container size, wrap deliberately, or split the message.
- `foreignObject` text boxes must have enough height for the planned line count. Do not rely on clipping or hidden overflow.
- Standalone `<text>` must be used only for short labels or numbers. Long prose must use a fitted `foreignObject` or multiple manually placed lines.
- Do not use standalone SVG `<text>` at all in local SVGlide output. Short labels, numbers, captions, and chart annotations still use fitted `foreignObject` text shapes with direct XHTML `<p>`/heading children.
- A text `foreignObject` must not use a `<div>` wrapper. The direct child must be `<p>`, `<h1>`, `<h2>`, `<h3>`, `<small>`, `<ul>`, or `<ol>` with inline concrete style values.
- Do not use root `<style>`, `class`, or CSS variables; parser-safe text uses inline concrete `font-family`, `font-size`, `line-height`, `font-weight`, and `color`.
- Foreground primitive geometry is not parser-safe unless it has explicit slide semantics: `rect`/rounded rect use `slide:role="shape"` plus `slide:shape-type="rect"` or `round-rect`; `circle`/`ellipse` use `slide:shape-type="ellipse"`; custom `path`/`polygon`/`polyline` use `slide:shape-type="custom"` with `slide:width` and `slide:height`.
- Timeline labels and axis labels must have non-overlapping estimated boxes. If adjacent labels collide, stagger them, reduce type, or move one label to a callout.
- Before finalizing each SVG, perform a manual canvas check: no visible text cut at the right/bottom edge, no labels glued together, and no important object partly outside the slide unless it is an intentional image bleed.
</layout_and_design>
@@ -144,6 +173,7 @@ Content decides the carrier. Do not solve layout by creating a rounded rectangle
- Avoid decks where repeated rounded text boxes become the primary visual system.
- Avoid converting every score, person, or takeaway into a bordered card when a direct label, image annotation, axis, route marker, or typographic lockup would carry the message better.
- Do not deliver any SVG that would fail the rendered visual gate: out-of-canvas text, clipped foreignObject text, collided timeline/axis labels, or important content outside the safe area.
- Do not deliver any SVG that would fail parser-safe lint: native `<text>/<tspan>`, root `<style>`, CSS `class`, `var(--*)`, wrong canvas size, foreground geometry missing parser `slide:shape-type`, or text `foreignObject` with direct `<div>`.
- Do not deliver an entity-driven deck with zero real image assets or a cover without a real subject visual unless the user explicitly requested chart-only/vector-only output.
</prohibited_practices>

View File

@@ -2,7 +2,7 @@
`slides +create-svglide` 是 AnyGen SVG Slides 的 agent runtime adapter。它不是 Codex-only workbenchCodex 只是 `agent.runtime=codex` 的一种实现,其他 agent 也必须通过同一套 CLI runtime protocol 执行。
本文档只定义 adapter 协议边界、run-dir 结构、receipt、schema、preview、quality、semantic gate 和 delivery receipt。它不复制 AnyGen prompt 正文,不负责创意生成本身,不接入真实图片 provider不进入 Feishu/SXSD/live-create 链路。
本文档只定义 adapter 协议边界、run-dir 结构、receipt、schema、preview、quality、semantic gate 和 delivery receipt。它不复制 AnyGen prompt 正文,不负责创意生成本身,不接入真实图片 provider不进入 Feishu/SXSD/live-create 链路。若用户请求线上交付但当前 runtime 没有真实 publisher必须写出 `publish/online_slide.json.status=blocked`,不能用本地 HTML 或截图冒充线上 slide。
## 权威顺序
@@ -19,10 +19,12 @@
- `mode_system_prompt_svg` 是唯一 orchestrator。
- `svg_reference` 是唯一 protocol authority。
- `resolve_delivery_contract`required tool promptstage=`request_resolution`,把本地预览、线上交付、真实素材要求写入 `request/delivery_contract.json`
- `resolve_design_brief`required tool promptstage=`design_brief`
- `slide_outline`required tool promptstage=`outline`
- `activate_slides_edit` -> `slides_edit`required tool prompt chainstage=`svg_author`
- `finish_slides_edit`required tool promptstage=`validate_preview_repair`,对应最终 validate、preview、quality、semantic gate。
- `publish_online`required tool prompt仅当 run 包含 `publish_online` stage 时出现;没有真实 Lark Slides publisher 时必须阻塞。
- `slide_organize`conditional tool prompt条件为 outline 创建后的增删页或重排。
- `compute_custom_shape_bbox`conditional tool prompt条件为 SVG 含 custom path。
- `generate_vega_lite_chart`conditional tool prompt条件为 standard quantitative chart requiredagent 写 `assets/charts/chart_briefs.json`、Vega-Lite specs 和 chart manifest。
@@ -47,7 +49,7 @@ adapter 不负责:
- 改写 AnyGen prompt 正文或替 agent 做创意判断。
- 自动研究、自动搜图、自动生图或接入真实图片 provider。
- 发布到 Feishu、创建 `.slides`、返回 `xml_presentation_id`、调用 `slide_engine`、SXSD 或 Slides OpenAPI。
- 静默发布到 Feishu、创建 `.slides`、返回 `xml_presentation_id`、调用 `slide_engine`、SXSD 或 Slides OpenAPI。线上交付只能通过显式 `publish_online` stage 记录真实发布结果;无 publisher 时记录 blocked。
- 原生实现 chart、table、图片裁剪这些需求必须通过 AnyGen 语义和本地 artifact 显式表达。
`author` action 只是诊断和占位能力,用于 smoke、协议调试或缺失 SVG 补齐;它不是 AnyGen authoring 的等价实现。
@@ -57,10 +59,10 @@ adapter 不负责:
标准循环是:
```text
init -> complete(request bootstrap) -> [next -> agent_task -> prompt_context -> tool_calls -> artifact -> complete]* -> next(final gate) -> repair -> complete -> delivery
init -> complete(request bootstrap) -> [next -> agent_task -> prompt_context -> tool_calls -> artifact -> complete]* -> next(final gate) -> repair -> complete -> [publish when delivery_target=online_slide|both] -> delivery
```
`init` 只建立 run-dir、请求、manifest 和 schema并已写好 `request/request.json``request/source_manifest.json``request` stage 是 bootstrap 校验阶段,不需要 agent 再生成 request 产物。`agent.runtime` 记录执行者,例如 `codex``claude``cursor``fake-agent`runtime protocol 本身不因 agent 名称改变。
`init` 只建立 run-dir、请求、manifest 和 schema并已写好 `request/request.json``request/source_manifest.json``request/delivery_contract.json``request` stage 是 bootstrap 校验阶段,不需要 agent 再生成 request 产物。`agent.runtime` 记录执行者,例如 `codex``claude``cursor``fake-agent`runtime protocol 本身不因 agent 名称改变。
`next` 是每个 stage 的唯一调度入口。agent 必须先调用 `next`,再按 `next.agent_task` 写 tool call receipt 和 stage artifact。`complete` 只接受当前 stage 的产物;跨 stage 复用旧 `prompt_context` 必须 fail-closed。
@@ -176,8 +178,10 @@ required tool prompt 缺 receipt 时,`complete` 必须失败。conditional too
`repair` passed 后必须写出 `receipts/delivery.json`。delivery receipt 至少应能指向:
- `request/delivery_contract.json` 中的目标。
- run-dir。
- `slides/*.svg`
- `publish/online_slide.json`,当 `delivery_target=online_slide|both` 时必须存在且 `status=passed`
- `preview.html`
- `receipts/lint.json``receipts/preview.json``quality_report.json``anygen_semantic_report.json`