[bug-yhg8dqypwmar] fix(check-naming): reject hidden provenance #4
@@ -23,12 +23,14 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
|||||||
if (fence_char == "`" || fence_char == "~") {
|
if (fence_char == "`" || fence_char == "~") {
|
||||||
while (substr(line, fence_pos + fence_run, 1) == fence_char) fence_run++
|
while (substr(line, fence_pos + fence_run, 1) == fence_char) fence_run++
|
||||||
}
|
}
|
||||||
if (in_fence) {
|
if (!in_comment && in_fence) {
|
||||||
print line
|
print line
|
||||||
if (fence_char == active_fence_char && fence_run >= active_fence_run) in_fence=0
|
if (fence_char == active_fence_char && fence_run >= active_fence_run) in_fence=0
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
if (fence_run >= 3) {
|
fence_info=substr(line, fence_pos + fence_run)
|
||||||
|
valid_fence_info=(fence_char == "~" || index(fence_info, "`") == 0)
|
||||||
|
if (!in_comment && fence_run >= 3 && valid_fence_info) {
|
||||||
in_fence=1
|
in_fence=1
|
||||||
|
|
|||||||
active_fence_char=fence_char
|
active_fence_char=fence_char
|
||||||
active_fence_run=fence_run
|
active_fence_run=fence_run
|
||||||
@@ -52,7 +54,13 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ux
commented
You put canonical provenance inside You put canonical provenance inside `<details open>`; Gitea preserves `open` and shows both sections on load, but this branch increments `details_depth` and removes them. The check exits 1 claiming the visible sections are missing. Preserve open disclosure content unless a collapsed ancestor still hides it, and cover that recovery path.
|
|||||||
if (substr(line, pos, 1) == "`") {
|
escaped=0
|
||||||
|
escape_pos=pos - 1
|
||||||
|
while (escape_pos >= 1 && substr(line, escape_pos, 1) == "\\") {
|
||||||
|
escaped++
|
||||||
|
security
commented
Blocker: You submit The checked
Parse attributes as tokens, then add this exact reproduction. Blocker: You submit `<details title=" open ">` with canonical Tracking and Attribution inside. Gitea preserves the attribute and the browser keeps the disclosure collapsed, but this substring match treats the title value as the boolean `open` attribute. Exact head returns `check-naming: ok`.
The checked `<details open>` path has an unchecked `open`-inside-an-attribute-value twin on this line, and it takes the same hidden provenance.
`title` isn't sanitized away: authenticated `/markdown` returned `<details title=" open ">`. This isn't malformed HTML; it is valid rendered markup and remains collapsed.
Parse attributes as tokens, then add this exact reproduction.
dev
commented
Blocker: this regex matches Blocker: this regex matches ` open ` anywhere in the serialized tag, including a quoted attribute value. `<details title=" open ">` has no boolean `open` attribute, so the browser keeps its provenance collapsed; Gitea preserves that tag and exact-head execution accepts the hidden Tracking and Attribution. Recognize an actual attribute name boundary outside quoted values, then cover this exact body.
ops
commented
Blocker: Blocker: `open` is searched across the whole serialized tag, so an ordinary attribute value containing whitespace-delimited `open` makes a collapsed disclosure visible to this filter. Gitea preserves `<details title="x open y">` without the boolean attribute; putting canonical Tracking and Attribution inside it renders collapsed, but exact head exits 0 with `check-naming: ok`. Match the actual boolean attribute without accepting text inside quoted attribute values, then add this reproduction.
|
|||||||
|
escape_pos--
|
||||||
|
}
|
||||||
|
if (substr(line, pos, 1) == "`" && escaped % 2 == 0) {
|
||||||
ticks=1
|
ticks=1
|
||||||
while (substr(line, pos + ticks, 1) == "`") ticks++
|
while (substr(line, pos + ticks, 1) == "`") ticks++
|
||||||
close_pos=pos + ticks
|
close_pos=pos + ticks
|
||||||
|
|||||||
@@ -150,6 +150,15 @@ check_contract "four-space indented backticks do not expose comments" \
|
|||||||
check_contract "unequal backtick runs do not expose comments" \
|
check_contract "unequal backtick runs do not expose comments" \
|
||||||
$'`<!--``\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-->' \
|
$'`<!--``\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-->' \
|
||||||
"$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 "invalid backtick fence info does not expose comments" \
|
||||||
|
$'```html`oops\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-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
|
check_contract "fences inside comments do not expose provenance" \
|
||||||
|
$'<!--\n```html\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-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
|
check_contract "escaped backticks do not hide a comment opener" \
|
||||||
|
$'\\`<!--\\`\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-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
check_contract_pass "inline code containing comment opener stays visible" \
|
check_contract_pass "inline code containing comment opener stays visible" \
|
||||||
$'Use `<!--` when documenting an HTML comment opener.\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>' \
|
$'Use `<!--` when documenting an HTML comment opener.\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"
|
||||||
|
|||||||
Blocker:
curlhas neither a connection nor total timeout. A renderer that accepts the socket and stops responding can hold this step until the configured 5-minute job timeout; the prior local parser had no remote wait. Add bounded connect and total timeouts, then cover a stalled-response reproduction.