feat: a work breakdown structure with a computed timeline (iteration 10)
Some checks failed
validation / verify (push) Failing after 10s

A new Deliverable in the packaging Phase, produced by a delivery planner
after validation.

- The planner writes the plan as data: work packages that name the Elements
  they deliver, and activities with days, what each follows, and whether the
  team or the customer owns it.
- Code checks the plan against the design: every Element belongs to a work
  package, and the activities can be scheduled.
- Code computes the schedule, with no more of the team's activities at once
  than the team has people, and the critical path.
- Code writes the WBS dictionary (a work package is done when the Checks on
  its Elements pass), the activity sequence and a timeline on a relative axis
  from Day 0.
- The plan is checked against the delivery window from the agreed scope; over
  it, the Deliverable says by how much and names the critical path.
- With a start date it also gives calendar dates and a Mermaid Gantt chart.
- The timeline is added to the solution guide, and the plan's length is in
  execution.json and the packaging Approval.

Not run with real models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 19:54:17 +01:00
parent 0f80cb642f
commit f54af24169
21 changed files with 1108 additions and 12 deletions

View File

@@ -4,10 +4,15 @@ Every Execution now begins with the scoping Phase (ADR-0008). A test about
requirements, design or validation is not about that, so these run scoping ahead
of the test's own script and leave the test where it always started: requirements
ready, nothing recorded of how the scope was agreed.
The work breakdown structure (iteration 10) is produced beside the solution guide.
A script written before it existed delegates the guide alone; here the plan is
delegated with it, and planned without a script.
"""
from __future__ import annotations
import dataclasses
from typing import Any
from app.adk.fake_runtime import FakeAgentRuntime, sample_submission
@@ -16,9 +21,28 @@ from app.agent import ExecutionEngine, Interaction
from app.workflows.deliverables import DEPENDENCY_GRAPH, DeliverableKind, PhaseId
SCOPE_ANALYST = DEPENDENCY_GRAPH[DeliverableKind.SCOPE].specialist
PLANNER = DEPENDENCY_GRAPH[DeliverableKind.WORK_BREAKDOWN].specialist
ORCHESTRATOR = "orchestrator"
def _with_the_plan(tool): # type: ignore[no-untyped-def]
"""`delegate`, delegating the work breakdown structure whenever the solution
guide is delegated."""
if tool.name != "delegate":
return tool
guide, plan = (
DeliverableKind.SOLUTION_GUIDE.value,
DeliverableKind.WORK_BREAKDOWN.value,
)
async def delegate(kinds, **rest): # type: ignore[no-untyped-def]
if guide in kinds and plan not in kinds:
kinds = [*kinds, plan]
return await tool.handler(kinds=kinds, **rest)
return dataclasses.replace(tool, handler=delegate)
class ScopedRuntime(FakeAgentRuntime):
"""A scripted runtime that first has the scope produced and its Approval asked
for, outside the script and outside `runs`."""
@@ -29,6 +53,11 @@ class ScopedRuntime(FakeAgentRuntime):
async def run(self, role, task, tools): # type: ignore[no-untyped-def]
by_name = {tool.name: tool for tool in tools}
if role.name == PLANNER and not self.remaining(PLANNER):
call = sample_submission(DeliverableKind.WORK_BREAKDOWN)
return Submitted(call.args["content"], call.args["attachments"])
if role.name == ORCHESTRATOR and "delegate" in by_name:
tools = [_with_the_plan(tool) for tool in tools]
if role.name == SCOPE_ANALYST and not self.remaining(SCOPE_ANALYST):
# Submitted as it stands: a test about a later Deliverable's draft is
# not asking whether the scope's draft was shown first.