Governed AI Sprint Delivery Orchestrator Implementation Plan
Status
Approved implementation direction — execute incrementally with reviewed infrastructure and repository changes.
M2 runtime and operator control checkpoint — 2026-08-17
Milestone 2’s durable infrastructure, operator control, and protected deployment
safeguards are complete. Orchestrator
Epic E1 #46
is closed after all durable-infrastructure child issues merged to main:
- Aurora PostgreSQL and migrations (#60): Private Aurora PostgreSQL Serverless v2 writer in isolated subnets with backups, parameterized deletion protection, migration execution task definitions, and cold-resume handling.
- SQS and DynamoDB runtime coordination (#61): Encrypted SQS FIFO command/callback queues with dead-letter queue redrive, and a DynamoDB runtime coordination table for delivery deduplication, worker wake generations, and status projections.
- Scale-to-zero ECS Fargate workers (#62): Inert worker service with 0–2 capacity, immutable commit-SHA image pinning, least-privilege execution/task roles, durable leases, and graceful drain.
Operator control (Epic E2 #47) and safe operations (Epic E3 #48) children are also complete:
- PR #63 added HTTP API Gateway and Lambda webhook ingress.
- PR #64 added the SigV4-authenticated operator API and Bruno collection.
- PR #65 added queue command, status projection, and runtime-control adapters.
- PR #66 attached least-privilege runtime roles and secret access boundaries.
- PR #67 added protected migration, deployment, rollback, and smoke workflows.
- PR #68 added CloudWatch alarms, cost telemetry, and backup/restore verification.
Live deployment validation proved the complete lifecycle in AWS:
- Protected Terraform apply run 31891258400 successfully provisioned the full pilot runtime.
- Protected Terraform destroy run 31893556477 successfully executed full automated teardown.
- PR #158 aligned bootstrap IAM policies with valid AWS Budgets actions and RDS snapshot lifecycle permissions, and parameterized deletion protection across the Aurora cluster and DynamoDB coordination table to guarantee clean automated teardowns.
The next ordered work is now M3 — Live Planning and Execution, beginning with live model and GitHub provider integration (Epic E1 #49), LangGraph workflow runtime (Epic E2 #50), and usage/diagnostics (Epic E3 #51).
M1 completion checkpoint — 2026-08-10
Milestone 1’s authority and repository safeguards are complete. Orchestrator
Epic E3 #45
is closed after both separated-identity children merged with human review.
PR #90
defined strict automation-identities/v1 contracts, exact role permission and
operation ceilings, fail-closed authorization/protection preflight, and three
role-specific empty secret containers. Protected
Terraform run 31351272293
applied the non-destructive secret/IAM changes.
PR #91
pinned the reviewer and merger App/installation IDs, portal-only audience,
permission snapshots, distinct secret ARNs, trusted diagnostic, and sanitized
provisioning evidence. A disposable client-portal
PR #133
proved one exact-head COMMENTED review by the reviewer bot and was closed
without merging. The merger proof minted a portal-constrained token but invoked
no merge endpoint. Independent rotation drills proved both replacement keys,
revoked both old keys, observed HTTP 401 for both revoked credentials, and
removed obsolete AWS staging labels without exposing values.
This checkpoint does not enable a reviewer/merger runtime consumer, automated review, automatic merge, release, or deployment. GitHub permissions remain platform ceilings beneath application policy, and later execution slices still require their own approved plans and human review.
The next ordered work is now M2 — AWS Runtime and Operator Control, beginning with Epic E1 #46 and its durable-infrastructure children. M3-M5 remain gated by the milestone sequence; completing M1 does not authorize infrastructure apply or deployment for M2.
Delivery progress checkpoint — 2026-08-09
Milestone 1 Epic E1, the autonomous-run contract and governance slice, is implemented and merged. Orchestrator PR #88 added immutable, fingerprinted automatic-run authorization, fail-closed drift evaluation, authorization-bound merge states, and durable PostgreSQL persistence. PR #89 added the autonomous-delivery threat model, separated authority matrix, and containment/recovery policy. Both required CI and human review before merge.
Client-portal
Epic E2 #111
is also complete. PR #130
published the passing history-aware publication audit, and
PR #131
added the proprietary notice and private vulnerability-reporting policy. The
repository is now public with private vulnerability reporting, squash-only
merging, one independent approval, stale-review dismissal, resolved
conversations, administrator enforcement, strict GitHub Actions CI Gate, and
force-push/deletion prevention. A disposable-branch exercise verified the
break-glass disable-and-restore procedure without weakening main.
The next ordered work remains M1, not M2: orchestrator Epic E3 #45 must define and provision the separated builder, reviewer, and merger identities. M2 remains blocked on completion of all M1 safeguards.
MVP definition and backlog checkpoint — 2026-08-07
The minimum viable product is now a complete, AWS-hosted autonomous delivery
run through one frozen and human-authorized manifest of the client portal’s
open Phase 1 issues. The operator first resolves every material decision,
approves every final marked plan, and authorizes the exact issue identities,
plan fingerprints, default-branch SHA, policy version, and automatic merge
mode. After that checkpoint, the orchestrator may plan execution order,
dispatch builds, review exact pull-request revisions, request at most two
repairs, independently approve passing revisions, and enable squash auto-merge
without a per-pull-request human gate.
Automatic merge is enabled only after the client portal becomes public and
protected main enforces pull requests, one independent approval, stale-review
dismissal, resolved conversations, and the strict CI Gate. Build publishing,
review approval, and merge enablement use three distinct least-privilege
identities. Any plan, head, base, check, review, identity, policy, protection,
or authorization drift fails closed. Independent work may continue after one
branch blocks, but the MVP succeeds only when every manifest issue is merged
and closed.
The candidate manifest is portal issues #74-#80, #82-#83, and #105-#110. Closed split parents #81 and #84 are excluded. The actual manifest is frozen only after decisions on #76, #78, and #79 are resolved, the six split children have approved plans, and stale dependency references are normalized.
The implementation sequence is maintained as matching GitHub milestones and epic/child issue hierarchies:
- M1 — Authority and Repository Safeguards (contract epic #44, identity epic #45, and portal-publication epic #111).
- M2 — AWS Runtime and Operator Control (infrastructure #46, operator control #47, and safe operations #48).
- M3 — Live Planning and Execution (providers #49, orchestration #50, and usage/diagnostics #51).
- M4 — Review, Repair, and Automatic Merge (portal adapter #112, review/repair #52, and automatic merge #53).
- M5 — Portal Backlog Completion (readiness #54 and backlog run #55).
Each epic is a non-authorizing tracker. Its child issues are the smallest planned implementation or explicitly human-operated units and retain the repository’s normal marked-plan, non-default-branch, pull-request, validation, and review requirements. This checkpoint supersedes the earlier sequence’s human-merge MVP boundary and two-target pilot requirement. Consulting-site rollout, client distribution, goal decomposition, dynamic backlog discovery, and unattended production deployment remain post-MVP.
Implementation checkpoint — 2026-08-01
Implementation is active in the private
todd-brunia/ai-delivery-orchestrator
repository. The repository foundation and the following reviewed slices have
merged to main:
- PR #5
defines the provider-neutral, versioned
sprint-delivery/v1domain, state-machine, risk, dependency, concurrency, and repository-adapter contracts. - PR #7 adds PostgreSQL migrations, immutable sprint identity, optimistic run transitions, durable leases, and transactional outbox creation.
- PR #9 adds work-item transitions, validated dependency and conflict persistence, dependency-ready scheduling, and concurrent-safe recoverable outbox claims.
- PR #11
adds exact-byte GitHub HMAC verification, strict
github-webhook/v1normalization, durable delivery deduplication, inbox claims, bounded retry, stale-claim recovery, and dead-letter handling. - PR #13 adds versioned GitHub/model provider ports, deterministic no-network stubs, inert GitHub mutation-intent capture, stub-only worker composition, and the local operating and recovery runbook.
- PR #15 adds the non-deploying Terraform foundation: protected S3 state with native lockfiles, pull-request-scoped GitHub OIDC planning, immutable scanned ECR, two-AZ public/isolated networking without NAT, pinned validation tooling, and guarded speculative-plan CI.
The current validation baseline is 42 unit/static-policy tests and 15 real-PostgreSQL integration tests, plus lint, type checking, production build, Docker build and runtime smoke test, dependency audit, secret scan, Compose validation, and credential-free Terraform formatting and validation in CI. The local PostgreSQL service can be stopped without deleting its named volume.
This checkpoint does not mean Phase 1 or Phase 2 is complete. The current code has no public HTTP/Lambda endpoint, GitHub App credentials or API calls, real model integration, LangGraph runtime or checkpoints, reconciliation loop, operator API, applied AWS resources, or target-repository installation. The provider composition rejects real-provider mode and cannot mutate another repository. The Terraform foundation is configuration only: no AWS plan or apply has run, no AWS variables are configured, and no cloud cost was created.
This is the current pause point. When implementation resumes, first decide whether to execute the separately authorized human bootstrap operation or continue defining unapplied Phase 1 infrastructure. Secrets contracts, observability, budgets, the Bruno smoke-test foundation, and application control-plane resources remain pending. HTTP/Lambda ingress, LangGraph workflow execution, and canonical GitHub refetch remain separate later slices.
This plan defines the first implementation slice of the broader autonomous goal-to-deployment delivery pipeline. It creates a reusable AWS-hosted orchestrator that coordinates an explicit list of GitHub issues. It does not yet generate epics from a business goal or select issues from filter criteria.
The first installation is ai-consulting-client-portal, which will become
public only after the separately reviewed publication audit and proprietary
notice changes. ai-consulting-site is a post-MVP second target.
After the internal pilot proves the operating model, the implementation must
also support a client-owned deployment path. A client should be able to fork a
client-distributable release of ai-delivery-orchestrator into its own GitHub
organization and use the fork’s Terraform and documented workflows to
provision an isolated deployment in an AWS account it controls. This is a
portability and productization requirement, not authorization to publish the
current private/proprietary repository or provision client infrastructure.
Initial outcome
Create a private implementation repository named ai-delivery-orchestrator
containing:
- A TypeScript and LangGraph orchestration service packaged as a Docker image.
- Terraform for an AWS deployment centered on ECS Fargate.
- Durable PostgreSQL checkpoints and workflow state.
- GitHub App webhook intake and narrowly authorized GitHub mutations.
- A secured operator API exercised through Bruno.
- GitHub Actions for validation, image publication, Terraform planning, and protected deployment.
The first workflow, sprint-delivery/v1, accepts one repository plus an
explicit list of issue numbers. It determines dependencies and conflict risk,
authorizes eligible plans, schedules safe work, reviews pull requests, attempts
bounded repairs, and either waits for human merge or, for a separately
authorized immutable run, enables guarded squash auto-merge.
Architecture
GitHub App webhooks Bruno with AWS SigV4
| |
+---------- API Gateway -------+
|
Ingress/API Lambda
| |
SQS FIFO DynamoDB
| status projection
v
ECS Fargate worker service
desired count 0-2
|
LangGraph
/ \
GitHub/OpenAI Aurora PostgreSQL
checkpoints + audit
Runtime responsibilities
- API Gateway and Lambda: accept GitHub webhooks and authenticated operator commands, verify and normalize inputs, record deduplication keys, enqueue work, return current projections, and wake workers.
- SQS FIFO: buffer commands and callbacks, group GitHub events by repository, and route exhausted messages to a dead-letter queue.
- DynamoDB: retain delivery and command deduplication records with TTL, coordinate worker wake generations, and expose an eventually consistent current-status projection without waking PostgreSQL.
- Fargate workers: claim durable leases, invoke versioned LangGraph workflows, call GitHub and OpenAI through bounded adapters, and write authoritative workflow history.
- Aurora PostgreSQL: store application workflow state, audit transitions, outbox actions, leases, attempts, evidence references, and LangGraph checkpoints in separate schemas.
- GitHub: remain the human-readable system of record for issues, labels, pull requests, checks, reviews, commits, and merges.
Use open-source LangGraph.js directly with
@langchain/langgraph-checkpoint-postgres; do not adopt the licensed LangGraph
Agent Server. Keep the domain state machine independent of LangGraph checkpoint
formats so another runtime can replace LangGraph later.
AWS infrastructure
Deploy the pilot in us-east-1 with Terraform.
Always-available control plane
- API Gateway HTTP API with TLS.
- Public
POST /webhooks/github, protected by GitHub HMAC-SHA256 validation. - AWS IAM-authorized
/v1/*operator routes. - Node.js Lambda handlers for ingress, control commands, projections, and worker wake-up.
- SQS FIFO work queue plus dead-letter queue.
- DynamoDB on-demand projection/deduplication table.
- ECR with immutable tags, image scanning, and lifecycle retention.
- CloudWatch logs, alarms, queue and worker metrics, and a configurable AWS Budget notification.
Scale-to-zero compute
- ECS Fargate service with desired count zero when idle and maximum count two.
- Public-subnet tasks with public IP for GitHub and OpenAI access, no inbound security-group rules, no load balancer, and no NAT Gateway.
- Non-root Docker runtime, read-only root filesystem, and a bounded writable ephemeral workspace.
- Immediate wake-up when ingress accepts work.
- Scheduled scale-down only after the queue is empty, no lease is active, and the wake generation is unchanged across two observations.
- Manual drain that stops new claims, checkpoints active work, and then scales the service to zero.
PostgreSQL
- One encrypted Aurora PostgreSQL Serverless v2 writer with no readers.
- PostgreSQL 16 pinned to an AWS-supported version at or above 16.3.
- Standard Aurora storage, minimum 0 ACUs, maximum 2 ACUs, and five-minute auto-pause.
- Private isolated subnets; port 5432 accepted only from the worker security group.
- Connection timeouts of at least 60 seconds and bounded jittered retries for cold resume.
- Seven-day backups, deletion protection, final snapshots, and an AWS-managed master password.
Aurora is authoritative. DynamoDB is only the durable inbox, deduplication store, wake coordinator, and read projection.
Credentials and deployment
Store the GitHub App private key, GitHub webhook secret, and OpenAI API key in Secrets Manager. Use short-lived GitHub App installation tokens for GitHub calls. Do not expose GitHub publishing credentials to model execution.
Use versioned S3 Terraform state with native locking. GitHub Actions assumes AWS roles through OIDC; do not create long-lived AWS deployment keys.
CI/CD behavior:
- Pull requests run lint, type checking, tests, Docker build and scan, Terraform formatting and validation, and a read-only Terraform plan.
- A merge to
mainpublishes an immutable commit-SHA image to ECR. - A protected GitHub
pilotenvironment requires human approval before Terraform apply, database migrations, ECS rollout, and smoke tests.
Client-owned fork and provisioning
The post-pilot distribution model is one fork per client organization and one or more client-owned AWS environments. The supported path must not depend on consultancy-owned AWS accounts, Terraform state, GitHub Apps, deployment roles, secrets, or a centrally operated control plane.
Before describing the repository as client-self-provisionable:
- Select a license and publish a client-distributable release with a security policy, support boundary, release notes, and upgrade policy. The current private/proprietary distribution terms do not grant clients a right to fork or reuse the implementation.
- Parameterize repository owner/name, AWS account, region, environment name, state key, resource-name prefix, GitHub App identity, target-repository allowlist, budgets, and notification endpoints. Checked-in defaults and examples must contain no Todd Brunia account or repository dependency.
- Provide a bootstrap path that creates or safely adopts the client’s remote Terraform state and GitHub Actions OIDC trust. Trust policies must bind to the client’s fork, protected environments, and intended branches; shared account-level GitHub OIDC providers must be imported rather than replaced.
- Provide reviewed plan and protected apply workflows that use short-lived client-owned credentials. Bootstrap remains an explicit human operation; normal deployment must not require long-lived AWS keys or consultancy access.
- Document prerequisites, estimated costs, GitHub App creation and installation, secret entry, first deployment, database migration, smoke testing, backup/restore, upgrades, rollback, break-glass disablement, and teardown. Destruction must remain separately approved and protect retained state, backups, and final database snapshots.
- Validate the path from a clean synthetic fork in a fresh test account. The acceptance test must prove that another authorized operator can provision, operate, upgrade, and recover the deployment using only published documentation, without undocumented consultancy intervention.
Client forks may carry local policy and target-repository configuration, but clients should receive upstream security and compatibility updates as reviewable pull requests pinned to immutable releases. A future managed multi-client service remains a separate product requiring its own tenant, privacy, threat, support, and incident-response design.
Implementation repository design
Use Node.js 22, TypeScript, npm workspaces, LangGraph.js, the official OpenAI JavaScript SDK and Responses API, AWS SDK v3, Octokit, PostgreSQL, and Zod.
Organize the code around:
- A framework-independent domain state machine and policy engine.
- A registry of immutable, versioned workflow definitions.
- The
sprint-delivery/v1LangGraph workflow. - GitHub, OpenAI, persistence, queue, and projection adapters.
- Lambda ingress/control entry points and the Fargate worker entry point.
- Terraform modules and a pilot environment.
- A local Docker Compose environment and Bruno collection.
Persist workflow definition/version, sprint run, work item, dependency edge, conflict domain, plan fingerprint, feasibility decision, attempt, GitHub artifact, review, transition, lease, retry, cost, and provenance records. Every external mutation uses a transactional outbox and idempotency key.
OpenAI credential routing, request correlation, and cost ownership follow the OpenAI usage attribution and project strategy: target-application model work is charged to that target’s OpenAI project, independent execution stages use separate project-scoped credentials, and the orchestrator project is not a default bucket for work it merely coordinates.
Do not retain raw model reasoning. Retain the structured decision, evidence references, model and policy versions, usage, and hashes of reviewed artifacts.
Public interfaces
Operator API
All /v1/* routes require API Gateway AWS IAM authorization. Bruno signs
requests with temporary AWS credentials using SigV4.
Provide:
POST /v1/sprint-runsGET /v1/sprint-runsGET /v1/sprint-runs/{runId}GET /v1/sprint-runs/{runId}/eventsPOST /v1/sprint-runs/{runId}/pausePOST /v1/sprint-runs/{runId}/resumePOST /v1/sprint-runs/{runId}/cancelPOST /v1/sprint-runs/{runId}/reconcileGET /v1/runtimePOST /v1/runtime/wakePOST /v1/runtime/drain
Run creation requires an Idempotency-Key header and this v1 body:
{
"repository": "todd-brunia/ai-consulting-client-portal",
"issueNumbers": [81, 82, 83],
"mergePolicy": "human"
}
Reject duplicates, closed issues, pull request numbers, inaccessible issues,
and cross-repository lists. The issue list is immutable after acceptance.
mergePolicy: "automatic" is represented in the versioned contract but must
be rejected until the automated-merge phase is enabled.
Queued commands return 202 Accepted. Reads include projectionAsOf so Bruno
users can identify stale projections. Cancellation prevents future automation
but does not close issues, abandon pull requests, or reverse completed merges.
Repository adapter
Add .github/ai-delivery-orchestrator.yml to each target. Version 1 declares:
- Default branch and repository identity.
- Implementation, repair, and synchronization workflow name.
- Workflow label mapping.
- Required CI and preview checks.
- Maximum parallel implementations, default two.
- Human-only risk labels, paths, and categories.
- Exact orchestrator GitHub App slug.
- Automation enable/kill switch and adapter version.
Reject unknown fields, unsupported versions, missing labels, and configurations that weaken mandatory controls.
GitHub App
Create a new orchestrator GitHub App, separate from both repositories’ current build-publisher Apps, and install it only on the portal and site repositories.
Initial repository permissions are:
- Metadata: read.
- Contents: read.
- Actions: read/write.
- Checks: read.
- Issues: read/write.
- Pull requests: read/write.
Subscribe to issue, pull request, pull request review, check run/suite, workflow run, installation, and repository-selection events. Do not grant source-write or merge permission in v1.
Webhook processing must validate the exact raw request body against
X-Hub-Signature-256, deduplicate X-GitHub-Delivery, respond promptly,
enqueue a normalized event, and refetch canonical GitHub state before acting.
A scheduled reconciliation loop repairs missed or delayed events.
Sprint workflow
States
Run states:
accepted -> collecting_plans -> analyzing -> active
-> waiting_for_human -> paused -> completed
Recovery outcomes are blocked, failed, cancelled, and superseded.
Work-item states:
discovered
-> awaiting_plan
-> feasibility_review
-> human_plan_approval_required | ready_to_build
-> build_dispatched
-> building
-> pr_open
-> checks_pending
-> reviewing
-> fixing
-> ready_for_human_review
-> merged
Every transition records actor, policy version, evidence, idempotency key, and time, and uses optimistic concurrency plus a durable lease.
Plan collection and authorization
- Validate and record every issue’s immutable GitHub identity.
- Apply
needs-planningwhen an issue has no marked plan and no conflicting state, allowing the existing repository workflow to plan it. - On
plan-ready, fingerprint the issue, marked plan, trusted amendments, adapter configuration, and default-branch SHA. - Use GPT-5.6 Terra at medium reasoning effort to return a schema-validated dependency graph, conflict domains, likely paths, feasibility result, risk classification, required evidence, and unresolved decisions.
- Detect cycles, open external dependencies, conflicting paths, and invalid or low-confidence output deterministically. Uncertainty forces serialization or human review rather than optimistic parallelism.
- Store feasibility findings privately; do not post them as issue comments.
- For ordinary feasible work, apply
approved-for-build, refetch and verify the plan fingerprint, then applyapproved-for-ai-build. - Require human
approved-for-buildfor security, authentication, secrets, infrastructure, destructive data, billing, workflow-policy, and external communication changes. After human approval, the orchestrator applies onlyapproved-for-ai-build. - For infeasible or ambiguous plans, remove
plan-ready, applyneeds-decision, expose the reason through the operator API, and stop that dependency branch.
The deterministic policy may make a work item more restrictive than the model suggests; model output may never weaken repository risk policy.
Scheduling and builds
- Allow at most two same-repository builds when dependencies and predicted conflict domains are disjoint.
- Allow the portal and site to build concurrently.
- Serialize merge eligibility within each repository.
- Delegate implementation to the existing GitHub Actions/Codex workflow; the Fargate worker must not push implementation branches.
- Update each repository’s trigger validation to trust only the exact orchestrator App bot for these transitions. Never enable arbitrary bot triggers.
Add narrowly scoped repair and sync dispatch stages to both repositories:
repairfetches a correlated automated review, runs Codex against the exact automation branch in the existing isolated generation/publisher boundary, validates the patch, and pushes with the existing publisher App.syncupdates a still-open automation branch after an earlier sprint pull request merges, then reruns required checks.
Pull request review and completion
- Correlate the draft pull request to its issue, plan fingerprint, automation marker, branch, base SHA, and head SHA.
- Wait for the repository-configured required checks.
- Review the exact diff with GPT-5.6 Sol at high reasoning effort and validate findings against a strict path, line, severity, evidence, and recommendation schema.
- If actionable findings exist, submit a GitHub
REQUEST_CHANGESreview and dispatchrepair. - Permit at most two review/fix cycles for a head lineage. After two failed
cycles, apply
blockedand require human attention. - When the review passes, submit a non-approving automated review summary,
convert the draft to ready for review and apply
preview-readyto the issue. Human-mode runs wait for review and merge; automatic-mode runs require an independent current approval and every exact-head merge-policy check before the separate merger identity may enable squash auto-merge. - On merge, verify the merged SHA, mark the item merged, synchronize stale parallel branches, and release newly unblocked work.
- On close without merge, force-push, plan mutation, check regression, or branch mismatch, stop and reconcile rather than continuing silently.
Delivery sequence
Phase 1 — Repository and platform foundation
- Create the private implementation repository.
- Add architecture decisions, threat model, security and contribution policy, operating runbook, and private/proprietary distribution notice.
- Build local Docker Compose with PostgreSQL and stubbed GitHub/OpenAI adapters.
- Implement Terraform bootstrap, AWS resources, OIDC CI/CD, migrations, secrets contract, observability, and Bruno smoke tests. Bootstrap, pilot-IAM, and pilot environments (Aurora PostgreSQL Serverless v2, SQS FIFO queues, DynamoDB coordination, scale-to-zero ECS Fargate workers, API Gateway ingress, SigV4 operator API, CloudWatch alarms, and Bruno collections) are fully implemented, applied, and verified in AWS.
Phase 2 — Dry-run orchestration
- In progress: Implement webhook validation, durable inbox/outbox, reconciliation, LangGraph persistence, dependency analysis, feasibility review, and scheduling. Webhook verification and normalization, durable inbox/outbox, status projections, queue consumption, domain dependency validation, and persistence-level scheduling are merged. Live model and GitHub provider integration, LangGraph workflow execution, and end-to-end dry-run execution continue in Milestone 3.
- Run read-only against both targets and report proposed labels, dispatches, reviews, and concurrency decisions without GitHub writes.
Phase 3 — Client portal pilot
- Add the repository adapter and exact-bot authorization changes through the client portal’s normal issue and pull request workflow.
- Use the frozen, human-authorized Phase 1 portal manifest.
- Enable AI plan authorization, implementation dispatch, automated review, two-cycle repair, independent automated approval, and guarded squash auto-merge.
- Demonstrate crash recovery, duplicate delivery handling, pause/drain, kill switch, Fargate scale-to-zero, Aurora auto-pause/resume, and reconciliation.
Phase 4 — Consulting site rollout
- Install the same adapter contract in
ai-consulting-site. - Prove cross-repository concurrency and per-repository merge serialization.
- Record evidence and implementation links in this planning repository.
Phase 5 — Client-owned deployment portability
- Complete licensing and public/client-distribution readiness before granting any client the right to fork the implementation.
- Remove account-specific assumptions and define versioned Terraform inputs, outputs, state layout, OIDC trust, and secret contracts.
- Add client-facing bootstrap, provisioning, verification, upgrade, recovery, and teardown documentation plus protected plan/apply workflows.
- Provide the client-owned
node-v1repository template, idempotentrepo:provisioncommand, non-mutating--checkmode, adapter registration, GitHub Team/Enterprise ruleset path, and GitHub Free fallback defined by the client repository provisioning plan. - Validate clean repository creation, repeated no-op provisioning, drift detection and repair, missing permissions and App access, and fail-closed handling of unenforceable mandatory controls.
- Prove the instructions from a clean synthetic fork in a fresh AWS test account, including a second operator following the documentation without repository-author assistance.
- Require that second operator to create and provision a synthetic target repository, run a synthetic issue through a checked draft pull request, and stop for human review without merge or deployment.
- Pilot the forked deployment with one client only after its technical owner approves the account boundary, expected costs, permissions, support model, and acceptance/rollback criteria.
Phase 6 — Post-MVP expansion
After the frozen portal backlog completes, evaluate consulting-site rollout, additional repositories, client-owned distribution, goal decomposition, and whether evidence supports any broader plan-approval policy. Automatic merge does not imply automatic release or deployment, and it remains bound to exact human-approved plans, protected repositories, separated identities, current checks and reviews, and emergency disablement.
Test and acceptance plan
- Unit-test state transitions, policies, DAG cycles, external dependencies, conflict domains, concurrency limits, retries, leases, and merge ordering.
- Verify HMAC validation, malformed webhook rejection, delivery deduplication, FIFO ordering, DLQ behavior, and missed-event reconciliation.
- Verify every GitHub mutation is outbox-backed, idempotent, refetched before execution, and rejected for stale fingerprints or SHAs.
- Test prompt injection through issue text, plans, comments, repository files, diffs, and CI output.
- Verify model output cannot select credentials, expand repository access, weaken policy, or grant merge authority.
- Integration-test LangGraph crash/resume after every graph node with PostgreSQL persistence.
- Test Aurora cold-resume retries and ECS zero-to-active-to-zero behavior.
- Test SigV4 authorization, cross-run isolation, invalid credentials, idempotency, pause/resume/cancel, and stale projections through Bruno.
- Use synthetic GitHub fixtures in CI; automated tests must not mutate either live target repository.
Pilot acceptance requires:
- Correct dependency order and one demonstrated safe parallel pair.
- No duplicate build, pull request, review, or label transition.
- Successful bounded repair and deterministic blocking after two failures.
- Human merge remaining mandatory.
- Traceability from sprint run through issue, plan fingerprint, Actions run, pull request, checks, review, and merge.
- Demonstrated worker drain, kill switch, scale-to-zero, database auto-pause, restore, and reconciliation.
Assumptions and explicit boundaries
- The implementation repository is private and contains no credentials or account-specific secret values.
- Client forking is a post-pilot distribution target. It requires an explicit license and a client-distributable release; the current private/proprietary repository must not be represented as reusable software.
- Each client deployment owns its AWS account boundary, Terraform state, GitHub App, OIDC roles, secrets, budgets, logs, backups, and operating decisions. Consultancy access is optional, explicit, least-privileged, and revocable by the client.
- AWS region is
us-east-1; AWS credentials must be reauthenticated before provisioning. - The target repositories’ current build workflows and publisher Apps remain in place.
- The client portal is the primary pilot; the consulting site is also an initial supported target.
- Human merge is the only enabled v1 merge policy.
- Same-repository parallelism defaults to two and uncertainty serializes work.
- Automated repair is limited to two cycles.
- GPT-5.6 Terra at medium effort is the default for sequencing and feasibility; GPT-5.6 Sol at high effort is the default for pull request review.
- Goal decomposition, epic generation, issue filter criteria, a user interface, unattended deployment, and multi-client hosting are later workflow versions.