Repository navigation
[Safe Outputs Conformance] REQ-002: Count required sections across full type blocks - #75114
Conversation
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
🟡 Changes recommended
The extraction does not stop at #### Type: headings, allowing an incomplete type to borrow a sibling’s sections, incorrectly report 5/5, and suppress the expected MEDIUM finding.
1 open issue
What changed in this PR
This PR updates the safe-output documentation conformance checker to address truncated section counts and lost REQ-002 failure reporting.
Changes:
- Replaces fixed 200-line windows with heading-based extraction and exact type-name matching.
- Checks all documented types and preserves failure state in the current shell.
- Adds regression fixtures for long type documentation and incomplete types.
| File | Description |
|---|---|
scripts/check-safe-outputs-conformance.sh |
Updates REQ-002 extraction, type coverage, and failure propagation. |
scripts/check-safe-outputs-conformance_test.sh |
Adds fixtures checking section counts and failure reporting. |
Review effort: Balanced (auto)
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
The REQ-002 fix is not merge-ready: its awk boundary does not stop at the next #### Type: heading, so sibling sections can still contaminate completeness results. It also silently passes when no types are extracted.
Highlights
- Correct the heading boundary to isolate each type block and add a sibling-bleed regression.
- Fail or report a finding when the spec is missing or no types are found.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
|
|
||
| # Bound each type at the next heading. A fixed line window truncates long types and also matches | ||
| # sibling types that share the name prefix, such as create_pull_request_review_comment. | ||
| type_section=$(awk -v name="$type_name" '$0 == "#### Type: " name {found=1; next} found && /^###? / {exit} found' "$spec_file") |
There was a problem hiding this comment.
The block terminator /^###? / does not match the #### Type: heading that starts the next type, so a type's section extraction still runs through sibling types and can count their required sections, preserving the false-pass bug this change is intended to fix.
💡 Why this matters and how to fix it
###? matches only ## or ###; all safe-output type headings are level four (####). Therefore an incomplete type followed by a complete type will still appear complete. Terminate on the next heading at the relevant levels, for example /^#{2,4} /, while retaining the current type's content. Add a regression with an incomplete #### type followed by a complete sibling.
| done < <(grep "^#### Type:" "$spec_file" 2>/dev/null | sed 's/^#### Type: //') | ||
|
|
||
| if [ $failed -eq 0 ]; then |
There was a problem hiding this comment.
If the specification file is missing or yields no type headings, this function now performs zero iterations and still prints a successful REQ-002 PASS, so the checker can silently validate nothing.
💡 Why this matters and how to fix it
The grep failure is suppressed and there is no processed-type count. Track whether at least one type was checked and emit a failure/medium finding when the file is absent or extraction is empty; otherwise this preserves the silent-pass failure mode that the loop fix is meant to eliminate.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd: requesting changes. The fix removes the fixed-window and subshell bugs, but the new awk still runs into sibling types, so the original symptom (a false PASS) remains for most types.
📋 Key Findings and Evidence
Blocking
- Sibling bleed is not fully fixed. The awk stops only at
##/###. The spec places many#### Type:headings under one###group, so each block continues into the next type.linear_add_commenthas none of the five sections but reports 5/5. A fixture withincomplete_typedirectly abovecomplete_typealso prints PASS. In the real spec, 44 of 47 blocks span a sibling type. - Suggested fix: stop at
#### Type:too, for examplefound && (/^###? / || /^#### Type: /) {exit}. I checked this on the fixture (reports 0/5) and on the spec (35 of 47 types below 5/5).
Non-blocking
- Literal match:
grep -q "**$section**"is a regex. Usegrep -qF. - Test gap: the new regression block passes on this branch but does not cover adjacent types, so it would not catch the bleed.
- Validation claim: the PR says all 47 types are at least 5/5, which holds only because of the sibling bleed. Once the bound is fixed, the summary will report about 35 MEDIUM findings. The script still exits 0 on MEDIUM, so the daily job does not fail. Several gaps are label-format mismatches (for example
**Configuration**:and**MCP Tool**:), so decide whether to fix the labels or the spec before merging.
Positive Highlights
- ✅ Pulling the loop out of the pipeline fixes the subshell bug, so
failedand the MEDIUM count reach the summary. - ✅ Removing
head -10checks all 47 types. - ✅ Replacing the fixed 200-line window fixes the truncation case in the new fixture.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
|
|
||
| # Bound each type at the next heading. A fixed line window truncates long types and also matches | ||
| # sibling types that share the name prefix, such as create_pull_request_review_comment. | ||
| type_section=$(awk -v name="$type_name" '$0 == "#### Type: " name {found=1; next} found && /^###? / {exit} found' "$spec_file") |
There was a problem hiding this comment.
[/diagnosing-bugs] The sibling-window bug is still present. The awk exit pattern /^###? / does not stop at the next #### Type: heading, so linear_add_comment (0 of 5 sections) reports 5/5 and the check prints PASS.
💡 Evidence and suggested fix
A fixture with incomplete_type directly above complete_type still prints PASS on this branch. On the real spec, 44 of 47 type blocks run into a sibling type.
Add the sibling heading to the exit pattern, for example found && (/^###? / || /^#### Type: /) {exit}. With that change, the fixture reports incomplete_type as 0/5 and the real spec reports linear_add_comment as 0/5.
@copilot please address this.
| # Check for required sections | ||
| for section in "MCP Tool Schema" "Operational Semantics" "Configuration Parameters" "Security Requirements" "Required Permissions"; do | ||
| type_section=$(grep -A 200 "^#### Type: $type_name" "$spec_file" 2>/dev/null || true) | ||
| if grep -q "**$section**" <<< "$type_section"; then |
There was a problem hiding this comment.
[/tdd] grep -q "**$section**" is a regex, so it also matches bare prose. For example, the text Security Requirements appears in prose counts as a section. Use grep -qF for a literal match.
💡 Suggested change
Change line 317 to if grep -qF "**$section**" <<< "$type_section"; then. The -F flag keeps the asterisks literal, so only the bold label counts.
@copilot please address this.
| exit 1 | ||
| fi | ||
|
|
||
| printf '\n#### Type: short_type\n\n**MCP Tool Schema**:\n**Operational Semantics**:\n\n### Next Section\n' >>"$spec" |
There was a problem hiding this comment.
[/tdd] This test does not cover the sibling-bleed case. short_type is the last heading before ### Next Section, so its block never reaches another type. The test passes even with the bug.
💡 Suggested regression fixture
Add a fixture where incomplete_type sits directly above complete_type, then assert the output contains MEDIUM: REQ-002: Type 'incomplete_type' has only 0/5 required sections. Run it on this branch first. It should fail before the end-anchor fix.
@copilot please address this.
| type_section=$(awk -v name="$type_name" '$0 == "#### Type: " name {found=1; next} found && /^###? / {exit} found' "$spec_file") | ||
|
|
||
| # Check for required sections | ||
| for section in "MCP Tool Schema" "Operational Semantics" "Configuration Parameters" "Security Requirements" "Required Permissions"; do |
There was a problem hiding this comment.
With the end-anchor fix, 35 of 47 types fall below 5/5. The summary would go from Medium Failures: 0 to 35. Several types use other labels. For example, linear_add_comment uses **Configuration**: and an **MCP Tool**: line instead of **MCP Tool Schema**. Decide whether to adjust the labels in this list or the spec before merging, so the new findings are real gaps and not format mismatches.
@copilot please address this.
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e325dee
|
Assignment running:
Sous-chef requested-head: e325dee |
…02-type-section-window-1b356256a09caaa6 Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |

Conformance Check Failure
Check ID: REQ-002
Severity: MEDIUM
Category: Specification
Problem Description
On every run, the checker prints
[MEDIUM] REQ-002: Typecreate_pull_requesthas only 4/5 required sections. The spec type has all five sections, so this is a checker defect. The same run then prints[PASS] REQ-002: All safe output types have complete documentationand reportsMedium Failures: 0.Three bugs in
check_type_completenesscause this:grep -A 200read 200 lines after each type heading.**Security Requirements**sits 264 lines below thecreate_pull_requestheading, so it was never counted.create_pull_request_review_comment. The window could count sections from a sibling type.failed=1and the MEDIUM counter were set in a subshell. The parent sawfailed=0, printed PASS, and dropped the MEDIUM count from the summary.Also,
head -10limited the check to the first 10 of 47 spec types.Affected Components
scripts/check-safe-outputs-conformance.sh,scripts/check-safe-outputs-conformance_test.shdocs/src/content/docs/specs/safe-outputs-specification.md(not changed)🔍 Current vs Expected Behavior
Current Behavior
create_pull_requestis reported as 4/5 complete, and the MEDIUM finding is hidden by a PASS line. Only the first 10 types are checked.Expected Behavior
create_pull_requestis reported as 5/5 complete. A real documentation gap is reported as MEDIUM and counted in the summary. All 47 types are checked.Remediation Steps
#### Type:heading and ends at the next##or###heading.while read ... done < <(...)so the loop runs in the current shell.head -10.Validation
head -10adds no findings.bash scripts/check-safe-outputs-conformance.sh: REQ-002 reports[PASS], andMedium Failures: 0.mainversion printsMEDIUM: REQ-002: Typelong_typehas only 1/5 required sections, thenPASS, and exits 1. The fixed version exits 0.main. The test file gains 2 SC2329 notes for thelog_mediumandlog_passstubs. The existing SEC-005 block has the same two notes.scripts/check-safe-outputs-conformance_test.shexits 0 only with this PR, the USE-001 PR, and the USE-003 PR applied together. Verified in a scratch worktree with a full run.References
scripts/check-safe-outputs-conformance.shdocs/src/content/docs/specs/safe-outputs-specification.mdReferences: §41975417561