Skip to content

repair(governance): enforce scoped doctoring Security Notes - #1204

Draft
seonghobae wants to merge 26 commits into
developfrom
repair/security-notes-doctoring-1203
Draft

seonghobae wants to merge 26 commits into
developfrom
repair/security-notes-doctoring-1203

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Governance finding

Closes #1203 only after this repository-policy change reaches protected develop.

Protected base is develop@314ddeae7b775a4957594b599358c8255617eb2e; current exact head is 8dda972f182086e16d0152a59e76d2f081fcf2b0. This remains the canonical writer for scripts/checks/verify_security_notes.py, its focused regression suite, and the additive quickcheck invocation. Product lanes must not carry a second copy of this parser.

Selected doctoring documents opt in to a rendered level-two Security Notes section containing an explicit ### Trust boundary contract. sidebar-disabled-tooltips.md remains the first registered document; absent preregistered files stay ignored until their product owner reaches the checked tree.

Current RED → causal repairs

Fresh CommonMark review found three related admission/boundary defects after the earlier raw-HTML unification.

  1. Type-2 HTML-comment termination line. _remove_html_comment_content() could expose <!-- -->## Security Notes or <!--\n-->## Security Notes as a policy heading even though CommonMark keeps the whole --> termination line inside the raw HTML block. RED ad3adf085c438d1dbab113375c41e34b1383047e adds same-line and multiline block-comment regressions; GREEN 5251fc14ffa4898eee39533d9da20bb5d9265835 admits block-start comments through the raw-HTML state machine before inline-comment stripping.

  2. Multiline inline-comment continuation. A comment beginning after visible paragraph text could continue onto the next line and have the parser remove --> while promoting a trailing ## Security Notes suffix as a block heading. RED 55bbc22d501cc2928f243cd7a53504ad42e22ac6 captures that continuation case; GREEN c03399ab248ec5a9336cacefaae53728e623917d conservatively excludes the full line when it begins while an inline comment is still open, preventing comment continuation text from manufacturing block-level governance evidence.

  3. Doctoring section ownership. doctoring_security_notes_section() stopped only on a later textual ## prefix, so a level-one # Appendix did not close the level-two ## Security Notes section. A ### Trust boundary under that appendix could therefore backfill the earlier Security Notes contract. RED 8e42cf81c2a737a02de60b39ffd0f3b9b7da1b72 fixes the expected failure; GREEN 8dda972f182086e16d0152a59e76d2f081fcf2b0 reuses the shared rendered-heading parser, requires an actual level-two Security Notes heading, and terminates its evidence at the next heading of level two or higher.

These REDs are source-level regressions; no hosted failing run is claimed for them. The checker is deliberately a conservative policy-admission parser, not a full CommonMark renderer. Ambiguous unsupported constructs fail closed rather than becoming review-visible security evidence.

Reference: CommonMark 0.31.2, §4.6 HTML blocks — https://spec.commonmark.org/0.31.2/#html-blocks

Earlier contracts retained

Earlier canonical RED 8871a5ae22873835271e7e42b8cbf973fd2eb1f7 → GREEN a96ba84c8bd73232e228fabd41ef9726e788ac1d unified plan and doctoring raw-HTML admission through markdown_policy_lines(). Plan RED dba7a961e4371e34f61567147ae26ce881b4bf87 → GREEN 88cba336d868b184c8740e84b9fdaa3c6274fba9 → edge contract 67428375e99c72f069bfafb7b149a35e8b6355bb still covers fenced/indented code, hidden HTML/comment evidence, fake headings, peer-section backfill, ATX indentation and closing-hash boundaries. Earlier CodeRabbit findings on bare trust-boundary prose and plan extraction also remain repaired.

