Skip to content

Cockpit D5 — add serialized live snapshot ingestion - #80

Merged
LogicDuke merged 2 commits into
mainfrom
feature/live-cockpit-snapshot-ingestion
Sep 5, 2026
Merged

Cockpit D5 — add serialized live snapshot ingestion#80
LogicDuke merged 2 commits into
mainfrom
feature/live-cockpit-snapshot-ingestion

Conversation

@LogicDuke

@LogicDuke LogicDuke commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Cockpit D5 introduces the bounded live-snapshot ingestion capability adopted by the Commander DDR.

Architecture:

Autoflow authoritative WorkflowState
→ read-only serialized snapshot producer
→ JSON serialization firewall
→ readCockpitSnapshot(unknown)
→ existing D2/D4 projections
→ read-only Cockpit rendering

Scope:

  • add pure serialized Cockpit snapshot producer
  • add explicit fixture/live source seam
  • keep D1 as the sole hostile-input trust boundary
  • preserve schema v2
  • derive LIVE/FIXTURE provenance labels from source mode
  • fail closed on unavailable or malformed live input
  • no silent live→fixture fallback

Authority remains unchanged:

  • no Autoflow transition authority
  • no Policy authority
  • no provider execution authority
  • no Git/GitHub mutation authority
  • no commit/push authority from Cockpit
  • no Ready authority
  • no review-trigger authority
  • no thread-resolution authority
  • no merge authority

Strong unchanged boundaries:

  • src/cockpit/read-model.ts
  • src/cockpit/evidence-freshness-projection.ts
  • src/cockpit/autoflow-projection.ts
  • src/domain/workflow.ts
  • src/domain/workflow-transitions.ts

Validation:

  • independent validation: PASS_COMMIT_GATE
  • 1792/1792 tests PASS
  • typecheck PASS
  • lint PASS
  • build PASS
  • git diff --check PASS

Exact candidate:

Commit:
6304f12

Parent:
068a523

Patch SHA256:
2c0b9d48e17e549a41966a0559746e27f5177f4917e7bd39689df2823769ca8f

Patch bytes:
35254

Known non-blocking observations:

  • pre-existing vitest hostile-toJSON reporting flake may occur nondeterministically; unchanged baseline infrastructure
  • actual end-to-end running Autoflow→live Cockpit wiring is a follow-up milestone; this PR delivers the ingestion producer/boundary/seam

🤖 Generated with Claude Code

https://claude.ai/code/session_013Ma5jqtnq1VEZc94QLkn89

Summary by CodeRabbit

  • New Features
    • Added support for rendering Cockpit dashboards from live, read-only serialized snapshots.
    • Dashboard labels now clearly distinguish live observations from fixture data.
    • Added deterministic snapshot handling with protection against unintended data mutation.
  • Bug Fixes
    • Live-source failures and malformed data now fail closed instead of silently falling back to fixture data.
    • Cockpit remains read-only; unsupported write requests are rejected.
  • Documentation
    • Added architecture documentation describing snapshot ingestion and source boundaries.
  • Tests
    • Added coverage for live rendering, provenance labels, validation, determinism, and failure handling.

Add a read-only serialized snapshot producer, an explicit host source
seam, and source-derived provenance labeling, so the Cockpit can ingest
a live Autoflow observation through the unchanged D1 hostile boundary
while preserving every read-only, workflow-truth, and human-authority
boundary. Schema v2 and the five protected implementation boundaries are
byte-unchanged; a failed live source fails closed with no fixture
fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Ma5jqtnq1VEZc94QLkn89
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 284e1b1d-414e-4428-914d-2fb9acb6dccc

📥 Commits

Reviewing files that changed from the base of the PR and between 068a523 and dede936.

📒 Files selected for processing (6)
  • docs/architecture/D5-live-cockpit-snapshot-ingestion.md
  • src/cockpit-host/render.ts
  • src/cockpit-host/server.ts
  • src/cockpit-snapshot/producer.ts
  • tests/cockpit-host/live-source.test.ts
  • tests/cockpit-snapshot/producer.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds a pure schema-v2 snapshot producer and a CockpitSource seam. The host can render fixture or live snapshots, preserves fail-closed behavior, and labels pages from the injected source mode. Tests cover serialization, validation, provenance, determinism, and HTTP behavior.

Changes

D5 live Cockpit ingestion

Layer / File(s) Summary
Snapshot observation and serialization
src/cockpit-snapshot/producer.ts, tests/cockpit-snapshot/producer.test.ts, docs/architecture/D5-live-cockpit-snapshot-ingestion.md
produceCockpitSnapshot serializes an authoritative observation into a schema-v2 envelope. It defaults only undefined optional lists, uses a JSON round-trip firewall, returns unknown, and performs no validation, I/O, clock reads, or workflow transitions. Tests cover D1 acceptance, malformed data, repository binding, mutation isolation, determinism, and source restrictions.
Source injection and provenance rendering
src/cockpit-host/server.ts, src/cockpit-host/render.ts, tests/cockpit-host/live-source.test.ts, docs/architecture/D5-live-cockpit-snapshot-ingestion.md
buildDashboardHtml and createCockpitServer accept fixture or live sources. Source failures and D1 failures propagate without fixture fallback. Rendering derives title, badges, and footer text from the injected provenance mode. Tests cover live ingestion, null workflow display, labeling, fail-closed behavior, deterministic HTML, loopback serving, and GET-only routing.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to dede9

This change adds bounded live snapshot ingestion while preserving fixture defaults, rejecting invalid live data, and clearly labeling live versus fixture output. The documented validation and coverage support merge readiness with no remaining actionable risk.

Sequence Diagram(s)

sequenceDiagram
  participant CockpitSource
  participant buildDashboardHtml
  participant readCockpitSnapshot
  participant renderDashboard
  CockpitSource->>buildDashboardHtml: read serialized snapshot
  buildDashboardHtml->>readCockpitSnapshot: validate raw snapshot
  readCockpitSnapshot-->>buildDashboardHtml: validated CockpitSnapshot
  buildDashboardHtml->>renderDashboard: render snapshot with source mode
  renderDashboard-->>buildDashboardHtml: dashboard HTML
Loading

Poem

A rabbit packs snapshots bright,
Through JSON gates they travel light.
Live labels bloom, fixtures stay,
Bad data finds the guarded way.
The read-only cockpit hops away.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 5 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding serialized live snapshot ingestion for Cockpit D5.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/live-cockpit-snapshot-ingestion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LogicDuke
LogicDuke marked this pull request as ready for review September 5, 2026 11:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T12:18:16.569832Z dede936 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6304f12160

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cockpit-snapshot/producer.ts Outdated
Default optional read-model lists only when absent (undefined), via a
defaultOptionalList helper, instead of a nullish `?? []` default. An
explicit null (or any other malformed runtime value) now survives the
producer serialization boundary and reaches readCockpitSnapshot, which
rejects the whole snapshot. This removes a sanitization; it adds no
producer-side validation, so D1 remains the sole hostile-input validator.
Schema v2 and the protected boundaries are unchanged; defaultBranchRef
keeps its legitimate null default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Ma5jqtnq1VEZc94QLkn89
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dede936afc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cockpit-snapshot/producer.ts
@LogicDuke

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@LogicDuke
LogicDuke merged commit 7af9030 into main Sep 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant