Skip to content

D61 — Startup-scripted human-gate progression - #83

Merged
LogicDuke merged 1 commit into
mainfrom
feature/d61-startup-human-gate
Sep 6, 2026
Merged

D61 — Startup-scripted human-gate progression#83
LogicDuke merged 1 commit into
mainfrom
feature/d61-startup-human-gate

Conversation

@LogicDuke

@LogicDuke LogicDuke commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Decision 061 — STARTUP-SCRIPTED HUMAN-GATE PROGRESSION

This Tier-2 milestone adds one structurally narrow production Autoflow progression:

startup workflow open
→ HUMAN_GATE_OPENED
→ AWAITING_HUMAN_DECISION

Production authority added:

  • HUMAN_GATE_OPENED only
  • one synchronous startup call site
  • strict AGENTBRIDGE_STARTUP_OPEN_HUMAN_GATE=1 semantics

Explicitly not added:

  • generic apply(event)
  • CLOSE_REQUESTED
  • any second production WorkflowEvent kind
  • autonomous/post-start event sourcing
  • Git/GitHub mutation authority
  • provider/Policy execution
  • persistence/replay
  • Cockpit write authority

Validated candidate:

  • base: 8455eb9
  • head: 85cb3bc
  • patch SHA256: 9C5E6A43C54FBDD0CA7DE211D2D7ABD6056E933B97A8E746AD1B98C2D5B0C740
  • patch bytes: 24193
  • focused tests: 52/52
  • full suite: 1891/1891, independently reproduced twice
  • typecheck: PASS
  • lint: PASS
  • build: PASS
  • git diff --check: PASS
  • protected files: byte-identical

Candidate was independently validated before commit and the committed bytes were proven identical to the validated candidate.

This PR intentionally remains Draft pending exact-head CI and substantive review.

Human merge authority is preserved.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H2mKZV7PWy3uRh6m81RRrX

Summary by CodeRabbit

  • New Features

    • Added an optional startup human-gate flow for live workflows.
    • When enabled with the startup configuration, workflows can pause in an awaiting-human-decision state.
    • Added safeguards to ensure human-gate actions apply only to the active workflow.
  • Bug Fixes

    • Invalid startup human-gate configuration is rejected instead of being silently interpreted.
    • Duplicate or unavailable human-gate actions are handled safely.
  • Tests

    • Added coverage for startup progression, configuration validation, workflow binding, and resulting cockpit states.

Decision 061 (STARTUP-SCRIPTED HUMAN-GATE PROGRESSION, Tier 2). Adds a
bounded, one-shot startup submission of exactly one HUMAN_GATE_OPENED
event after the authorized startup workflow-open. This is NOT a post-start
external event source and NOT autonomous orchestration.

- AutoflowOrchestrator gains a structurally narrow openHumanGate(): it mints
  one HUMAN_GATE_OPENED event bound to the workflow's own boundCommitSha and
  delegates once to the runtime. No generic apply(event); CLOSE_REQUESTED and
  the other kinds stay unconstructible in production (domain legality is not
  production authority).
- readStartupHumanGateConfig reads AGENTBRIDGE_STARTUP_OPEN_HUMAN_GATE once
  with strict "1"-or-throw semantics (no trim/case-fold/coercion).
- runStartupProgression is the single boot call site: a gate without a valid
  startup-open, a non-APPLIED open, or a non-APPLIED gate all fail closed
  before serving. No loop/timer/poll/callback/post-start path.

Cockpit stays read-only; AutoflowRuntime remains sole state owner; no
persistence/replay. Six strong boundaries byte-identical. Full suite
1891/1891; typecheck/lint/build/diff-check clean.

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

coderabbitai Bot commented Sep 6, 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: 2f95d920-4f95-46ee-a15c-c7303338eeb2

📥 Commits

Reviewing files that changed from the base of the PR and between 8455eb9 and 85cb3bc.

📒 Files selected for processing (6)
  • src/autoflow/orchestrator.ts
  • src/runtime/live-cockpit.ts
  • src/runtime/orchestration-input.ts
  • tests/autoflow/orchestrator.test.ts
  • tests/runtime/live-composition.test.ts
  • tests/runtime/orchestration-input.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 openHumanGate() to the orchestrator and adds strict startup configuration for an optional human-gate transition. Live startup progression now opens the workflow, applies one human-gate event when requested, and rejects invalid or unsuccessful transitions.

Changes

Startup Human-Gate Progression

Layer / File(s) Summary
Strict startup trigger
src/runtime/orchestration-input.ts, tests/runtime/orchestration-input.test.ts
Defines STARTUP_HUMAN_GATE_ENV and accepts only the exact value "1". The configuration is read once and rejects every other present value.
Orchestrator human-gate action
src/autoflow/orchestrator.ts, tests/autoflow/orchestrator.test.ts
Adds openHumanGate(). The method binds the event to the current workflow commit, returns no-workflow results unchanged, and rejects duplicate gates. The public surface excludes generic apply(event).
Live startup progression
src/runtime/live-cockpit.ts, tests/runtime/live-composition.test.ts
Adds runStartupProgression(). Startup opens the configured workflow and optionally submits one human-gate event. Invalid bindings and non-APPLIED results fail startup. LIVE Cockpit tests cover the awaiting-human-decision state.

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

Merge Risk: ⚪ Minimal · up to 85cb3

When explicitly enabled, startup now opens a human gate after opening the workflow, moving it to awaiting human decision. Invalid configuration and rejected transitions stop startup rather than proceeding with an invalid state, and no concrete merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Environment
  participant runStartupProgression
  participant AutoflowOrchestrator
  participant AutoflowRuntime
  Environment->>runStartupProgression: read startup configuration
  runStartupProgression->>AutoflowOrchestrator: open workflow binding
  AutoflowOrchestrator->>AutoflowRuntime: apply workflow-open event
  runStartupProgression->>AutoflowOrchestrator: openHumanGate()
  AutoflowOrchestrator->>AutoflowRuntime: apply HUMAN_GATE_OPENED event
  AutoflowRuntime-->>runStartupProgression: return transition result
Loading

Poem

A rabbit taps the startup gate,
One "1" makes the workflow wait.
The commit holds the binding tight,
A second tap gets no invite.
The cockpit shows the human state.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 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 main change: startup-scripted human-gate progression under Decision 061.
✨ 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 feature/d61-startup-human-gate

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 6, 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-06T06:34:09.381845Z 85cb3bc 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 85cb3bc0c8

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

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 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 marked this pull request as ready for review September 6, 2026 06:30
@LogicDuke
LogicDuke marked this pull request as draft September 6, 2026 06:31
@LogicDuke
LogicDuke marked this pull request as ready for review September 6, 2026 06:32
@LogicDuke
LogicDuke merged commit edaad85 into main Sep 6, 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