Skip to content

Make the implement Phase 4.1 documentation gate record only run-specific workpad facts - #2137

Merged
The01Geek merged 9 commits into
mainfrom
issue-2129-make-the-implement-phase-4-1-documentation-gate
Aug 29, 2026
Merged

Make the implement Phase 4.1 documentation gate record only run-specific workpad facts#2137
The01Geek merged 9 commits into
mainfrom
issue-2129-make-the-implement-phase-4-1-documentation-gate

Conversation

@prflow-implementer

@prflow-implementer prflow-implementer Bot commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • Make the /prflow:implement Phase 4.1 documentation gate record only real, run-specific workpad facts, so a workpad no longer carries a fixed once-per-run boilerplate note that is false on runs where nothing was suppressed.
  • Relay the extractor's first suppressed Documentation Needed span from scripts/read-doc-needed-deliverables.sh onto stdout so Stage 1 can record the actual span, and stop the gate from ticking a check-command doc-AC on evidence that does not yet exist.

Changes

Read boundary (scripts/read-doc-needed-deliverables.sh): The helper now captures the extractor's stderr to a truncated-per-attempt scratch file, forwards it unchanged to its own stderr (so the merged tool result still carries every suppressed a span breadcrumb), and emits one self-identifying docgate-suppressed: <span> line after the docgate-outcome: line on either success token (deliverables and no-deliverables). The span is the first suppressed span with the breadcrumb's surrounding backticks removed, parsed with bash builtins only. The # STDOUT SHAPE header documents the new line.

Phase 4.1 (skills/implement/phases/phase-4-documentation.md): The fixed once-per-run disclosure sentence is replaced with a span-suppression note that fires only when a docgate-suppressed: line is present, delivering the span to the workpad through --note-file (never a double-quoted --note argument). The deferred documentation-AC discharge paragraph gains a check-command rule: a criterion naming a check command is ticked only after the orchestrator runs that command itself (or the covering run the coverage map names) over the landed docs and quotes the result line; a subagent's report does not discharge it, and a tier refusal of both forms takes the existing Blocked arm naming prflow_implement.allowed_tools.

Docs (docs/internal/implement-skill.md): Corrected to state the read boundary captures and relays the breadcrumb as a docgate-suppressed: stdout line rather than the prior claim that the gate does not capture that stderr.

Tests (lib/test/run.sh, lib/test/modules/coverage-map.json): The #1554 adversarial exact-line expectation now asserts the docgate-suppressed: bash lib/test/run.sh line; a new assertion confirms the merged stream still carries the suppressed a span breadcrumb; a new no-deliverables fixture asserts the span is relayed on that branch too. A coverage-map entry for issue #2129 is added.

Resolves

Resolves #2129

