Harden clarification provenance validation#679
Conversation
There was a problem hiding this comment.
💡 Codex Review
SpecGraph/tools/real_idea_answer_authoring.py
Lines 1369 to 1370 in 6ae0519
When the current clarification report has no open requests but still retains closed rows such as preview_applied (the new closed-row behavior exercised by test_closed_clarification_rows_are_not_required), build_template now produces a ready clarification_not_required template with no answer targets, but verify-no-clarification still fails solely because the request list is non-empty. This blocks real-idea-intake-continue-without-answers for the closed-only report shape this change now treats as ready.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ( | ||
| "answer_question" in supported_actions | ||
| and shape | ||
| and not any(token in shape for token in SUPPORTED_BROWSER_ANSWER_SHAPE_TOKENS) |
There was a problem hiding this comment.
Treat text answer shapes as browser-answerable
When idea_to_spec_clarification_requests._question_answer_shape emits the existing active-frame shapes like "text" or "text | structured_context" (for example the subsystem clarification covered in tests/test_idea_to_spec_clarification_requests.py), this new token check rejects the otherwise supported answer_question request because the token set only includes "plain text" / "structured context". That makes build_template mark those intake/event-storming clarification requests as clarification_blocked, so operators cannot answer valid browser-renderable text questions.
Useful? React with 👍 / 👎.
| real_idea_answer_authoring.template_request_binding_findings( | ||
| template=template, | ||
| clarification_requests=clarification_requests, | ||
| requests_path=requests_path, | ||
| ) |
There was a problem hiding this comment.
Bind SpecSpace imports to the intake session workspace
When the selected SpecSpace answer state and rows match intake session B but their recorded refs point at template/requests from workspace A, _validate_refs passes because those refs match the selected A files, and this new binding only checks that the A template matches the A requests. The preview can therefore become ready and later apply A's clarification answers to B's raw intake session; include the intake session/workspace in this binding so cross-workspace artifacts cannot be selected as current intake evidence.
Useful? React with 👍 / 👎.
Summary
Motivation
Goals
Changes
Spec Evidence
For SpecGraph logic/tooling changes, cite at least one existing
SG-SPEC-####or proposal
####. PR body is preferred; commit trailers with the same fieldsare accepted. For a true no-impact change, use
Spec-ID: NO-SPEC-IMPACTandprovide a rationale.
Spec-ID:
SG-SPEC-0057Proposal-ID:
0210Spec-Impact: lifecycle
Spec-Rationale: Hardens the provenance and readiness invariants introduced by the fallback-free real-idea clarification contract.
Validation
Commands run:
.venv/bin/python -m pytest -q tests/test_real_idea_answer_authoring.py tests/test_idea_to_spec_clarification_requests.py tests/test_specspace_real_idea_answer_handoff.py tests/test_idea_intake_clarification_rerun.py make test .venv/bin/python tools/python_quality.py make proposal-tracking-gate make docc-sync make publish-bundleResults:
68 passed.1839 passed.Risks / Notes
Checklist