This commit is contained in:
@@ -64,6 +64,14 @@ class DeliverableSpec:
|
||||
depends_on: tuple[DeliverableKind, ...] = ()
|
||||
sections: tuple[str, ...] = ()
|
||||
attachments: tuple[str, ...] = ()
|
||||
# Which earlier Deliverables the Specialist reads whole. None means the ones it
|
||||
# depends on. Every other input arrives as its data file alone: the ids the
|
||||
# Requirements chain runs through, without the prose written around them.
|
||||
reads_in_full: tuple[DeliverableKind, ...] | None = None
|
||||
# The Deliverable whose files this Specialist's tools work on. Its own kind: the
|
||||
# files are its working copy, kept across attempts and attached on submission.
|
||||
# Another kind: a fresh copy of that Deliverable's files on every attempt.
|
||||
working_copy: DeliverableKind | None = None
|
||||
|
||||
def contract(self) -> dict[str, list[str]]:
|
||||
"""What a submission must contain, as plain data for the Specialist's context."""
|
||||
@@ -126,8 +134,10 @@ DEPENDENCY_GRAPH: Mapping[DeliverableKind, DeliverableSpec] = {
|
||||
PhaseId.SOLUTION_ARCHITECTURE,
|
||||
"target-architect",
|
||||
depends_on=(_K.PRODUCT_SELECTION, _K.DESIGN_RECOMMENDATIONS),
|
||||
sections=("Elements", "Relationships", "Checks"),
|
||||
# The engine adds architecture.mmd, rendered from the graph, on submission.
|
||||
# The Specialist writes the reasoning and the graph. On submission the
|
||||
# engine adds the Elements, Relationships and Checks tables to the content
|
||||
# and architecture.mmd to the attachments, both rendered from the graph.
|
||||
sections=("Design rationale",),
|
||||
attachments=(GRAPH_ATTACHMENT,),
|
||||
),
|
||||
DeliverableSpec(
|
||||
@@ -151,6 +161,9 @@ DEPENDENCY_GRAPH: Mapping[DeliverableKind, DeliverableSpec] = {
|
||||
"terraform/variables.tf",
|
||||
IMPLEMENTATION_FILE,
|
||||
),
|
||||
# The graph is all the code is written from.
|
||||
reads_in_full=(),
|
||||
working_copy=_K.DEPLOYMENT_GUIDANCE,
|
||||
),
|
||||
DeliverableSpec(
|
||||
_K.VALIDATION_RESULTS,
|
||||
@@ -159,6 +172,7 @@ DEPENDENCY_GRAPH: Mapping[DeliverableKind, DeliverableSpec] = {
|
||||
depends_on=(_K.DEPLOYMENT_GUIDANCE,),
|
||||
sections=("Deployment dry-run", "Architecture and policy analysis"),
|
||||
attachments=(VERDICTS_FILE,),
|
||||
working_copy=_K.DEPLOYMENT_GUIDANCE,
|
||||
),
|
||||
DeliverableSpec(
|
||||
_K.SOLUTION_GUIDE,
|
||||
@@ -175,6 +189,8 @@ DEPENDENCY_GRAPH: Mapping[DeliverableKind, DeliverableSpec] = {
|
||||
"Validation plan",
|
||||
"References",
|
||||
),
|
||||
# The guide is assembled from every Deliverable's prose.
|
||||
reads_in_full=tuple(_K)[:-1],
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -218,6 +234,31 @@ def inputs_of(kind: DeliverableKind) -> tuple[DeliverableKind, ...]:
|
||||
)
|
||||
|
||||
|
||||
def dependencies_for(
|
||||
kind: DeliverableKind, deliverables: Mapping[str, Mapping[str, object]]
|
||||
) -> dict[str, dict[str, object]]:
|
||||
"""What a Specialist is given of each Deliverable it works from.
|
||||
|
||||
A Deliverable read in full arrives as submitted. Any other arrives as its data
|
||||
file alone, which is all the Requirements chain needs of it.
|
||||
"""
|
||||
spec = DEPENDENCY_GRAPH[kind]
|
||||
in_full = spec.depends_on if spec.reads_in_full is None else spec.reads_in_full
|
||||
given: dict[str, dict[str, object]] = {}
|
||||
for dependency in inputs_of(kind):
|
||||
deliverable = deliverables[dependency.value]
|
||||
if dependency in in_full or dependency not in DATA_CHECKS:
|
||||
given[dependency.value] = dict(deliverable)
|
||||
continue
|
||||
name = DATA_CHECKS[dependency][0]
|
||||
attachments = deliverable.get("attachments")
|
||||
files = attachments if isinstance(attachments, Mapping) else {}
|
||||
given[dependency.value] = {
|
||||
"attachments": {name: files[name]} if name in files else {}
|
||||
}
|
||||
return given
|
||||
|
||||
|
||||
def deliverables_in(phase: PhaseId) -> tuple[DeliverableKind, ...]:
|
||||
return tuple(kind for kind, spec in DEPENDENCY_GRAPH.items() if spec.phase is phase)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user