MH-5 Filament Wizard / Managed Holdings UI — Plan-Review

Projekt: Steve-TradingBot · Phase: RECON-MH-5 · Author: claude-opus-4-7[1m]
Generated: 2026-05-12 21:42 UTC · master HEAD: cd37822 (MH-4c closed)
Status: NO CODE Plan-Review only — Operator-GO erforderlich vor MH-5 Code-Phase


1 — Live-State Verification

CheckSollIstOK
master HEADcd37822cd37822 mh-4c: add managed asset lifecycle command service
git statuscleanempty output
Bot in-container PID29984unverändert
Worker Host PID(egal)2486135 (pre-existing Watchdog-Respawn)
cmd 13cancelled13 | apply_baseline_holdings | cancelled
managed_proposals rows00
managed_assets_history rows00
BINANCE_TESTNETtrueBINANCE_TESTNET=true
runtime_config.jsonabsentnot present
baseline_holdings.jsonabsentnot present
managed_state.jsonabsentnot present
state/risk_proposals/absentnot present
Tracebacks last 200 lines00 matches

2 — Konsumierte Artefakte

KomponenteStatusKonsumiert in MH-5
MH-1: 8 managed.* CommandTypes + Validatorsea11637Filament Actions rufen Service-Methoden, die ihrerseits Registry validieren
MH-2: ManagedStateReader + ProposalReader (Bot-side dormant)50cc5c2nicht direkt — UI liest DB-Cache, nicht Bot-Files (Hybrid C)
MH-3a: ProposalEngine26c8ab3UI sieht Output via managed_proposals.proposal_json
MH-3b: ProposalWriter62a08f4UI sieht proposal_sha256 / proposal_file_path aus DB-Cache
MH-4a: managed_proposals + managed_assets_history + Enum + Models83dafcaHauptquelle für Filament Resource Tabellen + Detail-Views
MH-4b-1/2/3: ProposalService request/approve/reject + buildHardConfirmString()3fd7846 / be9cab7 / 93f4026Action-Backend für request/approve/reject
MH-4c: ManagedStateService pause/resume/release + buildReleaseHardConfirmString()cd37822Action-Backend für pause/resume/release
Worker-Handler _handle_*MH-6kommt nach MH-5 — Commands sitzen in pending/failed bis MH-6
flag_managed_drift Bot-Self-EmitMH-7nicht in MH-5

Pattern-Source: gui/app/Filament/Pages/BaselineHoldings.php (RECON-2.3 — Operator-Custom-Page mit Action-Buttons + Hard-Confirm-Modal).

3 — MH-5 Scope-Rekonstruktion

UI-Architektur — 3 Varianten

VarianteBestandteileKomplexität
A — Page-only1 Custom Page ManagedHoldings mit allen 6 Actions inlineLOW
B — Resource-only ← empfohlenManagedProposalResource (CRUD-style mit Custom Actions)MEDIUM
C — HybridPage ManagedHoldings (Overview + Request-Action) + Resource (Listing + Approve/Reject) + Page für Pause/Resume/ReleaseHIGH

Empfehlung: Option B (Resource-only) — Standard-Filament-CRUD-UX (Tabelle, Filter, Sortierung, Search) ohne Custom-Page-Boilerplate.

Wizard vs. Action

Per G-DR-7 (master_boundaries.md):

Operator-Multi-Step-Wizard für Promote: kein One-Click-Transfer; mindestens 5 Schritte inklusive Risk-Summary + Hard-Confirm

Approve-Action ist der einzige Wizard-Worthy Flow:

Filament 3 unterstützt Wizard Component. Reject / Pause / Resume / Release / Request brauchen keinen Wizard — Modal-Action mit Form genügt.

Wie werden die 6 Operationen angeboten?

CommandUI-StelleForm
requestFilament-Resource Header-Action "Analyze new asset"TextInput(asset) + TextInput(intent)
approveper-row Action auf Proposal (Wizard 5 Steps)Wizard mit form/sections
rejectper-row Action auf ProposalTextarea(reason) + TextInput(hard_confirm)
pauseper-row Action auf managed-assetConfirm-Modal, kein Hard-Confirm
resumeper-row Action auf managed_paused-assetConfirm-Modal
releaseper-row Action auf managed-assetSelect(strategy) + TextInput(hard_confirm)

Welche Actions disabled bis MH-6?

OptionInhaltEmpfehlung
1Alle 6 Actions ENABLED. Worker (pre-MH-6) marked unknown command_type als failed. Safe failure path — kein state-touch.
2Alle 6 Actions DISABLED mit Tooltip "Worker-Handler aktiviert sich erst in MH-6". UI sichtbar aber nicht triggerbar.EMPFOHLEN
3Read-only Listing only — keine Action-Buttons. Actions kommen in MH-5-FU nach MH-6.

