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 .egg/schemas/yaml-tasks.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
"goal": {
"type": "string",
"description": "What this slice achieves"
"description": "What this slice achieves. Rendered verbatim as the lead paragraph of the slice's PR body (#3115), so write it as a reviewer-facing summary in plain language — no plan-internal cross-references."
},
"dependencies": {
"type": "string",
Expand Down
14 changes: 14 additions & 0 deletions docs/architecture/sdlc-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ the agent reads to recover the task:
> Slice-1's `parent_branch` resolves to `egg/<id>/work`; the stacked-PR
> reconciler uses the work branch as the canonical fallback when
> retargeting orphaned children.
>
> **Context-PR body composition (#3115).** The opener composes the PR
> body via `_compose_context_pr_body` rather than sending
> `contract.pr.description` verbatim: the planner's `description`, then
> rendered `## Test Plan` / `## Manual Steps` sections from
> `pr.test_plan` / `pr.manual_steps` (these fields were silently dropped
> between #2777 and #3115 despite being preflight-required), then a
> generated `## Pipeline context` footer — pipeline id, originating
> issue, the slice table, and links to the refine analysis draft, the
> plan draft (`.egg-state/drafts/`), and the per-phase BRC transcripts
> (`.egg-state/brc-history/`) committed on the work branch. Artifact
> links are branch-qualified absolute URLs
> (`https://github.com/<repo>/blob/<work-branch>/...`) because GitHub
> resolves relative links in PR bodies against the default branch.

### Schema v1.1 → v1.2 migration note (#2777)

Expand Down
90 changes: 54 additions & 36 deletions docs/architecture/slice-dag.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,50 +502,63 @@ program_test_plan=None, program_manual_steps=None,
program_deferred_actions=None, terminal_slice_id=None, slice_index=None,
slice_count=None, slice_files_affected=None, context_pr_number=None, ...)`
opens one PR per slice (#2745). Slice PRs are scoped to their own slice:
the body shows the slice subject, files affected, and full task
descriptions with acceptance criteria. Strategic context (analysis doc,
plan doc, refine/plan BRC history) lives on the **context PR** —
the body leads with the planner's reviewer-facing slice `goal`, shows
what the branch actually contains (commit subjects + diffstat, #3115),
and carries the slice subject, files affected, and full task
descriptions with acceptance criteria behind a `<details>` fold.
Strategic context (analysis doc, plan doc, refine/plan BRC history)
lives on the **context PR** —
`egg/<pipeline_id>/work → main`, opened up-front at the plan→implement
boundary (#2777) — which slice PRs link to via `context_pr_number`.
Program-level test plan, manual steps, and pre-merge obligations now
live on that context PR (no longer on a "terminal slice umbrella"), so
every slice PR is purely slice-scoped.

- **Title.** `[<program-slug>][<position>] <subject>`, capped at 70
chars (titles longer than that get truncated to `title[:67] + "..."`).
`program-slug` is derived from `pipeline_id`: `issue-<N>` pipelines
collapse to `issue-<N>` (version suffix dropped); `pipeline-<hash>`
pipelines keep a truncated prefix. `position` is `slice-N/M` and
`subject` is the slice name; the legacy `merge-gate` marker and the
program-title fallback on the terminal slice were removed alongside
the umbrella banner (#2777). When `program_title` is empty (older
contracts / planner skipped the field), every slice falls back to
the deterministic `{slice_id}: {slice_name}` form (#2539).
- **Body (slice-scoped, `context_pr_number` present).** Optional
1-line program blurb (first sentence of `program_description`) →
`**Base PR:** #<context_pr_number>` → `## This slice` (slice name,
files affected, full task descriptions + acceptance criteria) →
`## Stack` (position, base PR, base branch). Program-level test
plan, manual steps and pre-merge obligations live on the up-front
context PR (#2777), not on any slice PR.
- **Body (slice-scoped, no `context_pr_number` — should not occur
under #2777).** Because the context PR is opened up-front,
hard-required and idempotent at the plan→implement boundary, every
slice PR sees a populated `context_pr_number`. The legacy "inline
program narrative" backstop body was removed in #2777; if
`context_pr_number` is unexpectedly missing, the slice PR opens
without the `**Base PR:**` line and the stack is non-mergeable until
the operator reconciles the missing context PR.

The `## Stack` block is the human-facing footer, but `_format_stack_block`
also appends a legacy plain-text line (``Slice <slice-id> of pipeline
<pipeline>. Stacked on top of `<base>`.``) after it, preserved so
existing tooling / scrapers that grep for that exact phrase keep
working.
chars; over-long titles truncate at a word boundary (#3115), not the
pre-#3115 hard `title[:67] + "..."` cut that produced mid-word
fragments. `program-slug` is derived from `pipeline_id`: `issue-<N>`
pipelines collapse to `issue-<N>` (version suffix dropped);
`pipeline-<hash>` pipelines keep a truncated prefix. `position` is
`slice-N/M` and `subject` is the slice name; the legacy `merge-gate`
marker and the program-title fallback on the terminal slice were
removed alongside the umbrella banner (#2777). When `program_title`
is empty (older contracts / planner skipped the field), every slice
falls back to the deterministic `{slice_id}: {slice_name}` form
(#2539).
- **Body (uniform shape, #3115).** Lead paragraph — the planner's
reviewer-facing per-slice `goal` from the contract (falls back to
the first sentence of `program_description` for pre-#3115
contracts) → `**Base PR:** #<context_pr_number>` whenever the
number is known (the run loop falls back to `pipeline.pr_number`
when the contract linkage is missing, #3100/#3115) →
`## What's in this PR` (commit subjects + diffstat computed by
`_build_slice_diff_summary` from the pushed integration branch;
best-effort, omitted on any git/fetch failure) → `## This slice`
(slice name, files affected, full task descriptions + acceptance
criteria behind a `<details>` fold) → `## Stack` (position, base
PR, base branch). Program-level test plan, manual steps and
pre-merge obligations live on the up-front context PR (#2777), not
on any slice PR.
- **No `context_pr_number` — should not occur under #2777.** Because
the context PR is opened up-front, hard-required and idempotent at
the plan→implement boundary, every slice PR sees a populated
`context_pr_number`. If it is unexpectedly missing AND the contract
carries program metadata, the program narrative (description + test
plan + manual steps) is inlined around the sections above as a UX
backstop; the stack is non-mergeable until the operator reconciles
the missing context PR.

The `## Stack` block is the body's footer. The legacy plain-text line
(``Slice <slice-id> of pipeline <pipeline>. Stacked on top of
`<base>`.``) that used to follow it was dropped in #3115 — a repo-wide
search found no consumer parsing it.

Task bullets carry full descriptions (the pre-#2745 300-char
truncation is removed) and a nested `Acceptance criteria:` line when
`task.acceptance_criteria` is set.
`task.acceptance_criteria` is set; since #3115 the whole task list
renders inside a collapsed `<details>` block so traceability does not
crowd out the reviewer-facing summary.

`program_deferred_actions` is **terminal-only** by convention — the
merge gate is the last-to-merge PR in the stack, so obligations live
Expand All @@ -560,9 +573,14 @@ every slice (no terminal-slice selection under #2777):
1. For **every** slice: compute 1-based `slice_index` (position in
`contract.slices`) and total `slice_count`; collect
`slice_files_affected` as the union of `task.files_affected` across
the slice's tasks; pass `context_pr_number` from
the slice's tasks; pass `slice_goal` from the contract slice
(#3115); pass `context_pr_number` from
`program_pr.context_pr_number` (the up-front context PR opened by
#2777 at the plan→implement boundary).
#2777 at the plan→implement boundary), falling back to
`pipeline.pr_number` when the contract linkage is missing
(#3100/#3115); compute `commit_subjects` + `diffstat` via
`_build_slice_diff_summary` (best-effort — `(None, None)` on any
fetch/git failure and the PR opens without the section).
2. `program_deferred_actions` is **always `None`** on slice PRs —
pre-merge obligations live on the context PR (#2777), not on any
slice PR.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/sdlc-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ Template sections:
- [TASK-1-2] Add role validation — Acceptance: Unauthorized mutations rejected
```

**PR Metadata**: The plan should include a `pr:` section in the YAML appendix with a title, description, test plan, and manual steps for the pull request. The `test_plan` field is required — describe both automated test coverage and manual verification steps. The `manual_steps` field lists any pre- or post-merge actions (migrations, config changes, deployments); use an empty string if none. The pipeline uses this metadata when creating and finalizing the PR. If not provided, the orchestrator falls back to the issue title (or a generic stub) and opens the PR as a **draft** with a warning banner in the body that lists any parse errors from the plan draft, so reviewers cannot silently merge a PR whose planner metadata is missing (see #1975).
**PR Metadata**: The plan should include a `pr:` section in the YAML appendix with a title, description, test plan, and manual steps for the pull request. The `test_plan` field is required — describe both automated test coverage and manual verification steps. The `manual_steps` field lists any pre- or post-merge actions (migrations, config changes, deployments); use an empty string if none. The context PR's body renders all of these: the description verbatim, then `## Test Plan` / `## Manual Steps` sections, then a generated `## Pipeline context` footer linking the originating issue, the slice table, and the analysis/plan drafts and BRC transcripts committed on the work branch (#3115). Each slice's `goal` field is likewise rendered verbatim as that slice's PR-body lead paragraph, so write it as a reviewer-facing summary. If not provided, the orchestrator falls back to the issue title (or a generic stub) and opens the PR as a **draft** with a warning banner in the body that lists any parse errors from the plan draft, so reviewers cannot silently merge a PR whose planner metadata is missing (see #1975).

### Phase Completion Comments

Expand Down
Loading
Loading