This repository was archived by the owner on May 26, 2026. It is now read-only.
feat(KR-P2-CONTROL-PANEL): kora_control runtime-observed-state viewer against stub endpoint#37
Merged
Merged
Conversation
… against stub endpoint
Read-only diagnostic panel showing STOP-KORA commands as the runtime
has observed them: which commands are active (pre-enforced), which
were recently enforced, and a deeper history of terminal-state
commands. Pairs with CC#1's KR-P2-J (KoraControlReader + STOP-KORA
handler) but goes in ahead of the runtime wire-in — the data source
is a hardcoded sample-data stub at each lifecycle position with
``stub: True`` so the frontend renders a banner making it obvious to
operators that values are not real commands. When KR-P2-J lands and
``KoraControlReader.get_all_observed_commands()`` exists, the endpoint
body flips to a projection of that read; the page itself doesn't
change.
Command ISSUANCE happens cockpit-side (IsoKron-team's lane). The
Kora-runtime panel built here is observation-only — operators check
here to confirm the runtime saw + acked + enforced commands issued
from the cockpit. Two complementary panels by design.
Backend (kora_cli/web_server.py):
GET /api/kora-control/observed-state — read-only stub returning 3
lifecycle-grouped lists. No POST/PUT/DELETE — the runtime advances
lifecycle on its own based on the reader + handler; there's nothing
for an operator to do from here.
Frontend:
- KoraControlPage.tsx — 3 sections by lifecycle position:
* Active: prominent cards with pulsing live indicator, level/kind
badges (color-toned by STOP-KORA tier), and a GitHub-PR-checks-
style horizontal timeline strip showing created → visible →
observed → acked → enforced with check marks for reached steps,
pulsing warning for the current step, and connector lines that
turn green as progress advances. Terminal-but-non-success states
(superseded/expired/failed/escalated) suppress the timeline
progression and render with destructive accent.
* Recently enforced: same card layout, quiet styling, timeline
collapsed by default (expandable per-card).
* History: collapsible (default-collapsed). Table sorted
created_at desc with truncated-reason + hover-full.
- api.ts — typed KoraControlKind / KoraControlLifecycleState enums
+ KoraControlCommand + KoraControlObservedStateResponse so a
future Python-side enum drift surfaces at compile time.
- App.tsx — /kora-control route + nav entry (OctagonAlert icon)
between /operational-state and /sea-tickets per spec §3.
- Multiple-active fallback: R4.1 "highest open level wins" — when
multiple actives exist (shouldn't, but defensively), sort by
level desc + sequence asc with a small note that the topmost card
is the effective constraint.
Tests: tests/kora_cli/test_web_server_kora_control.py — 8 tests
covering all 7 §5 scenarios plus a contract guard
(recently_enforced entries are always in ``enforced`` lifecycle with
non-null ``enforced_at``). 65/65 across full web_server test suite
pass. tsc -b + vite build clean.
§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
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 Kora-runtime-local panel showing STOP-KORA commands as the runtime has observed them. Pairs with KR-P2-J (KoraControlReader + STOP-KORA handler, CC#1 — in flight) and goes in ahead of the runtime wire-in so the UI is ready when J lands.
Two complementary panels (by design)
Endpoint (kora_cli/web_server.py)
GET /api/kora-control/observed-state— 3 lifecycle-grouped lists withstub: true:activerecently_enforcedhistoryNo POST/PUT/DELETE — the runtime advances lifecycle on its own based on KR-P2-J's reader + handler. Nothing for an operator to do from here.
Frontend (web/)
pages/KoraControlPage.tsxcreated → visible → observed → acked → enforcedwith check marks for reached steps, pulsing warning for the current step, and connector lines that turn green as progress advances. Terminal-but-non-success states (superseded/expired/failed/escalated) suppress the progression and render with destructive accent.created_at desc, truncated-reason with hover-full.level desc + sequence ascwith a small note that the topmost card is the effective constraint.lib/api.ts— typedKoraControlKind/KoraControlLifecycleStateenums +KoraControlCommand+KoraControlObservedStateResponseApp.tsx—/kora-controlroute + nav entry (OctagonAlert icon) between/operational-stateand/sea-ticketsFlip-over plan
When KR-P2-J lands and
KoraControlReader.get_all_observed_commands() -> ObservedKoraControlStateexists, swapget_kora_control_observed_statebody to project from that read and drop thestubflag. The page itself doesn't change — banner disappears the momentstubis gone.Test plan
tests/kora_cli/test_web_server_kora_control.py— 8/8 green, covers all 7 §5 scenarios + contract guard (recently_enforced ⇒ enforced lifecycle with non-nullenforced_at)test_web_server_{sea_tickets,operational_state,cron_profiles,host_header,mcp,gateway_identity}.py— 57/57 still green (regression sanity, 65 total in suite)npx tsc -bonweb/— cleannpx vite buildonweb/— clean/kora-control, verify STUB banner renders, verify Active card shows the timeline strip withcreated/visible/observed/ackedchecked +enforcedunchecked + pulsing warning markerDependency notes
KoraControlReader+ STOP-KORA L1-5 handlerKoraControlReader.get_all_observed_commands()is the helper that flips this from stub to real (after J)🤖 Generated with Claude Code