feat: keep an unchanged description, list conditions, review coverage with Jev
After case 02 (completed at 100%, but with two Revisions of the Target architecture for gaps validation found one pass at a time): - A Deliverable stands while what it was written from is unchanged. The architecture description is written from the Elements and Relationships, so a Revision that only adds or rewords Checks no longer runs the describer. - Non-functional requirements and recommendations list their conditions, one entry per separate thing that must be true; submission requires them. - A coverage review at submission (JEV_COVERAGE_REVIEW, off by default): for each condition, Jev chooses which Check verifies it, or none. Asked as one broad yes-or-no per requirement it could not tell a complete design from one with known gaps; asked as a choice per condition it raised all four known gaps of case 02 and nothing on the complete graph. An opt-in live test (LIVE_JEV=1) repeats that. - The validator is told to report every gap in its first pass. Plans record the case 02 run and both forms of the review with figures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ from app.adk.runtime import (
|
||||
RoleSpec,
|
||||
RunLimiter,
|
||||
Stopped,
|
||||
SubmissionReview,
|
||||
Submitted,
|
||||
ToolFactory,
|
||||
ToolSpec,
|
||||
@@ -61,6 +62,9 @@ from app.workflows.deliverables import (
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Working-memory key: the last submission of a Deliverable with what it was written from.
|
||||
STANDING = "standing"
|
||||
|
||||
NO_USER_REPLY = (
|
||||
"No user is available. State your assumption, record it in the Deliverable under "
|
||||
"'Assumptions', and proceed."
|
||||
@@ -98,6 +102,7 @@ def make_execution_nodes(
|
||||
limiter: RunLimiter | None = None,
|
||||
skill_versions: Mapping[str, str] | None = None,
|
||||
orchestrator: OrchestratorPolicy | None = None,
|
||||
submission_review: SubmissionReview | None = None,
|
||||
) -> ExecutionNodes:
|
||||
tool_factory = tool_factory or _no_tools
|
||||
# How an Orchestrator turn is decided. The default drives the tools from the
|
||||
@@ -357,6 +362,48 @@ def make_execution_nodes(
|
||||
working[workspace.FILES] = dict(
|
||||
upstream.get(source.value, {}).get("attachments", {})
|
||||
)
|
||||
spec = DEPENDENCY_GRAPH[kind]
|
||||
# Feedback on this Deliverable itself. A note that a dependency was revised
|
||||
# is not a reason to write it again; the basis says whether that matters.
|
||||
feedback = [
|
||||
item
|
||||
for item in task_input["context"].get("feedback") or []
|
||||
if not str(item).startswith("Dependency ")
|
||||
]
|
||||
basis = spec.written_from(upstream) if spec.written_from else None
|
||||
standing = working.get(STANDING)
|
||||
if (
|
||||
basis
|
||||
and isinstance(standing, Mapping)
|
||||
and standing.get("basis") == basis
|
||||
and standing.get("feedback") == feedback
|
||||
):
|
||||
# What it was written from has not changed, so the last submission
|
||||
# still stands: no Specialist is run.
|
||||
logger.info(
|
||||
"[%s] %s kept %s (attempt %d): written from an unchanged basis",
|
||||
task_input["execution_id"],
|
||||
role.name,
|
||||
kind,
|
||||
task_input["attempt"],
|
||||
)
|
||||
kept = Submitted(standing["content"], dict(standing["attachments"]))
|
||||
return {
|
||||
"outcomes": [
|
||||
{
|
||||
**_outcome_record(role.name, kind, task_input["attempt"], kept),
|
||||
"refusals": [],
|
||||
}
|
||||
],
|
||||
"working": {kind.value: working},
|
||||
}
|
||||
|
||||
async def review(attachments: Mapping[str, str]) -> Sequence[str]:
|
||||
assert submission_review is not None
|
||||
return await submission_review(
|
||||
kind, attachments, upstream, task_input["execution_id"]
|
||||
)
|
||||
|
||||
refusals: list[dict[str, Any]] = []
|
||||
tools = _noting_refusals(
|
||||
specialist_tools(
|
||||
@@ -366,6 +413,7 @@ def make_execution_nodes(
|
||||
upstream=upstream,
|
||||
working=working,
|
||||
library=task_input.get("library"),
|
||||
review=review if submission_review else None,
|
||||
),
|
||||
refusals,
|
||||
role.name,
|
||||
@@ -402,6 +450,13 @@ def make_execution_nodes(
|
||||
time.monotonic() - started,
|
||||
_summarise_outcome(outcome),
|
||||
)
|
||||
if basis and isinstance(outcome, Submitted):
|
||||
working[STANDING] = {
|
||||
"basis": basis,
|
||||
"feedback": feedback,
|
||||
"content": outcome.content,
|
||||
"attachments": dict(outcome.attachments),
|
||||
}
|
||||
return {
|
||||
"outcomes": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user