body-marker.jq strips inline code spans, not only block fences (#2111) #2115

Closed
matou-build-agent wants to merge 1 commit from agent/issue-2111 into main

closes #2111

What this lands

body-marker.jq's marker($key) de-fenced only CommonMark block fences before searching for an <!-- key: value --> marker, so a marker someone merely quoted in inline backticks while describing it in prose was read as a live marker. The fix adds strip_inline_code — a run of N backticks closed by the next run of N on the same line (. never crosses a newline, so an unbalanced backtick in prose cannot swallow a later line) — applied after outside_fences, then matches as before.

Two mis-reads confirmed on the live tracker, reproduced read-only through the real vendored lib and re-verified after the vendor:

ticket marker before after
#2036 (healer triage ticket) origin report (read as a ROOT app report → wedged landing-tripwire leg 2 on every push to main) ∅
#2054 (human-gated forward-port) session-landing pr (unattended-landing knob flipped off prose about the knob) ∅ (origin still 2046, its genuine bare marker)
#2064 origin 2047 2047 (unchanged)

Why not "a marker alone on its own line"

The ticket proposed requiring a marker to be alone on its line. That would break the #206 agent-merge gate: close-report.sh stamps its gates-passed marker sharing its line with a human-readable sentence, a prose-adjacent marker that is not in a code span and must keep parsing. The issue-body-only blast-radius sweep in the ticket missed this PR-comment consumer. Stripping inline code spans is narrower — it kills the backtick-quoted phantoms while leaving every prose-adjacent (non-span) marker working.

Where it lands

body-marker.jq / body-marker-lib.sh / tests/body-marker-lib-test.sh are vendored byte-identical from Matou/dev-factory (protected .sandcastle/, #445). Fix + test landed on dev-factory backport/idss-2111 (a4189e0, off the pin e77a951, #1684 still open), then re-vendored here: FACTORY_REF e77a951→a4189e0, FACTORY_MANIFEST no churn, drift-gate OK.

Proof

  • Red-before-green: the new test fails on the old jq, passes on the new.
  • body-marker-lib-test.sh group 7 (prose-adjacent incl. close-report #206 parses; single + double backtick inline-span markers do not; a lone unmatched backtick opens no span; a real marker beats an earlier inline-span phantom) + group 8 (#2036 origin phantom).
  • Suites green: landing-lib-test (121), close-report-test (139), close-report-lib-test (77), list-ready-tasks-test, session-runner-test (25), ticket-landing-test (49).

Owed (filed, out of scope)

  • #2113 — forward-port this fix onto dev-factory main (a reviewed PR; dev-factory is LANDING=pr; joins the #2049/#2053 debt gating #1684).
  • #2114 — session_host_marker has its own sed parser the marker() fix does not cover and still honours an inline-backtick host pin (same class).

For the human (not part of this PR)

Once merged, #2036 stops reading as an app report on its own — no body edit needed, and the charter forbids the healer removing an origin marker (real or phantom). #2054 is worth a by-hand re-read to confirm nobody acted on the phantom session-landing opt-in while it stood.

Screenshots: none — a jq marker-parser fix with no UI surface; proof is the vendored red-before-green test suite plus the read-only live-body reproduction (#2036/#2054/#2064) shown above.

closes #2111 ## What this lands `body-marker.jq`'s `marker($key)` de-fenced only CommonMark **block** fences before searching for an `<!-- key: value -->` marker, so a marker someone merely quoted in **inline backticks** while describing it in prose was read as a live marker. The fix adds `strip_inline_code` — a run of N backticks closed by the next run of N on the same line (`.` never crosses a newline, so an unbalanced backtick in prose cannot swallow a later line) — applied after `outside_fences`, then matches as before. Two mis-reads confirmed on the live tracker, reproduced **read-only** through the real vendored lib and re-verified after the vendor: | ticket | marker | before | after | | --- | --- | --- | --- | | #2036 (healer triage ticket) | origin | `report` (read as a ROOT app report → wedged `landing-tripwire` leg 2 on every push to `main`) | ∅ | | #2054 (human-gated forward-port) | session-landing | `pr` (unattended-landing knob flipped off prose about the knob) | ∅ (origin still `2046`, its genuine bare marker) | | #2064 | origin | `2047` | `2047` (unchanged) | ## Why not "a marker alone on its own line" The ticket proposed requiring a marker to be alone on its line. That would **break the #206 agent-merge gate**: `close-report.sh` stamps its `gates-passed` marker *sharing* its line with a human-readable sentence, a prose-adjacent marker that is **not** in a code span and must keep parsing. The issue-body-only blast-radius sweep in the ticket missed this PR-comment consumer. Stripping inline code spans is narrower — it kills the backtick-quoted phantoms while leaving every prose-adjacent (non-span) marker working. ## Where it lands `body-marker.jq` / `body-marker-lib.sh` / `tests/body-marker-lib-test.sh` are vendored byte-identical from `Matou/dev-factory` (protected `.sandcastle/`, #445). Fix + test landed on dev-factory `backport/idss-2111` (`a4189e0`, off the pin `e77a951`, #1684 still open), then re-vendored here: `FACTORY_REF` `e77a951`→`a4189e0`, `FACTORY_MANIFEST` no churn, drift-gate OK. ## Proof - Red-before-green: the new test fails on the old jq, passes on the new. - `body-marker-lib-test.sh` group 7 (prose-adjacent incl. close-report #206 parses; single + double backtick inline-span markers do not; a lone unmatched backtick opens no span; a real marker beats an earlier inline-span phantom) + group 8 (#2036 origin phantom). - Suites green: `landing-lib-test` (121), `close-report-test` (139), `close-report-lib-test` (77), `list-ready-tasks-test`, `session-runner-test` (25), `ticket-landing-test` (49). ## Owed (filed, out of scope) - #2113 — forward-port this fix onto dev-factory `main` (a reviewed PR; dev-factory is `LANDING=pr`; joins the #2049/#2053 debt gating #1684). - #2114 — `session_host_marker` has its own `sed` parser the `marker()` fix does not cover and still honours an inline-backtick host pin (same class). ## For the human (not part of this PR) Once merged, #2036 stops reading as an app report on its own — no body edit needed, and the charter forbids the healer removing an origin marker (real or phantom). #2054 is worth a by-hand re-read to confirm nobody acted on the phantom `session-landing` opt-in while it stood. **Screenshots:** none — a jq marker-parser fix with no UI surface; proof is the vendored red-before-green test suite plus the read-only live-body reproduction (#2036/#2054/#2064) shown above.
sandcastle: #2111 — body-marker strips INLINE code spans, not only block fences (re-vendored FACTORY_REF e77a951→a4189e0)
Some checks failed
ci / seam (pull_request) Successful in 18m0s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been cancelled
f26accf37d
marker($key) de-fenced only CommonMark BLOCK fences, so a marker someone merely
quoted in inline backticks while describing it in prose was read as a live
marker. Two confirmed mis-reads, reproduced read-only through the real vendored
lib: #2036 (a healer-filed triage ticket) read origin=report — a ROOT app report
— which pages landing-tripwire leg 2 on every push to main (leg 2 sweeps all open
issues, so the wedge could not be cleared by advancing a workflow mark); and
#2054 read session-landing=pr off a sentence explaining the opt-in knob, flipping
an unattended-landing routing knob on a human-gated ticket.

Fix (two-way door, narrows what is honoured): after outside_fences, also
strip_inline_code — a run of N backticks closed by the next run of N on the same
line (`.` never crosses a newline) — then match as before. Deliberately narrower
than the ticket's "alone on its own line" proposal, which would have broken the
#206 agent-merge gate: close-report.sh stamps its gates-passed marker SHARING its
line with a human sentence, a prose-adjacent marker NOT in a code span that must
keep parsing (the ticket's issue-body-only sweep missed this PR-comment consumer).

Factory-vendored (ADR 0180): landed on dev-factory backport/idss-2111 (a4189e0,
off the pin e77a951, #1684 open) and re-vendored — FACTORY_REF e77a951→a4189e0,
body-marker.jq + body-marker-lib.sh + 1 test updated, FACTORY_MANIFEST no churn,
drift OK. Red-before-green: body-marker-lib-test group 7 (prose-adjacent incl.
close-report #206 parses; single+double backtick spans do not; lone backtick
opens no span; real marker beats an earlier span phantom) + group 8 (#2036
origin phantom); landing-lib/close-report/close-report-lib/list-ready-tasks/
session-runner/ticket-landing suites green. Post-vendor through the real lib:
#2036 origin empty, #2054 session-landing empty (origin still 2046), #2064
unchanged. STATUS + GOTCHAS 403. OWED (filed): #2113 forward-port to dev-factory
main, #2114 session_host_marker's own sed parser (same class, uncovered).
Advances #2111.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Factory-Account: d631bd58e1e9
Owner

Reviewed for merge at Ben's request (2026-11-16 PR sweep) — not merged; left open. Its FACTORY_REF pin is a dev-factory backport/idss-* commit 6–9 commits BEHIND the pin main now carries (291c9bf, after #2179), and not an ancestor of it — merging would roll the vendored harness back. Needs its dev-factory commit re-backported on top of 291c9bf and re-vendored (drift-clean), then a fresh PR.

Reviewed for merge at Ben's request (2026-11-16 PR sweep) — **not merged; left open.** Its FACTORY_REF pin is a dev-factory `backport/idss-*` commit 6–9 commits BEHIND the pin main now carries (`291c9bf`, after #2179), and not an ancestor of it — merging would roll the vendored harness back. Needs its dev-factory commit re-backported on top of `291c9bf` and re-vendored (drift-clean), then a fresh PR.
Owner

Superseded by a7483d0e on main. That commit re-vendors #2068, #2111 and #2114 together onto the current pin (dev-factory backport/idss-2068-2111-2114 @ bbcf34e, off 69d5c0d), so the #2057 snapshot fix stays in. Merging this PR would have rolled FACTORY_REF back. One change: the docs tier now reads its trees from .sandcastle/docs-gate.globs rather than hardcoding idss paths in vendored gate-lib.sh (dev-factory #47 guard).

Superseded by a7483d0e on main. That commit re-vendors #2068, #2111 and #2114 together onto the current pin (dev-factory `backport/idss-2068-2111-2114` @ bbcf34e, off 69d5c0d), so the #2057 snapshot fix stays in. Merging this PR would have rolled `FACTORY_REF` back. One change: the docs tier now reads its trees from `.sandcastle/docs-gate.globs` rather than hardcoding idss paths in vendored `gate-lib.sh` (dev-factory #47 guard).
ben closed this pull request 2026-11-17 12:55:48 +00:00
Some checks failed
ci / seam (pull_request) Successful in 18m0s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss!2115
No description provided.