From 79d6ba5be932ed5b75315f54ad6cb2cb165bfdc8 Mon Sep 17 00:00:00 2001 From: Evelyn Chen Date: Thu, 27 Aug 2026 17:48:43 +0000 Subject: [PATCH] Tokenize open disclosure attributes Authored-By: Codex (GPT-5) --- check.sh | 4 +++- tests/bin/curl | 6 ++++-- tests/run | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/check.sh b/check.sh index f04b634..f6355fa 100755 --- a/check.sh +++ b/check.sh @@ -55,9 +55,11 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" | if (char == ">") { lower=tolower(tag) if (lower ~ /^])/) { + attributes=lower + gsub(/"[^"]*"/, "", attributes) parent_hidden=(details_depth > 0 && hidden[details_depth]) details_depth++ - hidden[details_depth]=(parent_hidden || lower !~ /[[:space:]]open([[:space:]=>]|$)/) + hidden[details_depth]=(parent_hidden || attributes !~ /[[:space:]]open([[:space:]=>]|$)/) } else if (lower ~ /^<\/details([[:space:]>])/) { if (details_depth > 0) { diff --git a/tests/bin/curl b/tests/bin/curl index 6ac3373..3832ec0 100755 --- a/tests/bin/curl +++ b/tests/bin/curl @@ -62,8 +62,10 @@ printf '%s\n' "${PR_BODY}" | awk ' next } if (lower ~ /^[ ]{0,3}])/) { - if (lower ~ /[[:blank:]]open([[:blank:]=>]|$)/) print "
" - else print "
" + attributes=lower + gsub(/"[^"]*"/, "", attributes) + if (attributes ~ /[[:blank:]]open([[:blank:]=>]|$)/) sub(/
/, "
", line) + print line next } if (line ~ /^## Tracking[[:space:]]*$/) print "

Tracking

" diff --git a/tests/run b/tests/run index 15246a2..c6bce89 100755 --- a/tests/run +++ b/tests/run @@ -185,6 +185,9 @@ check_contract_pass "open details preserve visible provenance" \ check_contract "open details inside collapsed details remain hidden" \ $'
Release notes\n
Visible only after expansion\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) \n
\n
' \ "$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section" +check_contract "open text in another details attribute remains collapsed" \ + $'
Release notes\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) \n
' \ + "$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section" check_contract_pass "unrelated collapsed details remain available" \ $'
Logs\n\nSupporting output\n
\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) ' \ "$BASE" "$GOOD_HEAD"