Begründung Option 2: UI-Vollständigkeit für Operator-Review + Safety. MH-6 Closure-Phase entfernt das disabled=true Flag — minimal-invasiver Aktivierungs-Punkt.

Hard-Confirm-Anzeige

Confidence-Override-Anzeige

Wizard Step 4 (nur sichtbar wenn score < 0.50):

Reason-Field für Reject

Mainnet-Block

UI-Layer-Mainnet-Block (Layer 5 per master_boundaries §8):

4 — Strikte Abgrenzung (Konfliktcheck)

TabuMH-5-TouchVerdict
Kein command_workerUI ruft NUR Service-Methodenkonform
Kein Bot-Codetrading/*.py bleibt unverändertkonform
Kein ProposalEngine/Writer-Aufruf aus GUIService hat das verboten; UI ruft Servicekonform
Kein managed_state.json writeUI liest DB-Cache, Worker MH-6 schreibt JSONkonform
Kein baseline_holdings.json writeUI nicht beteiligtkonform
Kein runtime_config-touchnicht im Scopekonform
Keine direkte Exchange/API-AktionUI nicht beteiligtkonform
Kein Mainnethardcoded testnet + Bannerkonform
Kein Docker / Restartreine PHP/Blade-Phasekonform

5 — Empfohlene Lieferung

Komponenten (MH-5-monolithic)

KomponenteInhalt
gui/app/Filament/Resources/ManagedProposalResource.phpList + View + Header-Action (Request) + per-row Actions (Approve/Reject)
gui/app/Filament/Resources/ManagedProposalResource/Pages/ListManagedProposals.phpTabelle mit state/asset/generated_at/expires_at columns + filters
gui/app/Filament/Resources/ManagedProposalResource/Pages/ViewManagedProposal.phpDetail-View des proposal_json (Risk-Recommendation, Confidence, Market-Context)
gui/app/Filament/Pages/ManagedAssets.phpOperator-Page für Asset-Level Actions (Pause/Resume/Release per Asset)
gui/app/Filament/Resources/ManagedAssetHistoryResource.php (optional)Read-only Audit-Trail-Listing

Action-Inventar

ActionFormHard-ConfirmDisabled bis MH-6?
Request (header)asset + intentNEINJA (Empfehlung)
Approve (per-row, Wizard)asset/variant/overrides/confidence_override/hard_confirm<asset>:<variant>:<sha8>JA
Reject (per-row)reason + hard_confirm<asset>:reject:<sha8>JA
Pause (per-asset)confirm modalNEINJA
Resume (per-asset)confirm modalNEINJA
Release (per-asset)strategy + hard_confirm<asset>:release:<strategy>JA

UI-Flows

Flow A: Request a managed proposal

Operator → ManagedProposalResource Header-Action "Analyze new asset"
        → Modal: TextInput(asset) + TextInput(intent)
        → Submit → ProposalService::createRequestCommand
        → Notification "Command queued"
        → Resource Table refreshes (new row pending Worker fill)

Flow B: Approve a proposal (Wizard)

Operator → ProposalResource per-row Action "Approve"
        → Wizard Step 1: Risk Summary (read-only display)
        → Step 2: Variant Select
        → Step 3: Overrides (4 optional TextInputs)
        → Step 4: Confidence Display + Override Checkbox (if score<0.50)
        → Step 5: Hard-Confirm TextInput
        → Submit → ProposalService::createApproveCommand
        → Notification + redirect

Flow C: Pause/Resume/Release (per-asset)

Operator → ManagedAssets Page → per-row Action
        → Pause/Resume: Confirm-Modal, single submit
        → Release: Select(strategy) + Hard-Confirm
        → Submit → ManagedStateService::create*
        → Notification

Service-Aufrufe (constructor-injected)

// In Action callable:
app(ProposalService::class)->createRequestCommand(...)
app(ProposalService::class)->createApproveCommand(...)
app(ProposalService::class)->createRejectCommand(...)
app(ManagedStateService::class)->createPauseCommand(...)
app(ManagedStateService::class)->createResumeCommand(...)
app(ManagedStateService::class)->createReleaseCommand(...)

Erlaubt: nur Service-Methoden + Filament-Standards (Action/Notification/Form/Wizard).
Verboten: direct Eloquent-Mutation auf managed_proposals / managed_assets_history.

6 — Test-Plan

Test-KlasseAnzahlInhalt
ManagedProposalResourceCanAccessTest3Admin allowed · Operator denied · Anonymous denied
ManagedProposalResourceListingTest5Empty list · multiple proposals shown · state filter · asset filter · pagination
ManagedProposalResourceViewTest4Detail-View shows proposal_json fields · confidence · market_context · risk_recommendation
RequestActionTest6happy path triggers Service · invalid asset rejected · disabled-tooltip visible (MH-6-gate) · notification on success · empty input · trim
ApproveWizardTest10all 5 steps · variant select · overrides whitelist · confidence-override conditional display · hard-confirm validation · Service call · Notification on success · cancel returns to list
RejectActionTest6happy path · reason required · max-length · hard-confirm validation · Service call · Notification
PauseActionTest4confirm modal · Service call · notification · disabled-tooltip
ResumeActionTest4analog Pause
ReleaseActionTest6strategy select · hard-confirm validation · Service call · 2 strategies · disabled-tooltip · Notification
MainnetBannerTest2Banner visible · "testnet only" text
DisabledByMh6GateTest6all 6 actions show "Worker MH-6 not deployed" tooltip · disabled flag set
AuditEventVisibilityTest3managed.* audit events visible · subject_type filter · per-asset filter
Total~59 Tests(Filament-UI-Tests sind heavier als pure Service-Tests)

7 — Betroffene Dateien

Neue Files (MH-5-monolithic)

DateiStatus
gui/app/Filament/Resources/ManagedProposalResource.phpNEU
gui/app/Filament/Resources/ManagedProposalResource/Pages/ListManagedProposals.phpNEU
gui/app/Filament/Resources/ManagedProposalResource/Pages/ViewManagedProposal.phpNEU
gui/app/Filament/Pages/ManagedAssets.phpNEU
gui/app/Filament/Resources/ManagedAssetHistoryResource.php (optional)NEU
Tests in gui/tests/Feature/Filament/Managed*NEU

Unverändert

Erwartete LOC: ~600-900 Resource + Pages + Forms + ~1200-1500 Tests = ~2000-2400 LOC.

8 — Stop-Regeln MH-5

IDStop wenn…
MH-5-SR-1Filament-Code ruft direkt ManagedProposal::create oder ManagedAssetHistory::create (muss über Service)
MH-5-SR-2Filament-Code touched managed_state.json / baseline_holdings.json / risk_proposals/
MH-5-SR-3Filament-Code ruft Engine / Writer / Reader (Python-Bot-Side)
MH-5-SR-4Filament-Code ruft command_worker (Python-Subprocess)
MH-5-SR-5Action akzeptiert environment != 'testnet'
MH-5-SR-6Approve-Action ist Single-Click (muss Wizard mit ≥5 Steps sein, G-DR-7)
MH-5-SR-7Hard-Confirm Validierung ist case-insensitive
MH-5-SR-8Action ist für non-Admin sichtbar (UserRole::Admin gating)
MH-5-SR-9Mainnet-Banner fehlt
MH-5-SR-10Action-disabled-by-MH-6-Gate fehlt (Empfehlung Option 2)
MH-5-SR-11Wizard erlaubt strategy_group / variant Override (G-DR-3 Q-MH-3)
MH-5-SR-12Filament-Form-Validierung umgeht Service-Layer-Validierung

9 — Backup / Migration / Restart-Bedarf

AktionPflicht?Begründung
pg_dump GUI-DBNEINkeine Migration; reine UI-Phase
State-Files snapshotNEINkein State-Touch
DB MigrationNEINMH-4a Schema bleibt unverändert
Bot-RestartNEINkein Bot-Code-Touch
Worker-RestartNEINcommand_worker.py unverändert
docker cpNEINPHP via Laravel Live-Volume mount
GUI Cache-ClearJAphp artisan config:clear && php artisan route:clear && php artisan view:clear nach Filament-Resource-Add (Filament-Caching)

MH-5 = Reine UI-Code+Test+Commit Phase + GUI-Container Cache-Clear.

10 — Risiken-Übersicht

#RisikoSeverityMitigation
R1Wizard ist UX-komplex — Filament Wizard-Component hat Edge-CasesMEDIUMPattern-Source BaselineHoldings zeigt Modal-mit-Multi-Form-Sections; Wizard-Tests deck large surface
R2Hard-Confirm-String wird gecopy-pastet statt getippt → kein "Awareness-Check"LOWAkzeptable Default: TextInput + visual verify
R3Operator klickt Approve im Wizard, vergisst Step 4 (Confidence)LOWWizard Step::completedIcon + disabled-bis-completed. Falls submit + Service throws ConfidenceOverrideRequiredException → Notification + zurück zu Step 4
R4Worker pre-MH-6 marked Commands als failed/rejected → Operator-VerwirrungMEDIUMUI zeigt Tooltip "Worker handler activates in MH-6"; Empfehlung Option 2 (disabled until MH-6 closure)
R5Filament-Notification spam wenn Operator schnell klicktLOWSame-second idempotency in Service returnt existing — UI sieht "same command returned" und unterdrückt 2nd notification
R6Resource-Listing zeigt stale Daten weil Worker MH-6 nicht läuftLOWUI-Refresh-Button + Auto-Polling alle 10s
R7proposal_json Display-Drift wenn Engine V2 neue Fields hinzufügtLOWJsonInfolistEntry zeigt raw JSON; Wizard-Steps only read specific fields (graceful degradation)
R8UserRole::Admin canAccess()-DriftLOWTest pinned (existing pattern)
R9Filament Wizard erlaubt browser-back-navigation mit stale stateLOWFilament 3 handles wizard-state per-form; akzeptabel
R10Tests sind UI-fragil (Filament-Internals changes)MEDIUMUse Filament Test-Macros (->assertActionExists, ->callAction); avoid DOM-snapshot tests

11 — Kleinste sichere Code-Phase + GO/NO-GO

Subschnitt-Optionen

VarianteInhaltLOCTestsRisk
MH-5-monolithicResource + Pages + Wizard + alle 6 Actions + Tests~2400~59MEDIUM
MH-5a ← empfohlenResource Listing + View (read-only, kein Action)~800~20LOW
MH-5b (folgt)Request + Reject Actions (einfach, kein Wizard)~500~15LOW
MH-5c (folgt)Approve Wizard (5 Steps, complex)~700~15MEDIUM
MH-5d (folgt)Pause/Resume/Release Actions (ManagedAssets Page)~600~15LOW

Empfehlung: MH-5a (Resource Listing + View, read-only)

Begründung:

  1. Größter Sicherheitsabstand vor MH-6: Listing-only = NULL action-trigger-risk
  2. Maximale Operator-Visibility: Operator kann managed_proposals + Audit-Trail sehen, sobald Worker MH-6 die Rows füllt
  3. Wizard-Complexity ausgelagert: Approve-Wizard kommt MH-5c (nach MH-6 oder parallel) — Worker-Handler aktiv = Approve-Submit funktional
  4. 0 Actions = 0 disabled-gate-Logik — saubere Read-only-UI
  5. Pattern-Etablierung: MH-5a setzt das Filament-Resource-Skelett für MH-5b/c/d

Alternative bei Operator-Wunsch nach Full-Phase → MH-5-monolithic mit allen 6 Actions disabled-bis-MH-6 via Tooltip + UI-Flag. Akzeptabel — keine Live-Trigger-Risk.

Pre-Implementation-Q an Operator

  1. MH-5-monolithic oder MH-5a (Listing-only)? ← Empfehlung MH-5a (max Sicherheit)
  2. UI-Architektur: Option A (Page) / B (Resource) / C (Hybrid)? ← Empfehlung B (Resource) für CRUD-Style
  3. Actions disabled bis MH-6 (Option 2) oder enabled mit "Worker failed/pending" Status (Option 1)? ← Empfehlung disabled (Defense-in-Depth)
  4. Hard-Confirm-Display: Plain TextInput oder mit Live-Preview-Builder? ← Empfehlung Plain TextInput (analog G10-3b Apply, bewusste Operator-Aufmerksamkeit)
  5. Approve-Wizard 5 Steps wie skizziert oder andere Step-Reihenfolge? ← Empfehlung 5 Steps wie skizziert (per G-DR-7)
  6. Read-only audit_events Display: separate Tab/Widget oder inline in Resource? ← Empfehlung Widget auf ManagedProposalResource Header
  7. Filament Resource oder Custom Page?Empfehlung Resource für Proposals, Page für Asset-Lifecycle-Actions
  8. Mainnet-Banner-Position: oben auf Page oder global? ← Empfehlung oben auf Page + globaler Filament-Notification-State
  9. MH-6-Gate-Mechanismus: hardcoded disabled=true Flag in Resource oder via Feature-Flag/env? ← Empfehlung hardcoded disabled + Tooltip (einfacher revert in MH-6)

Scope-Größe + Risiko-Bewertung MH-5a (Listing-only)

AspektBewertung
LOC~500 Resource + ~300 Tests = ~800
Tests~20
KomplexitätLOW (Standard Filament-Resource ohne Actions)
Blast-RadiusNULL — read-only auf DB-Cache; keine Service-Aufrufe; 0 Commands
Roll-Back-Costminimal: git revert + 0 DB-Rows verändert
Dependencies-KlärungUI-Architektur (Resource vs Page)
Backup-PflichtNEIN
Migration-PflichtNEIN
Restart-PflichtNEIN
Mainnet-TouchNEIN
Cache-ClearJA (Filament-Resource-Add)
docker cpNEIN

STOP vor Implementierung. Erwarte Operator-GO mit Subschnitt-Wahl (MH-5a empfohlen) + Q1-Q9-Approval, insbesondere UI-Architektur + Actions-disabled-bis-MH-6-Mechanismus + Wizard 5-Step-Reihenfolge.

© Steve-TradingBot · RECON-MH-5 · Plan-Review (no-code phase)