@@ -7,16 +7,15 @@ import { evaluateHarnessSubmissionTrigger } from "@loopover/engine";
77// event -- regardless of outcome, so a paused-pending-human-review session leaves a full trail of why.
88//
99// NOT WIRED INTO ANY AUTOMATIC SCHEDULE: per this issue's own "manual owner sign-off on the wiring before this
10- // ships to any default-on profile" deliverable. `prepareOpenPrSubmission` below is the call site up to the
11- // cross-package boundary: on `allow: true` it shapes the exact input `buildOpenPrSpec` (root
12- // `src/mcp/local-write-tools.ts`) needs -- but does not, and cannot, call that function itself, since the spec
13- // builder lives in the private root `src/` tree, unreachable from this package (same cross-package-boundary
14- // reason self-review-adapter.ts's slop injection exists). A real root-side/MCP call site (e.g. the existing
15- // `loopover_open_pr` tool, src/mcp/server.ts) takes `openPrInput` from a `ready: true` result and passes it
16- // to `buildOpenPrSpec` (or the equivalent tool call) to actually produce the runnable local-write spec. The
17- // CLI/driver entrypoint that instantiates a real `CodingAgentDriver` and calls `runIterateLoop` end to end with
18- // live credentials does not exist yet in this package -- that is separate, larger scope from this decision-to-
19- // payload bridge.
10+ // ships to any default-on profile" deliverable. `prepareOpenPrSubmission` below is the gate→payload bridge:
11+ // on `allow: true` it shapes the exact input `buildOpenPrSpec` (`@loopover/engine`,
12+ // `packages/loopover-engine/src/miner/local-write-tools.ts`, re-exported from the engine public barrel) expects
13+ // as `openPrInput`. It deliberately does NOT call `buildOpenPrSpec` itself -- that stays the caller's job so
14+ // this module stays a decision-to-payload bridge. The in-package caller is `attempt-runner.js`, which imports
15+ // `buildOpenPrSpec` from `@loopover/engine` and runs it after a `ready: true` result (the pre-#5131/#5132
16+ // "unreachable from root `src/mcp/`" boundary no longer applies, but the layering still does: gate evaluate →
17+ // shape openPrInput here → build the runnable local-write spec in the driver). Equivalent MCP call sites
18+ // (e.g. `loopover_open_pr`) can likewise take `openPrInput` from a `ready: true` result.
2019//
2120// SESSION-SCOPED, NOT PER-REPO: the circuit breaker's own "pauses the run entirely" wording means the tally is
2221// counted across EVERY repo's decisions this session, not scoped to one repo -- distinct from #2338's loop-
@@ -90,12 +89,13 @@ export function evaluateAndRecordHarnessSubmissionTrigger(candidate, deps) {
9089
9190/**
9291 * Bridge one completed handoff through the submission gate to a submission-READY payload -- the exact input
93- * shape `buildOpenPrSpec` expects (repoFullName/base/head/title/body/draft). On `allow: true` returns
94- * `{ ready: true, decision, event, openPrInput }`; otherwise `{ ready: false, decision, event }` -- the block
95- * reasons are on `decision.reasons` and already on the ledger via the wrapped call either way. Does NOT call
96- * `buildOpenPrSpec` itself (see this module's own doc comment for why it cannot) -- a real root-side/MCP call
97- * site takes `openPrInput` from a `ready: true` result and passes it to that function or the equivalent
98- * `loopover_open_pr` MCP tool.
92+ * shape `buildOpenPrSpec` (`@loopover/engine`) expects (repoFullName/base/head/title/body/draft). On `allow:
93+ * true` returns `{ ready: true, decision, event, openPrInput }`; otherwise `{ ready: false, decision, event }`
94+ * -- the block reasons are on `decision.reasons` and already on the ledger via the wrapped call either way.
95+ * Does NOT call `buildOpenPrSpec` itself: this stays a gate→payload bridge; `attempt-runner.js` (and MCP
96+ * `loopover_open_pr` equivalents) take `openPrInput` from a `ready: true` result and call
97+ * `buildOpenPrSpec`. The cross-package "unreachable from root src/" reason no longer applies (#5131/#5132
98+ * moved the builder into `@loopover/engine`), but the deliberate non-call layering is still necessary.
9999 *
100100 * Fails closed (throws) on a malformed candidate, mirroring evaluateAndRecordHarnessSubmissionTrigger's own
101101 * validation -- a missing PR title/base is a caller bug that must never silently degrade into a garbage spec.
0 commit comments