feat(core): system prompt v2 — denser, smarter, artifact-type aware#44
feat(core): system prompt v2 — denser, smarter, artifact-type aware#44
Conversation
There was a problem hiding this comment.
Findings
- [Major]
picsum.photosallowance conflicts with global no-hotlink rule — this weakens a hard output constraint and can cause generated artifacts to violate existing policy on external image hotlinks. Evidence:packages/core/src/prompts/artifact-types.v1.txt:67vspackages/core/src/prompts/output-rules.v1.txt:58.
Suggested fix:- - For abstract photography or hero imagery, prefer: inline SVG composition, CSS gradient + grain overlay, or `https://picsum.photos/seed/<deterministic-seed>/<w>/<h>` (deterministic seed only, never random). + - For abstract photography or hero imagery, prefer: inline SVG composition or CSS gradient + grain overlay. + - If seeded placeholders are ever allowed, update Output rules first to explicitly permit that domain under the external-resource policy.
Summary
- Review mode: initial
- 1 issue found in changed lines.
docs/VISION.mdanddocs/PRINCIPLES.mdare referenced by process but not present in this checkout (Not found in repo/docs), so only available repo content was used for policy validation.
Testing
- Not run (automation):
pnpmis unavailable in this runner, so Vitest/Playwright could not be executed.
open-codesign Bot
| ## Imagery rules | ||
|
|
||
| - No hotlinked photos from `placeholder.com`, `via.placeholder.com`, `placehold.it`, or `unsplash.com`. | ||
| - For abstract photography or hero imagery, prefer: inline SVG composition, CSS gradient + grain overlay, or `https://picsum.photos/seed/<deterministic-seed>/<w>/<h>` (deterministic seed only, never random). |
There was a problem hiding this comment.
This newly-added picsum.photos allowance conflicts with existing Output rules (output-rules.v1.txt) that prohibit hotlinked photos and require inline SVG/CSS placeholders. Please align these sections to avoid contradictory instructions to the model.
Suggested minimal change:
- - For abstract photography or hero imagery, prefer: inline SVG composition, CSS gradient + grain overlay, or `https://picsum.photos/seed/<deterministic-seed>/<w>/<h>` (deterministic seed only, never random).
+ - For abstract photography or hero imagery, prefer: inline SVG composition or CSS gradient + grain overlay.The artifact-types imagery rules permitted picsum.photos seeded URLs while output-rules globally banned hotlinked images. Strip the picsum exception and unify both sections on self-contained imagery (inline SVG, CSS gradient, or data: URI) per Codex review on PR #44.
c97de91 to
4530224
Compare
There was a problem hiding this comment.
Findings
- [Major] Density-floor counts contradict required beats in multiple artifact rows — this creates conflicting instructions for the model and can cause under-dense output (or inconsistent self-check behavior) depending on which rule it follows. Evidence:
packages/core/src/prompts/artifact-types.v1.txt:31,packages/core/src/prompts/artifact-types.v1.txt:32,packages/core/src/prompts/artifact-types.v1.txt:33.
Suggested fix:-| `email` | 4 | preheader · headline · body with one image or accent · CTA · footer | -| `one_pager` | 5 | hero · 3 supporting blocks · evidence (numbers, quote, or chart) · CTA | -| `report` | 6 | cover · TL;DR · 3 finding sections · methodology · conclusion | +| `email` | 5 | preheader · headline · body with one image or accent · CTA · footer | +| `one_pager` | 6 | hero · 3 supporting blocks · evidence (numbers, quote, or chart) · CTA | +| `report` | 7 | cover · TL;DR · 3 finding sections · methodology · conclusion |
Summary
- Review mode: follow-up after new commits
- 1 issue found in changed lines.
docs/VISION.md,docs/PRINCIPLES.md,docs/ARCHITECTURE.md, anddocs/RESEARCH_QUEUE.mdwere requested by process but are not present in this checkout (Not found in repo/docs), so validation was performed against available repo files only.
Testing
- Not run (automation)
open-codesign Bot
| | `slide` | 1 | one rectangle, one idea, hierarchy across at least three type sizes | | ||
| | `email` | 4 | preheader · headline · body with one image or accent · CTA · footer | | ||
| | `one_pager` | 5 | hero · 3 supporting blocks · evidence (numbers, quote, or chart) · CTA | | ||
| | `report` | 6 | cover · TL;DR · 3 finding sections · methodology · conclusion | |
There was a problem hiding this comment.
Min sections should not be lower than the count implied by Required structural beats. In this table, email (line 31), one_pager (line 32), and report (line 33) currently conflict with their own beat lists, which can produce contradictory model behavior.
Suggested minimal fix:
-| `email` | 4 | preheader · headline · body with one image or accent · CTA · footer |
-| `one_pager` | 5 | hero · 3 supporting blocks · evidence (numbers, quote, or chart) · CTA |
-| `report` | 6 | cover · TL;DR · 3 finding sections · methodology · conclusion |
+| `email` | 5 | preheader · headline · body with one image or accent · CTA · footer |
+| `one_pager` | 6 | hero · 3 supporting blocks · evidence (numbers, quote, or chart) · CTA |
+| `report` | 7 | cover · TL;DR · 3 finding sections · methodology · conclusion |…fore/after rendering Addresses user feedback that generated designs are too sparse, miss before/after comparisons, and lack design density / hierarchy. - New `artifact-types` section: 8-type taxonomy (landing / case_study / dashboard / pricing / slide / email / one_pager / report) with a per-type density floor and required structural beats. Case studies now require ≥6 sections (hero · before/after · challenge · solution · pull quote · CTA), not "4 metric cards plus a quote". - New `pre-flight` checklist (internal SCT pattern): forces the model to classify type, posture, density, comparisons, featured numbers, palette, type ladder, and slop guard before writing any HTML. - Comparison enforcement: when the brief mentions before/after, 前后, 对比, vs, growth %, the model MUST render side-by-side or paired visualizations. A floating `+40%` no longer satisfies the rule. - Required four-step type ladder (display · h1 · body · caption) with Fraunces / Geist (now bundled, removed Fraunces from forbidden list). - Dark theme density rules: ≥3 surface tones, gradient or glow, two accents minimum. The canonical sparse-LLM dark output (#0E0E10 + single accent + four cards) is explicitly called out as slop. - Anti-pattern guard: no placeholder.com / via.placeholder / unsplash hotlinks, no default Tailwind grays as the only neutral, no soft- rounded square + single letter logo placeholders. - Workflow expanded from 6 to 7 steps; self-check now references the density floor and comparison rule. Tests: 6 new vitest cases in generate.test.ts cover the taxonomy, pre-flight beats, dark-theme rules, type ladder, and font rules. All 47 tests pass; .txt-vs-TS drift test confirms the inlined constants match the source files byte-for-byte. Signed-off-by: hqhq1025 <1506751656@qq.com>
The artifact-types imagery rules permitted picsum.photos seeded URLs while output-rules globally banned hotlinked images. Strip the picsum exception and unify both sections on self-contained imagery (inline SVG, CSS gradient, or data: URI) per Codex review on PR #44. Signed-off-by: hqhq1025 <1506751656@qq.com>
Codex Major: email/one_pager/report had floors lower than the count of listed required beats, creating conflicting instructions for the model. Raise floors to match the beats so self-check is unambiguous. Signed-off-by: hqhq1025 <1506751656@qq.com>
Codex Major: density-floor counts still contradicted listed beats — "3 supporting blocks" and "3 finding sections" hid count behind a plural noun, so a literal dot-count gave 4/5 items vs floor 6/7. Expand to explicit numbered items so dot-count matches floor exactly. Signed-off-by: hqhq1025 <1506751656@qq.com>
4530224 to
fe8bf8c
Compare
There was a problem hiding this comment.
Findings
- No high-confidence issues found in the added/modified lines of this update.
Summary
- Review mode: follow-up after new commits
- No issues found in changed lines for this revision.
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.- Residual risk/testing gap: new prompt constraints are asserted via string-presence tests, but no behavior-level test verifies model outputs satisfy the new density/comparison rules end-to-end.
Testing
- Not run (automation)
open-codesign Bot
Summary
Upgrades the system prompt from sparse/generic to artifact-type aware. Addresses user feedback that generated designs are too sparse, miss before/after comparisons, and lack design density / hierarchy. The trigger was a customer-case-study prompt rendering as four floating metric cards on a flat black background — the canonical sparse-LLM output.
Key changes
artifact-types.v1.txtsection defines an 8-type taxonomy (landing/case_study/dashboard/pricing/slide/email/one_pager/report) with cue words, primary job, and per-type structural beats.+40%no longer satisfies the rule.pre-flight.v1.txtadds an internal SCT-style 8-question pass (artifact type · posture · density · comparisons · numbers · palette · type ladder · slop guard) the model must complete silently before generating.display·h1·body·caption); skipping a step is forbidden. Fraunces (bundled in feat(ui): Anthropic-inspired warm aesthetic + starter cards + BYOK badge #25) and Geist are now first-class display / sans choices; Fraunces removed from the forbidden font list.#0E0E10end-to-end + single accent + four cards) is explicitly named as slop.placeholder.com/via.placeholder/unsplashhotlinks, no default Tailwind grays as the only neutral, no decorative emoji unless asked, no "John Doe" / "Acme Corp" filler.What was removed
Stack hygiene
*.v1.txt); composer signature unchanged; existing callers untouched.Test plan
.txtsource files byte-for-byte.pnpm -r typecheckclean across the workspace.pnpm lintclean (warnings are pre-existing inrunModel).