Exclude hidden media fallback provenance
test / test (pull_request) Successful in 8s

Authored-By: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
2026-08-27 18:01:03 +00:00
parent 29c34f1527
commit cb30e5d7a6
3 changed files with 19 additions and 4 deletions
+9 -4
View File
@@ -43,7 +43,8 @@ fi
# A collapsed disclosure is valid supporting content, but provenance inside one # A collapsed disclosure is valid supporting content, but provenance inside one
# is not visible by default. Remove only collapsed details subtrees; an open # is not visible by default. Remove only collapsed details subtrees; an open
# disclosure remains visible unless one of its ancestors is collapsed. # disclosure remains visible unless one of its ancestors is collapsed. Media
# fallback subtrees are likewise hidden when the browser supports the element.
VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" | VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
awk ' awk '
{ {
@@ -54,7 +55,11 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
tag=tag char tag=tag char
if (char == ">") { if (char == ">") {
lower=tolower(tag) lower=tolower(tag)
if (lower ~ /^<details([[:space:]>])/) { if (lower ~ /^<(video|audio)([[:space:]>])/) media_depth++
else if (lower ~ /^<\/(video|audio)([[:space:]>])/) {
if (media_depth > 0) media_depth--
}
else if (lower ~ /^<details([[:space:]>])/) {
attributes=lower attributes=lower
gsub(/"[^"]*"/, "", attributes) gsub(/"[^"]*"/, "", attributes)
parent_hidden=(details_depth > 0 && hidden[details_depth]) parent_hidden=(details_depth > 0 && hidden[details_depth])
@@ -67,7 +72,7 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
details_depth-- details_depth--
} }
} }
else if (!hidden[details_depth]) printf "%s", tag else if (!hidden[details_depth] && media_depth == 0) printf "%s", tag
in_tag=0 in_tag=0
tag="" tag=""
} }
@@ -76,7 +81,7 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
in_tag=1 in_tag=1
tag=char tag=char
} }
else if (!hidden[details_depth]) printf "%s", char else if (!hidden[details_depth] && media_depth == 0) printf "%s", char
} }
} }
') ')
+4
View File
@@ -68,6 +68,10 @@ printf '%s\n' "${PR_BODY}" | awk '
print line print line
next next
} }
if (lower ~ /^[ ]{0,3}<\/?(video|audio)([[:blank:]>])/) {
print line
next
}
if (line ~ /^## Tracking[[:space:]]*$/) print "<h2>Tracking</h2>" if (line ~ /^## Tracking[[:space:]]*$/) print "<h2>Tracking</h2>"
else if (line ~ /^## Attribution[[:space:]]*$/) print "<h2>Attribution</h2>" else if (line ~ /^## Attribution[[:space:]]*$/) print "<h2>Attribution</h2>"
else if (line ~ /^- Fixes[[:space:]]/) print "<li>" substr(line, 3) "</li>" else if (line ~ /^- Fixes[[:space:]]/) print "<li>" substr(line, 3) "</li>"
+6
View File
@@ -188,6 +188,12 @@ check_contract "open details inside collapsed details remain hidden" \
check_contract "open text in another details attribute remains collapsed" \ check_contract "open text in another details attribute remains collapsed" \
$'<details title="x open y"><summary>Release notes</summary>\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n</details>' \ $'<details title="x open y"><summary>Release notes</summary>\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n</details>' \
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section" "$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
check_contract "video fallback cannot hide provenance" \
$'<video controls>\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n</video>' \
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
check_contract "audio fallback cannot hide provenance" \
$'<audio controls>\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n</audio>' \
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
check_contract_pass "unrelated collapsed details remain available" \ check_contract_pass "unrelated collapsed details remain available" \
$'<details><summary>Logs</summary>\n\nSupporting output\n</details>\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>' \ $'<details><summary>Logs</summary>\n\nSupporting output\n</details>\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>' \
"$BASE" "$GOOD_HEAD" "$BASE" "$GOOD_HEAD"