Skip to content

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

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

repair(governance): enforce scoped doctoring Security Notes#1204
seonghobae wants to merge 15 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 when this change reaches protected develop.

Protected base is develop@314ddeae7b775a4957594b599358c8255617eb2e; current exact head is b217087f7697dbc255cd31688ad5868fd489ee15. The canonical verify_security_notes.py gate previously enforced the six-subsection Security Notes contract only for docs/plans/*.md. That allowed reviewed trust-boundary evidence in docs/doctoring/sidebar-disabled-tooltips.md to disappear while quickcheck still reported the Security Notes gate as passing.

This is repository-policy ownership, not Tooltip product ownership. #1193 source/docs are not copied into this branch.

RED → GREEN contract

The checker keeps the existing plan parser and six-subsection policy unchanged and adds an explicit opt-in registry for doctoring evidence whose reviewed trust-boundary statement must survive regeneration. The first registered document is sidebar-disabled-tooltips.md.

A registered doctoring document is enforced only when it exists in the checked tree. This lets the generic policy reach protected develop before dependent #1193 without consuming a mutable sibling. Once present, the document must contain an explicit level-two ## Security Notes section, an explicit level-three ### Trust boundary subsection, substantive prose, and evidence that is part of rendered Markdown rather than hidden/example content.

The focused regression pins these fail-closed cases:

  • narrative Security Notes/trust-boundary text outside the governed section;
  • trust-boundary prose without the governed subsection;
  • heading-only, token-only, and short-fragment subsection bodies;
  • valid-looking governed headings/body inside fenced code;
  • valid-looking governed headings/body inside indented code;
  • valid-looking governed headings/body hidden inside a multiline HTML comment;
  • unregistered doctoring citations remain outside this boilerplate policy;
  • existing plan six-subsection enforcement remains unchanged.

A structured rendered ### Trust boundary with substantive prose remains GREEN. Quickcheck runs this regression immediately before the production Security Notes gate.

Review/finding repairs

CodeRabbit review of predecessor 5066b03ae60ca979d043b92178402392e3edabdf identified two valid P1 defects: bare trust boundary text could satisfy doctoring validation, and plan extraction accidentally stopped at ## References. Both were repaired without weakening the protected-base plan policy.

Review of later exact 58d76aab5dd614375758af3c143a79e8c78712e8 found another valid P1: fenced or indented code could impersonate the doctoring headings. doctoring_markdown_lines() now excludes both before heading/body extraction.

Fresh inspection of exact 21d8856f95e93baf93511d4162438760f2238981 found one more equivalent rendering bypass: multiline HTML comments were still returned as ordinary Markdown lines, so a hidden ## Security Notes### Trust boundary block could satisfy the gate while rendering no governance evidence. RED b160bb354748dab4ef03308f64772d73aa71e930 added the hidden-comment regression. GREEN b217087f7697dbc255cd31688ad5868fd489ee15 strips HTML-comment spans before doctoring heading/body admission while leaving fenced-code state authoritative. No product/UI/runtime trust boundary changed.

Fresh exact-head CodeRabbit review of b217087f... found no actionable issue and specifically re-checked HTML-comment exclusion, the focused hidden-comment regression, fenced/indented-code exclusion, and unchanged plan-policy behavior. This is review evidence, not a formal GitHub APPROVED, and does not replace protected-branch acceptance.

Hosted exact-head evidence

Hosted ci run 34570305066, ci / build-and-test job 103171867553 reached current exact b217087f... and proves the new governance slice itself is GREEN before the repository's pre-existing formatter prerequisite stops the lane:

  • Documentation check: PASS.
  • scripts/checks/test_verify_security_notes.py: 5 tests, all PASS.
  • production Security Notes gate: PASS.
  • security-pattern, supply-chain, GitHub-bootstrap: PASS.
  • Python docstring check: PASS.
  • repository-pinned Ruff 0.15.5 ruff check src tests: PASS.
  • first causal failure: ruff format --check src tests reports only tests/test_supply_chain_policy.py (1 file would be reformatted, 89 files already formatted).

tests/test_supply_chain_policy.py is not #1204 ownership. It is the known #1176 formatter prerequisite. This PR therefore does not copy, rewrite, or bypass that file; #1176 must reach protected ancestry first, after which #1204 is ordinarily reconciled and revalidated. SBOM for b217087f... is already SUCCESS; remaining current-head workflows are accepted only when terminal-success, never from queued/pending state.

Scope

Exact branch delta over protected develop remains three repository-governance files only:

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

The quickcheck.sh delta is one additive test invocation. Active Distribution PR #1126 also owns release-related quickcheck changes on a separate Draft lineage; this PR does not copy or depend on that mutable branch. If either owner reaches protected ancestry first, the other must ordinarily reconcile and preserve both independent checks rather than overwrite or force-rebase.

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

Security Notes

The registry is the durable machine-readable scope marker for selected doctoring trust-boundary evidence. It deliberately does not impose the plan template's six subsections on every doctoring note. Registered files not yet present are ignored until their owning product document reaches the checked tree; when present, the required headings and substantive trust-boundary statement must exist in rendered Markdown, not fenced/indented code or HTML comments. Removing a registry entry is therefore a review-visible policy change, not an agent-memory or .jules side effect.

Keep Draft until #1176 reaches protected ancestry, this branch is ordinarily reconciled, one unchanged exact head has applicable repository/central checks terminal-success, valid review findings are exhausted, and ordinary protected-branch acceptance plus qualifying independent non-author review are available. 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.

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