Skip to content

feat(console): add decision cockpit backend API - #1010

Draft
Pigbibi wants to merge 11 commits into
mainfrom
feat/cockpit-backend-api
Draft

Pigbibi wants to merge 11 commits into
mainfrom
feat/cockpit-backend-api

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

AI assistance

OpenAI Codex.

What changed

Add decision review/action, operation and audit APIs, versioned envelopes, opaque inbox pagination, and selected/approved/observed risk-tier projections. Revision checks and request replay preserve existing owner-intent boundaries: no_order: true and execution_authority_granted: false.

Move the duplicate promotion-authority read correction from #1020 into this base so its own JavaScript validation can pass. The regression keeps the single-read assertion and checks the projected authority fields. #1020 retains the Bash 3 compatibility change; #1018 adds audit pagination and runtime readback.

Patch development dependencies to Vite 7.3.7, undici 7.30.1 and sharp 0.35.5 without changing runtime authority or upgrading Miniflare. Effective tier remains unknown without observed evidence; declarative tier parameters do not authorize execution.

How verified

  • Passed locally on Node 22: decision cockpit API, evidence metadata, console API Worker and human-decision Worker validations.
  • Both npm projects report zero vulnerabilities after the compatible dependency updates.
  • Remote CI is evaluated on the current branch head. The owner-approval risk gate remains blocked under the explicit no-label instruction.
  • No merge, deployment, labels, IAM or secret changes. Production behavior is unverified.

Adds qsl.decision_review.v1, qsl.operation.v1, audit-event and
risk-tier binding definitions plus the decision inbox server_time
fields the new read endpoints return.
Extracts decision identity, revision, transition, actionability and
receipt fields into decision_contract.js, adds closed risk-tier policy
bindings, and projects them onto canonical inbox items. Inbox payloads
now carry schema_version and server_time.
Adds GET /api/decisions/:id, POST /api/decisions/:id/actions,
GET /api/operations/:id and GET /api/audit-events. Writes require the
current revision and an Idempotency request id, reject expired or
ineligible decisions, and replay identical requests instead of
recording a second decision.
Adds an end-to-end validation for the decision review, action,
operation and audit-event routes, and compares inbox payloads without
their per-request server_time.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Effective tier in the risk-tier binding projection was hard-coded to null.
It now comes from an explicit runtime readback observation and stays null
with reason code effective_tier_not_observed when no observation exists.

The tier is never derived from the approved policy: ARCHITECTURE.md 4.4
requires selected, approved and effective policy to be displayed
separately, and section 3.2 states runtime readback independently
establishes effective state. No observed-tier source is wired into the
console yet, so production reads still report null plus the reason code,
and effective_derived_from_approved is a false constant in the contract.
Reject a reused operation id with a different intent instead of replaying
the recorded decision, and echo the operation identity in the result.
The cockpit now returns every declarative tier policy (tier id,
composer_mdd_multiple, promotion_size_scale) from the inbox and the
decision review. The catalog is projected from the single risk_tiers.js
source, so no numbers are duplicated.

Each entry stays labeled owner intent only: executable false,
activation_status not_connected, no_order true and
execution_authority_granted false. An unknown tier still resolves to
null rather than a numeric default, and effective.tier behavior is
unchanged.
Pigbibi and others added 2 commits November 1, 2026 15:42
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
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