Refactor launcher and studio modules

This commit is contained in:
Andraxion 2026-06-27 04:36:26 -04:00
parent a20d298be2
commit ec3e0f5138
34 changed files with 10300 additions and 8600 deletions

View file

@ -0,0 +1,52 @@
# Request System Flowchart
This flow shows the current Worldshaper request pipeline from public submission through promotion into the public Active request list.
![Worldshaper Request System Flowchart](./request-system-flowchart.svg)
```mermaid
flowchart TD
A[User submits request from Launcher Requests tab] --> B[POST /api/launcher-requests]
B --> C[Server normalizes request<br/>status = pending<br/>stores sourceText + fallback title]
C --> D[Request saved in launcher request store]
D --> E{How does analysis start?}
E -->|Auto / queued worker| F[Request analysis worker selects pending unprocessed requests]
E -->|Admin clicks Run Pending Queue| F
E -->|Admin manual resubmission| F
F --> G[Mark request analysis.state = processing]
G --> H[Routing pass]
H --> H1[Map slang / loose wording to Worldshaper terminology]
H1 --> H2[Suggest standardized tags, likely systems, likely modules]
H2 --> I[Load only relevant KB docs]
I --> J[Deep analysis pass]
J --> K[Split submission into one or more atomic request items]
K --> L[Generate title, category, standardized tags,<br/>parsed interpretation, implementation approach,<br/>review rationale, and confidence]
L --> M{Can it auto-promote?}
M -->|Yes| N[Requirements:<br/>all items statusRecommendation = active<br/>every item confidence >= promote threshold<br/>routing ambiguity is not high]
N --> O[POST /api/launcher-requests/:id/process-analysis<br/>action = promote]
O --> P[Server replaces pending submission with one or more active request rows]
P --> Q[Public Requests tab shows those rows as Active]
M -->|No| R[POST /api/launcher-requests/:id/process-analysis<br/>action = review]
R --> S[Original request stays pending]
S --> T[analysis.state = needs_review or error<br/>routing + analysis metadata saved on the request]
T --> U[Admin reviews request in Admin window]
U --> V{Admin outcome}
V -->|Edit + approve| O
V -->|Edit + resubmit| F
V -->|Leave pending| S
```
## Notes
- Public submission starts as a single `pending` request record, even if the worker later splits it into multiple active items.
- The original `sourceText` is preserved through the workflow.
- Auto-promotion is intentionally strict:
- every analyzed item must recommend `active`
- every item must meet the confidence threshold
- routing ambiguity cannot be `high`
- If the analyzer is unsure, the request is still interpreted and stored with review guidance instead of being dropped.
- Promotion replaces the pending submission with one or more normalized active request rows that appear on the public board.

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

View file

