Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ egg takes a GitHub issue through a phased pipeline where the agent cannot skip s
3. **Implement** — Agent creates a draft PR and implements tasks. CI runs, automated review provides line-level feedback. Re-implementation cycles continue until all checks pass.
4. **Merge** — Draft PR is marked ready. Only a human can merge via GitHub UI.

The pipeline state lives in a JSON contract (`.egg-state/contracts/{issue}.json`) committed to the feature branch, giving full auditability of every phase transition.
The pipeline state lives in a JSON contract (`.egg-state/contracts/{identifier}.json`) committed to the feature branch, giving full auditability of every phase transition. For issue-mode pipelines, `{identifier}` is the issue number; for local-mode pipelines, it's the pipeline ID.

## The Gateway

Expand Down
6 changes: 3 additions & 3 deletions docs/adr/implemented/ADR-SDLC-Pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This architecture does **not** protect against:
│ ▼ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Contract State │ │
│ │ .egg-state/contracts/{issue}.json │ │
│ │ .egg-state/contracts/{identifier}.json │ │
│ │ - Current phase │ │
│ │ - Phases with tasks │ │
│ │ - Task status and commits │ │
Expand All @@ -86,7 +86,7 @@ This architecture does **not** protect against:
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Contract API │ │
│ │ POST /api/v1/contract/mutate │ │
│ │ GET /api/v1/contract/{issue} │ │
│ │ GET /api/v1/contract/{issue_number} │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
Expand Down Expand Up @@ -223,7 +223,7 @@ If the orchestrator restarts while a pipeline is token-gated, in-memory tokens a

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/contract/{issue}` | GET | Retrieve contract state |
| `/api/v1/contract/{issue_number}` | GET | Retrieve contract state |
| `/api/v1/contract/mutate` | POST | Apply mutation with role enforcement |
| `/api/v1/contract/validate` | POST | Validate mutation without applying |
| `/api/v1/phase/advance` | POST | Advance to next phase |
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ The orchestrator reads pipeline artifacts (verdict files, draft documents, check
- Worktree paths are resolved dynamically based on pipeline ID and repository

**Key artifact files in worktrees:**
- `.egg-state/contracts/{issue}.json` — Contract state
- `.egg-state/drafts/{issue}-analysis.md` — Draft for `refine` phase (special-cased to `analysis`)
- `.egg-state/drafts/{issue}-{phase}.md` — Draft for other phases (e.g., `plan`). No draft for `implement` phase.
- `.egg-state/reviews/{issue}-{phase}-{reviewer_type}-review.json` — Review verdict files
- `.egg-state/contracts/{identifier}.json` — Contract state (issue number for issue-mode, pipeline ID for local-mode)
- `.egg-state/drafts/{identifier}-analysis.md` — Draft for `refine` phase (special-cased to `analysis`)
- `.egg-state/drafts/{identifier}-{phase}.md` — Draft for other phases (e.g., `plan`). No draft for `implement` phase.
- `.egg-state/reviews/{identifier}-{phase}-{reviewer_type}-review.json` — Review verdict files
- `.egg-state/checks/implement-results.json` — Check results from the `implement` phase

**Volume mounts:**
Expand Down
28 changes: 14 additions & 14 deletions docs/guides/sdlc-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Agents cannot be trusted to self-police via prompts alone. The pipeline enforces

### 2. Contract-as-Code

All pipeline state is stored in JSON contracts at `.egg-state/contracts/{issue-number}.json` and committed to the feature branch (not main). This provides:
All pipeline state is stored in JSON contracts at `.egg-state/contracts/{identifier}.json` and committed to the feature branch (not main), where `{identifier}` is the issue number for issue-mode pipelines or the pipeline ID for local-mode pipelines. This provides:

- Auditable history of all state changes
- Recovery from failures without losing progress
Expand Down Expand Up @@ -228,7 +228,7 @@ Multi-agent orchestration is triggered via `.github/workflows/sdlc-multi-agent.y

The refine and plan phases include an automated internal review step before human approval. All reviews happen internally without posting to the issue until approval:

1. **Producer agent runs** — The refine/plan agent writes its output to `.egg-state/drafts/{issue}-{analysis|plan}.md`
1. **Producer agent runs** — The refine/plan agent writes its output to `.egg-state/drafts/{identifier}-{analysis|plan}.md`
2. **Reviewer agents run in parallel** — Each reviewer reads the draft and writes verdict to its own file
3. **Verdicts aggregated** — If any reviewer needs revision, the aggregate verdict is `needs_revision`
4. **If approved** — The final draft is posted to the issue with an approval checkbox for human review
Expand All @@ -239,19 +239,19 @@ The refine and plan phases include an automated internal review step before huma
**File Structure:**
```
.egg-state/
├── contracts/{issue}.json # Contract state
├── contracts/{identifier}.json # Contract state
├── drafts/
│ ├── {issue}-analysis.md # Refine phase draft
│ └── {issue}-plan.md # Plan phase draft
│ ├── {identifier}-analysis.md # Refine phase draft
│ └── {identifier}-plan.md # Plan phase draft
└── reviews/
├── {issue}-refine-review.json # Unified review verdict
├── {issue}-refine-agent-design.json # Agent-design review verdict
├── {issue}-plan-review.json # Unified review verdict
├── {issue}-plan-agent-design.json # Agent-design review verdict
├── {issue}-implement-review.json # Unified review verdict
├── {issue}-implement-agent-design.json
├── {issue}-implement-contract.json
└── {issue}-implement-code.json
├── {identifier}-refine-review.json # Unified review verdict
├── {identifier}-refine-agent-design.json # Agent-design review verdict
├── {identifier}-plan-review.json # Unified review verdict
├── {identifier}-plan-agent-design.json # Agent-design review verdict
├── {identifier}-implement-review.json # Unified review verdict
├── {identifier}-implement-agent-design.json
├── {identifier}-implement-contract.json
└── {identifier}-implement-code.json
```

**Review Verdict JSON Schema:**
Expand Down Expand Up @@ -657,7 +657,7 @@ When a phase is complete and ready for human approval, agents post a comment usi

Tasks are automatically extracted from the plan document and populated into the contract during the plan phase, after the plan document is validated.

The `action/populate-contract-tasks.py` script:
The `action/populate-contract-tasks.py` script (issue-mode only):
1. Fetches the plan comment from the GitHub issue
2. Parses task markers and PR metadata using `shared/egg_contracts/plan_parser.py`
3. Writes phases, tasks, and PR metadata into `.egg-state/contracts/{issue-number}.json`
Expand Down
Loading