🏭 Build the GitHub Actions-hosted AI software factory #633

Description

@taras

Why

Build the GitHub Actions-hosted AI Software Factory specified in draft PR
#630.

The factory turns one issue into one durable XMD run whose current owner is
projected on a GitHub Project. Product intent, architecture, planning,
implementation, and review accumulate as an accepted handoff chain. GitHub
Actions invokes the run; XMD owns the procedure, transitions, effects, and
journal. There is no separate controller.

Settled lifecycle

StageStatus
0Backlog
1User
2Architect
3Planner
4Implementor
5Planner Review
6Architect Review
7User Review
8Closed

Forward progress is strictly adjacent:

1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8

A backward transition may jump to the earliest invalidated contract, but every
later stage runs again. Same-stage correction is iteration, not progress.

Ownership bands

Each horizontal band belongs to one participant. The User forms the base,
Architect and Planner progressively narrow uncertainty, and implementation is
the apex. Validation returns through the paired prompt on each band.

AI Software Factory ownership bands

Feedback through preparation

An implementation question descends only as far as the earliest contract that
does not resolve it. Each participant can stop an unnecessary invalidation and
send the work forward again.

flowchart TB
I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
P3 -->|Yes - clarify and return| I4
P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
A2 -->|Yes - send forward| P3
A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
Loading

Feedback through validation

Review feedback bubbles toward implementation through the validation roles.
Only a proven upstream gap crosses the apex and descends the preparation side.

flowchart BT
U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
A6 -->|No - return forward| U7
A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
P5 -->|No - return forward| A6
P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
I4 -->|New revision| P5
I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
Loading

Sequence

sequenceDiagram
autonumber
actor User
participant Project as GitHub Project
participant Actions as GitHub Actions
participant XMD as Durable XMD workflow
participant Agent as Current role Agent
participant Issue as GitHub Issue
participant Git as Workspace + Git
participant PR as Draft Pull Request
User->>Project: Assign Issue from Backlog (0) to User (1)
Project-->>Actions: Authorized intake signal
Actions->>XMD: Start run for issue at immutable definition SHA
Note over XMD: One issue = one durable run<br/>Definition SHA never changes
loop Stages 1-3 remove uncertainty
XMD->>Agent: Render accepted chain and invoke current role
Agent-->>XMD: Structured outcome
alt Same-stage amendment
XMD->>Issue: Record iteration
XMD->>Project: Keep current stage
else Earlier contract invalidated
XMD->>Issue: Record full backward handoff
XMD->>Project: Set earliest invalidated stage
else Current role passes
XMD->>Issue: Record accepted adjacent handoff
XMD->>Project: Advance exactly one stage
end
end
XMD->>Agent: Stage 4 Implementor receives accepted plan
Agent-->>XMD: Generated XMD with proposed writes/deletions
XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
Git-->>XMD: Implementation head SHA
XMD->>Git: Checkpoint head, target base, and merge base
alt Base synchronization merges cleanly
XMD->>Git: Perform trusted merge
Git-->>XMD: New head SHA
Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
XMD->>Git: Run selected evidence and non-force push
else Merge conflicts
Git-->>XMD: Durable structured conflict evidence
XMD->>PR: Link exact SHAs, paths, blob identities, and classes
XMD-->>User: Suspend for human resolution in the initial release
User->>PR: Resolve and push changed branch
PR-->>Actions: Authorized resume signal
Actions->>XMD: Resume the same durable run
XMD->>PR: Observe new exact head/base revision
Note over XMD: Re-enter Stage 4<br/>No review is inherited
end
XMD->>PR: Create/update draft PR
XMD->>PR: Record adjacent handoff with exact head and base SHAs
XMD->>Project: Advance to Planner Review (5)
XMD->>Agent: Planner Review exact head and base SHAs
Agent-->>XMD: Verdict for that exact revision
XMD->>PR: Record accepted Planner verdict
XMD->>Project: Advance to Architect Review (6)
XMD->>Agent: Architect Review same revision and Planner verdict
Agent-->>XMD: Verdict for that exact revision
XMD->>PR: Record accepted Architect verdict and make PR ready
XMD->>Project: Advance to User Review (7)
XMD-->>User: Review PR at exact validated head/base revision and handoff chain
alt User accepts
User-->>XMD: Authorize merge
XMD->>PR: Merge with permitted target policy
XMD->>Project: Advance to Closed (8)
Note over XMD,Issue: Retain merged terminal reason and merge identity
else User abandons
User-->>XMD: Authorize abandonment
XMD->>Project: Advance to Closed (8)
Note over XMD,Issue: Retain abandoned terminal reason
else User requests changes
User-->>XMD: Identify earliest invalidated contract
XMD->>Project: Move backward to Stage 1-6
Note over XMD,Project: Forward progress traverses every later stage again
end
Loading

Identity and invalidation

Two SHA identities remain distinct:

  1. The XMD workflow definition SHA is immutable for the factory run.
  2. The implementation revision evolves as { headSha, baseSha }.

Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
Any change to headSha remains or returns to Stage 4 and invalidates Stages
5-7. Base movement without a head change invalidates Stage 5; if synchronization
or implementation work is required, it returns to Stage 4.

The initial synchronization policy merges the latest base into the published
implementation branch. It uses the ordinary reconciled non-force Push effect.
Rebases, force pushes, and force-with-lease are outside this issue.

Record and authority boundaries

  • The issue owns product intent, architecture, planning, and the transition into
    implementation. Issue comments record Stages 1-3.
  • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
    The draft PR owns implementation iterations and Stages 5-7.
  • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
    issue and a short link on the PR. Crossing back into implementation links the
    accepted issue handoff from the PR.
  • Comments are the human-readable transition record. The XMD journal is the
    durable execution record. The Project status is a projection of that record.
  • The Agent decides desired contents. XMD inspects Git, applies admitted file
    effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
    reconciles interruption.
  • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
    checkout, native-tool, or equivalent MCP authority.

Acceptance criteria

  • One GitHub issue maps to one durable XMD factory run across every Stage 4
    revision.
  • The Project exposes the nine settled statuses and XMD enforces adjacent
    forward transitions.
  • Same-stage iteration and backward invalidation preserve history while
    replacing the active validation frontier.
  • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
    environment; it owns no role outcome or transition decision.
  • Stage 1-3 handoffs are recorded on the issue using the settled crossing
    rules.
  • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
    { headSha, baseSha }.
  • Planner, Architect, and User review conclusions are accepted only for the
    exact current revision.
  • A changed head returns to Stage 4; a base-only change returns to Stage 5
    unless Stage 4 work is required.
  • Clean base merges create a new Stage 4 revision, run the selected evidence,
    and publish through a normal non-force push.
  • A conflicted merge records exact head, base, merge base, conflict paths,
    base/ours/theirs blob identities, and conflict classifications.
  • Unsupported conflict forms suspend without granting the Agent additional
    authority.
  • A manually changed branch is observed as a new exact revision and re-enters
    Stage 4 before review.
  • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
    Stage 7 -> 8 transition with its terminal reason retained.
  • Interrupted GitHub effects reconcile under stable identities rather than
    being repeated blindly.
  • Rebases and force pushes are refused.

Initial release decision

Decide before Planner readiness:

  • Implement structured generated-XMD resolution for ordinary text conflicts
    in the first release; or
  • Suspend for human resolution on every conflict.

Architecture recommendation: choose the second option. Automatically perform
clean merges, suspend on every conflict, prohibit rebases and force pushes, and
add structured ordinary-text resolution later as a separately bounded
capability.

Deployment decisions before readiness

  • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
    provider shared by ephemeral Actions runners.
  • Select the authorized Project admission, human-answer, and resume ingress and
    its actor authentication.
  • Select the GitHub principal and exact repository, issue, pull-request, Project,
    merge, and abandonment permission ceilings.