@ -0,0 +1,148 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1620" viewBox="0 0 1600 1620" role="img" aria-labelledby="title desc">
<title id="title">Worldshaper Request System Flowchart</title>
<desc id="desc">Flowchart showing the Worldshaper request system from public submission through automated analysis, review, and promotion into active requests.</desc>
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#07111f"/>
<stop offset="100%" stop-color="#0b1627"/>
</linearGradient>
<linearGradient id="panel" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#173258"/>
<stop offset="100%" stop-color="#112544"/>
</linearGradient>
<linearGradient id="decision" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#2a466d"/>
<stop offset="100%" stop-color="#19304f"/>
</linearGradient>
<linearGradient id="success" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#1c7a53"/>
<stop offset="100%" stop-color="#146b78"/>
</linearGradient>
<linearGradient id="review" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#7f4a19"/>
<stop offset="100%" stop-color="#6c2f13"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="10" stdDeviation="14" flood-color="#000000" flood-opacity="0.28"/>
</filter>
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#89b9ff"/>
</marker>
<style>
.title { font: 800 36px "Segoe UI", "Trebuchet MS", sans-serif; fill: #eef6ff; }
.subtitle { font: 500 16px "Segoe UI", "Trebuchet MS", sans-serif; fill: #9fb8e5; }
.box { fill: url(#panel); stroke: #5f96d6; stroke-width: 2; rx: 22; filter: url(#shadow); }
.box-success { fill: url(#success); stroke: #8ce7bb; stroke-width: 2; rx: 22; filter: url(#shadow); }
.box-review { fill: url(#review); stroke: #f0b06f; stroke-width: 2; rx: 22; filter: url(#shadow); }
.decision { fill: url(#decision); stroke: #7ab5ff; stroke-width: 2; filter: url(#shadow); }
.label { font: 700 17px "Segoe UI", "Trebuchet MS", sans-serif; fill: #eef6ff; }
.copy { font: 500 14px "Segoe UI", "Trebuchet MS", sans-serif; fill: #d7e7ff; }
.small { font: 700 13px "Segoe UI", "Trebuchet MS", sans-serif; fill: #9fd8ff; }
.line { fill: none; stroke: #89b9ff; stroke-width: 3; marker-end: url(#arrow); }
.line-soft { fill: none; stroke: #89b9ff; stroke-width: 2.5; marker-end: url(#arrow); }
.tag { font: 800 12px "Segoe UI", "Trebuchet MS", sans-serif; fill: #ffd166; letter-spacing: 0.08em; }
</style>
</defs>
<rect x="0" y="0" width="1600" height="1620" fill="url(#bg)"/>
<text x="800" y="62" text-anchor="middle" class="title">Worldshaper Request System</text>
<text x="800" y="92" text-anchor="middle" class="subtitle">From public submission through review and promotion into the Active request list</text>
<rect class="box" x="560" y="130" width="480" height="86" rx="22"/>
<text x="800" y="162" text-anchor="middle" class="tag">PUBLIC ENTRY</text>
<text x="800" y="186" text-anchor="middle" class="label">1. User submits request</text>
<text x="800" y="206" text-anchor="middle" class="copy">Launcher Requests tab posts raw submission text.</text>
<path class="line" d="M800 216 L800 258"/>
<rect class="box" x="560" y="258" width="480" height="94" rx="22"/>
<text x="800" y="290" text-anchor="middle" class="tag">API WRITE</text>
<text x="800" y="314" text-anchor="middle" class="label">2. Server stores pending request</text>
<text x="800" y="334" text-anchor="middle" class="copy">`POST /api/launcher-requests` normalizes the record,</text>
<text x="800" y="352" text-anchor="middle" class="copy">sets `status = pending`, and preserves `sourceText`.</text>
<path class="line" d="M800 352 L800 394"/>
<rect class="box" x="560" y="394" width="480" height="94" rx="22"/>
<text x="800" y="426" text-anchor="middle" class="tag">QUEUE STATE</text>
<text x="800" y="450" text-anchor="middle" class="label">3. Request sits in the pending queue</text>
<text x="800" y="470" text-anchor="middle" class="copy">It keeps fallback title, timestamps, and raw source text</text>
<text x="800" y="488" text-anchor="middle" class="copy">until automated or manual analysis begins.</text>
<path class="line" d="M800 488 L800 542"/>
<polygon class="decision" points="800,542 950,632 800,722 650,632"/>
<text x="800" y="620" text-anchor="middle" class="label">4. What starts analysis?</text>
<text x="800" y="642" text-anchor="middle" class="copy">Autorun, admin queue trigger,</text>
<text x="800" y="660" text-anchor="middle" class="copy">or manual resubmission</text>
<path class="line" d="M800 722 L800 770"/>
<rect class="box" x="560" y="770" width="480" height="94" rx="22"/>
<text x="800" y="802" text-anchor="middle" class="tag">WORKER PICKUP</text>
<text x="800" y="826" text-anchor="middle" class="label">5. Worker selects eligible pending requests</text>
<text x="800" y="846" text-anchor="middle" class="copy">It targets pending records whose analysis state is still</text>
<text x="800" y="864" text-anchor="middle" class="copy">unprocessed, then marks them as `processing`.</text>
<path class="line" d="M800 864 L800 912"/>
<rect class="box" x="560" y="912" width="480" height="94" rx="22"/>
<text x="800" y="944" text-anchor="middle" class="tag">ROUTING PASS</text>
<text x="800" y="968" text-anchor="middle" class="label">6. Route the request into Worldshaper terms</text>
<text x="800" y="988" text-anchor="middle" class="copy">Map loose wording onto standardized tags, likely systems,</text>
<text x="800" y="1006" text-anchor="middle" class="copy">and likely modules before the deeper analysis call.</text>
<path class="line" d="M800 1006 L800 1054"/>
<rect class="box" x="560" y="1054" width="480" height="94" rx="22"/>
<text x="800" y="1086" text-anchor="middle" class="tag">KB RETRIEVAL</text>
<text x="800" y="1110" text-anchor="middle" class="label">7. Load only relevant KB sections</text>
<text x="800" y="1130" text-anchor="middle" class="copy">The worker pulls matching systems, focused modules,</text>
<text x="800" y="1148" text-anchor="middle" class="copy">terminology hints, and standardized tag definitions.</text>
<path class="line" d="M800 1148 L800 1196"/>
<rect class="box" x="560" y="1196" width="480" height="112" rx="22"/>
<text x="800" y="1228" text-anchor="middle" class="tag">ANALYSIS PASS</text>
<text x="800" y="1252" text-anchor="middle" class="label">8. Produce structured request items</text>
<text x="800" y="1272" text-anchor="middle" class="copy">Split the submission into atomic items, then generate</text>
<text x="800" y="1290" text-anchor="middle" class="copy">title, category, tags, interpretation, implementation path,</text>
<text x="800" y="1308" text-anchor="middle" class="copy">review rationale, options, and confidence.</text>
<path class="line" d="M800 1308 L800 1362"/>
<polygon class="decision" points="800,1362 960,1452 800,1542 640,1452"/>
<text x="800" y="1430" text-anchor="middle" class="label">9. Can it auto-promote?</text>
<text x="800" y="1452" text-anchor="middle" class="copy">Every item must be `active`,</text>
<text x="800" y="1470" text-anchor="middle" class="copy">meet confidence threshold,</text>
<text x="800" y="1488" text-anchor="middle" class="copy">and avoid high ambiguity</text>
<text x="595" y="1458" text-anchor="end" class="small">NO</text>
<text x="1005" y="1458" class="small">YES</text>
<path class="line-soft" d="M960 1452 L1160 1452"/>
<rect class="box-success" x="1110" y="1386" width="390" height="98" rx="22"/>
<text x="1305" y="1418" text-anchor="middle" class="tag">PROMOTION</text>
<text x="1305" y="1442" text-anchor="middle" class="label">10A. Promote analyzed items</text>
<text x="1305" y="1462" text-anchor="middle" class="copy">`process-analysis` runs with `action = promote`</text>
<text x="1305" y="1480" text-anchor="middle" class="copy">and replaces the pending request with active rows.</text>
<path class="line-soft" d="M1305 1484 L1305 1542"/>
<rect class="box-success" x="1110" y="1542" width="390" height="62" rx="22"/>
<text x="1305" y="1578" text-anchor="middle" class="label">11A. Public board lists them as Active</text>
<path class="line-soft" d="M640 1452 L430 1452"/>
<rect class="box-review" x="90" y="1386" width="420" height="98" rx="22"/>
<text x="300" y="1418" text-anchor="middle" class="tag">REVIEW HOLD</text>
<text x="300" y="1442" text-anchor="middle" class="label">10B. Save review metadata on the pending request</text>
<text x="300" y="1462" text-anchor="middle" class="copy">The original request stays pending with routing,</text>
<text x="300" y="1480" text-anchor="middle" class="copy">analysis items, rationale, and possible options attached.</text>
<path class="line-soft" d="M300 1484 L300 1542"/>
<rect class="box-review" x="90" y="1542" width="420" height="62" rx="22"/>
<text x="300" y="1578" text-anchor="middle" class="label">11B. Admin reviews, edits, or resubmits</text>
<path class="line-soft" d="M510 1573 L620 1573 L620 1516"/>
<text x="560" y="1560" text-anchor="middle" class="small">Approve or rerun</text>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

View file

@ -41,6 +41,7 @@ Request records can now contain:
- Depends on `Launcher Home` for the public site presentation.
- Depends on the KB under `docs/kb/` for model-grounded request parsing.
- Depends on the request-analysis worker for automated triage.
- Flow reference: `docs/kb/request-system-flowchart.md`
## Triage Hints