Test Plan

  • lib/test/run-shard.sh monolith (the #1554/#2129 fixture matrix in lib/test/run.sh): the adversarial body prints docgate-outcome: deliverables, docgate-suppressed: bash lib/test/run.sh, then the docgate-path: line; the clean fixtures print no docgate-suppressed: line.
  • The #2129 assertion confirming rdnd_run on the adversarial body still contains extract-doc-needed-paths.sh: suppressed a span on the merged stream.
  • The new #2129 no-deliverables fixture asserts docgate-outcome: no-deliverables plus the docgate-suppressed: line at exit 10.
  • lib/test/lint-reference-size.py reports no violation for skills/implement/phases/phase-4-documentation.md.
  • The #644 pin (suppressed a span appears once in the phase file) and the #380 discharge-heading pin pass unchanged.

Visual Changes

N/A

Breaking Changes

None. The shipped helper and phase file reach a consumer in the same vendored plugin fetch, so an old helper beside a new phase file cannot occur.

Prompt-surface size

Derived at ec6e53f18a7ee66df300f1c9c83e0cbd80e7040b against merge-base 352dc01ccef94d5ded525d36f4ce20c4107ca682 (origin/main). Covered: tracked *.md under skills/, agents/, .prflow/prompt-extensions/.

Path Before After Δ bytes Δ %
skills/implement/phases/phase-4-documentation.md 59,830 61,012 +1,182 +2.0%
Whole covered surface 2,207,587 2,208,769 +1,182 +0.1%

Review response (PRFlow review at ec6e53f18a7ee66df300f1c9c83e0cbd80e7040b)

  • Important 1 — fixed (1f318a3f): lib/test/run.sh gains a suppress-flaky-extractor stub whose failing attempts emit the suppressed a span breadcrumb, plus two assertions: a clean retry relays no phantom docgate-suppressed: line, and the extract-failed token forwards the breadcrumb but relays no span. Mutation-checked on scratch copies of the helper: 2>2>> turns the retry assertion RED with docgate-suppressed: phantom-span on the clean retry (and breadcrumbs=2 on the failure case); an emit added to the failure arm turns only the extract-failed assertion RED. The working-tree helper passes 13/13 in the fixture block; lib/test/run-shard.sh monolith: 10201 passed, 0 failed, 0 skipped.
  • Suggestion 1 — declined. An empty suppressed span is unreachable from the only producer: handle_span in scripts/extract-doc-needed-paths.sh returns at ntok -eq 0 before it can call suppress_span, so every breadcrumb carries at least one token and [ -n "$SUPPRESSED_SPAN" ] cannot conflate "empty span" with "no span". Revisit only if a second breadcrumb producer appears.
  • Suggestion 2 — done. The backtick coupling is named at both ends: a two-line comment in suppress_span() (the producer) and one at the parse site in scripts/read-doc-needed-deliverables.sh.
  • Suggestion 3 — done. The #2129 comment blocks in lib/test/run.sh are trimmed to at most three lines, each naming the wrong change it prevents.
  • Suggestion 4 — half done, half declined. The extract-failed emit restriction is now exercised (see Important 1). The first-span [ -z ] guard stays untested: span_warned makes the producer's breadcrumb once-per-run, so a test would have to pin a two-breadcrumb shape the producer never emits; the guard is defence in depth against a future producer change. Revisit if suppress_span ever emits more than once per run.
  • Branch merged with origin/main (no conflicts).

Generated via /prflow:implement (v2.36.15, claude-opus-4-8, low)

@prflow-implementer
prflow-implementer Bot marked this pull request as ready for review August 29, 2026 04:43
@prflow-implementer

Copy link
Copy Markdown
Author

/prflow:review

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

PRFlow Review — PR #2137

Status: ✅ APPROVE with notes
Diff profile: engine_self_modifying (full checklist; Phase 3 roster gated by 3.1)
Run: View run
Reviewed HEAD: ec6e53f
Last updated: Phase 4 complete

Blueprint

  • Classify diff (Phase 0.5)
  • Generate verification checklist (Phase 1) — 13 items
  • Verify checklist (Phase 2) — 13 passed, 0 failed, 0 inconclusive (2 lite, 11 agent)
  • Review agents (Phase 3) — code-reviewer, silent-failure-hunter, comment-analyzer, pr-test-analyzer, requesting-code-review (final pass: APPROVE)
  • Aggregate & verdict (Phase 4)
  • Run complete — everything this run owed

Verdict: APPROVE with notes (all 13 checklist items pass and all 9 acceptance criteria are met; only below-threshold notes remain)

Issue Compliance

Reviewed against issue #2129: Make the implement Phase 4.1 documentation gate record only run-specific workpad facts — criteria from workpad; scope unchanged. Requirement-based checklist items are included in the verification results below.
Criteria came from the /prflow:implement workpad comment — this run's authoritative set, possibly narrowed from the issue.
No divergence between the workpad's criteria and the issue body's.

Test evidence (CI, reviewed commit ec6e53f1): all required checks reported successlib + python tests, lint (shellcheck + actionlint + ruff), and the four shards (modules-pin, modules-large, python-pool, monolith, modules-rest), plus lint-manifest. This is the authoritative test evidence for this commit; Phase 2 verified the checklist, not the suite.

Verification Checklist Results

13 passed, 0 failed, 0 inconclusive — 2 via lite probe, 11 via agent.

✅ Passed items (13 of 13) — click to expand
  • VC-1: adversarial fixture body prints docgate-outcome: deliverables, docgate-path:, plus exactly one docgate-suppressed: bash lib/test/run.sh line [scripts/read-doc-needed-deliverables.sh]
  • VC-2: clean fixture bodies print no docgate-suppressed: line; existing exact-line expectations unchanged (emit guarded on non-empty SUPPRESSED_SPAN) [scripts/read-doc-needed-deliverables.sh]
  • VC-3: rdnd_run on the adversarial body carries extract-doc-needed-paths.sh: suppressed a span on the merged stream (stderr captured to scratch AND forwarded >&2) [scripts/read-doc-needed-deliverables.sh]
  • VC-4: literal "not durably observable on the cloud tier" absent in every file under skills/ at head [skills/implement/phases/phase-4-documentation.md]
  • VC-5: phase file names suppressed a span exactly once; span delivered via --note-file, never a double-quoted --note argument [skills/implement/phases/phase-4-documentation.md]
  • VC-6: deferred doc-AC paragraph states all six check-command clauses (own tool call / coverage-map covering run / subagent report insufficient / quote result line / no result of a gate not yet run / tier refusal → Blocked naming prflow_implement.allowed_tools) [skills/implement/phases/phase-4-documentation.md]
  • VC-7: heading sentence "Discharge every 3.4-deferred documentation AC (mandatory, before §4.3)" present verbatim exactly once [skills/implement/phases/phase-4-documentation.md]
  • VC-8: lint-reference-size.py no violation — file is 61,012 bytes at head, under the 61,750 ceiling [skills/implement/phases/phase-4-documentation.md]
  • VC-9: implement-skill.md no longer says the gate does not capture stderr; now describes the capture/forward/relay recorded on the workpad [docs/internal/implement-skill.md]
  • VC-10: backtick-stripping isolates the span correctly — the breadcrumb wraps the span in a single trailing backtick with no trailing text [scripts/read-doc-needed-deliverables.sh]
  • VC-11: FIRST span captured ([ -z "$SUPPRESSED_SPAN" ] guard) and EXTRACTOR_ERR truncated per attempt (rm -f + 2>) [scripts/read-doc-needed-deliverables.sh]
  • VC-12: no-deliverables fixture asserts docgate-outcome: no-deliverables + docgate-suppressed: bash lib/test/run.sh + rc=10, matching the exit-10 emit site [lib/test/run.sh]
  • VC-13: coverage-map "2129" entry well-formed (owner unmodularized, empty note), in string-sort order, accepted by the coverage-map guard [lib/test/modules/coverage-map.json]

Code Review Findings

All findings are single-source (no mechanical corroboration; 5 Phase-3 agents returned). None is a documented_falsehood / self-contradicting-diff. None is at or above the critical verdict threshold, so none drives a REJECT.

🟠 Important / Major

  1. The retry stderr truncation guarantee (rm -f + 2> not 2>>) that prevents a phantom docgate-suppressed: from a failed extractor attempt is asserted only in prose, not exercised by any test; a regression to 2>> or dropping rm -f would leak a phantom span with no RED. A dedicated flaky stub that emits the suppressed a span breadcrumb on attempt 1 then succeeds cleanly on attempt 2 would close it. (raised by 1/5 agents) [suspected over-grade: shape 3 — single-source test_gap from pr-test-analyzer, no corroboration, no Phase-2 FAIL; observable fail-direction is a coverage gap, milder than the Important label]

🟡 Suggestion / Minor

  1. read-doc-needed-deliverables.sh: the emit is gated on [ -n "$SUPPRESSED_SPAN" ], so a degenerate empty suppressed span is indistinguishable from "no span suppressed"; a separate boolean set inside the case arm would be more faithful. (raised by 1/5 agents)
  2. read-doc-needed-deliverables.sh: the span parse ${_line#*\}` couples to the extractor breadcrumb carrying no backtick before the span — currently pinned by the run.sh assertion; a one-line comment naming that load-bearing coupling would help a future editor of the breadcrumb producer. (raised by 1/5 agents)
  3. lib/test/run.sh: three added test-file comment blocks exceed three physical lines / are rationale-or-worked-example rather than a nameable wrong change (prevention-only comment standard). (raised by 1/5 agents)
  4. The first-span [ -z ] guard and the extract-failed success-token-only emit restriction are structurally sound (backed by the extractor's once-per-run breadcrumb contract) but not directly exercised by a dedicated test. (raised by 1/5 agents)

over-grade annotation: finding flagged (shape 3, advisory — verdict unchanged)
intra-diff contradiction scan: no contradiction found
truthfulness sweep: no finding promoted

Verdict Criteria

  • No verification checklist FAIL or INCONCLUSIVE → no REJECT on rules 1–2.
  • No finding that a diff-added/modified doc line, comment, example, or command-form is untrue against HEAD → self-contradicting-diff carve-out does not fire (all agents confirmed no documented_falsehood; docs, changeset, and phase-file prose track the shipped helper exactly).
  • No review-agent finding at or above the critical threshold → no REJECT on rule 3 (the single Important is a below-threshold test-coverage note; the rest are Suggestions).
  • Checklist ran fully (engine_self_modifying → full checklist); 0 agents failed.
  • Result: only below-threshold findings present → APPROVE with notes.

Verdict

APPROVE with notes — reviewed HEAD ec6e53f18a7ee66df300f1c9c83e0cbd80e7040b. The change is coherent and well-covered: the read boundary captures, forwards, and relays the extractor's first suppressed span as a self-identifying docgate-suppressed: line on both success branches; the phase file replaces the always-false once-per-run note with a conditional --note-file record and adds the check-command tick discipline; docs and changeset are consistent with shipped behavior. CI is green for the reviewed commit. The lone Important is an advisory over-grade (a truncation-on-retry test gap that project pins already keep RED-on-drift indirectly); the Suggestions are optional polish. Nothing blocks merge.

Run telemetry

Per-phase call/token/wall-clock figures: unavailable (not established this run).

Subagent effectiveness trace

Iteration 1

  • Diff profile: engine_self_modifying
  • Phase 3 agents dispatched: 5
  • Checklist verifiers: 2 lite, 11 agent.
  • Effectiveness signal: verdict contribution (standalone review applies no fixes) — 3 of 5 agent(s) contributed
  • Agent verdicts:
    • prflow:code-reviewer — null
    • prflow:comment-analyzer — unique-effective
    • prflow:pr-test-analyzer — unique-effective
    • prflow:requesting-code-review — null
    • prflow:silent-failure-hunter — unique-effective

Recurring defect kinds

  • Unestablished — no iteration record carried a defect_signature to read.

@prflow-reviewer prflow-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE with notes — full report in PR comment

The complete review report (checklist results, findings, details) is in the
PRFlow Review progress comment on this PR.

The01Geek and others added 2 commits August 28, 2026 23:32
…capture (review of #2137)

Adds a suppress-flaky-extractor stub whose failing attempts emit the
`suppressed a span` breadcrumb, and two run.sh assertions: a clean retry
relays no phantom docgate-suppressed line (RED under `2>>`), and the
extract-failed token forwards the breadcrumb but relays no span (RED with
an emit on the failure arm). Trims the #2129 run.sh comment blocks to the
prevention-only standard and names the breadcrumb/parse backtick coupling
at both the producer and the consumer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@prflow-implementer

Copy link
Copy Markdown
Author

/prflow:review

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

PRFlow Review — PR #2137

Status: ✅ APPROVE with notes
Diff profile: engine_self_modifying (full checklist)
Run: View run
Reviewed HEAD: 1f318a3
Last updated: Phase 4

Blueprint

  • Phase 0.5 — diff classified
  • Phase 1/1.5 — checklist generated (17 items)
  • Phase 2 — checklist verified
  • Phase 3 — review agents returned
  • Phase 4 — verdict aggregated
  • Terminal completion

Verdict: APPROVE with notes (all findings are Suggestions; no Critical/Important; 17/17 checklist items pass; both repo prompt-surface gates discharged)

Issue Compliance

Reviewed against issue #2129: Make the /prflow:implement Phase 4.1 documentation gate record only real, run-specific workpad facts — criteria from workpad; scope unchanged. Requirement-based checklist items are included in the verification results below.
Criteria came from the /prflow:implement workpad comment — this run's authoritative set, possibly narrowed from the issue.
No divergence between the workpad's criteria and the issue body's.

DevFlow-repo prompt-surface gate (extension): the diff touches skills/implement/phases/phase-4-documentation.md, so the prompt-surface edit routing evidence gate applies and is DISCHARGED — issue #2129's workpad carries a Writing-skills evidence: marker for that file with all four slots explicit: skill-loaded=yes, guidance-applied=yes, pressure-scenario=no (reason recorded), micro-tests=no (reason recorded). A recorded no fully discharges each slot.
Verification-evidence advisory (non-blocking): satisfied — a Verification evidence: marker is present on the workpad (cloud run per gha: checkpoints; aggregate CLEAN 22839 passed).

Verification Checklist Results

17 passed, 0 failed, 0 inconclusive — 1 via lite probe, 16 via agent.

✅ Passed items (17 of 17) — click to expand
  • VC-1: backtick-span parse (first-to-last) matches suppress_span() single-backtick-pair breadcrumb [scripts/read-doc-needed-deliverables.sh]
  • VC-2: 'suppressed a span' substring match aligns with the extractor's emitted wording [scripts/read-doc-needed-deliverables.sh]
  • VC-3: per-attempt truncating 2> redirect prevents a phantom span on the clean retry [scripts/read-doc-needed-deliverables.sh]
  • VC-4: docgate-suppressed emitted on both success branches, absent on extract-failed [scripts/read-doc-needed-deliverables.sh]
  • VC-5: suppress-flaky-extractor stub breadcrumb format matches the real extractor [lib/test/run.sh]
  • VC-6: first suppressed span for adversarial body = 'bash lib/test/run.sh' [lib/test/run.sh]
  • VC-7: AC1 — adversarial fixture prints deliverables + one docgate-suppressed + path lines [lib/test/run.sh]
  • VC-8: AC2 — clean fixtures print no docgate-suppressed line; existing expectations unchanged [lib/test/run.sh]
  • VC-9: AC3 — unfiltered rdnd_run relays 'suppressed a span' breadcrumb once [lib/test/run.sh]
  • VC-10: AC4 — 'not durably observable on the cloud tier' absent under skills/ (lite probe) [skills/]
  • VC-11: AC5 — 'suppressed a span' appears exactly once in phase file, span via --note-file; extract-doc-needed-paths.sh: command and grant literals inside the Documentation Needed block are tokenized into phantom doc deliverables that Block implement runs #644 pin passes [skills/implement/phases/phase-4-documentation.md]
  • VC-12: AC6 — deferred doc-AC paragraph states all five check-command discharge rules [skills/implement/phases/phase-4-documentation.md]
  • VC-13: AC7 — heading sentence present verbatim exactly once; Wave 6A — producer/consumer gate fixes: recognize doc-ACs as Phase-4-owned in the 3.4 gate, and harden create-issue's mechanical-claim and Documentation Needed contracts #380 pin passes [skills/implement/phases/phase-4-documentation.md]
  • VC-14: AC8 — phase file 61,303 bytes < 61,750 ceiling; lint-reference-size clean [skills/implement/phases/phase-4-documentation.md]
  • VC-15: AC9 — implement-skill.md updated: helper captures/relays span, no stale 'does not capture' claim [docs/internal/implement-skill.md]
  • VC-16: coverage-map '2129' entry well-formed, owner 'unmodularized' accepted [lib/test/modules/coverage-map.json]
  • VC-17: SUPPRESSED_SPAN derived with bash builtins only (no non-preflight tools) [scripts/read-doc-needed-deliverables.sh]

Code Review Findings

🟡 Suggestion / Minor

  1. The stderr-relay loop while IFS= read -r _line drops an unterminated final stderr line, so the header's "forwards it UNCHANGED" guarantee is weaker than stated; safe today because the extractor breadcrumb is always newline-terminated. Consider || [ -n "$_line" ]. (raised by 1/5 agents)
  2. A #2129 stderr-capture comment block in scripts/read-doc-needed-deliverables.sh is 4 physical source lines, over the 3-line prevention-comment cap; the trailing sentence restates behavior legible from rm -f + 2>. (raised by 1/5 agents)
  3. No fixture pins the interior-backtick / empty-span parsing corner (all fixture spans are simple non-empty tokens); low value since doc-needed spans rarely contain backticks and the end-to-end adversarial test already pins the real breadcrumb coupling. (raised by 1/5 agents)

A second silent-failure-hunter observation (a no-backtick breadcrumb would relay the whole line) was noted as "no change required" — defended by the documented producer-side coupling — and is not filed as a finding.

over-grade annotation: no finding flagged
truthfulness sweep: no finding promoted
intra-diff contradiction scan: no contradiction found

Verdict Criteria applied (threshold: critical)

  • No checklist FAIL / INCONCLUSIVE (17/17 PASS).
  • No self-contradicting-diff finding (the prior documented falsehood in implement-skill.md is correctly removed by this diff).
  • No review-agent finding at or above critical — only Suggestions present → APPROVE with notes.

Final-pass reviewer prompt-extension load: loaded-empty, resolved-root matches the engine's own root (no propagation failure). Dirty-tree backstop: clean (no agent modified the tree).

Run telemetry

Per-phase call/token figures were not instrumented this run (telemetry: "unavailable").

Subagent effectiveness trace

Iteration 1

  • Diff profile: engine_self_modifying
  • Phase 3 agents dispatched: 5
  • Checklist verifiers: 1 lite, 16 agent.
  • Effectiveness signal: verdict contribution (standalone review applies no fixes) — 3 agents raised the contributing Suggestions (silent-failure-hunter, comment-analyzer, pr-test-analyzer); code-reviewer and requesting-code-review returned clean.

@prflow-reviewer prflow-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE with notes — full report in PR comment

The complete review report (checklist results, findings, details) is in the
PRFlow Review progress comment on this PR.

@The01Geek
The01Geek merged commit f3d95e5 into main Aug 29, 2026
10 checks passed
@The01Geek
The01Geek deleted the issue-2129-make-the-implement-phase-4-1-documentation-gate branch August 29, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the implement Phase 4.1 documentation gate record only run-specific workpad facts

1 participant