Skip to content

D62 — Authenticated post-start Autoflow control channel - #84

Draft
LogicDuke wants to merge 1 commit into
mainfrom
feature/d062-post-start-control-channel
Draft

D62 — Authenticated post-start Autoflow control channel#84
LogicDuke wants to merge 1 commit into
mainfrom
feature/d062-post-start-control-channel

Conversation

@LogicDuke

Copy link
Copy Markdown
Owner

Decision 062 implementation.

Authority:

  • Adds the first genuine post-start Autoflow control path.
  • Exposes exactly OPEN_HUMAN_GATE.
  • No generic WorkflowEvent submission.
  • No generic apply(event).
  • No CLOSE_REQUESTED production source.
  • No Git/GitHub/provider/Policy/repository mutation authority.
  • Cockpit remains GET-only/read-only.

Security boundary:

  • Deployment-anchored Windows control store.
  • Runtime/CLI fail-closed verification.
  • Unpredictable per-process named pipe.
  • Mutual HMAC-SHA256 authentication.
  • 4-byte big-endian bounded framing.
  • Required official AgentBridge control CLI.
  • Runtime subprocess authority restricted to absolute System32 whoami.exe and read-only icacls.exe queries only.

Validation before commit:

  • Fresh independent implementation validation: PASS_D062_INDEPENDENT_VALIDATION
  • Focused D062 tests: 96/96
  • Full repository suite: 1987/1987
  • Typecheck: PASS
  • Lint: PASS
  • Build: PASS
  • git diff --check: PASS

Exact validated candidate:

  • base: edaad85
  • head: 2b00c91
  • patch SHA256: 32c6f485f689d997a2195e944ac47e31c30cd8e28168913ebcdf2fb7832772b1
  • patch bytes: 133644
  • files: 21

Deployment remains separately gated.
No ACL provisioning or runtime cutover is part of this PR.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 860ec451-6224-4e27-9f9c-31bb4360beb2


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 6, 2026 11:19
@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-06T11:23:26.470735Z 2b00c91 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: 2b00c91c52

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

}

// 3. Anchor ACL (read-only).
const icacls = await runProcess(icaclsPath(systemRoot), [anchorPath]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify the control-directory owner

When the anchor is owned by another local account but its current DACL lists only the runtime operator and SYSTEM, this verification succeeds because the plain icacls <anchor> output is used only to inspect ACEs and the owner is never queried. A Windows object owner can change its DACL, so that account can subsequently grant itself access, read the descriptor token, and authenticate to the control channel; verify that the owner is also the runtime operator or SYSTEM before accepting the anchor.

Useful? React with 👍 / 👎.

pipePath,
close: (): Promise<void> =>
new Promise<void>((resolvePromise) => {
removeDescriptorFile(anchorPath, deps.descriptorDeps);

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 Delete only this server's descriptor

When two runtime instances overlap, the newer instance replaces the fixed descriptor file, but shutting down the older instance unconditionally removes that newer descriptor here. The newer pipe remains live yet the official CLI can no longer discover it; this also occurs during a normal start-before-stop restart. Associate cleanup with the descriptor this handle published and avoid removing the file if it now identifies another process/channel.

Useful? React with 👍 / 👎.

Comment on lines +279 to +281
if (/processed\s+\d+\s+files/i.test(line)) {
sawSummary = true;
continue;

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 Accept localized successful icacls output

On a non-English Windows installation, icacls localizes its success-summary text, so this English-only regex does not recognize the footer. The footer is then passed to parseAce, which returns null, causing every otherwise valid anchor to be rejected as ACL_UNREADABLE and disabling the control channel. Determine command success from the already-checked exit status or parse the output without requiring an English sentence.

Useful? React with 👍 / 👎.

@LogicDuke
LogicDuke marked this pull request as draft September 6, 2026 11:37
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