This repository was archived by the owner on May 26, 2026. It is now read-only.
feat(KR-P2-BOOT-PANEL): boot status admin UI (gate sequence viewer) against stub endpoint#45
Merged
Merged
Conversation
…gainst stub endpoint Read-only diagnostic panel showing Kora's most recent boot — the ordered gate sequence with per-gate outcomes — plus recent boot history. Pairs with CC#1's KR-P2-H (BootGateRunner) but goes in ahead of the runtime wire-in; v1 returns a hardcoded sample of a successful current boot + one failed historical boot with ``stub: True`` so the panel renders meaningfully and the operator can verify the failed-gate path before any real failures occur. The flip-over swaps the endpoint body to project from ``BootGateRunner.last_result()`` + ``BootGateRunner.recent_history( limit=20)``; the page itself doesn't change. This is the 4th panel shipped against the same stub-first pattern (#26 OPS, #31 SEA, #37 CONTROL all proven; KR-P2-I-integration #35 flipped OPS-PANEL's stub → real two weeks ahead of where the bucket originally planned). Backend (kora_cli/web_server.py): GET /api/boot-status — read-only stub. No POST/PUT/DELETE; operator intervention on stuck boots is operator-side (flyctl restart, Doppler env-var fix, etc.). Frontend: - BootStatusPage.tsx — 2 sections: * Current boot card: outcome badge with appropriate tone, boot metadata strip, GitHub-PR-checks-style horizontal gate-sequence strip with checkmark for pass / red X for fail / spinning loader for pending. Steps after the failure render gray (not run). Connector lines turn green progressively and gray at/after a failure. When failed, a destructive call-out renders below the strip with the failed gate's title + detail + operator playbook hint pointing at the ``kora.boot.failed`` chain event payload. * Recent history: collapsible table sorted ``started_at desc``; default-expanded if the most recent boot failed (operator should see prior boots immediately for context), collapsed otherwise. Limit 10 rows by default with "show more (up to 20)" toggle. - api.ts — typed GateOutcome / GateClass / BootOutcome enums + GateResult / CurrentBoot / BootHistoryEntry / BootStatusResponse. - App.tsx — /boot-status route + nav entry (PowerSquare icon) between /operational-state and /kora-control per spec §3. Tests: tests/kora_cli/test_web_server_boot_status.py — 10 tests covering all 8 §5 scenarios + 2 contract guards (ready ⇒ all-pass; failed history entries carry failure metadata). 10/10 green. Pre-existing test debt: tests/kora_cli/test_web_server_operational_state.py has 4 failing tests on main HEAD (reproduces on c2f9f16 base) due to PR #35's operational-state stub → real flip not updating the test file. Out of scope for this PR (it's a separate operational-state clean-up); flagged in the PR body so it isn't lost. §8 pre-push grep checks: STUB banner present, endpoint registered, zero write-side routes leaked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 21, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Read-only operator-side panel for Kora's boot sequence outcome — the ordered gate run with per-gate pass/fail + a recent boot history table. Pairs with KR-P2-H (BootGateRunner, CC#1 — in flight) and ships ahead of the runtime wire-in.
This is the 4th panel in the proven stub-first pattern. Predecessors: PR #26 (OPS), #31 (SEA), #37 (CONTROL). The OPS-PANEL stub→real flip already landed in PR #35, so the pattern is empirically known to flip cleanly.
Endpoint (kora_cli/web_server.py)
GET /api/boot-status— returnscurrent+historywithstub: true:current.outcomebooting/ready/failedcurrent.gates[]{gate_id, title, gate_class, outcome, elapsed_ms, detail}history[]failed_gate_id+failed_gate_title+detailNo POST/PUT/DELETE — operator intervention on stuck boots is operator-side (
flyctl restart, Doppler env-var fix). No "force re-boot" / "skip gate" controls.Frontend (web/)
pages/BootStatusPage.tsxkora.boot.failedchain event payloadlib/api.ts— typedGateOutcome/GateClass/BootOutcomeenums +GateResult/CurrentBoot/BootHistoryEntry/BootStatusResponseApp.tsx—/boot-statusroute + nav entry (PowerSquare icon) between/operational-stateand/kora-controlFlip-over plan
When KR-P2-H lands and
BootGateRunner.last_result()+BootGateRunner.recent_history(limit=20)exist, swapget_boot_statusbody to project from those and drop thestubflag. The page itself doesn't change.Test plan
tests/kora_cli/test_web_server_boot_status.py— 10/10 green, covers all 8 §5 scenarios + 2 contract guards (ready ⇒ all-pass; failed history entries carry failure metadata)test_web_server_{kora_control,sea_tickets,cron_profiles,host_header,mcp,gateway_identity}.py— 57/57 still greennpx tsc -bonweb/— cleannpx vite buildonweb/— clean/boot-status, verify STUB banner renders, verify gate-sequence strip shows all 7 gates checked green, verify history table shows the failed prior boot with red X on gate 5Pre-existing test debt (NOT caused by this PR)
tests/kora_cli/test_web_server_operational_state.pyhas 4 failing tests on main HEADe33e90a— reproduces with this PR's tree stashed:test_stub_shape_matches_spec_exactlytest_transition_history_has_required_keystest_valid_next_states_point_at_valid_primary_statestest_ready_state_advertises_three_known_next_statesCause: PR #35 (KR-P2-I-integration ST5) flipped
/api/operational-statefrom stub → real but didn't update the test file that pinned the original stub shape. These tests were valid against the stub and need rewriting for the real endpoint's shape. Out of scope for this PR — flagged so it doesn't get lost.Dependency notes
BootGateRunner+ R4.1 §9.2 gate sequenceBootGateRunner.last_result()+.recent_history(limit=20)are the accessors that flip this from stub to real🤖 Generated with Claude Code