Stoka Admin - build inventory + staging spine
THE MODE (set 2026-06-26, Madara). We are NOT building piecemeal. We do ONE inventory pass: walk every surface / role / functionality Madara wants working, and STAGE each into a detailed, build-ready spec. No building during the walk (so we don’t get sidetracked making each thing work as we go). End state = one comprehensive spec, then ONE long Workflow execution builds it all from that detail (ultracode on).
How this mode runs
- Walk. Madara names a surface / role / feature. We discuss what it composes of and how it should work.
- Stage, don’t build. I capture it into a per-surface spec at the depth bar below, and index it here. I do NOT implement it now.
- Accumulate decisions. Global / cross-cutting answers land in section 5 so the build workflow never has to guess.
- When the inventory is complete, Madara says go, and I launch ONE Workflow that executes the whole staged spec, phase by phase, with verification gates.
Depth bar (every staged item matches this)
The template is specs/black-zetsu-panel.md. Each staged surface captures: intent · what it composes of (grounded) · the sub-views (SurfaceNav) · the modular components · data sources + wiring (reuse vs new endpoints vs mounts) · HARD constraints · a phased build plan with verification gates · open questions for Madara · provenance + file index. Ground it (read the real code/state) before writing - no hand-waving.
The locked build patterns (already shipped to preprod - do NOT re-litigate, build ON these)
- The shell = the ST instrument shell (38px strip + full-bleed main + 96px rail) in the Madara panel; chrome-less, full-bleed, crimson/accent-is-state.
- Hierarchy = panel > tab (modebar bubble) > per-tab right sidebar > buttons (ST canon §0).
- RoleNav (
src/components/RoleNav.astro) = codified, automatic cross-role roster fromsrc/lib/roles.ts; apex-sees-all enforced in code. Tall icon-only flex-fill buttons. - SurfaceNav (
src/components/SurfaceNav.astro) = codified in-tab sub-nav (same button primitive, toggles[data-subpane]panes, active state). A surface with asub[]auto-gets it. - AdminUserChip (
src/components/AdminUserChip.astro) = the pseudonym identity chip (“Azure Peak” + pfp + menu). - Pseudonymous commits (
Portal Engineer <[email protected]>, no trailer); preprod-only (:4322, NEVER prod:4321); preprod FE isolated but DB SHARED with prod (DB writes = Edward-authorize); no em dashes in Stoka UI.
Territory to inventory (the walk list - statuses update as we go)
| Surface | Status | Detailed spec | Notes |
|---|---|---|---|
| Shell + tab/sidebar pattern | DONE (shipped) | (locked patterns above) | RoleNav/SurfaceNav/AdminUserChip live |
| Madara > Home (role roster) | DONE (shipped) | - | full 7-role roster, apex-sees-all |
| Madara > White Zetsu | BUILT (preprod ce06661c) | src/components/WhiteZetsuSurface.astro | full repattern: 10 SurfaceNav views (Live/Inbox/Meetings/Questions/Files/Procedures/Notes/Wiki/Decisions/Scry), backend unchanged. Inbox = held DEP-1. Wiki = working list-fallback first cut (force-graph TBD). Scry blank. Edward: “best attempt full port = starting point”, expects iteration + skill changes. |
| Madara > Black Zetsu | BUILT (preprod ce06661c) | src/components/BlackZetsuRejections.astro | old ideate panel DEPRECATED (Edward 2026-06-27, started fresh). One Rejections view; backend /api/admin/rejections = held DEP-2 (degrades gracefully). The full anatomy specs/black-zetsu-panel.md is a SEPARATE future build (superseded as the BZ tab’s content by the deprecate-and-restart decision). |
| Madara > Rinnegan | BUILT (preprod ce06661c) | src/components/RinneganSurface.astro | FE-only port of the prod /admin/rinnegan main area. 3 views: Emulator (live HUD), Mangekyou (gallery + routing + marks), Tsukuyomi (new cockpit bridge mirror render). Violet accent. All 13 endpoints already in preprod. |
| Role-panel ARCHITECTURE | DONE (781b2ba0) | specs/role-panels-port.md | singleton-per-role; generalized RolePanel.astro + rolePanels.ts; conditional roster tab (no-if-empty); surfaces are shared singletons. Madara refactored onto it, no regression. |
| Role panel: Pain | BUILT (781b2ba0) | rolePanels.ts (pain) | [home roster + Rinnegan] reuses RinneganSurface. rose accent. |
| Role panel: Tobi | BUILT (781b2ba0) | rolePanels.ts (tobi) + KamuiSurface.astro | [home roster + Kamui + Rinnegan]. orange accent. |
| Role panel: Kakuzu | WF2 (next) | specs/role-panels-port.md §3 | port kakuzu.astro Bounties/Outreach + Treasury/Stripe/Crypto-pending. no roster. |
| Role panel: Konan | WF2 (next) | specs/role-panels-port.md §3 | port old blog admin (git 4c76eca3 + AdminKonanBubble) + Specs/Submissions/Newsletter/Supporters/Users. STAYS at /admin. no roster. |
| Role panel: Juzo | BUILT (dc671c09) as INTERN | specs/role-panels-port.md §6 + InternPanel.astro + InternGrantsSurface.astro | Madara redefined Juzo = intern: default empty, dynamically renders the functional tabs GRANTED to the viewer; Pain+Tobi got the grant-control surface (existing access API, no backend). Verified, fixed a toggle-direction bug. KNOWN: account/me omits wallet -> seat-fallback (clean fix = /api/me/functional deploy-dep). |
| Role: Hidan | UNDEFINED | - | not in backend ROLE_TAB_ORDER / roles.yaml; phantom in roles.ts. DROP or define (Madara). |
| Role: Deidara | NOT A SEAT | - | external app + operated by Juzo; a surface/launcher, not a roster role. Reconcile the roles.ts drift. |
| Cross-cutting / global | PENDING | section 5 | identity, gating, theming, shared data, actions-vs-readonly |
5. Global / cross-cutting decisions (accumulate Madara’s answers here)
- MODE PIVOT 2026-06-27 (Madara): for the 3 surface tabs we did NOT finish the inventory-only walk - Madara gave the inventory inline (“rinnegan = port prod main area + emulator/mangekyou/tsukuyomi; black zetsu = deprecate + start new, rejections sidebar; white zetsu = keep backend/sources, fully repattern, best-attempt full port, inbox sidebar”) and said “lets test it, dispatch workflow execution”. So these three were BUILT (Workflow
wf_2b3fcfd3-58e), not just staged. The role panels + remaining surfaces can still go either way (walk-then-build or inventory-inline-then-build) per Madara’s call. - Black Zetsu in Stoka admin = DEPRECATE + restart (Madara 2026-06-27). The old ideate panel (Talk/Document/Meetings/Ideas) is dead for this rework. The BZ tab’s content restarts from Rejections. The full anatomy
specs/black-zetsu-panel.mdis NOT the BZ-tab content (it was the prior direction); keep it as a separate future visualization build if Madara revives it. - Codified nav contract =
src/lib/surfaces.ts(the per-surface sub-view registry: id + label + glyph + optional accent), mirroringroles.ts. Every multi-view surface reads it; MadaraPanel + the surface component stay in lockstep by construction. This is the locked pattern for any future surface’s sidebar. - (Black Zetsu spec’s 7 open Qs - only relevant if the anatomy panel is revived: RO-mounts vs host-exporter · read-first confirm · inbox-v2-cascade alignment · anatomy live-vs-static · MVP scope · auth bar genesis-vs-admin-session · sealed-existence-only.)
- (add global answers as Madara gives them: read-only vs interactive bar for the whole admin; theming per role; etc.)
End state
One comprehensive spec (this spine + the per-surface specs, all at depth) -> Madara says go -> ONE Workflow run executes it, phased, verified, preprod-first. Build patterns above are the foundation; nothing in the walk re-opens them unless Madara says so.
Index of detailed specs / built surfaces
src/lib/surfaces.ts- the codified sub-view registry (BUILT). Single source for every surface’s sidebar.src/components/RinneganSurface.astro- Rinnegan tab (BUILT preprodce06661c).src/components/WhiteZetsuSurface.astro- White Zetsu tab (BUILT preprodce06661c).src/components/BlackZetsuRejections.astro- Black Zetsu tab (BUILT preprodce06661c).specs/black-zetsu-panel.md- Black Zetsu anatomy visualization panel (SPEC, PARKED - superseded as the BZ-tab content by the 2026-06-27 deprecate-and-restart; revive only if Madara wants the full entity viz).- (more land here as we stage each surface.)