Architecture

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
      Skip to content

      🏭 Build the GitHub Actions-hosted AI software factory #633

      Description

      @taras

      Why

      Build the GitHub Actions-hosted AI Software Factory specified in draft PR
      #630.

      The factory turns one issue into one durable XMD run whose current owner is
      projected on a GitHub Project. Product intent, architecture, planning,
      implementation, and review accumulate as an accepted handoff chain. GitHub
      Actions invokes the run; XMD owns the procedure, transitions, effects, and
      journal. There is no separate controller.

      Settled lifecycle

      StageStatus
      0Backlog
      1User
      2Architect
      3Planner
      4Implementor
      5Planner Review
      6Architect Review
      7User Review
      8Closed

      Forward progress is strictly adjacent:

      1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
      

      A backward transition may jump to the earliest invalidated contract, but every
      later stage runs again. Same-stage correction is iteration, not progress.

      Ownership bands

      Each horizontal band belongs to one participant. The User forms the base,
      Architect and Planner progressively narrow uncertainty, and implementation is
      the apex. Validation returns through the paired prompt on each band.

      AI Software Factory ownership bands

      Feedback through preparation

      An implementation question descends only as far as the earliest contract that
      does not resolve it. Each participant can stop an unnecessary invalidation and
      send the work forward again.

      flowchart TB
      I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
      P3 -->|Yes - clarify and return| I4
      P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
      A2 -->|Yes - send forward| P3
      A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
      
      Loading

      Feedback through validation

      Review feedback bubbles toward implementation through the validation roles.
      Only a proven upstream gap crosses the apex and descends the preparation side.

      flowchart BT
      U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
      A6 -->|No - return forward| U7
      A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
      P5 -->|No - return forward| A6
      P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
      I4 -->|New revision| P5
      I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
      P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
      A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
      
      Loading

      Sequence

      sequenceDiagram
      autonumber
      actor User
      participant Project as GitHub Project
      participant Actions as GitHub Actions
      participant XMD as Durable XMD workflow
      participant Agent as Current role Agent
      participant Issue as GitHub Issue
      participant Git as Workspace + Git
      participant PR as Draft Pull Request
      User->>Project: Assign Issue from Backlog (0) to User (1)
      Project-->>Actions: Authorized intake signal
      Actions->>XMD: Start run for issue at immutable definition SHA
      Note over XMD: One issue = one durable run<br/>Definition SHA never changes
      loop Stages 1-3 remove uncertainty
      XMD->>Agent: Render accepted chain and invoke current role
      Agent-->>XMD: Structured outcome
      alt Same-stage amendment
      XMD->>Issue: Record iteration
      XMD->>Project: Keep current stage
      else Earlier contract invalidated
      XMD->>Issue: Record full backward handoff
      XMD->>Project: Set earliest invalidated stage
      else Current role passes
      XMD->>Issue: Record accepted adjacent handoff
      XMD->>Project: Advance exactly one stage
      end
      end
      XMD->>Agent: Stage 4 Implementor receives accepted plan
      Agent-->>XMD: Generated XMD with proposed writes/deletions
      XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
      Git-->>XMD: Implementation head SHA
      XMD->>Git: Checkpoint head, target base, and merge base
      alt Base synchronization merges cleanly
      XMD->>Git: Perform trusted merge
      Git-->>XMD: New head SHA
      Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
      XMD->>Git: Run selected evidence and non-force push
      else Merge conflicts
      Git-->>XMD: Durable structured conflict evidence
      XMD->>PR: Link exact SHAs, paths, blob identities, and classes
      XMD-->>User: Suspend for human resolution in the initial release
      User->>PR: Resolve and push changed branch
      PR-->>Actions: Authorized resume signal
      Actions->>XMD: Resume the same durable run
      XMD->>PR: Observe new exact head/base revision
      Note over XMD: Re-enter Stage 4<br/>No review is inherited
      end
      XMD->>PR: Create/update draft PR
      XMD->>PR: Record adjacent handoff with exact head and base SHAs
      XMD->>Project: Advance to Planner Review (5)
      XMD->>Agent: Planner Review exact head and base SHAs
      Agent-->>XMD: Verdict for that exact revision
      XMD->>PR: Record accepted Planner verdict
      XMD->>Project: Advance to Architect Review (6)
      XMD->>Agent: Architect Review same revision and Planner verdict
      Agent-->>XMD: Verdict for that exact revision
      XMD->>PR: Record accepted Architect verdict and make PR ready
      XMD->>Project: Advance to User Review (7)
      XMD-->>User: Review PR at exact validated head/base revision and handoff chain
      alt User accepts
      User-->>XMD: Authorize merge
      XMD->>PR: Merge with permitted target policy
      XMD->>Project: Advance to Closed (8)
      Note over XMD,Issue: Retain merged terminal reason and merge identity
      else User abandons
      User-->>XMD: Authorize abandonment
      XMD->>Project: Advance to Closed (8)
      Note over XMD,Issue: Retain abandoned terminal reason
      else User requests changes
      User-->>XMD: Identify earliest invalidated contract
      XMD->>Project: Move backward to Stage 1-6
      Note over XMD,Project: Forward progress traverses every later stage again
      end
      
      Loading

      Identity and invalidation

      Two SHA identities remain distinct:

      1. The XMD workflow definition SHA is immutable for the factory run.
      2. The implementation revision evolves as { headSha, baseSha }.

      Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
      Any change to headSha remains or returns to Stage 4 and invalidates Stages
      5-7. Base movement without a head change invalidates Stage 5; if synchronization
      or implementation work is required, it returns to Stage 4.

      The initial synchronization policy merges the latest base into the published
      implementation branch. It uses the ordinary reconciled non-force Push effect.
      Rebases, force pushes, and force-with-lease are outside this issue.

      Record and authority boundaries

      • The issue owns product intent, architecture, planning, and the transition into
        implementation. Issue comments record Stages 1-3.
      • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
        The draft PR owns implementation iterations and Stages 5-7.
      • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
        issue and a short link on the PR. Crossing back into implementation links the
        accepted issue handoff from the PR.
      • Comments are the human-readable transition record. The XMD journal is the
        durable execution record. The Project status is a projection of that record.
      • The Agent decides desired contents. XMD inspects Git, applies admitted file
        effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
        reconciles interruption.
      • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
        checkout, native-tool, or equivalent MCP authority.

      Acceptance criteria

      • One GitHub issue maps to one durable XMD factory run across every Stage 4
        revision.
      • The Project exposes the nine settled statuses and XMD enforces adjacent
        forward transitions.
      • Same-stage iteration and backward invalidation preserve history while
        replacing the active validation frontier.
      • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
        environment; it owns no role outcome or transition decision.
      • Stage 1-3 handoffs are recorded on the issue using the settled crossing
        rules.
      • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
        { headSha, baseSha }.
      • Planner, Architect, and User review conclusions are accepted only for the
        exact current revision.
      • A changed head returns to Stage 4; a base-only change returns to Stage 5
        unless Stage 4 work is required.
      • Clean base merges create a new Stage 4 revision, run the selected evidence,
        and publish through a normal non-force push.
      • A conflicted merge records exact head, base, merge base, conflict paths,
        base/ours/theirs blob identities, and conflict classifications.
      • Unsupported conflict forms suspend without granting the Agent additional
        authority.
      • A manually changed branch is observed as a new exact revision and re-enters
        Stage 4 before review.
      • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
        Stage 7 -> 8 transition with its terminal reason retained.
      • Interrupted GitHub effects reconcile under stable identities rather than
        being repeated blindly.
      • Rebases and force pushes are refused.

      Initial release decision

      Decide before Planner readiness:

      • Implement structured generated-XMD resolution for ordinary text conflicts
        in the first release; or
      • Suspend for human resolution on every conflict.

      Architecture recommendation: choose the second option. Automatically perform
      clean merges, suspend on every conflict, prohibit rebases and force pushes, and
      add structured ordinary-text resolution later as a separately bounded
      capability.

      Deployment decisions before readiness

      • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
        provider shared by ephemeral Actions runners.
      • Select the authorized Project admission, human-answer, and resume ingress and
        its actor authentication.
      • Select the GitHub principal and exact repository, issue, pull-request, Project,
        merge, and abandonment permission ceilings.

      Architecture

      Activity

      Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

      Metadata

      Metadata

      Assignees

      No one assigned

        Labels

        No labels
        No labels

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
          Skip to content

          🏭 Build the GitHub Actions-hosted AI software factory #633

          Description

          @taras

          Why

          Build the GitHub Actions-hosted AI Software Factory specified in draft PR
          #630.

          The factory turns one issue into one durable XMD run whose current owner is
          projected on a GitHub Project. Product intent, architecture, planning,
          implementation, and review accumulate as an accepted handoff chain. GitHub
          Actions invokes the run; XMD owns the procedure, transitions, effects, and
          journal. There is no separate controller.

          Settled lifecycle

          StageStatus
          0Backlog
          1User
          2Architect
          3Planner
          4Implementor
          5Planner Review
          6Architect Review
          7User Review
          8Closed

          Forward progress is strictly adjacent:

          1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
          

          A backward transition may jump to the earliest invalidated contract, but every
          later stage runs again. Same-stage correction is iteration, not progress.

          Ownership bands

          Each horizontal band belongs to one participant. The User forms the base,
          Architect and Planner progressively narrow uncertainty, and implementation is
          the apex. Validation returns through the paired prompt on each band.

          AI Software Factory ownership bands

          Feedback through preparation

          An implementation question descends only as far as the earliest contract that
          does not resolve it. Each participant can stop an unnecessary invalidation and
          send the work forward again.

          flowchart TB
          I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
          P3 -->|Yes - clarify and return| I4
          P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
          A2 -->|Yes - send forward| P3
          A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
          
          Loading

          Feedback through validation

          Review feedback bubbles toward implementation through the validation roles.
          Only a proven upstream gap crosses the apex and descends the preparation side.

          flowchart BT
          U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
          A6 -->|No - return forward| U7
          A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
          P5 -->|No - return forward| A6
          P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
          I4 -->|New revision| P5
          I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
          P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
          A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
          
          Loading

          Sequence

          sequenceDiagram
          autonumber
          actor User
          participant Project as GitHub Project
          participant Actions as GitHub Actions
          participant XMD as Durable XMD workflow
          participant Agent as Current role Agent
          participant Issue as GitHub Issue
          participant Git as Workspace + Git
          participant PR as Draft Pull Request
          User->>Project: Assign Issue from Backlog (0) to User (1)
          Project-->>Actions: Authorized intake signal
          Actions->>XMD: Start run for issue at immutable definition SHA
          Note over XMD: One issue = one durable run<br/>Definition SHA never changes
          loop Stages 1-3 remove uncertainty
          XMD->>Agent: Render accepted chain and invoke current role
          Agent-->>XMD: Structured outcome
          alt Same-stage amendment
          XMD->>Issue: Record iteration
          XMD->>Project: Keep current stage
          else Earlier contract invalidated
          XMD->>Issue: Record full backward handoff
          XMD->>Project: Set earliest invalidated stage
          else Current role passes
          XMD->>Issue: Record accepted adjacent handoff
          XMD->>Project: Advance exactly one stage
          end
          end
          XMD->>Agent: Stage 4 Implementor receives accepted plan
          Agent-->>XMD: Generated XMD with proposed writes/deletions
          XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
          Git-->>XMD: Implementation head SHA
          XMD->>Git: Checkpoint head, target base, and merge base
          alt Base synchronization merges cleanly
          XMD->>Git: Perform trusted merge
          Git-->>XMD: New head SHA
          Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
          XMD->>Git: Run selected evidence and non-force push
          else Merge conflicts
          Git-->>XMD: Durable structured conflict evidence
          XMD->>PR: Link exact SHAs, paths, blob identities, and classes
          XMD-->>User: Suspend for human resolution in the initial release
          User->>PR: Resolve and push changed branch
          PR-->>Actions: Authorized resume signal
          Actions->>XMD: Resume the same durable run
          XMD->>PR: Observe new exact head/base revision
          Note over XMD: Re-enter Stage 4<br/>No review is inherited
          end
          XMD->>PR: Create/update draft PR
          XMD->>PR: Record adjacent handoff with exact head and base SHAs
          XMD->>Project: Advance to Planner Review (5)
          XMD->>Agent: Planner Review exact head and base SHAs
          Agent-->>XMD: Verdict for that exact revision
          XMD->>PR: Record accepted Planner verdict
          XMD->>Project: Advance to Architect Review (6)
          XMD->>Agent: Architect Review same revision and Planner verdict
          Agent-->>XMD: Verdict for that exact revision
          XMD->>PR: Record accepted Architect verdict and make PR ready
          XMD->>Project: Advance to User Review (7)
          XMD-->>User: Review PR at exact validated head/base revision and handoff chain
          alt User accepts
          User-->>XMD: Authorize merge
          XMD->>PR: Merge with permitted target policy
          XMD->>Project: Advance to Closed (8)
          Note over XMD,Issue: Retain merged terminal reason and merge identity
          else User abandons
          User-->>XMD: Authorize abandonment
          XMD->>Project: Advance to Closed (8)
          Note over XMD,Issue: Retain abandoned terminal reason
          else User requests changes
          User-->>XMD: Identify earliest invalidated contract
          XMD->>Project: Move backward to Stage 1-6
          Note over XMD,Project: Forward progress traverses every later stage again
          end
          
          Loading

          Identity and invalidation

          Two SHA identities remain distinct:

          1. The XMD workflow definition SHA is immutable for the factory run.
          2. The implementation revision evolves as { headSha, baseSha }.

          Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
          Any change to headSha remains or returns to Stage 4 and invalidates Stages
          5-7. Base movement without a head change invalidates Stage 5; if synchronization
          or implementation work is required, it returns to Stage 4.

          The initial synchronization policy merges the latest base into the published
          implementation branch. It uses the ordinary reconciled non-force Push effect.
          Rebases, force pushes, and force-with-lease are outside this issue.

          Record and authority boundaries

          • The issue owns product intent, architecture, planning, and the transition into
            implementation. Issue comments record Stages 1-3.
          • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
            The draft PR owns implementation iterations and Stages 5-7.
          • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
            issue and a short link on the PR. Crossing back into implementation links the
            accepted issue handoff from the PR.
          • Comments are the human-readable transition record. The XMD journal is the
            durable execution record. The Project status is a projection of that record.
          • The Agent decides desired contents. XMD inspects Git, applies admitted file
            effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
            reconciles interruption.
          • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
            checkout, native-tool, or equivalent MCP authority.

          Acceptance criteria

          • One GitHub issue maps to one durable XMD factory run across every Stage 4
            revision.
          • The Project exposes the nine settled statuses and XMD enforces adjacent
            forward transitions.
          • Same-stage iteration and backward invalidation preserve history while
            replacing the active validation frontier.
          • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
            environment; it owns no role outcome or transition decision.
          • Stage 1-3 handoffs are recorded on the issue using the settled crossing
            rules.
          • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
            { headSha, baseSha }.
          • Planner, Architect, and User review conclusions are accepted only for the
            exact current revision.
          • A changed head returns to Stage 4; a base-only change returns to Stage 5
            unless Stage 4 work is required.
          • Clean base merges create a new Stage 4 revision, run the selected evidence,
            and publish through a normal non-force push.
          • A conflicted merge records exact head, base, merge base, conflict paths,
            base/ours/theirs blob identities, and conflict classifications.
          • Unsupported conflict forms suspend without granting the Agent additional
            authority.
          • A manually changed branch is observed as a new exact revision and re-enters
            Stage 4 before review.
          • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
            Stage 7 -> 8 transition with its terminal reason retained.
          • Interrupted GitHub effects reconcile under stable identities rather than
            being repeated blindly.
          • Rebases and force pushes are refused.

          Initial release decision

          Decide before Planner readiness:

          • Implement structured generated-XMD resolution for ordinary text conflicts
            in the first release; or
          • Suspend for human resolution on every conflict.

          Architecture recommendation: choose the second option. Automatically perform
          clean merges, suspend on every conflict, prohibit rebases and force pushes, and
          add structured ordinary-text resolution later as a separately bounded
          capability.

          Deployment decisions before readiness

          • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
            provider shared by ephemeral Actions runners.
          • Select the authorized Project admission, human-answer, and resume ingress and
            its actor authentication.
          • Select the GitHub principal and exact repository, issue, pull-request, Project,
            merge, and abandonment permission ceilings.

          Architecture

          Activity

          Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

          Metadata

          Metadata

          Assignees

          No one assigned

            Labels

            No labels
            No labels

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              🏭 Build the GitHub Actions-hosted AI software factory #633

              Description

              @taras

              Why

              Build the GitHub Actions-hosted AI Software Factory specified in draft PR
              #630.

              The factory turns one issue into one durable XMD run whose current owner is
              projected on a GitHub Project. Product intent, architecture, planning,
              implementation, and review accumulate as an accepted handoff chain. GitHub
              Actions invokes the run; XMD owns the procedure, transitions, effects, and
              journal. There is no separate controller.

              Settled lifecycle

              StageStatus
              0Backlog
              1User
              2Architect
              3Planner
              4Implementor
              5Planner Review
              6Architect Review
              7User Review
              8Closed

              Forward progress is strictly adjacent:

              1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
              

              A backward transition may jump to the earliest invalidated contract, but every
              later stage runs again. Same-stage correction is iteration, not progress.

              Ownership bands

              Each horizontal band belongs to one participant. The User forms the base,
              Architect and Planner progressively narrow uncertainty, and implementation is
              the apex. Validation returns through the paired prompt on each band.

              AI Software Factory ownership bands

              Feedback through preparation

              An implementation question descends only as far as the earliest contract that
              does not resolve it. Each participant can stop an unnecessary invalidation and
              send the work forward again.

              flowchart TB
              I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
              P3 -->|Yes - clarify and return| I4
              P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
              A2 -->|Yes - send forward| P3
              A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
              
              Loading

              Feedback through validation

              Review feedback bubbles toward implementation through the validation roles.
              Only a proven upstream gap crosses the apex and descends the preparation side.

              flowchart BT
              U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
              A6 -->|No - return forward| U7
              A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
              P5 -->|No - return forward| A6
              P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
              I4 -->|New revision| P5
              I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
              P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
              A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
              
              Loading

              Sequence

              sequenceDiagram
              autonumber
              actor User
              participant Project as GitHub Project
              participant Actions as GitHub Actions
              participant XMD as Durable XMD workflow
              participant Agent as Current role Agent
              participant Issue as GitHub Issue
              participant Git as Workspace + Git
              participant PR as Draft Pull Request
              User->>Project: Assign Issue from Backlog (0) to User (1)
              Project-->>Actions: Authorized intake signal
              Actions->>XMD: Start run for issue at immutable definition SHA
              Note over XMD: One issue = one durable run<br/>Definition SHA never changes
              loop Stages 1-3 remove uncertainty
              XMD->>Agent: Render accepted chain and invoke current role
              Agent-->>XMD: Structured outcome
              alt Same-stage amendment
              XMD->>Issue: Record iteration
              XMD->>Project: Keep current stage
              else Earlier contract invalidated
              XMD->>Issue: Record full backward handoff
              XMD->>Project: Set earliest invalidated stage
              else Current role passes
              XMD->>Issue: Record accepted adjacent handoff
              XMD->>Project: Advance exactly one stage
              end
              end
              XMD->>Agent: Stage 4 Implementor receives accepted plan
              Agent-->>XMD: Generated XMD with proposed writes/deletions
              XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
              Git-->>XMD: Implementation head SHA
              XMD->>Git: Checkpoint head, target base, and merge base
              alt Base synchronization merges cleanly
              XMD->>Git: Perform trusted merge
              Git-->>XMD: New head SHA
              Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
              XMD->>Git: Run selected evidence and non-force push
              else Merge conflicts
              Git-->>XMD: Durable structured conflict evidence
              XMD->>PR: Link exact SHAs, paths, blob identities, and classes
              XMD-->>User: Suspend for human resolution in the initial release
              User->>PR: Resolve and push changed branch
              PR-->>Actions: Authorized resume signal
              Actions->>XMD: Resume the same durable run
              XMD->>PR: Observe new exact head/base revision
              Note over XMD: Re-enter Stage 4<br/>No review is inherited
              end
              XMD->>PR: Create/update draft PR
              XMD->>PR: Record adjacent handoff with exact head and base SHAs
              XMD->>Project: Advance to Planner Review (5)
              XMD->>Agent: Planner Review exact head and base SHAs
              Agent-->>XMD: Verdict for that exact revision
              XMD->>PR: Record accepted Planner verdict
              XMD->>Project: Advance to Architect Review (6)
              XMD->>Agent: Architect Review same revision and Planner verdict
              Agent-->>XMD: Verdict for that exact revision
              XMD->>PR: Record accepted Architect verdict and make PR ready
              XMD->>Project: Advance to User Review (7)
              XMD-->>User: Review PR at exact validated head/base revision and handoff chain
              alt User accepts
              User-->>XMD: Authorize merge
              XMD->>PR: Merge with permitted target policy
              XMD->>Project: Advance to Closed (8)
              Note over XMD,Issue: Retain merged terminal reason and merge identity
              else User abandons
              User-->>XMD: Authorize abandonment
              XMD->>Project: Advance to Closed (8)
              Note over XMD,Issue: Retain abandoned terminal reason
              else User requests changes
              User-->>XMD: Identify earliest invalidated contract
              XMD->>Project: Move backward to Stage 1-6
              Note over XMD,Project: Forward progress traverses every later stage again
              end
              
              Loading

              Identity and invalidation

              Two SHA identities remain distinct:

              1. The XMD workflow definition SHA is immutable for the factory run.
              2. The implementation revision evolves as { headSha, baseSha }.

              Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
              Any change to headSha remains or returns to Stage 4 and invalidates Stages
              5-7. Base movement without a head change invalidates Stage 5; if synchronization
              or implementation work is required, it returns to Stage 4.

              The initial synchronization policy merges the latest base into the published
              implementation branch. It uses the ordinary reconciled non-force Push effect.
              Rebases, force pushes, and force-with-lease are outside this issue.

              Record and authority boundaries

              • The issue owns product intent, architecture, planning, and the transition into
                implementation. Issue comments record Stages 1-3.
              • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
                The draft PR owns implementation iterations and Stages 5-7.
              • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
                issue and a short link on the PR. Crossing back into implementation links the
                accepted issue handoff from the PR.
              • Comments are the human-readable transition record. The XMD journal is the
                durable execution record. The Project status is a projection of that record.
              • The Agent decides desired contents. XMD inspects Git, applies admitted file
                effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
                reconciles interruption.
              • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
                checkout, native-tool, or equivalent MCP authority.

              Acceptance criteria

              • One GitHub issue maps to one durable XMD factory run across every Stage 4
                revision.
              • The Project exposes the nine settled statuses and XMD enforces adjacent
                forward transitions.
              • Same-stage iteration and backward invalidation preserve history while
                replacing the active validation frontier.
              • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
                environment; it owns no role outcome or transition decision.
              • Stage 1-3 handoffs are recorded on the issue using the settled crossing
                rules.
              • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
                { headSha, baseSha }.
              • Planner, Architect, and User review conclusions are accepted only for the
                exact current revision.
              • A changed head returns to Stage 4; a base-only change returns to Stage 5
                unless Stage 4 work is required.
              • Clean base merges create a new Stage 4 revision, run the selected evidence,
                and publish through a normal non-force push.
              • A conflicted merge records exact head, base, merge base, conflict paths,
                base/ours/theirs blob identities, and conflict classifications.
              • Unsupported conflict forms suspend without granting the Agent additional
                authority.
              • A manually changed branch is observed as a new exact revision and re-enters
                Stage 4 before review.
              • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
                Stage 7 -> 8 transition with its terminal reason retained.
              • Interrupted GitHub effects reconcile under stable identities rather than
                being repeated blindly.
              • Rebases and force pushes are refused.

              Initial release decision

              Decide before Planner readiness:

              • Implement structured generated-XMD resolution for ordinary text conflicts
                in the first release; or
              • Suspend for human resolution on every conflict.

              Architecture recommendation: choose the second option. Automatically perform
              clean merges, suspend on every conflict, prohibit rebases and force pushes, and
              add structured ordinary-text resolution later as a separately bounded
              capability.

              Deployment decisions before readiness

              • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
                provider shared by ephemeral Actions runners.
              • Select the authorized Project admission, human-answer, and resume ingress and
                its actor authentication.
              • Select the GitHub principal and exact repository, issue, pull-request, Project,
                merge, and abandonment permission ceilings.

              Architecture

              Activity

              Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

              Metadata

              Metadata

              Assignees

              No one assigned

                Labels

                No labels
                No labels

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions

                  , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
                  Skip to content

                  🏭 Build the GitHub Actions-hosted AI software factory #633

                  Description

                  @taras

                  Why

                  Build the GitHub Actions-hosted AI Software Factory specified in draft PR
                  #630.

                  The factory turns one issue into one durable XMD run whose current owner is
                  projected on a GitHub Project. Product intent, architecture, planning,
                  implementation, and review accumulate as an accepted handoff chain. GitHub
                  Actions invokes the run; XMD owns the procedure, transitions, effects, and
                  journal. There is no separate controller.

                  Settled lifecycle

                  StageStatus
                  0Backlog
                  1User
                  2Architect
                  3Planner
                  4Implementor
                  5Planner Review
                  6Architect Review
                  7User Review
                  8Closed

                  Forward progress is strictly adjacent:

                  1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
                  

                  A backward transition may jump to the earliest invalidated contract, but every
                  later stage runs again. Same-stage correction is iteration, not progress.

                  Ownership bands

                  Each horizontal band belongs to one participant. The User forms the base,
                  Architect and Planner progressively narrow uncertainty, and implementation is
                  the apex. Validation returns through the paired prompt on each band.

                  AI Software Factory ownership bands

                  Feedback through preparation

                  An implementation question descends only as far as the earliest contract that
                  does not resolve it. Each participant can stop an unnecessary invalidation and
                  send the work forward again.

                  flowchart TB
                  I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
                  P3 -->|Yes - clarify and return| I4
                  P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
                  A2 -->|Yes - send forward| P3
                  A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
                  
                  Loading

                  Feedback through validation

                  Review feedback bubbles toward implementation through the validation roles.
                  Only a proven upstream gap crosses the apex and descends the preparation side.

                  flowchart BT
                  U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
                  A6 -->|No - return forward| U7
                  A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
                  P5 -->|No - return forward| A6
                  P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
                  I4 -->|New revision| P5
                  I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
                  P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
                  A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
                  
                  Loading

                  Sequence

                  sequenceDiagram
                  autonumber
                  actor User
                  participant Project as GitHub Project
                  participant Actions as GitHub Actions
                  participant XMD as Durable XMD workflow
                  participant Agent as Current role Agent
                  participant Issue as GitHub Issue
                  participant Git as Workspace + Git
                  participant PR as Draft Pull Request
                  User->>Project: Assign Issue from Backlog (0) to User (1)
                  Project-->>Actions: Authorized intake signal
                  Actions->>XMD: Start run for issue at immutable definition SHA
                  Note over XMD: One issue = one durable run<br/>Definition SHA never changes
                  loop Stages 1-3 remove uncertainty
                  XMD->>Agent: Render accepted chain and invoke current role
                  Agent-->>XMD: Structured outcome
                  alt Same-stage amendment
                  XMD->>Issue: Record iteration
                  XMD->>Project: Keep current stage
                  else Earlier contract invalidated
                  XMD->>Issue: Record full backward handoff
                  XMD->>Project: Set earliest invalidated stage
                  else Current role passes
                  XMD->>Issue: Record accepted adjacent handoff
                  XMD->>Project: Advance exactly one stage
                  end
                  end
                  XMD->>Agent: Stage 4 Implementor receives accepted plan
                  Agent-->>XMD: Generated XMD with proposed writes/deletions
                  XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
                  Git-->>XMD: Implementation head SHA
                  XMD->>Git: Checkpoint head, target base, and merge base
                  alt Base synchronization merges cleanly
                  XMD->>Git: Perform trusted merge
                  Git-->>XMD: New head SHA
                  Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
                  XMD->>Git: Run selected evidence and non-force push
                  else Merge conflicts
                  Git-->>XMD: Durable structured conflict evidence
                  XMD->>PR: Link exact SHAs, paths, blob identities, and classes
                  XMD-->>User: Suspend for human resolution in the initial release
                  User->>PR: Resolve and push changed branch
                  PR-->>Actions: Authorized resume signal
                  Actions->>XMD: Resume the same durable run
                  XMD->>PR: Observe new exact head/base revision
                  Note over XMD: Re-enter Stage 4<br/>No review is inherited
                  end
                  XMD->>PR: Create/update draft PR
                  XMD->>PR: Record adjacent handoff with exact head and base SHAs
                  XMD->>Project: Advance to Planner Review (5)
                  XMD->>Agent: Planner Review exact head and base SHAs
                  Agent-->>XMD: Verdict for that exact revision
                  XMD->>PR: Record accepted Planner verdict
                  XMD->>Project: Advance to Architect Review (6)
                  XMD->>Agent: Architect Review same revision and Planner verdict
                  Agent-->>XMD: Verdict for that exact revision
                  XMD->>PR: Record accepted Architect verdict and make PR ready
                  XMD->>Project: Advance to User Review (7)
                  XMD-->>User: Review PR at exact validated head/base revision and handoff chain
                  alt User accepts
                  User-->>XMD: Authorize merge
                  XMD->>PR: Merge with permitted target policy
                  XMD->>Project: Advance to Closed (8)
                  Note over XMD,Issue: Retain merged terminal reason and merge identity
                  else User abandons
                  User-->>XMD: Authorize abandonment
                  XMD->>Project: Advance to Closed (8)
                  Note over XMD,Issue: Retain abandoned terminal reason
                  else User requests changes
                  User-->>XMD: Identify earliest invalidated contract
                  XMD->>Project: Move backward to Stage 1-6
                  Note over XMD,Project: Forward progress traverses every later stage again
                  end
                  
                  Loading

                  Identity and invalidation

                  Two SHA identities remain distinct:

                  1. The XMD workflow definition SHA is immutable for the factory run.
                  2. The implementation revision evolves as { headSha, baseSha }.

                  Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
                  Any change to headSha remains or returns to Stage 4 and invalidates Stages
                  5-7. Base movement without a head change invalidates Stage 5; if synchronization
                  or implementation work is required, it returns to Stage 4.

                  The initial synchronization policy merges the latest base into the published
                  implementation branch. It uses the ordinary reconciled non-force Push effect.
                  Rebases, force pushes, and force-with-lease are outside this issue.

                  Record and authority boundaries

                  • The issue owns product intent, architecture, planning, and the transition into
                    implementation. Issue comments record Stages 1-3.
                  • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
                    The draft PR owns implementation iterations and Stages 5-7.
                  • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
                    issue and a short link on the PR. Crossing back into implementation links the
                    accepted issue handoff from the PR.
                  • Comments are the human-readable transition record. The XMD journal is the
                    durable execution record. The Project status is a projection of that record.
                  • The Agent decides desired contents. XMD inspects Git, applies admitted file
                    effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
                    reconciles interruption.
                  • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
                    checkout, native-tool, or equivalent MCP authority.

                  Acceptance criteria

                  • One GitHub issue maps to one durable XMD factory run across every Stage 4
                    revision.
                  • The Project exposes the nine settled statuses and XMD enforces adjacent
                    forward transitions.
                  • Same-stage iteration and backward invalidation preserve history while
                    replacing the active validation frontier.
                  • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
                    environment; it owns no role outcome or transition decision.
                  • Stage 1-3 handoffs are recorded on the issue using the settled crossing
                    rules.
                  • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
                    { headSha, baseSha }.
                  • Planner, Architect, and User review conclusions are accepted only for the
                    exact current revision.
                  • A changed head returns to Stage 4; a base-only change returns to Stage 5
                    unless Stage 4 work is required.
                  • Clean base merges create a new Stage 4 revision, run the selected evidence,
                    and publish through a normal non-force push.
                  • A conflicted merge records exact head, base, merge base, conflict paths,
                    base/ours/theirs blob identities, and conflict classifications.
                  • Unsupported conflict forms suspend without granting the Agent additional
                    authority.
                  • A manually changed branch is observed as a new exact revision and re-enters
                    Stage 4 before review.
                  • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
                    Stage 7 -> 8 transition with its terminal reason retained.
                  • Interrupted GitHub effects reconcile under stable identities rather than
                    being repeated blindly.
                  • Rebases and force pushes are refused.

                  Initial release decision

                  Decide before Planner readiness:

                  • Implement structured generated-XMD resolution for ordinary text conflicts
                    in the first release; or
                  • Suspend for human resolution on every conflict.

                  Architecture recommendation: choose the second option. Automatically perform
                  clean merges, suspend on every conflict, prohibit rebases and force pushes, and
                  add structured ordinary-text resolution later as a separately bounded
                  capability.

                  Deployment decisions before readiness

                  • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
                    provider shared by ephemeral Actions runners.
                  • Select the authorized Project admission, human-answer, and resume ingress and
                    its actor authentication.
                  • Select the GitHub principal and exact repository, issue, pull-request, Project,
                    merge, and abandonment permission ceilings.

                  Architecture

                  Activity

                  Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                  Metadata

                  Metadata

                  Assignees

                  No one assigned

                    Labels

                    No labels
                    No labels

                    Projects

                    No projects

                      Milestone

                      No milestone

                      Relationships

                      None yet

                      Development

                      No branches or pull requests

                      Issue actions

                      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                      Skip to content

                      🏭 Build the GitHub Actions-hosted AI software factory #633

                      Description

                      @taras

                      Why

                      Build the GitHub Actions-hosted AI Software Factory specified in draft PR
                      #630.

                      The factory turns one issue into one durable XMD run whose current owner is
                      projected on a GitHub Project. Product intent, architecture, planning,
                      implementation, and review accumulate as an accepted handoff chain. GitHub
                      Actions invokes the run; XMD owns the procedure, transitions, effects, and
                      journal. There is no separate controller.

                      Settled lifecycle

                      StageStatus
                      0Backlog
                      1User
                      2Architect
                      3Planner
                      4Implementor
                      5Planner Review
                      6Architect Review
                      7User Review
                      8Closed

                      Forward progress is strictly adjacent:

                      1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
                      

                      A backward transition may jump to the earliest invalidated contract, but every
                      later stage runs again. Same-stage correction is iteration, not progress.

                      Ownership bands

                      Each horizontal band belongs to one participant. The User forms the base,
                      Architect and Planner progressively narrow uncertainty, and implementation is
                      the apex. Validation returns through the paired prompt on each band.

                      AI Software Factory ownership bands

                      Feedback through preparation

                      An implementation question descends only as far as the earliest contract that
                      does not resolve it. Each participant can stop an unnecessary invalidation and
                      send the work forward again.

                      flowchart TB
                      I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
                      P3 -->|Yes - clarify and return| I4
                      P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
                      A2 -->|Yes - send forward| P3
                      A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
                      
                      Loading

                      Feedback through validation

                      Review feedback bubbles toward implementation through the validation roles.
                      Only a proven upstream gap crosses the apex and descends the preparation side.

                      flowchart BT
                      U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
                      A6 -->|No - return forward| U7
                      A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
                      P5 -->|No - return forward| A6
                      P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
                      I4 -->|New revision| P5
                      I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
                      P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
                      A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
                      
                      Loading

                      Sequence

                      sequenceDiagram
                      autonumber
                      actor User
                      participant Project as GitHub Project
                      participant Actions as GitHub Actions
                      participant XMD as Durable XMD workflow
                      participant Agent as Current role Agent
                      participant Issue as GitHub Issue
                      participant Git as Workspace + Git
                      participant PR as Draft Pull Request
                      User->>Project: Assign Issue from Backlog (0) to User (1)
                      Project-->>Actions: Authorized intake signal
                      Actions->>XMD: Start run for issue at immutable definition SHA
                      Note over XMD: One issue = one durable run<br/>Definition SHA never changes
                      loop Stages 1-3 remove uncertainty
                      XMD->>Agent: Render accepted chain and invoke current role
                      Agent-->>XMD: Structured outcome
                      alt Same-stage amendment
                      XMD->>Issue: Record iteration
                      XMD->>Project: Keep current stage
                      else Earlier contract invalidated
                      XMD->>Issue: Record full backward handoff
                      XMD->>Project: Set earliest invalidated stage
                      else Current role passes
                      XMD->>Issue: Record accepted adjacent handoff
                      XMD->>Project: Advance exactly one stage
                      end
                      end
                      XMD->>Agent: Stage 4 Implementor receives accepted plan
                      Agent-->>XMD: Generated XMD with proposed writes/deletions
                      XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
                      Git-->>XMD: Implementation head SHA
                      XMD->>Git: Checkpoint head, target base, and merge base
                      alt Base synchronization merges cleanly
                      XMD->>Git: Perform trusted merge
                      Git-->>XMD: New head SHA
                      Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
                      XMD->>Git: Run selected evidence and non-force push
                      else Merge conflicts
                      Git-->>XMD: Durable structured conflict evidence
                      XMD->>PR: Link exact SHAs, paths, blob identities, and classes
                      XMD-->>User: Suspend for human resolution in the initial release
                      User->>PR: Resolve and push changed branch
                      PR-->>Actions: Authorized resume signal
                      Actions->>XMD: Resume the same durable run
                      XMD->>PR: Observe new exact head/base revision
                      Note over XMD: Re-enter Stage 4<br/>No review is inherited
                      end
                      XMD->>PR: Create/update draft PR
                      XMD->>PR: Record adjacent handoff with exact head and base SHAs
                      XMD->>Project: Advance to Planner Review (5)
                      XMD->>Agent: Planner Review exact head and base SHAs
                      Agent-->>XMD: Verdict for that exact revision
                      XMD->>PR: Record accepted Planner verdict
                      XMD->>Project: Advance to Architect Review (6)
                      XMD->>Agent: Architect Review same revision and Planner verdict
                      Agent-->>XMD: Verdict for that exact revision
                      XMD->>PR: Record accepted Architect verdict and make PR ready
                      XMD->>Project: Advance to User Review (7)
                      XMD-->>User: Review PR at exact validated head/base revision and handoff chain
                      alt User accepts
                      User-->>XMD: Authorize merge
                      XMD->>PR: Merge with permitted target policy
                      XMD->>Project: Advance to Closed (8)
                      Note over XMD,Issue: Retain merged terminal reason and merge identity
                      else User abandons
                      User-->>XMD: Authorize abandonment
                      XMD->>Project: Advance to Closed (8)
                      Note over XMD,Issue: Retain abandoned terminal reason
                      else User requests changes
                      User-->>XMD: Identify earliest invalidated contract
                      XMD->>Project: Move backward to Stage 1-6
                      Note over XMD,Project: Forward progress traverses every later stage again
                      end
                      
                      Loading

                      Identity and invalidation

                      Two SHA identities remain distinct:

                      1. The XMD workflow definition SHA is immutable for the factory run.
                      2. The implementation revision evolves as { headSha, baseSha }.

                      Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
                      Any change to headSha remains or returns to Stage 4 and invalidates Stages
                      5-7. Base movement without a head change invalidates Stage 5; if synchronization
                      or implementation work is required, it returns to Stage 4.

                      The initial synchronization policy merges the latest base into the published
                      implementation branch. It uses the ordinary reconciled non-force Push effect.
                      Rebases, force pushes, and force-with-lease are outside this issue.

                      Record and authority boundaries

                      • The issue owns product intent, architecture, planning, and the transition into
                        implementation. Issue comments record Stages 1-3.
                      • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
                        The draft PR owns implementation iterations and Stages 5-7.
                      • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
                        issue and a short link on the PR. Crossing back into implementation links the
                        accepted issue handoff from the PR.
                      • Comments are the human-readable transition record. The XMD journal is the
                        durable execution record. The Project status is a projection of that record.
                      • The Agent decides desired contents. XMD inspects Git, applies admitted file
                        effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
                        reconciles interruption.
                      • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
                        checkout, native-tool, or equivalent MCP authority.

                      Acceptance criteria

                      • One GitHub issue maps to one durable XMD factory run across every Stage 4
                        revision.
                      • The Project exposes the nine settled statuses and XMD enforces adjacent
                        forward transitions.
                      • Same-stage iteration and backward invalidation preserve history while
                        replacing the active validation frontier.
                      • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
                        environment; it owns no role outcome or transition decision.
                      • Stage 1-3 handoffs are recorded on the issue using the settled crossing
                        rules.
                      • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
                        { headSha, baseSha }.
                      • Planner, Architect, and User review conclusions are accepted only for the
                        exact current revision.
                      • A changed head returns to Stage 4; a base-only change returns to Stage 5
                        unless Stage 4 work is required.
                      • Clean base merges create a new Stage 4 revision, run the selected evidence,
                        and publish through a normal non-force push.
                      • A conflicted merge records exact head, base, merge base, conflict paths,
                        base/ours/theirs blob identities, and conflict classifications.
                      • Unsupported conflict forms suspend without granting the Agent additional
                        authority.
                      • A manually changed branch is observed as a new exact revision and re-enters
                        Stage 4 before review.
                      • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
                        Stage 7 -> 8 transition with its terminal reason retained.
                      • Interrupted GitHub effects reconcile under stable identities rather than
                        being repeated blindly.
                      • Rebases and force pushes are refused.

                      Initial release decision

                      Decide before Planner readiness:

                      • Implement structured generated-XMD resolution for ordinary text conflicts
                        in the first release; or
                      • Suspend for human resolution on every conflict.

                      Architecture recommendation: choose the second option. Automatically perform
                      clean merges, suspend on every conflict, prohibit rebases and force pushes, and
                      add structured ordinary-text resolution later as a separately bounded
                      capability.

                      Deployment decisions before readiness

                      • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
                        provider shared by ephemeral Actions runners.
                      • Select the authorized Project admission, human-answer, and resume ingress and
                        its actor authentication.
                      • Select the GitHub principal and exact repository, issue, pull-request, Project,
                        merge, and abandonment permission ceilings.

                      Architecture

                      Activity

                      Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                      Metadata

                      Metadata

                      Assignees

                      No one assigned

                        Labels

                        No labels
                        No labels

                        Projects

                        No projects

                          Milestone

                          No milestone

                          Relationships

                          None yet

                          Development

                          No branches or pull requests

                          Issue actions

                          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                          Skip to content

                          🏭 Build the GitHub Actions-hosted AI software factory #633

                          Description

                          @taras

                          Why

                          Build the GitHub Actions-hosted AI Software Factory specified in draft PR
                          #630.

                          The factory turns one issue into one durable XMD run whose current owner is
                          projected on a GitHub Project. Product intent, architecture, planning,
                          implementation, and review accumulate as an accepted handoff chain. GitHub
                          Actions invokes the run; XMD owns the procedure, transitions, effects, and
                          journal. There is no separate controller.

                          Settled lifecycle

                          StageStatus
                          0Backlog
                          1User
                          2Architect
                          3Planner
                          4Implementor
                          5Planner Review
                          6Architect Review
                          7User Review
                          8Closed

                          Forward progress is strictly adjacent:

                          1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
                          

                          A backward transition may jump to the earliest invalidated contract, but every
                          later stage runs again. Same-stage correction is iteration, not progress.

                          Ownership bands

                          Each horizontal band belongs to one participant. The User forms the base,
                          Architect and Planner progressively narrow uncertainty, and implementation is
                          the apex. Validation returns through the paired prompt on each band.

                          AI Software Factory ownership bands

                          Feedback through preparation

                          An implementation question descends only as far as the earliest contract that
                          does not resolve it. Each participant can stop an unnecessary invalidation and
                          send the work forward again.

                          flowchart TB
                          I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
                          P3 -->|Yes - clarify and return| I4
                          P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
                          A2 -->|Yes - send forward| P3
                          A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
                          
                          Loading

                          Feedback through validation

                          Review feedback bubbles toward implementation through the validation roles.
                          Only a proven upstream gap crosses the apex and descends the preparation side.

                          flowchart BT
                          U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
                          A6 -->|No - return forward| U7
                          A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
                          P5 -->|No - return forward| A6
                          P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
                          I4 -->|New revision| P5
                          I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
                          P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
                          A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
                          
                          Loading

                          Sequence

                          sequenceDiagram
                          autonumber
                          actor User
                          participant Project as GitHub Project
                          participant Actions as GitHub Actions
                          participant XMD as Durable XMD workflow
                          participant Agent as Current role Agent
                          participant Issue as GitHub Issue
                          participant Git as Workspace + Git
                          participant PR as Draft Pull Request
                          User->>Project: Assign Issue from Backlog (0) to User (1)
                          Project-->>Actions: Authorized intake signal
                          Actions->>XMD: Start run for issue at immutable definition SHA
                          Note over XMD: One issue = one durable run<br/>Definition SHA never changes
                          loop Stages 1-3 remove uncertainty
                          XMD->>Agent: Render accepted chain and invoke current role
                          Agent-->>XMD: Structured outcome
                          alt Same-stage amendment
                          XMD->>Issue: Record iteration
                          XMD->>Project: Keep current stage
                          else Earlier contract invalidated
                          XMD->>Issue: Record full backward handoff
                          XMD->>Project: Set earliest invalidated stage
                          else Current role passes
                          XMD->>Issue: Record accepted adjacent handoff
                          XMD->>Project: Advance exactly one stage
                          end
                          end
                          XMD->>Agent: Stage 4 Implementor receives accepted plan
                          Agent-->>XMD: Generated XMD with proposed writes/deletions
                          XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
                          Git-->>XMD: Implementation head SHA
                          XMD->>Git: Checkpoint head, target base, and merge base
                          alt Base synchronization merges cleanly
                          XMD->>Git: Perform trusted merge
                          Git-->>XMD: New head SHA
                          Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
                          XMD->>Git: Run selected evidence and non-force push
                          else Merge conflicts
                          Git-->>XMD: Durable structured conflict evidence
                          XMD->>PR: Link exact SHAs, paths, blob identities, and classes
                          XMD-->>User: Suspend for human resolution in the initial release
                          User->>PR: Resolve and push changed branch
                          PR-->>Actions: Authorized resume signal
                          Actions->>XMD: Resume the same durable run
                          XMD->>PR: Observe new exact head/base revision
                          Note over XMD: Re-enter Stage 4<br/>No review is inherited
                          end
                          XMD->>PR: Create/update draft PR
                          XMD->>PR: Record adjacent handoff with exact head and base SHAs
                          XMD->>Project: Advance to Planner Review (5)
                          XMD->>Agent: Planner Review exact head and base SHAs
                          Agent-->>XMD: Verdict for that exact revision
                          XMD->>PR: Record accepted Planner verdict
                          XMD->>Project: Advance to Architect Review (6)
                          XMD->>Agent: Architect Review same revision and Planner verdict
                          Agent-->>XMD: Verdict for that exact revision
                          XMD->>PR: Record accepted Architect verdict and make PR ready
                          XMD->>Project: Advance to User Review (7)
                          XMD-->>User: Review PR at exact validated head/base revision and handoff chain
                          alt User accepts
                          User-->>XMD: Authorize merge
                          XMD->>PR: Merge with permitted target policy
                          XMD->>Project: Advance to Closed (8)
                          Note over XMD,Issue: Retain merged terminal reason and merge identity
                          else User abandons
                          User-->>XMD: Authorize abandonment
                          XMD->>Project: Advance to Closed (8)
                          Note over XMD,Issue: Retain abandoned terminal reason
                          else User requests changes
                          User-->>XMD: Identify earliest invalidated contract
                          XMD->>Project: Move backward to Stage 1-6
                          Note over XMD,Project: Forward progress traverses every later stage again
                          end
                          
                          Loading

                          Identity and invalidation

                          Two SHA identities remain distinct:

                          1. The XMD workflow definition SHA is immutable for the factory run.
                          2. The implementation revision evolves as { headSha, baseSha }.

                          Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
                          Any change to headSha remains or returns to Stage 4 and invalidates Stages
                          5-7. Base movement without a head change invalidates Stage 5; if synchronization
                          or implementation work is required, it returns to Stage 4.

                          The initial synchronization policy merges the latest base into the published
                          implementation branch. It uses the ordinary reconciled non-force Push effect.
                          Rebases, force pushes, and force-with-lease are outside this issue.

                          Record and authority boundaries

                          • The issue owns product intent, architecture, planning, and the transition into
                            implementation. Issue comments record Stages 1-3.
                          • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
                            The draft PR owns implementation iterations and Stages 5-7.
                          • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
                            issue and a short link on the PR. Crossing back into implementation links the
                            accepted issue handoff from the PR.
                          • Comments are the human-readable transition record. The XMD journal is the
                            durable execution record. The Project status is a projection of that record.
                          • The Agent decides desired contents. XMD inspects Git, applies admitted file
                            effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
                            reconciles interruption.
                          • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
                            checkout, native-tool, or equivalent MCP authority.

                          Acceptance criteria

                          • One GitHub issue maps to one durable XMD factory run across every Stage 4
                            revision.
                          • The Project exposes the nine settled statuses and XMD enforces adjacent
                            forward transitions.
                          • Same-stage iteration and backward invalidation preserve history while
                            replacing the active validation frontier.
                          • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
                            environment; it owns no role outcome or transition decision.
                          • Stage 1-3 handoffs are recorded on the issue using the settled crossing
                            rules.
                          • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
                            { headSha, baseSha }.
                          • Planner, Architect, and User review conclusions are accepted only for the
                            exact current revision.
                          • A changed head returns to Stage 4; a base-only change returns to Stage 5
                            unless Stage 4 work is required.
                          • Clean base merges create a new Stage 4 revision, run the selected evidence,
                            and publish through a normal non-force push.
                          • A conflicted merge records exact head, base, merge base, conflict paths,
                            base/ours/theirs blob identities, and conflict classifications.
                          • Unsupported conflict forms suspend without granting the Agent additional
                            authority.
                          • A manually changed branch is observed as a new exact revision and re-enters
                            Stage 4 before review.
                          • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
                            Stage 7 -> 8 transition with its terminal reason retained.
                          • Interrupted GitHub effects reconcile under stable identities rather than
                            being repeated blindly.
                          • Rebases and force pushes are refused.

                          Initial release decision

                          Decide before Planner readiness:

                          • Implement structured generated-XMD resolution for ordinary text conflicts
                            in the first release; or
                          • Suspend for human resolution on every conflict.

                          Architecture recommendation: choose the second option. Automatically perform
                          clean merges, suspend on every conflict, prohibit rebases and force pushes, and
                          add structured ordinary-text resolution later as a separately bounded
                          capability.

                          Deployment decisions before readiness

                          • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
                            provider shared by ephemeral Actions runners.
                          • Select the authorized Project admission, human-answer, and resume ingress and
                            its actor authentication.
                          • Select the GitHub principal and exact repository, issue, pull-request, Project,
                            merge, and abandonment permission ceilings.

                          Architecture

                          Activity

                          Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                          Metadata

                          Metadata

                          Assignees

                          No one assigned

                            Labels

                            No labels
                            No labels

                            Projects

                            No projects

                              Milestone

                              No milestone

                              Relationships

                              None yet

                              Development

                              No branches or pull requests

                              Issue actions

                              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                              Skip to content

                              🏭 Build the GitHub Actions-hosted AI software factory #633

                              Description

                              @taras

                              Why

                              Build the GitHub Actions-hosted AI Software Factory specified in draft PR
                              #630.

                              The factory turns one issue into one durable XMD run whose current owner is
                              projected on a GitHub Project. Product intent, architecture, planning,
                              implementation, and review accumulate as an accepted handoff chain. GitHub
                              Actions invokes the run; XMD owns the procedure, transitions, effects, and
                              journal. There is no separate controller.

                              Settled lifecycle

                              StageStatus
                              0Backlog
                              1User
                              2Architect
                              3Planner
                              4Implementor
                              5Planner Review
                              6Architect Review
                              7User Review
                              8Closed

                              Forward progress is strictly adjacent:

                              1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
                              

                              A backward transition may jump to the earliest invalidated contract, but every
                              later stage runs again. Same-stage correction is iteration, not progress.

                              Ownership bands

                              Each horizontal band belongs to one participant. The User forms the base,
                              Architect and Planner progressively narrow uncertainty, and implementation is
                              the apex. Validation returns through the paired prompt on each band.

                              AI Software Factory ownership bands

                              Feedback through preparation

                              An implementation question descends only as far as the earliest contract that
                              does not resolve it. Each participant can stop an unnecessary invalidation and
                              send the work forward again.

                              flowchart TB
                              I4["4 Implement Issue"] -->|Question| P3{"3 Planner<br/>Does the existing plan resolve it?"}
                              P3 -->|Yes - clarify and return| I4
                              P3 -->|No| A2{"2 Architect<br/>Does the specification cover it?"}
                              A2 -->|Yes - send forward| P3
                              A2 -->|No - real product gap| U1["1 User<br/>Make product decision"]
                              
                              Loading

                              Feedback through validation

                              Review feedback bubbles toward implementation through the validation roles.
                              Only a proven upstream gap crosses the apex and descends the preparation side.

                              flowchart BT
                              U7["7 User<br/>Review PR"] -->|Feedback| A6{"6 Architect<br/>Specification issue?"}
                              A6 -->|No - return forward| U7
                              A6 -->|Yes or uncertain| P5{"5 Planner<br/>Plan or evidence issue?"}
                              P5 -->|No - return forward| A6
                              P5 -->|Implementation correction| I4["4 Implementor<br/>Correct implementation"]
                              I4 -->|New revision| P5
                              I4 -->|Plan gap| P3["3 Planner<br/>Prepare Issue"]
                              P3 -->|Specification gap| A2["2 Architect<br/>Review Issue"]
                              A2 -->|Product gap| U1["1 User<br/>Assign Issue"]
                              
                              Loading

                              Sequence

                              sequenceDiagram
                              autonumber
                              actor User
                              participant Project as GitHub Project
                              participant Actions as GitHub Actions
                              participant XMD as Durable XMD workflow
                              participant Agent as Current role Agent
                              participant Issue as GitHub Issue
                              participant Git as Workspace + Git
                              participant PR as Draft Pull Request
                              User->>Project: Assign Issue from Backlog (0) to User (1)
                              Project-->>Actions: Authorized intake signal
                              Actions->>XMD: Start run for issue at immutable definition SHA
                              Note over XMD: One issue = one durable run<br/>Definition SHA never changes
                              loop Stages 1-3 remove uncertainty
                              XMD->>Agent: Render accepted chain and invoke current role
                              Agent-->>XMD: Structured outcome
                              alt Same-stage amendment
                              XMD->>Issue: Record iteration
                              XMD->>Project: Keep current stage
                              else Earlier contract invalidated
                              XMD->>Issue: Record full backward handoff
                              XMD->>Project: Set earliest invalidated stage
                              else Current role passes
                              XMD->>Issue: Record accepted adjacent handoff
                              XMD->>Project: Advance exactly one stage
                              end
                              end
                              XMD->>Agent: Stage 4 Implementor receives accepted plan
                              Agent-->>XMD: Generated XMD with proposed writes/deletions
                              XMD->>Git: Admit scoped mutations, stage, commit, and run evidence
                              Git-->>XMD: Implementation head SHA
                              XMD->>Git: Checkpoint head, target base, and merge base
                              alt Base synchronization merges cleanly
                              XMD->>Git: Perform trusted merge
                              Git-->>XMD: New head SHA
                              Note over XMD,Git: Remain at Stage 4<br/>Stages 5-7 are invalidated
                              XMD->>Git: Run selected evidence and non-force push
                              else Merge conflicts
                              Git-->>XMD: Durable structured conflict evidence
                              XMD->>PR: Link exact SHAs, paths, blob identities, and classes
                              XMD-->>User: Suspend for human resolution in the initial release
                              User->>PR: Resolve and push changed branch
                              PR-->>Actions: Authorized resume signal
                              Actions->>XMD: Resume the same durable run
                              XMD->>PR: Observe new exact head/base revision
                              Note over XMD: Re-enter Stage 4<br/>No review is inherited
                              end
                              XMD->>PR: Create/update draft PR
                              XMD->>PR: Record adjacent handoff with exact head and base SHAs
                              XMD->>Project: Advance to Planner Review (5)
                              XMD->>Agent: Planner Review exact head and base SHAs
                              Agent-->>XMD: Verdict for that exact revision
                              XMD->>PR: Record accepted Planner verdict
                              XMD->>Project: Advance to Architect Review (6)
                              XMD->>Agent: Architect Review same revision and Planner verdict
                              Agent-->>XMD: Verdict for that exact revision
                              XMD->>PR: Record accepted Architect verdict and make PR ready
                              XMD->>Project: Advance to User Review (7)
                              XMD-->>User: Review PR at exact validated head/base revision and handoff chain
                              alt User accepts
                              User-->>XMD: Authorize merge
                              XMD->>PR: Merge with permitted target policy
                              XMD->>Project: Advance to Closed (8)
                              Note over XMD,Issue: Retain merged terminal reason and merge identity
                              else User abandons
                              User-->>XMD: Authorize abandonment
                              XMD->>Project: Advance to Closed (8)
                              Note over XMD,Issue: Retain abandoned terminal reason
                              else User requests changes
                              User-->>XMD: Identify earliest invalidated contract
                              XMD->>Project: Move backward to Stage 1-6
                              Note over XMD,Project: Forward progress traverses every later stage again
                              end
                              
                              Loading

                              Identity and invalidation

                              Two SHA identities remain distinct:

                              1. The XMD workflow definition SHA is immutable for the factory run.
                              2. The implementation revision evolves as { headSha, baseSha }.

                              Every Stage 5-7 conclusion names the exact implementation revision it reviewed.
                              Any change to headSha remains or returns to Stage 4 and invalidates Stages
                              5-7. Base movement without a head change invalidates Stage 5; if synchronization
                              or implementation work is required, it returns to Stage 4.

                              The initial synchronization policy merges the latest base into the published
                              implementation branch. It uses the ordinary reconciled non-force Push effect.
                              Rebases, force pushes, and force-with-lease are outside this issue.

                              Record and authority boundaries

                              • The issue owns product intent, architecture, planning, and the transition into
                                implementation. Issue comments record Stages 1-3.
                              • Stage 4 creates or updates a draft PR before its first Planner Review handoff.
                                The draft PR owns implementation iterations and Stages 5-7.
                              • Crossing backward from the PR to Stages 1-3 writes the full handoff on the
                                issue and a short link on the PR. Crossing back into implementation links the
                                accepted issue handoff from the PR.
                              • Comments are the human-readable transition record. The XMD journal is the
                                durable execution record. The Project status is a projection of that record.
                              • The Agent decides desired contents. XMD inspects Git, applies admitted file
                                effects, stages, commits, merges, runs evidence, pushes, updates GitHub, and
                                reconciles interruption.
                              • The workflow Agent receives no Git, filesystem, shell, GitHub, Workspace,
                                checkout, native-tool, or equivalent MCP authority.

                              Acceptance criteria

                              • One GitHub issue maps to one durable XMD factory run across every Stage 4
                                revision.
                              • The Project exposes the nine settled statuses and XMD enforces adjacent
                                forward transitions.
                              • Same-stage iteration and backward invalidation preserve history while
                                replacing the active validation frontier.
                              • GitHub Actions only starts or resumes XMD and supplies a bounded GitHub
                                environment; it owns no role outcome or transition decision.
                              • Stage 1-3 handoffs are recorded on the issue using the settled crossing
                                rules.
                              • Stage 4 creates or updates a draft PR and hands Stage 5 its exact
                                { headSha, baseSha }.
                              • Planner, Architect, and User review conclusions are accepted only for the
                                exact current revision.
                              • A changed head returns to Stage 4; a base-only change returns to Stage 5
                                unless Stage 4 work is required.
                              • Clean base merges create a new Stage 4 revision, run the selected evidence,
                                and publish through a normal non-force push.
                              • A conflicted merge records exact head, base, merge base, conflict paths,
                                base/ours/theirs blob identities, and conflict classifications.
                              • Unsupported conflict forms suspend without granting the Agent additional
                                authority.
                              • A manually changed branch is observed as a new exact revision and re-enters
                                Stage 4 before review.
                              • Stage 6 alone may make the PR ready. Merge or abandonment is the adjacent
                                Stage 7 -> 8 transition with its terminal reason retained.
                              • Interrupted GitHub effects reconcile under stable identities rather than
                                being repeated blindly.
                              • Rebases and force pushes are refused.

                              Initial release decision

                              Decide before Planner readiness:

                              • Implement structured generated-XMD resolution for ordinary text conflicts
                                in the first release; or
                              • Suspend for human resolution on every conflict.

                              Architecture recommendation: choose the second option. Automatically perform
                              clean merges, suspend on every conflict, prohibit rebases and force pushes, and
                              add structured ordinary-text resolution later as a separately bounded
                              capability.

                              Deployment decisions before readiness

                              • Select the durable WorkflowRun, Workspace, Agent-session, and executor-lock
                                provider shared by ephemeral Actions runners.
                              • Select the authorized Project admission, human-answer, and resume ingress and
                                its actor authentication.
                              • Select the GitHub principal and exact repository, issue, pull-request, Project,
                                merge, and abandonment permission ceilings.

                              Architecture

                              Activity

                              Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                              Metadata

                              Metadata

                              Assignees

                              No one assigned

                                Labels

                                No labels
                                No labels

                                Projects

                                No projects

                                  Milestone

                                  No milestone

                                  Relationships

                                  None yet

                                  Development

                                  No branches or pull requests

                                  Issue actions