Skip to content

fix(pr-quality): validate rendered markdown proof boundaries - #389

Open
BenSheridanEdwards wants to merge 6 commits into
mainfrom
fix/pr-body-markdown-boundaries
Open

BenSheridanEdwards wants to merge 6 commits into
mainfrom
fix/pr-body-markdown-boundaries

Conversation

@BenSheridanEdwards

@BenSheridanEdwards BenSheridanEdwards commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Why does this feature exist?

Valid PR bodies can lose verification fields when code looks like a heading, and empty proof labels can pass without an actual exemption reason. Fixes #378. Fixes #379. Fixes #382.

What changed?

Use Marked block tokens to split top-level ATX sections, count exemption reasons after their label, and detect portable-path violations after publishing punctuation. Add the pinned development dependency, its ESM test transform, ADR 0130, and focused regressions. The shared fake-agent fixture commits through normal hooks; every result-commit assertion is retained.

Section extraction: Markdown body → Marked block tokens → top-level ATX headings → raw section content → proof and metadata checks.

Behavioural Proof (with video and screenshots)

  • Video: Not applicable: this change affects repository tooling without a rendered UI.
  • Screenshots: Not applicable: executable regression checks verify the tooling output.
  • Behaviour tests: The PR-body suite passes 346 tests, including every original issue example and all independent-review counterexamples. Regression cases fail against the unfixed validator; accepted URL and populated-reason controls remain green. These regressions are included in the final full suite.
  • Fixture repair: all seven earlier frozen snapshots reproduce the guard refusal. The repaired focused case passes with unchanged assertions and normal hooks. Earlier full-pass logs are historical. The PR383 full-run failure and focused red/green evidence are retained in the delivery report.
  • E2E mapping: browser behaviour is unchanged; the complete Playwright map passed in the normal pre-push hook.

Verification Summary

  • Head commit: 0905a66
  • PRDs checked: None: repository tooling outside product coverage globs
  • PRD impact: None
  • North Star commit: b6b5631
  • Commands run: pnpm exec jest --selectProjects tooling --testPathPattern tooling/trial/run-trial.test.ts --runInBand --testNamePattern '^runTrial makes the one result commit with the hooks on, whatever the agent committed$'; pnpm install --frozen-lockfile; pnpm lint:anti-slop; pnpm verify; pnpm e2e. Full verification ran through the shared heavy-suite limiter in the normal pre-push hook.
  • Results: 85 unit/tooling suites and 3214 tests passed; 2 consumer and 1 provider contract tests, 7 HTTP integration tests and 19 Playwright tests passed at this committed head. Normal pre-commit and commit-message hooks passed. The unchanged Marked development dependency is pinned at 18.2.0 with ADR 0130. Its dependency scan passed high/critical auditing and the licence allow-list before the fixture-only repair; 4 low and 10 moderate advisories remain recorded.
  • Pre-commit wall-clock timing: measured from the normal fixture-repair commit's hook steps at this head.
Pre-commit step Seconds
typecheck 1.429
biome (format, import order, JSON and CSS lint, staged only) 0.85
oxlint (all lint: general, policy, naming, React, Tailwind and React Doctor rules) 2.24
style tokens (CSS and index.html on the @repo/ui design tokens) 0.806
anti-slop (vendored Oxlint rules) 1.172
suppression ban (no inline lint or coverage suppressions) 1.521
architecture gate (fallow zones, folder structure, role diagram) 2.935
fallow (code intelligence: dead code, cycles, complexity) 1.657
secret scan (gitleaks, staged content) 0.879
  • Security hold: GHSA-fc5q-39xc-vjpf affects installed picomatch 2.3.2 and 4.0.4. Refreshed hosted Security audit and Required gates fail. The official advisory lists no patched release and npm 4.0.8 is unavailable. A bounded upstream backport probe exposed matching and capture regressions, so no unvalidated patch, fictional version or audit exception was adopted. Release-age policy and audit thresholds remain unchanged.
  • Definition of Done: local checks passed at this head. Latest hosted checks and any guarded-change sign-off must pass before readiness.
  • pnpm verify
  • pnpm e2e
  • Behaviour is covered by the E2E map when user-visible behaviour changed; this tooling change has regression coverage.
  • Logic is unit-tested where logic changed.
  • Accessibility considered; the browser accessibility map passed.
  • The diff follows .agents/project/ARCHITECTURE.md and CONVENTIONS.md.
  • No gates were bypassed or weakened.
  • Known risks or skipped checks: production runtime and a live model trial remain unverified. Hosted checks are recorded separately. Required human sign-off is reserved for the named maintainer. Revert this PR to restore the previous tooling behaviour.

PRD Behaviours to Review

  • None

PR Proof Law

  • I followed .agents/project/PR_QUALITY.md and .agents/skills/pr-quality-contract/SKILL.md; the PR quality check verifies the proof format.

@github-actions github-actions Bot added confidence: red A required gate is failing or pending, or evidence is unavailable. confidence: green Required gates, slice E2E/PRDs, unit line coverage and import blast radius passed. and removed confidence: red A required gate is failing or pending, or evidence is unavailable. labels Nov 17, 2026
@github-actions github-actions Bot added confidence: red A required gate is failing or pending, or evidence is unavailable. and removed confidence: green Required gates, slice E2E/PRDs, unit line coverage and import blast radius passed. labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confidence: red A required gate is failing or pending, or evidence is unavailable.

Projects

None yet

1 participant