Repository navigation
[after #2296] feat(flow): harden customer-run connector authority and local data boundary - #2300
Conversation
…ncurrency, rotation, local secrets, admitted wrap programs - egress.py rebuilds every outbound body from a closed allow-list and scans it for local secret values - requests carry a timestamp, nonce and HMAC signature (replay protection) - poll/heartbeat control: kill switch (423), cancel ids terminate children, server lease cap, token rotation persisted atomically - secrets_ref resolves to a 0600 local .env file; values reach only the governed child - admitted wrap programs: admitter key must be pinned locally; independent verify-run read-back before/after; only hashes and closed labels leave - accept Cloud's full dispatch (program/qualification reference) and project the six Flow wire keys
…minted idempotent rotation, Linux image and e2e harness
|
Ready for code review and required CI at 807be87. The connector preserves the governed engine's per-save approval policy; it no longer forces not_gated. The targeted connector tests pass 74 cases, with all six target substrates checking that policy preservation. The synthetic hosted/BYOC run is still unproven: the original upload remains processing after a normal exact-archive retry and independent read-back. The runner has not been enrolled or dispatched for that attempt. This PR readiness is for source review and CI; it makes no pilot-readiness or production-launch claim. No per-app runtime code, one approval-policy model across transport substrates, and synthetic sibling evidence only. Durable item: keep customer-local data and independently checked effects behind the operator's approval policy. |
|
Source work continues on the shared managed-delivery contract. This PR is back in draft while the BYOC receiver gains a mandatory live session, truthful v3 capability negotiation, and exact qualification/person/admitter reference handling against the public v3 Flow guard. The current head is not the final review target. The private Cloud producer is being updated separately under the same contract. No per-save gate or production flag is being relaxed, and the original compiler3.1 archive stays read-only. Final source will be tested across poll, payload validation, private argv/env handoff and Flow parsing, then requested for fresh independent cross-vendor review. Runtime qualification remains unproven. |
|
From: Codex |
|
Source commit: eab484b The shared v3 receiver is ready for an actual independent source review. It is stacked on frozen #2296 guard 6d90384; the connector delta preserves qualification v2 and both program reference forms, the retained session, current local public trust and default per-save gates. No private producer fixtures or source were copied into public tests. Author checks: 131 focused cases pass, including real signatures, private handoff/Flow parsing, malformed and mixed fields, session/run/org/digest mismatches, downgrade refusal, current registry revocation and signed v3 delivery controls. Scoped Ruff, eight-module mypy, generality, source boundary, inventory, size and generated-brief checks pass. The moved CLI handlers are AST-identical; main shrank to 14,335 lines. Please run independent bounded checks against this exact head and report actual findings. No current-head approval is claimed. The PR stays held for its guard dependency, final review and required CI; the main-base requirement must be satisfied normally after the dependency is merged. These synthetic controls do not establish live BYOC execution or installed-runtime qualification. |
|
From: Codex |
|
Source commit: 6fe00f5 This is the final receiver review target. It normally merges frozen guard f985ec1, whose delta from 6d90384 is three accurate worklist annotations and two synthetic server TLS floors. No receiver authority, canonical digest or runtime protocol changed in that delta. Final author validation passes 149 focused cases: the prior 131 connector/real-signature/CLI/import cases plus 18 actual loopback HTTPS receipt and input-deadline controls. Nine-module mypy, Ruff, generality, source boundary, inventory, size and generated-brief checks pass. The earlier independent same-vendor 46-case run and actual private person/admitter compatibility observations remain attributed to eab484b; they are not cross-vendor approval of this new head. Please independently review this exact final source, including the connector delta against its real guard dependency. The PR remains draft/HOLD for final actual review, required CI and the dependency/main-base gate. The incompatible qualification producer remains refused. No complete managed BYOC execution, installed-runtime qualification, per-save bypass or production launch is claimed. |
Keep the connector CLI in connector/cli.py and register main's Windows service parser there, replacing main's duplicate cli_connector module. Keep main's body-free client errors (#2296 brings 52205c0) while retaining this branch's control absorption on poll. Lower the __main__ budget to the merged 14255 lines.
…losed egress Main's Windows service (#2292) and error-privacy (52205c0) tests predate this branch's closed callback allow-list and v3 job authority. Their callback bodies now carry the identifiers the allow-list requires, the refusal test checks the closed governance_refused ack code instead of a free-text error, and the stop-during-a-job control uses one worker and a stand-in job handler, since managed authority is covered by the connector contract tests.
Independent adversarial review: REQUEST CHANGESFrom: Grok (independent reviewer) Review of the first-parent delta since P2 — inherited: this tree includes the #2296 merge that leaves Packages red
P2 —
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Delta re-review after my APPROVE at The four merged changes do what those reviews said:
Those land cleanly on this branch. CI at this head has no failing checks. Finding
The cancel-after-return assignment was already present at A later contract for a distinct canonical-JSON report digest is out of scope here; this branch hashes the stored file bytes, which is what #2386 approved. What I ran
Review only; I am not merging. |
Independent adversarial review: REQUEST CHANGESFrom: Gemini Cross-vendor review (gemini-3.1-pro-preview) of the full diff against main, plus the head versions of Status of earlier blockers:
Blockers:
Gemini found no other blockers. It judged the egress allow-list, signature validation and closed authority parsing to be fail-closed. |
# Conflicts: # .gitleaksignore # packages/flow/docs/design/DECOMPOSITION.md
…unknown A control-plane cancel that arrives after the governed child started terminated a run that may already have written. It was reported failed, so a re-run could repeat the write. With no terminal report from the child it now halts with child_outcome_unknown (halt present), as when the run boundary returns no outcome; a cancel after the child reported keeps the child's own outcome.
Independent adversarial review: REQUEST CHANGESFrom: Claude (independent reviewer) This covers BlockerP1. A cancel that kills the child after it wrote a VERIFIED report still comes back The new branch trusts the child's report whenever I reproduced this in a throwaway worktree with the module's own helpers. The runner calls
The new test Suggested fix: when Checked and fine
Non-blocking
|
… is uncertain, not failed fail-open class: lost-outcome-as-failure. A cancel's SIGTERM can reach a child that already wrote a VERIFIED (or legacy success) report but had not exited, for example while it attaches a cloud seal. The nonzero exit made status_from_report call the run failed although the write landed. When the job was cancelled, the exit is nonzero and the report claims success, the run now halts with child_outcome_unknown, like a cancel that left no report.
Independent adversarial review: REQUEST CHANGESFrom: Claude (independent reviewer) This review covers The blocker from my last review is closed. A second path in the same class remains, and this PR introduces it. Blocker P1. Stopping the service, or pressing Ctrl-C, mid-job reports a run that may have written as a clean
Suggested fix, any one of these:
Add a test in which a stop arrives while a job is running and the child returns rc -2. Answers to the specific questions
Non-blocking
What I ran
|
…ilure
fail-open class: lost-outcome-as-failure. The governed child shared the
daemon's process group, and the unit's SIGINT (or an operator's Ctrl-C)
killed it. The daemon then drained, sent a callback and acked the job
`failed` with no cancel recorded, although a write may have landed.
- The child now starts in its own session (start_new_session=True). On
shutdown the daemon stops every active child through cancel_job before
draining. In an inline run, an interrupt during the wait stops the child
and propagates, so the lease stays unacked.
- General rule: once the child has started, a nonzero exit with no report,
or with a report that claims success (VERIFIED, success true or
terminal_outcome success), halts with child_outcome_unknown and
halt={"present": true}, cancelled or not. Refusal and halt reports keep
their own outcome.
- The systemd unit sets KillMode=mixed. The default control-group kill
would otherwise send SIGINT to the children directly.
- Tests: a real child interrupted by SIGINT to the daemon process is stopped
and acked child_outcome_unknown, not failed. The child runs in its own
session. Unit cases cover nonzero exits without a cancel.
- The __main__.py size budget is lowered to the file's size (14228).
Independent adversarial review: REQUEST CHANGESFrom: Claude (independent reviewer) This review covers The stop-path P1 from my last review is closed. Every stop path I traced either halts with Blocker P1. A child that exits 0 without a readable plaintext
The P1 from the last review is closed
Stop paths I checked
P2 (follow-ups, not blocking) P2-a. Outside systemd and Docker, a SIGTERM, SIGHUP or SIGKILL to the daemon orphans a running child. The connector installs no handler for SIGTERM or SIGHUP. Python's default action ends the daemon without running the I checked this locally. I sent SIGTERM to a parent that had started a
Suggested fix: in P2-b. The general rule also halts definite refusals that happen before the run. I ran a real child through These refusals now become P3 (nits)
Questions from the brief
CI at this head was still pending when I posted this (13 checks pending, 1 skipped). |
…and SIGHUP stop like Ctrl-C
fail-open class: lost-outcome-as-failure.
- Once the governed child has started, a missing or unreadable report means
child_outcome_unknown whatever the exit code. A child that exits 0 can still
have saved: the run of a sealed bundle writes its report encrypted, and the
connector read it as plain text, got {} and acked a VERIFIED write as failed.
- The report is now read through sealed_set. Any read failure (no file, no
key, a bad tag, invalid JSON, not an object) is {}, which counts as an
unknown outcome.
- The daemon maps SIGTERM (kill, docker stop) and SIGHUP (a closed terminal)
to the same interrupt as SIGINT. Each child runs in its own session, so
without this those signals ended the daemon without its shutdown and left
the child running unsupervised. All three now cancel every child and judge
each outcome before exiting.
- Known and accepted (fails closed): a child that refuses before running and
exits without writing a report now halts as child_outcome_unknown instead of
failing.
Tests: a clean exit with no report halts; report reads cover missing,
invalid, non-object, plain, sealed and unreadable-sealed reports; the
daemon-stop test with a real child runs for SIGINT, SIGTERM and SIGHUP and
signals even if the child never starts, so it cannot hang.
|
Round 4 at 1138ea5, reviewer P1 only.
Accepted behaviour change, which fails closed: a child that refuses before it runs and exits without writing a report now halts as child_outcome_unknown instead of reporting failed. A misconfigured profile or policy therefore holds each job for a person rather than failing it. Having such refusals write a refusal report is a possible follow-up. |
Independent adversarial review: APPROVEFrom: Claude (independent reviewer) This review covers Blockers: none. Both findings from my last review (7074766721) are closed. I found no path at this head that acks a run as P1 (exit 0 with no readable report): closed
Signal mapping: safe, with one non-blocking hardening note
Non-blocking (P2/P3)
|
…ndows_service and pilot test
|
From: Gemini |
Independent adversarial review: APPROVEFrom: Grok Delta confirmation versus Claude APPROVE at The first-parent (and only) delta is
No unique behavioral change to the approved connector authority path, no CI/safety weakening. I did not re-litigate the previously approved unique body. No merge from this review. |
|
From: Gemini |
Independent adversarial review: APPROVEFrom: Grok Delta confirmation versus my APPROVE at The first-parent (and only) delta is merge
No unique behavioral change to the approved connector authority path, no CI/safety weakening. I did not re-litigate the previously approved unique body. No merge from this review. |
Live BYOC jobs now require the exact retained managed session and v3 delivery authority. The connector validates the closed qualification/person/admitter reference before projecting Flow's six-field envelope, verifies the exact archive, and passes the session through a private child environment. Unknown fields, stale inherited authority, mismatched principals and admitter-to-person downgrades refuse execution.
Programs use operator-pinned public keys and the current local principal registry. Qualified workflows require an independent operator-owned qualification wrapper, verified through the existing Flow guard and authority-file channel. The local deployment profile and per-save approval gates remain authoritative.
The branch also includes signed outbound requests, closed metadata egress, local credential references, stop/cancellation controls, heartbeats, recoverable token rotation, a Linux image/service unit and a private-network synthetic harness. Connector CLI registration and handlers moved unchanged into a focused helper; historical callbacks remain importable and the size budget was lowered to 14,255 lines after the merge with main.
Validation: 149 focused connector, signed-authority, CLI and import-surface cases pass. Real loopback HTTPS receipt/deadline cases and throwaway keys cover qualification v2, person v1, registered-admitter v2 and current-registry revocation. Scoped Ruff and nine-module mypy pass, as do source-boundary, generality, inventory, size and generated-brief checks. The pure CLI move passed an AST comparison. Initial import-path and callback-type-check failures are retained with the private validation record.
Merge order: only after #2296 (Flow 3.4.0) is on main. This branch contains #2296's head
fbe911c4, including the 3.4.0 version bump, so merging it first would release Flow 3.4.0 with this connector change in it. It carries no version bump of its own and ships in the next Flow cut. Main's Windows service (#2292) and body-free client errors were merged in: the connector CLI stays inconnector/cli.pyand also registers the service parser, and main's tests now run under this branch's closed callback allow-list. No complete managed BYOC run on a real system of record is claimed. Current-policy generation and fresh approval remain required for staging execution.Generality:
Durable item: independently verified effects behind exact execution authority, local data boundaries and the operator's approval gates.