Spaces:
Sleeping
Sleeping
Commit Β·
65e1839
1
Parent(s): 8629759
Add speculative badge to results + v2 ROADMAP
Browse files- Static "speculative / modeled, not predicted" badge on timeline and
world results (responsible-UX guardrail, no extra model calls)
- ROADMAP.md parks the routed schema-driven architecture as v2
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ROADMAP.md +62 -0
- app.py +14 -0
ROADMAP.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Reality Divergence β v2 Roadmap
|
| 2 |
+
|
| 3 |
+
The hackathon build is intentionally lean: two explicit tabs, schema-driven
|
| 4 |
+
generation, validation + fallbacks, and one atmospheric image per result. This
|
| 5 |
+
document parks the larger **routed, schema-driven architecture** as the post-
|
| 6 |
+
hackathon direction. Nothing here is required for the current submission.
|
| 7 |
+
|
| 8 |
+
## Guiding idea
|
| 9 |
+
|
| 10 |
+
Move from "two fixed tabs" to a **router β policy gate β prompt picker β
|
| 11 |
+
structured generation β validation β renderer** pipeline. Routing is decided in
|
| 12 |
+
*code*, never by the model picking its own route.
|
| 13 |
+
|
| 14 |
+
## Where we already are (β55% of the target)
|
| 15 |
+
|
| 16 |
+
| Target capability | Status |
|
| 17 |
+
|---|---|
|
| 18 |
+
| Schema-driven structured generation | β
done (`prompts.py` + parsing in `app.py`) |
|
| 19 |
+
| Per-intent output schemas | β
done (timeline β reflection; world β alt-history/fork) |
|
| 20 |
+
| Validation + never-crash fallback | β
done (`safe_int/str/list`, curated fallbacks) |
|
| 21 |
+
| Timeline / branch renderer | β
done (HTML spine, better/worse, winners/losers) |
|
| 22 |
+
| Safety guardrail (personal tab) | β
done (risk gate + 988 notice) |
|
| 23 |
+
| Uncertainty framing | π‘ in prompts + a "speculative" badge; no per-claim tagging |
|
| 24 |
+
| Prompt picker | π‘ by tab, not by router (2 routes, not 9) |
|
| 25 |
+
| Intent router + confidence + clarification | β not built |
|
| 26 |
+
| Tone/mode selectors, confidence indicator | β not built |
|
| 27 |
+
| Streaming staged output | β not built |
|
| 28 |
+
| Conversational follow-up (turn-taking) | π‘ reflection question shown statically |
|
| 29 |
+
|
| 30 |
+
## v2 backlog (priority order)
|
| 31 |
+
|
| 32 |
+
1. **Intent router** β one lightweight model (or rules) call classifying input into
|
| 33 |
+
a taxonomy: `personal_regret`, `alternate_history`, `event_counterfactual`,
|
| 34 |
+
`global_shock`, `regional_disaster`, `civilizational_fork`, `comparison`,
|
| 35 |
+
`creative_weird`, `mixed`. Returns `primary_intent`, `secondary_intents`,
|
| 36 |
+
`confidence`, `needs_clarification`, `divergence_scale`, `tone`, `image_policy`.
|
| 37 |
+
2. **Policy gate** β below a confidence threshold (~0.72) ask one clarifying
|
| 38 |
+
question instead of generating; decide allowed output type.
|
| 39 |
+
3. **Per-claim epistemic tagging** β tag statements `certain | speculative |
|
| 40 |
+
assumption`; render badges; downgrade tone when the model is over-confident.
|
| 41 |
+
4. **Image policy** β generate images only for `creative_weird` / explicit visual
|
| 42 |
+
requests, not for reflective/uncertain output. (Current build always shows one
|
| 43 |
+
decorative banner β revisit.)
|
| 44 |
+
5. **Single prompt box + mode/tone selectors + confidence indicator** to replace
|
| 45 |
+
the two-tab split.
|
| 46 |
+
6. **Streaming** the response in stages (intent β structure β text β timeline β
|
| 47 |
+
image) so it feels fast.
|
| 48 |
+
7. **Retry-once on schema-validation failure** before falling back.
|
| 49 |
+
8. **Strict validation** via Pydantic/JSON-schema instead of the current `safe_*`
|
| 50 |
+
coercion.
|
| 51 |
+
|
| 52 |
+
## Known design tensions to decide in v2
|
| 53 |
+
|
| 54 |
+
- **Images:** v2 spec says default-off, artifact-only. Current build shows one
|
| 55 |
+
text-free atmospheric banner per result (decorative, not informational).
|
| 56 |
+
- **Visual style:** v2 spec favors restraint ("no chaotic gradients, reflective
|
| 57 |
+
instrument"). Current build uses an animated gradient hero for impact.
|
| 58 |
+
|
| 59 |
+
## Reference
|
| 60 |
+
|
| 61 |
+
Architecture spec drafted from the Build Small field guide constraints and a
|
| 62 |
+
prompt-routing / structured-output design pass (June 2026).
|
app.py
CHANGED
|
@@ -285,6 +285,7 @@ def render_timeline_html(timeline: Dict, direction: str, image_uri: str = "") ->
|
|
| 285 |
<div class="rd-stack">
|
| 286 |
<div class="rd-card rd-fork">
|
| 287 |
{img}
|
|
|
|
| 288 |
<div class="rd-badge">{arrow}</div>
|
| 289 |
<div class="rd-eyebrow">{label}</div>
|
| 290 |
<h2 class="rd-title">{html.escape(timeline.get('title', 'Alternate Timeline'))}</h2>
|
|
@@ -321,6 +322,7 @@ def render_world_html(world: Dict, image_uri: str = "") -> str:
|
|
| 321 |
<div class="rd-stack">
|
| 322 |
<div class="rd-card rd-fork">
|
| 323 |
{img}
|
|
|
|
| 324 |
<div class="rd-badge">π</div>
|
| 325 |
<div class="rd-eyebrow">Year {html.escape(str(world.get('year_divergence', '')))} Β· Point of divergence</div>
|
| 326 |
<h2 class="rd-title">{html.escape(world.get('title', 'Alternate World'))}</h2>
|
|
@@ -553,6 +555,18 @@ body, .gradio-container {
|
|
| 553 |
box-shadow: 0 8px 30px rgba(5, 8, 22, 0.55);
|
| 554 |
}
|
| 555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
.rd-badge {
|
| 557 |
display: inline-flex; align-items: center; justify-content: center;
|
| 558 |
width: 46px; height: 46px; border-radius: 50%;
|
|
|
|
| 285 |
<div class="rd-stack">
|
| 286 |
<div class="rd-card rd-fork">
|
| 287 |
{img}
|
| 288 |
+
<div class="rd-spec">β One possible path β modeled, not predicted</div>
|
| 289 |
<div class="rd-badge">{arrow}</div>
|
| 290 |
<div class="rd-eyebrow">{label}</div>
|
| 291 |
<h2 class="rd-title">{html.escape(timeline.get('title', 'Alternate Timeline'))}</h2>
|
|
|
|
| 322 |
<div class="rd-stack">
|
| 323 |
<div class="rd-card rd-fork">
|
| 324 |
{img}
|
| 325 |
+
<div class="rd-spec">β Speculative β causal chains are modeled, not known</div>
|
| 326 |
<div class="rd-badge">π</div>
|
| 327 |
<div class="rd-eyebrow">Year {html.escape(str(world.get('year_divergence', '')))} Β· Point of divergence</div>
|
| 328 |
<h2 class="rd-title">{html.escape(world.get('title', 'Alternate World'))}</h2>
|
|
|
|
| 555 |
box-shadow: 0 8px 30px rgba(5, 8, 22, 0.55);
|
| 556 |
}
|
| 557 |
|
| 558 |
+
.rd-spec {
|
| 559 |
+
display: inline-flex; align-items: center; gap: 0.4rem;
|
| 560 |
+
font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
|
| 561 |
+
text-transform: uppercase;
|
| 562 |
+
color: #FBBF24;
|
| 563 |
+
background: rgba(251, 191, 36, 0.12);
|
| 564 |
+
border: 1px solid rgba(251, 191, 36, 0.4);
|
| 565 |
+
border-radius: 999px;
|
| 566 |
+
padding: 4px 12px;
|
| 567 |
+
margin-bottom: 0.9rem;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
.rd-badge {
|
| 571 |
display: inline-flex; align-items: center; justify-content: center;
|
| 572 |
width: 46px; height: 46px; border-radius: 50%;
|