Skip to content

Cockpit D4 Stage A — project Autoflow state - #72

Merged
LogicDuke merged 3 commits into
mainfrom
cockpit/d4-autoflow-projection-clean
Sep 4, 2026
Merged

Cockpit D4 Stage A — project Autoflow state#72
LogicDuke merged 3 commits into
mainfrom
cockpit/d4-autoflow-projection-clean

Conversation

@LogicDuke

@LogicDuke LogicDuke commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Scope

Adds Cockpit D4 Stage A: a pure read-only projection of an already-valid in-process PR 007 WorkflowState into Cockpit presentation state.

Architecture

WorkflowState
→ pure projectCockpitAutoflow()
→ immutable Cockpit presentation
→ read-only D3 host rendering

D4 Stage A is observability only.

It does not:

  • execute Autoflow transitions
  • make policy decisions
  • grant authority
  • choose next actions
  • project Ready/merge state
  • derive freshness/supersession
  • invoke providers
  • add persistence or collection
  • project WF1/WF2/WF3 escalation state

Files

Exactly 7 changed files:

  • docs/architecture/D4-cockpit-autoflow-projection.md
  • src/cockpit-host/render.ts
  • src/cockpit/autoflow-projection.ts
  • src/cockpit/index.ts
  • tests/cockpit-host/render.test.ts
  • tests/cockpit/autoflow-projection-invariants.test.ts
  • tests/cockpit/autoflow-projection.test.ts

Validation

The source tree was independently validated before commit.

Evidence:

  • focused D4 tests: 21 passed
  • complete Cockpit/Cockpit-host tests: 146 passed
  • workflow/domain tests: 1567 passed
  • full repository suite: 1714 passed
  • typecheck: PASS
  • lint: PASS
  • build: PASS
  • git diff --check: PASS
  • independent adversarial validation: PASS
  • findings: none

Validated tree:
1d9aec24694a7680640c977ca7f76382d13e3ff3

Clean PR HEAD:
8e7dc84c63e4e68ea9590f91f6eaebc3bf9fcbc9

Base:
1619a3cd22a553c24bc1fe3161266c531d045b8e

Deferred

The D4 input-provenance/serialization mechanism remains deferred:

  • in-process Stage-A value is implemented
  • no D1 snapshot-envelope extension yet
  • no collector/persistence/Evidence Store sourcing yet

WF1/WF2/WF3 escalation, finding-family, and reviewer-budget projection remain out of scope until authoritative domain state exists.

Status

DRAFT.

Do not review/merge yet.

Summary by CodeRabbit

  • New Features

    • Added an Autoflow dashboard panel showing workflow details, invocation activity, status, revision, closure reason, gate revision, and summary counts.
    • Added an honest “not projected yet” state when Autoflow data is unavailable.
    • Preserved source ordering and safely escaped displayed identifiers.
    • Added a deterministic, immutable presentation of validated Autoflow workflow data.
  • Tests

    • Added coverage for projected and unprojected dashboard states, data integrity, ordering, counts, immutability, and security-related display behavior.

@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: 49772bda-3dbc-4476-adc8-7a627426f5cc

📥 Commits

Reviewing files that changed from the base of the PR and between 1619a3c and 6018fd5.

📒 Files selected for processing (7)
  • docs/architecture/D4-cockpit-autoflow-projection.md
  • src/cockpit-host/render.ts
  • src/cockpit/autoflow-projection.ts
  • src/cockpit/index.ts
  • tests/cockpit-host/render.test.ts
  • tests/cockpit/autoflow-projection-invariants.test.ts
  • tests/cockpit/autoflow-projection.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 pure D4 projection from validated WorkflowState, exports its read-model types, renders the projection in the dashboard, preserves an absence state, and adds architecture, rendering, invariant, serialization, and immutability tests.

Changes

Autoflow projection

Layer / File(s) Summary
Projection contract and exports
docs/architecture/D4-cockpit-autoflow-projection.md, src/cockpit/index.ts
Defines the D4 projection boundary and re-exports its counts, invocation, and projection types.
WorkflowState projection and invariants
src/cockpit/autoflow-projection.ts, tests/cockpit/autoflow-projection.test.ts, tests/cockpit/autoflow-projection-invariants.test.ts
Projects workflow facts and invocation records into a deterministic, deeply frozen read model with derived counts. Tests cover purity, neutrality, excluded fields, ordering, serialization, and immutability.
Optional dashboard rendering
src/cockpit-host/render.ts, tests/cockpit-host/render.test.ts
Renders projected Autoflow facts and counts, or an absence state when no projection is provided. Tests cover escaping, notices, and non-interactive output.

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

Merge Risk: ⚪ Minimal · up to 6018f

The change adds an optional read-only dashboard projection while preserving the existing absence state when no projection is supplied. No current merge-blocking risk was identified.

Poem

A rabbit projects facts in a row
Frozen records hop into the show
Counts wear neat ears
Notices disappear
The dashboard blooms, soft and aglow

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 6 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 identifies the main change: adding the Cockpit D4 Stage A projection of Autoflow state.
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 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 6 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 cockpit/d4-autoflow-projection-clean

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

Copy link
Copy Markdown
Owner Author

@codex review

@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-04T13:37:12.805435Z 6018fd5 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: 8e7dc84c63

ℹ️ 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-host/render.ts
PR72-F1 — hide obsolete Autoflow gap notice
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6018fd58d4

ℹ️ 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".

@LogicDuke
LogicDuke marked this pull request as ready for review September 4, 2026 13:32
@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.

@LogicDuke
LogicDuke merged commit 58f1dcb into main Sep 4, 2026
2 checks passed
@LogicDuke
LogicDuke deleted the cockpit/d4-autoflow-projection-clean branch September 4, 2026 14:10
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