Skip to content

Cockpit D4 Stage B — ingest serialized Autoflow state - #74

Closed
LogicDuke wants to merge 5 commits into
mainfrom
cockpit/d4-stage-b-autoflow-provenance
Closed

Cockpit D4 Stage B — ingest serialized Autoflow state#74
LogicDuke wants to merge 5 commits into
mainfrom
cockpit/d4-stage-b-autoflow-provenance

Conversation

@LogicDuke

@LogicDuke LogicDuke commented Sep 4, 2026

Copy link
Copy Markdown
Owner

D4 Stage B implements the ratified Option-A input-provenance contract.

Scope:

  • strict Cockpit snapshot schema v2;
  • required serialized autoflow field;
  • domain-owned readWorkflowState(unknown) hostile-input reader;
  • detached/frozen WorkflowState reconstruction;
  • D1 ingestion of serialized Autoflow;
  • server composition through existing projectCockpitAutoflow;
  • no D4 projection redesign;
  • no Evidence Store persistence;
  • no orchestration/Ready/merge authority.

Validation completed before commit:

  • finite Commander-directed falsification matrix;
  • 30 files / 1753 tests passed;
  • typecheck PASS;
  • lint PASS;
  • build PASS;
  • git diff --check PASS;
  • frozen 13-file candidate fingerprint verified.

Commit:
0e92fbf

Base:
58f1dcb

Summary by CodeRabbit

  • New Features

    • Added support for Autoflow workflow observations in cockpit snapshots.
    • The dashboard now displays projected workflow and review invocation details when available.
    • Added secure reconstruction of workflow state from serialized data.
  • Bug Fixes

    • Invalid or unsafe workflow observations are rejected without disrupting snapshot processing.
    • Accepted workflow data is isolated and protected from later mutation or serialization interference.

@coderabbitai

coderabbitai Bot commented Sep 4, 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: 5e2760a8-a211-49ad-9f66-28bb0375072b

📥 Commits

Reviewing files that changed from the base of the PR and between 58f1dcb and f9e8cb6.

📒 Files selected for processing (13)
  • src/cockpit-host/fixtures/stage-a.ts
  • src/cockpit-host/server.ts
  • src/cockpit/read-model.ts
  • src/domain/index.ts
  • src/domain/workflow-transitions.ts
  • tests/cockpit-host/render.test.ts
  • tests/cockpit-host/server.test.ts
  • tests/cockpit-host/stage-a-invariants.test.ts
  • tests/cockpit/autoflow-provenance.test.ts
  • tests/cockpit/read-model-fixtures.ts
  • tests/cockpit/read-model-invariants.test.ts
  • tests/cockpit/read-model.test.ts
  • tests/domain/workflow-read-state.test.ts

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


📝 Walkthrough

Walkthrough

The change adds a secure serialized WorkflowState reader, upgrades cockpit snapshots to schema version 2, adds Autoflow data to the Stage-A fixture, and renders the validated workflow projection in the dashboard.

Changes

Autoflow provenance and projection

Layer / File(s) Summary
Workflow observation reader
src/domain/workflow-transitions.ts, src/domain/index.ts, tests/domain/workflow-read-state.test.ts
readWorkflowState validates hostile serialized data, detaches records, and returns a deeply frozen workflow state. The tests cover malformed input, prototype poisoning, proxies, and serialization.
Snapshot schema and ingestion
src/cockpit/read-model.ts, tests/cockpit/autoflow-provenance.test.ts, tests/cockpit/read-model-*
Cockpit snapshots now require schema version 2 and an own autoflow property. Valid observations are read through readWorkflowState; invalid observations fail closed.
Fixture and dashboard projection
src/cockpit-host/fixtures/stage-a.ts, src/cockpit-host/server.ts, tests/cockpit-host/*
The Stage-A fixture supplies one observed workflow. The host projects it into the dashboard, and host tests verify the populated Autoflow panel.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to f9e8c

The serialized Autoflow state is validated, detached, frozen, and safely projected through the dashboard path. No actionable merge-blocking risk is identified.

Sequence Diagram(s)

sequenceDiagram
  participant StageAFixture
  participant readCockpitSnapshot
  participant readWorkflowState
  participant buildDashboardHtml
  participant projectCockpitAutoflow
  participant renderDashboard
  StageAFixture->>readCockpitSnapshot: provide schema version 2 and autoflow
  readCockpitSnapshot->>readWorkflowState: validate serialized observation
  readWorkflowState-->>readCockpitSnapshot: return frozen WorkflowState
  readCockpitSnapshot-->>buildDashboardHtml: return validated snapshot
  buildDashboardHtml->>projectCockpitAutoflow: project autoflow state
  projectCockpitAutoflow-->>buildDashboardHtml: return projection
  buildDashboardHtml->>renderDashboard: render dashboard with projection
Loading

Poem

I hop through the snapshot, tidy and bright
I freeze every record and guard it from blight
The workflow arrives with its facts in a row
The dashboard now shows what the reader can know
One rabbit approves this projected flow

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 13 files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: ingesting serialized Autoflow state for Cockpit D4 Stage B.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cockpit/d4-stage-b-autoflow-provenance

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 4, 2026 15:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-04T19:43:05.721967Z f9e8cb6 Draft marked ready
ℹ️ 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.

@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: 0e92fbfc8c

ℹ️ 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/domain/workflow-transitions.ts Outdated
@LogicDuke
LogicDuke marked this pull request as draft September 4, 2026 16:04
…pe-insulation

PR74-F1 — insulate Autoflow observation graph
@LogicDuke
LogicDuke marked this pull request as ready for review September 4, 2026 17:33
@LogicDuke

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 4, 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.

@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: f9e8cb6f15

ℹ️ 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/domain/workflow-transitions.ts
Comment thread src/cockpit/read-model.ts Outdated
@LogicDuke
LogicDuke marked this pull request as draft September 4, 2026 17:44
@LogicDuke
LogicDuke marked this pull request as ready for review September 4, 2026 19:39
@LogicDuke
LogicDuke marked this pull request as draft September 4, 2026 19:40

@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: f9e8cb6f15

ℹ️ 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/read-model.ts
export const COCKPIT_SNAPSHOT_SCHEMA_VERSION = 1;
export const COCKPIT_SNAPSHOT_SCHEMA_VERSION = 2;

export type CockpitSnapshotSchemaVersion = typeof COCKPIT_SNAPSHOT_SCHEMA_VERSION;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the D1 contract for schema version 2

Changing the only accepted version to 2 leaves docs/architecture/D1-cockpit-read-model.md actively inconsistent with the implementation: it still declares V1, says D1 has no Autoflow integration, and documents an envelope without autoflow. A collector implemented against that public contract will emit version-1 snapshots that this reader now rejects wholesale, so update the contract to document the version-2 field and compatibility policy alongside this bump.

Useful? React with 👍 / 👎.

…ory-binding

PR74-F2 — bind Autoflow to snapshot repository
@LogicDuke

Copy link
Copy Markdown
Owner Author

Superseded by PR #78.

PR #78 replaced this fragmented D4 Stage B delivery with one clean, independently validated Stage-B candidate built from current main and now merged successfully.

PR #74 is preserved as historical evidence and must not be merged.

@LogicDuke LogicDuke closed this Sep 5, 2026
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