The plan scope remains docs/plans/*.md; this PR does not expand the six-subsection plan template to all doctoring/traceability documents. Doctoring remains opt-in and keeps its narrower substantive trust-boundary rule.

Single-writer consolidation

Project Persistence #970 temporarily accumulated a parallel generic Security Notes parser/test lineage while investigating the same class of issue. That was a single-writer violation. #970 ordinary descendants restored the generic checker to protected develop and removed its generic governance regression files; historical #970 parser commits remain ancestry only. This PR owns exactly:

  • scripts/checks/verify_security_notes.py
  • scripts/checks/test_verify_security_notes.py
  • scripts/harness/quickcheck.sh

No Tooltip/UI source, product-persistence code, dependency, lockfile, model, audio/MIR code, release workflow, required status, or gate threshold is changed.

Evidence boundary

Every source movement invalidates predecessor hosted evidence. Exact 8dda972f182086e16d0152a59e76d2f081fcf2b0 must obtain its own repository/central checks. #1176 remains the one-file formatter prerequisite and must reach protected ancestry before ordinary reconciliation; its delta must not be copied here.

A qualifying independent non-author current-head formal approval is also required. Automated review comments, predecessor approvals, queued/pending checks, self/admin approval, mention receipts, or synthetic statuses are not merge authority.

Security Notes

Documentation source is untrusted policy input. The attack surface is parser ambiguity allowing hidden/example text or mis-bounded sections to impersonate review-visible governance evidence. The trust boundary is quickcheck admission for plan and registered doctoring evidence. Mitigations are one shared rendered-Markdown admission boundary, explicit heading-level ownership, exclusion of code/comments/raw HTML including whole termination lines and continuation lines, bounded doctoring registration, and focused regressions. Test points cover hidden headings/subsection phrases, peer and higher-level section leakage, ATX/closing-hash edges, representative raw-HTML classes, block-comment termination tails, multiline inline-comment continuation, and existing doctoring behavior. Realistic threats are generated or hand-written documentation satisfying a security gate without visible reviewer evidence. Remaining risk is that the checker is intentionally conservative rather than a full renderer; ambiguous constructs must fail closed and be repaired in this canonical governance owner.

Keep Draft until #1176 reaches protected ancestry, this branch is ordinarily reconciled, one unchanged final head/base has all applicable repository/central checks terminal-success, valid findings are zero, and qualifying independent non-author review exists. No self-approval, bypass, force-push, destructive rebase, no-op retrigger, synthetic status, or gate weakening.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please review exact head 5066b03ae60ca979d043b92178402392e3edabdf only. Focus on whether the explicit doctoring registry is a sufficiently durable machine-readable scope marker, whether absent preregistered files fail safely without creating a mutable sibling dependency, whether the registered-file trust-boundary predicate can be bypassed by heading/body placement, and whether the existing six-subsection docs/plans policy remains byte-semantically unchanged. Do not transfer findings or approvals from #1193 or predecessor heads.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='5066b03ae60ca979d043b92178402392e3edabdf'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== commit identity ==='
git rev-parse HEAD
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

echo '=== exact name-status delta ==='
git diff --name-status "$base" "$head"

echo '=== exact patch ==='
git diff --no-ext-diff --unified=80 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== checker structure at exact head ==='
ast-grep outline scripts/checks/verify_security_notes.py --items all || true
echo '=== checker content at exact head ==='
cat -n scripts/checks/verify_security_notes.py

echo '=== test structure at exact head ==='
ast-grep outline scripts/checks/test_verify_security_notes.py --items all || true
echo '=== test content at exact head ==='
cat -n scripts/checks/test_verify_security_notes.py

echo '=== quickcheck relevant calls ==='
rg -n -C 8 'verify_security_notes|test_verify_security_notes|Security Notes' scripts/harness/quickcheck.sh

echo '=== baseline checker content ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

Length of output: 22554


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='5066b03ae60ca979d043b92178402392e3edabdf'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== registry target in exact head tree ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | sed -n '/sidebar-disabled-tooltips\.md$/p'
echo '=== doctoring markdown files and Security Notes/trust-boundary headings ==='
if [ -d docs/doctoring ]; then
  fd -e md . docs/doctoring -x sh -c '
    printf "\n--- %s ---\n" "$1"
    rg -n -i -C 2 "^[[:space:]]{0,3}#{1,6}[[:space:]]+.*(security notes|trust.boundary)|security notes|trust.boundary" "$1" || true
  ' sh {}
fi

echo '=== plan files containing References and Security Notes/subsection headings ==='
if [ -d docs/plans ]; then
  fd -e md . docs/plans -x sh -c '
    if rg -qi "^[[:space:]]{0,3}##[[:space:]]+references|security notes" "$1"; then
      printf "\n--- %s ---\n" "$1"
      rg -n -i -C 2 "^[[:space:]]{0,3}#{1,6}[[:space:]]+(security notes|references|attack surface|trust boundary|mitigations|test points|realistic threats|remaining risk)" "$1" || true
    fi
  ' sh {}
fi

echo '=== all direct checker calls and imports ==='
rg -n -C 3 '(find_security_notes_violations|security_notes_section|verify_security_notes\.py)' \
  -g '*.py' -g '*.sh' -g '*.md' .

echo '=== baseline-vs-head function body, whitespace visible ==='
git diff --no-ext-diff --word-diff=porcelain "$base" "$head" -- scripts/checks/verify_security_notes.py

echo '=== test cases that exercise heading/body placement ==='
rg -n -C 4 '(Security Notes|trust.boundary|References|Approaches considered|Decision)' \
  scripts/checks/test_verify_security_notes.py

Length of output: 31871


@seonghobae I reviewed only 5066b03ae60ca979d043b92178402392e3edabdf against develop@314ddeae7b775a4957594b599358c8255617eb2e.

The source-controlled DOCTORING_SECURITY_NOTES_REQUIRED registry is a durable machine-readable scope marker. The path.exists() skip correctly permits the preregistered document to be absent until its owner integrates it. I found two blocking contract defects.

  1. P1 — Require a real trust-boundary statement, not a matching heading or token.
    scripts/checks/verify_security_notes.py:79 accepts any "trust boundary" substring in the extracted text. A registered document with only ### Trust boundary, or a prose fragment such as trust boundary, passes without a trust-boundary statement. The predicate must require the intended structured content and non-empty statement body. Add regression fixtures for an empty heading, a heading-only match, and a body-token-only match.

  2. P1 — Do not change the existing plan-section extraction semantics.
    scripts/checks/verify_security_notes.py:38 adds "\n## references" to security_notes_section(). Plan validation also uses this function at scripts/checks/verify_security_notes.py:66-69. A plan that places a required subsection after ## References passed before this change but now fails. This is not byte-semantically unchanged plan policy. Keep the original extractor for docs/plans, or use a doctoring-specific extractor that stops at ## References.

The new quickcheck ordering is correct. It runs the policy regression immediately before the production Security Notes gate.

You are interacting with an AI system.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Fresh review request for exact head 47595c4c7bae985068878ba2a816e9e978da6a73 only. The prior request targeted predecessor 5066b03... and is stale. Please verify the explicit ## Security Notes doctoring parser cannot be satisfied by narrative mentions outside the section, the opt-in registry/absent-file behavior does not create a mutable #1193 dependency, and the existing docs/plans six-subsection semantics remain unchanged. Do not transfer predecessor or #1193 review evidence.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='47595c4c7bae985068878ba2a816e9e978da6a73'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== commit identity and ancestry ==='
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=yes'

echo '=== exact delta ==='
git diff --name-status "$base" "$head"
git diff --no-ext-diff --unified=100 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== exact-head checker outline and contents ==='
ast-grep outline scripts/checks/verify_security_notes.py --items all || true
cat -n scripts/checks/verify_security_notes.py

echo '=== protected-base checker contents ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

echo '=== exact-head regression tests ==='
ast-grep outline scripts/checks/test_verify_security_notes.py --items all || true
cat -n scripts/checks/test_verify_security_notes.py

echo '=== quickcheck integration ==='
rg -n -C 8 'test_verify_security_notes|verify_security_notes' scripts/harness/quickcheck.sh

echo '=== registered doctoring target existence in exact head ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | rg -n '(^|/)sidebar-disabled-tooltips\.md$' || true

echo '=== all direct checker references in exact head ==='
rg -n -C 3 '\b(find_security_notes_violations|security_notes_section|DOCTORING_SECURITY_NOTES_REQUIRED)\b' \
  scripts/checks scripts/harness

Length of output: 29266


@seonghobae I reviewed only 47595c4c7bae985068878ba2a816e9e978da6a73 against develop@314ddeae7b775a4957594b599358c8255617eb2e.

I found one blocking issue.

  1. P1 — Reject pseudo-headings inside fenced code blocks.
    Line 54 accepts any stripped line equal to ## Security Notes. The parser does not distinguish Markdown content from a fenced code block. Therefore, this registered document passes without an actual level-two Security Notes heading or an in-section trust-boundary statement:

    # Tooltip evidence
    
    ```text
    ## Security Notes
    documentation-only trust-boundary example

    References

    
    The parser returns the code-block text as the section body. It then finds `"trust boundary"` after hyphen normalization. Parse Markdown fence state, or otherwise exclude fenced code blocks, before matching the heading and section body. Add a regression fixture for this bypass.
    
    

The registry is a source-controlled, explicit scope marker. The path.exists() condition correctly ignores the preregistered file while it is absent. The exact head does not contain docs/doctoring/sidebar-disabled-tooltips.md. This does not create a mutable dependency on #1193.

The plan parser at Lines 30-47 and the six required subsection strings are unchanged from the protected base. The existing docs/plans six-subsection semantics remain unchanged.


_You are interacting with an AI system._

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Fresh exact-head review for 7ec499bae3ea4016f57fc58c4816edad4b8d8d8f only. The predecessor 5066b03... review found two P1 defects; current descendants repair both: plan extraction uses protected-base delimiters again, and doctoring validation now rejects narrative/heading-only/token-only/short-fragment trust boundary matches while requiring substantive prose in the explicit ## Security Notes section. Please verify those repairs, absent preregistered-file semantics, and the three-file governance scope. Predecessor review evidence does not transfer.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='7ec499bae3ea4016f57fc58c4816edad4b8d8d8d8f'
base='314ddeae7b775a4957594b599358c8255617eb2e'

# Correct the requested head variable from the authoritative user-provided hash.
head='7ec499bae3ea4016f57fc58c4816edad4b8d8d8f'

echo '=== commit identity and ancestry ==='
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'protected_base_is_ancestor=yes'

echo '=== exact protected-base delta ==='
git diff --name-status "$base" "$head"
git diff --no-ext-diff --unified=120 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== exact-head checker structure and content ==='
ast-grep outline scripts/checks/verify_security_notes.py --items all || true
cat -n scripts/checks/verify_security_notes.py

echo '=== protected-base checker content ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

echo '=== exact-head regression test structure and content ==='
ast-grep outline scripts/checks/test_verify_security_notes.py --items all || true
cat -n scripts/checks/test_verify_security_notes.py

echo '=== exact-head quickcheck integration ==='
rg -n -C 10 '\btest_verify_security_notes\.py\b|\bverify_security_notes\.py\b' \
  scripts/harness/quickcheck.sh

echo '=== registered file presence in exact-head tree ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | \
  rg '(^|/)sidebar-disabled-tooltips\.md$' || true

echo '=== checker call sites and policy constants ==='
rg -n -C 4 \
  '\b(DOCTORING_SECURITY_NOTES_REQUIRED|security_notes_section|doctoring_security_notes_section|find_security_notes_violations)\b' \
  scripts/checks scripts/harness

echo '=== markdown fence and heading-related test fixtures ==='
rg -n -i -C 6 \
  '(fence|```|Security Notes|trust.boundary|References|Attack surface|Realistic threats|Remaining risk)' \
  scripts/checks/test_verify_security_notes.py

Length of output: 37866


@seonghobae I reviewed only 7ec499bae3ea4016f57fc58c4816edad4b8d8d8f against develop@314ddeae7b775a4957594b599358c8255617eb2e.

I found one blocking issue.

  1. P1 — Exclude fenced and indented code from doctoring heading parsing.
    doctoring_security_notes_section() at Lines 56-64 uses line.strip() to match ## Security Notes. It does not track Markdown fence state. It also accepts an indented code line after stripping indentation. Therefore, code content can satisfy both the heading and substantive-prose checks:

    # Tooltip evidence
    
    ```text
    ## Security Notes
    The external URL is documentation-only and creates no runtime trust-boundary path.

    References

    
    This document has no actual level-two `## Security Notes` heading. The checker still accepts it. Exclude fenced and indented code before heading and body parsing. Add RED regression fixtures for both forms.
    
    

The other requested properties are correct:

  • The registry is explicit and source controlled.
  • The absent registered file is skipped at Lines 103-106. The exact head does not contain docs/doctoring/sidebar-disabled-tooltips.md. This does not create a mutable dependency on #1193.
  • The narrative, heading-only, token-only, and short-fragment fixtures cover the stated trust-boundary predicate repairs.
  • security_notes_section() at Lines 32-49 is unchanged from the protected base. The docs/plans six-subsection extraction semantics remain unchanged.
  • The exact protected-base delta contains only the three stated governance files.
  • quickcheck.sh runs the new regression test immediately before the production Security Notes gate.

_You are interacting with an AI system._

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Fresh exact-head review for 58d76aab5dd614375758af3c143a79e8c78712e8 only. This replaces stale requests for 5066b03... and 7ec499.... The predecessor P1 findings are now addressed structurally: the plan extractor again matches protected-base semantics, while registered doctoring evidence requires ## Security Notes### Trust boundary with a substantive sentence body; prose without the subsection, heading-only, token-only, and short-fragment cases are pinned RED. Please verify these repairs, absent-file preregistration, and the three-file governance scope. No predecessor review evidence transfers.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='58d76aab5dd614375758af3c143a79e8c78712e8'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== exact commit identity and ancestry ==='
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'protected_base_is_ancestor=yes'

echo '=== exact protected-base changed-file scope ==='
git diff --name-status "$base" "$head"
echo '--- changed paths only ---'
git diff --name-only "$base" "$head"

echo '=== exact patch for stated governance files ==='
git diff --no-ext-diff --unified=120 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== exact-head checker outline ==='
ast-grep outline scripts/checks/verify_security_notes.py --items all || true
echo '=== exact-head checker ==='
git show "$head:scripts/checks/verify_security_notes.py" | cat -n
echo '=== protected-base checker ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

echo '=== exact-head regression tests ==='
ast-grep outline scripts/checks/test_verify_security_notes.py --items all || true
git show "$head:scripts/checks/test_verify_security_notes.py" | cat -n

echo '=== quickcheck Security Notes ordering ==='
git show "$head:scripts/harness/quickcheck.sh" | \
  rg -n -C 10 '\btest_verify_security_notes\.py\b|\bverify_security_notes\.py\b'

echo '=== registry target presence in exact-head tree ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | \
  rg '(^|/)sidebar-disabled-tooltips\.md$' || true

echo '=== direct checker call sites at exact head ==='
git grep -n -I -E \
  '(DOCTORING_SECURITY_NOTES_REQUIRED|security_notes_section|doctoring_security_notes_section|find_security_notes_violations)' \
  "$head" -- scripts/checks scripts/harness || true

echo '=== parser and fixture lines related to Markdown code and section boundaries ==='
git show "$head:scripts/checks/test_verify_security_notes.py" | \
  rg -n -i -C 8 \
  '(fence|indented|code block|```|Security Notes|Trust boundary|References|Attack surface|Realistic threats|Remaining risk)' || true

Length of output: 33635


@seonghobae I reviewed only 58d76aab5dd614375758af3c143a79e8c78712e8 against develop@314ddeae7b775a4957594b599358c8255617eb2e.

I found one blocking issue.

  1. P1 — Exclude fenced and indented code from doctoring Markdown parsing.
    Line 57 and Line 73 call strip() before they match the required headings. The parser does not track fenced-code state. It also accepts indented code. Therefore, code content can satisfy both required headings and the substantive-body predicate.

    This document passes even though it has no real ## Security Notes section:

    # Tooltip evidence
    
    ```text
    ## Security Notes
    ### Trust boundary
    The external URL is documentation-only and creates no runtime trust-boundary path.

    References

    
    Exclude fenced-code and indented-code lines before parsing headings or subsection bodies. Add RED fixtures for both cases.
    
    

The requested repairs are otherwise present:

  • The exact protected-base delta contains only the three stated governance files.
  • security_notes_section() at Lines 32-49 is byte-equivalent to the protected-base plan extractor. The six-subsection docs/plans policy remains unchanged.
  • The source-controlled registry is an explicit machine-readable scope marker.
  • Lines 106-109 ignore an absent registered file. The registered sidebar-disabled-tooltips.md file is absent at this exact head. This does not create a mutable dependency on #1193.
  • The tests cover narrative text outside the governed section, a missing Trust boundary subsection, a heading-only subsection, a token-only body, and a short-fragment body.
  • quickcheck.sh runs the regression test immediately before the production Security Notes gate.

_You are interacting with an AI system._

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Fresh exact-head review for 21d8856f95e93baf93511d4162438760f2238981 only. The valid P1 on 58d76aa... is repaired by filtering fenced Markdown and 4-space/tab indented code before doctoring heading/body extraction; focused regressions require valid-looking ## Security Notes### Trust boundary evidence inside either code form to remain RED. Protected-base plan extraction semantics remain unchanged. Please review only this current three-file governance delta; no predecessor review/check evidence transfers.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='21d8856f95e93baf93511d4162438760f2238981'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== exact commit identity and ancestry ==='
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'protected_base_is_ancestor=yes'

echo '=== protected-base changed-file scope ==='
git diff --name-status "$base" "$head"
echo '--- changed paths ---'
git diff --name-only "$base" "$head"

echo '=== exact patch: governance files ==='
git diff --no-ext-diff --unified=120 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== exact-head checker outline ==='
git show "$head:scripts/checks/verify_security_notes.py" > /tmp/verify_security_notes.py
ast-grep outline /tmp/verify_security_notes.py --items all || true

echo '=== exact-head checker ==='
cat -n /tmp/verify_security_notes.py

echo '=== protected-base checker ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

echo '=== exact-head regression tests ==='
git show "$head:scripts/checks/test_verify_security_notes.py" | cat -n

echo '=== quickcheck ordering ==='
git show "$head:scripts/harness/quickcheck.sh" | \
  rg -n -C 10 '\btest_verify_security_notes\.py\b|\bverify_security_notes\.py\b'

echo '=== registered doctoring document in exact tree ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | \
  rg '(^|/)sidebar-disabled-tooltips\.md$' || true

echo '=== exact code-filtering and doctoring-policy locations ==='
git show "$head:scripts/checks/verify_security_notes.py" | \
  rg -n -C 8 \
  '(DOCTORING_SECURITY_NOTES_REQUIRED|doctoring_markdown_lines|doctoring_security_notes_section|Trust boundary|fenced|indent|path\.exists|security_notes_section)' || true

echo '=== exact RED fixtures for code blocks and trust boundary ==='
git show "$head:scripts/checks/test_verify_security_notes.py" | \
  rg -n -i -C 8 \
  '(fenced|indented|code block|```|Security Notes|Trust boundary|heading.only|token.only|short.fragment|narrative)' || true

echo '=== plan extractor equality after normalizing header line numbers ==='
git diff --no-ext-diff -U0 "$base" "$head" -- scripts/checks/verify_security_notes.py | \
  rg -n -C 3 'security_notes_section|required_subsections|docs/plans' || true

Length of output: 43440


@seonghobae I reviewed only 21d8856f95e93baf93511d4162438760f2238981 against develop@314ddeae7b775a4957594b599358c8255617eb2e.

I found no blocking issue.

  • The delta contains only the three stated governance files.
  • doctoring_markdown_lines() removes fenced code and tab or four-space indented code before doctoring heading and body parsing.
  • The focused fixtures require fenced and indented valid-looking Security Notes evidence to fail.
  • The doctoring parser requires the exact ## Security Notes heading, the exact ### Trust boundary subsection, and a substantive sentence body.
  • The source-controlled registry remains explicit and scoped.
  • The absent registered sidebar-disabled-tooltips.md file is skipped. The exact tree does not contain that file. This does not create a mutable dependency on #1193.
  • security_notes_section() remains byte-equivalent to the protected-base plan extractor. The existing docs/plans six-subsection semantics remain unchanged.
  • quickcheck.sh invokes the focused regression immediately before verify_security_notes.py.

I did not execute repository code in the inspection sandbox.

You are interacting with an AI system.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please review only current exact head b217087f7697dbc255cd31688ad5868fd489ee15 against protected develop@314ddeae7b775a4957594b599358c8255617eb2e. Focus on the doctoring Security Notes parser after RED b160bb354748dab4ef03308f64772d73aa71e930: hidden multiline HTML comments must not be able to impersonate rendered ## Security Notes / ### Trust boundary evidence, while fenced/indented-code rejection and the existing plans six-subsection contract remain unchanged. Treat all predecessor reviews/checks as stale; please report actionable findings only on this exact head. Do not infer approval from queued checks.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='b217087f7697dbc255cd31688ad5868fd489ee15'
base='314ddeae7b775a4957594b599358c8255617eb2e'

echo '=== exact commit identity and ancestry ==='
git cat-file -t "$head"
git cat-file -t "$base"
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'protected_base_is_ancestor=yes'

echo '=== exact protected-base scope ==='
git diff --name-status "$base" "$head"
git diff --name-only "$base" "$head"

echo '=== exact governance patch ==='
git diff --no-ext-diff --unified=140 "$base" "$head" -- \
  scripts/checks/verify_security_notes.py \
  scripts/checks/test_verify_security_notes.py \
  scripts/harness/quickcheck.sh

echo '=== exact-head checker structure ==='
git show "$head:scripts/checks/verify_security_notes.py" > /tmp/verify_security_notes.py
ast-grep outline /tmp/verify_security_notes.py --items all || true

echo '=== exact-head checker ==='
cat -n /tmp/verify_security_notes.py

echo '=== protected-base checker ==='
git show "$base:scripts/checks/verify_security_notes.py" | cat -n

echo '=== exact-head test module ==='
git show "$head:scripts/checks/test_verify_security_notes.py" | cat -n

echo '=== quickcheck Security Notes ordering ==='
git show "$head:scripts/harness/quickcheck.sh" | \
  rg -n -C 10 '\btest_verify_security_notes\.py\b|\bverify_security_notes\.py\b'

echo '=== registered doctoring document in exact tree ==='
git ls-tree -r --name-only "$head" -- docs/doctoring | \
  rg '(^|/)sidebar-disabled-tooltips\.md$' || true

echo '=== exact Markdown filtering and HTML-comment fixtures ==='
git show "$head:scripts/checks/verify_security_notes.py" | \
  rg -n -i -C 12 \
  '(doctoring_markdown_lines|comment|fenced|indent|Security Notes|Trust boundary|path\.exists|security_notes_section)' || true
git show "$head:scripts/checks/test_verify_security_notes.py" | \
  rg -n -i -C 10 \
  '(html|comment|multiline|fenced|indented|Security Notes|Trust boundary|References)' || true

echo '=== plan extractor diff check ==='
git diff --no-ext-diff -U0 "$base" "$head" -- scripts/checks/verify_security_notes.py | \
  rg -n -C 4 '(security_notes_section|required_subsections|docs/plans)' || true

echo '=== direct policy references in exact tree ==='
git grep -n -I -E \
  '(DOCTORING_SECURITY_NOTES_REQUIRED|doctoring_markdown_lines|doctoring_security_notes_section|find_security_notes_violations)' \
  "$head" -- scripts/checks scripts/harness || true

Length of output: 52247


@seonghobae I reviewed only b217087f7697dbc255cd31688ad5868fd489ee15 against develop@314ddeae7b775a4957594b599358c8255617eb2e.

I found no actionable issue.

  • doctoring_markdown_lines() removes multiline HTML-comment content before it matches ## Security Notes or extracts ### Trust boundary content.
  • The regression at scripts/checks/test_verify_security_notes.py Lines 96-108 confirms that a complete valid-looking evidence block inside <!-- ... --> fails.
  • Fenced-code and four-space/tab-indented-code exclusion remains in doctoring_markdown_lines().
  • security_notes_section() is unchanged from the protected base. The plan six-subsection contract remains unchanged.
  • The exact delta contains only the three stated governance files.
  • The absent registered sidebar-disabled-tooltips.md file is skipped. This behavior does not require mutable content from #1193.
  • quickcheck.sh runs the focused regression directly before verify_security_notes.py.

I performed static inspection only. I did not treat queued or non-terminal checks as passing evidence.

You are interacting with an AI system.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent review

Please review exact head 5251fc14ffa4898eee39533d9da20bb5d9265835 only. Focus on the CommonMark type-2 HTML-comment block boundary added by RED ad3adf085c438d1dbab113375c41e34b1383047e → GREEN 5251fc14ffa4898eee39533d9da20bb5d9265835: a line beginning <!-- must keep its full matching --> termination line outside review-visible policy evidence, while genuinely inline HTML comments inside visible Markdown must not create a second parser or weaken the existing plan/doctoring contracts. Treat this as review dispatch only; do not infer source repair or approval from the mention itself.

Copy link
Copy Markdown
Collaborator Author

@cwl-noema-review

Review exact head 8dda972f182086e16d0152a59e76d2f081fcf2b0 only. Please verify the final governance boundary after RED 8e42cf81c2a737a02de60b39ffd0f3b9b7da1b72 → GREEN 8dda972f182086e16d0152a59e76d2f081fcf2b0: a rendered level-two Security Notes section must end at the next peer or higher-level heading, while the existing CommonMark raw-HTML/comment admission contracts remain intact. Treat this mention strictly as review dispatch; no source-repair progress or approval is inferred from the request itself.

"remaining risk",
]
FENCE_OPEN_RE = re.compile(r"^ {0,3}(`{3,}|~{3,})(.*)$")
MARKDOWN_HEADING_RE = re.compile(r"^ {0,3}(#{1,6})(?:[ \t]+|$)(.*?)\s*$")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance priority: high High-priority or P1 work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Governance] Enforce Security Notes for doctoring documents with external references

1 participant