Conversation
leandrodamascena
left a comment
There was a problem hiding this comment.
Thank you for tackling the protected-branch integration gap. The detection model, full review-history folding, and decision to keep AI-DLC observe-only are valuable foundations.
I reviewed the current head 2136a9283360f38277f79550f202affb1c1c403a against v2 at 518578adb3284898b6f9c073cf91c37322ba0fad (merge base 2fbee12fb29d2a6614b70b6f61f3cceeaf235245).
The underlying problem is aligned with the project: the existing local-merge boundary cannot operate against protected trunks. However, RFC #970 still has unresolved product decisions about stage placement, GitHub-only scope, and greenfield policy establishment, with no substantive maintainer feedback yet.
I found the following blockers:
-
[P1]
awaiting-integrationcannot self-clear through the supported workflow.Once every remaining Unit is integrating, the router emits
awaiting-integration. Harness instructions allow only--status --refreshand then stop. Status refresh invokes an observe-onlysweep; even when it detectsMERGED, it only displaysMERGED (finalize pending). It does not emitPR_MERGED, complete the Unit, or invokefinalize, so the nextnextcall emitsawaiting-integrationagain.Formal
CHANGES_REQUESTEDhas the same routing problem:sync-feedbackappendsPR_FEEDBACKbut emits no lifecycle transition that makes the Unit routable for revision.References:
core/tools/aidlc-orchestrate.ts:5227,core/tools/aidlc-orchestrate.ts:5626,core/tools/aidlc-utility.ts:1554,core/tools/aidlc-pr.ts:1094, and the harnessawaiting-integrationinstructions.Please add an authority-bound reconciliation path that is reachable from normal resume/status routing: merged PRs must finalize their exact Unit, while formal changes requests must reactivate that Unit for a revision round. This needs end-to-end routing tests.
-
[P1]
finalizecan settle a Unit using an unrelated merged PR.handleFinalizetrusts caller-supplied--prvalues without binding them to the Unit's current-runPR_OPENEDreceipts. I reproduced Unitalpha, opened againstexample/service#42, being successfully finalized with merged fixtureother/repo#999.Reference:
core/tools/aidlc-pr.ts:1817.Please derive or validate the exact coordinated PR set from the Unit's current run-floor receipts, including repository, PR number, head, base, and coordination membership, before emitting settlement receipts.
-
[P1] Feedback content is fetched but never surfaced.
Review bodies, inline comments, and issue comments are fetched, but
feedbackRowsstores only a body digest andsweepResultomits the content. I verified that neither a review body nor an inline finding appeared in command output or persisted feedback. The advertised revision loop therefore has no finding text to evaluate.References:
core/tools/aidlc-pr.ts:882,core/tools/aidlc-pr.ts:976,core/tools/aidlc-pr.ts:1083.Please preserve and expose bounded, safely framed feedback text as untrusted findings data, with regression coverage.
-
[P2]
opencannot recover after a partial remote write.Receipts are emitted only after every push, PR creation, read-back, and reviewer request succeeds. I reproduced a PR being created, followed by reviewer-request failure. No
PR_OPENEDreceipt was recorded, and retry failed because the PR already existed.Reference:
core/tools/aidlc-pr.ts:1686.Please make publication transactional/reconcilable by recording progress incrementally or adopting and verifying an existing PR on retry. Multi-repository partial creation needs explicit coverage.
-
[P2]
finalizeis not retry-safe.A successful finalize followed by the same command fails because Unit completion is attempted again after the Unit is no longer active or integrating. This also blocks recovery when output is lost or a later metadata/cleanup step fails.
Reference:
core/tools/aidlc-pr.ts:1857.Please make each finalization step idempotent and resume from already-recorded receipts.
-
[P2] GitHub execution depends on external POSIX
timeout.runGhinvokestimeout 10 gh .... Windows does not provide this command, and macOS does not include it by default. PR integration is therefore unavailable on supported installations without an undocumented dependency.Reference:
core/tools/aidlc-pr.ts:689.Please use the subprocess timeout support provided by Node/Bun and add platform coverage.
I made no changes, commits, or pushes because this is an internal contribution.
Validation performed on the reviewed head:
- Focused PR integration tests: 27 passed, 103 assertions.
bun scripts/package.ts --check: all seven harness distributions synchronized.- Full TypeScript typecheck: passed.
- Focused Biome validation: passed.
- Current remote CI: green.
- Recovery diagnostics reproduced the mismatched-finalize, partial-open, and finalize-retry failures.
Remaining risk includes the unresolved RFC decision that AI-DLC's whole-stage Build and Test runs only after the PRs have already merged. The current PR is also conflicting with the latest v2 and requires a rebase.
Proposed review event: REQUEST_CHANGES.
…age + aidlc-pr tool) Design RFC: #970 (rationale, target experience, spike-verified claims table, and open questions). Composes with #801; team-mode fusion seam for #795/#879 is named there. Construction can now integrate finished work through GitHub pull requests instead of only local merges. At most organizations the trunk is protected: direct pushes are rejected and PRs with required approvals are the only path to the integration branch, so the shipped local-merge boundary cannot complete there. This PR adds that missing boundary as a first-class, evidence-backed part of the workflow - dormant by default, byte-identical for every workflow that does not affirm it.
…ke open/finalize reconcilable Reconcile integrating Units at normal next routing and active-intent status refresh. Verified merges emit PR_MERGED and use receipt-plus-evidence finalization; formal changes requests persist PR_FEEDBACK and reopen routable revision without changing approval authority. Read-only observer probes remain dormant. Bind finalization to the Unit's current-run and claim-attempt PR_OPENED set: repository, number, head, base, URL and coordinated membership must agree. Derive omitted selectors and refuse mismatched caller or platform identities before settlement. Surface review bodies, inline findings and issue comments as JSON-framed untrusted data in sweep, sync-feedback, audit and status. Bound bodies to 4096 UTF-8 bytes and results to 64 findings/32768 encoded bytes with marked, codepoint-safe truncation. Persist per-repository publication progress through push, creation, read-back and reviewer request. Retry adopts the verified existing PR by repository/head/base, creates only missing coordinated siblings, and emits PR_OPENED once before later remote steps can fail. Resume finalization from current merge and Unit completion receipts, then existing Bolt/state/audit completion receipts. Repeated success and partial metadata recovery remain idempotent; worktree retirement keeps its honest integrated-via-pr reason and merge holds remain enforced. Replace the external timeout command with a ten-second native subprocess deadline and preserve offline last-known-state degradation. Exercise all six regressions with restored negative mutations, maintain the exact dormancy pin against untouched main, update non-release inventories, and retain native dispatcher compatibility.
2136a92 to
674d2e6
Compare
|
Rebased onto 1 [P1] 2 [P1] 3 [P1] Feedback text is surfaced. Review bodies, inline comments, and issue comments are kept as JSON-framed untrusted findings data - 4,096 UTF-8 bytes per body (with 4 [P2] 5 [P2] 6 [P2] No external Rebase notes: 43 conflicts, grouped in the commit body - main's typed asks and guard recovery, completion receipts, commit provenance, archive verbs, Change Control, and on-demand Construction autonomy are all preserved; the native dispatcher gained the Verified: affected matrix 40 files / 1,421 tests / 0 failures (t328 11, t329 15, t330 21, t239 13, t188 93, t165 58, t111 116, t14 173, …); |
…nterrupted finalizations from next
|
Third commit Compiled dispatch (#1070's exact shape). The rebase added Interrupted finalization. 12 files / 359 tests / 0 failures (t230 117, t328-pr-integration-routing 12, t329-pr-integration-finalize 18, t330-pr-integration-policy 21, …); |
|
Note for whoever rebases this after #1115 merges: #1115's
|
Summary
Design RFC: #970 (rationale, target experience, spike-verified claims table, and open questions). Composes with #801; team-mode fusion seam for #795/#879 is named there.
Construction can now integrate finished work through GitHub pull requests instead of only local merges. At most organizations the trunk is protected: direct pushes are rejected and PRs with required approvals are the only path to the integration branch, so the shipped local-merge boundary cannot complete there. This PR adds that missing boundary as a first-class, evidence-backed part of the workflow - dormant by default, byte-identical for every workflow that does not affirm it.
What this adds
pr-integrationstage (Construction 3.6), per unit,execution: CONDITIONAL: composes a PR record from the stage'sconsumes(story trace, design decisions, internal review findings, test evidence), fills the repository's own PR template, and opens the PR only after an operator gate. Build & Test becomes 3.7, CI Pipeline 3.8. The stage ships SKIP in every scope and activates per intent only after Practices Discovery detects and affirms PR integration.aidlc-pr.tstool (detect | open | sweep | sync-feedback | finalize): deterministic, audit-emitting, observe-only. It never merges, never enables auto-merge, and every outward write sits behind an explicit--executeflag (default is a dry run that prints the exact commands). All GitHub reads are timeout-bounded with graceful offline degradation to last-known state plus its age.integratingstate; the engine keeps routing other eligible units. When everything left is external, a new turn-terminalawaiting-integrationdirective ends the session honestly and self-clears once a merge is verified. No polling: platform reads happen only at routing decisions and/aidlc --status.aidlc-worktree discard --reason), never as an abort.What does not change
Workflows that never affirm PR integration are byte-identical: the stage is SKIP everywhere, the routing partition is empty without the knob, new audit event types are tool-owned and refused by the append CLI, and no hook gains a network call. Nothing touches the approve path.
Evidence
t276-cursor-adaptertests 29 and 35 fail on this branch's base commit as well (reproduced on a clean v2 checkout at 2fbee12); they are unrelated to this change.Upgrade
No version or changelog bump (release-preparation PR's job). Native installs pick this up with the binary; copy-channel installs re-copy
dist/<harness>/. Existing workflows are unaffected until Practices Discovery affirms PR integration for an intent; affirm it there (or runaidlc-state.ts set-integration-mode pr) to enable the flow.Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.