body-marker: forward-port idss #2111 onto dev-factory main (strip inline code spans, not only block fences) #318

Open
matou-build-agent wants to merge 1 commit from forward-port/idss-2111 into main

Forward-port of the cheap-backport commit a4189e0 (authored off the pin e77a951) onto main, so dev-factory main HEAD carries the body-marker inline-code-span hardening. idss's eventual main-HEAD adoption — the human-gated idss #1684 — then inherits the fix instead of silently regressing it.

What lands

cherry-pick -x a4189e0 onto main — a clean apply. marker($key) previously de-fenced only BLOCK fences, so a marker someone merely quoted in inline backticks while describing it (`<!-- origin: app-report -->` in a sentence) was read as a live marker. Two confirmed mis-reads on idss drove the fix: #2036 read as a ROOT app report (wedging landing-tripwire leg 2) and #2054 read session-landing=pr off prose about the opt-in knob. The fix strips CommonMark inline code spans after outside_fences, narrower than "alone on its own line" (which would have broken the #206 agent-merge gate, where close-report writes its gates-passed marker sharing a line with prose).

  • body-marker.jq — new strip_inline_code def (a run of N backticks closed by the next run of N on the same line); marker($key) now pipes outside_fences | strip_inline_code.
  • body-marker-lib.sh — doc comment on body_marker updated.
  • tests/body-marker-lib-test.sh — group 7 asserts prose-adjacent markers still parse, single/double inline-span markers do not, a lone unmatched backtick opens no span, and a real marker wins over an earlier inline-span phantom; group 8 adds the #2036 inline-span origin phantom.

All three files were byte-identical pin→main (verified git diff e77a951 origin/main), so the cherry-pick applied with no conflicts; the net branch diff is exactly those three files (33 insertions / 6 deletions).

Proof (this branch, offline)

  • tests/body-marker-lib-test.sh → 8 groups passed.
  • Red-before-green: reverting only body-marker.jq/body-marker-lib.sh to origin/main while keeping the new test file fails marker: a marker in an inline code span is NOT honoured (#2111) — the new assertions genuinely catch the old parser.

Provenance

Prepared by the idss standing session working idss #2113 (the forward-port of idss #2111), under ADR 0174 as a two-way-door action: the branch push is inert for consumers (they pin FACTORY_REF to a SHA on main), the resolution is proven by the repo's own suite, and the merge to shared main stays human-gated by this LANDING=pr review. idss FACTORY_REF is deliberately not bumped here — idss adopts df-main-HEAD on its own cadence (#1684). 🤖

🤖 Generated with Claude Code

Forward-port of the cheap-backport commit `a4189e0` (authored off the pin `e77a951`) onto `main`, so dev-factory `main` HEAD carries the body-marker inline-code-span hardening. idss's eventual main-HEAD adoption — the human-gated idss #1684 — then inherits the fix instead of silently regressing it. ### What lands `cherry-pick -x a4189e0` onto `main` — a clean apply. `marker($key)` previously de-fenced only BLOCK fences, so a marker someone merely quoted in inline backticks while describing it (`` `<!-- origin: app-report -->` `` in a sentence) was read as a live marker. Two confirmed mis-reads on idss drove the fix: #2036 read as a ROOT app report (wedging landing-tripwire leg 2) and #2054 read `session-landing=pr` off prose about the opt-in knob. The fix strips CommonMark inline code spans after `outside_fences`, narrower than "alone on its own line" (which would have broken the #206 agent-merge gate, where close-report writes its `gates-passed` marker sharing a line with prose). - **`body-marker.jq`** — new `strip_inline_code` def (a run of N backticks closed by the next run of N on the same line); `marker($key)` now pipes `outside_fences | strip_inline_code`. - **`body-marker-lib.sh`** — doc comment on `body_marker` updated. - **`tests/body-marker-lib-test.sh`** — group 7 asserts prose-adjacent markers still parse, single/double inline-span markers do not, a lone unmatched backtick opens no span, and a real marker wins over an earlier inline-span phantom; group 8 adds the #2036 inline-span origin phantom. All three files were **byte-identical pin→main** (verified `git diff e77a951 origin/main`), so the cherry-pick applied with no conflicts; the net branch diff is exactly those three files (33 insertions / 6 deletions). ### Proof (this branch, offline) - `tests/body-marker-lib-test.sh` → **8 groups passed**. - Red-before-green: reverting only `body-marker.jq`/`body-marker-lib.sh` to `origin/main` while keeping the new test file fails `marker: a marker in an inline code span is NOT honoured (#2111)` — the new assertions genuinely catch the old parser. ### Provenance Prepared by the idss standing session working **idss #2113** (the forward-port of idss #2111), under ADR 0174 as a two-way-door action: the branch push is inert for consumers (they pin `FACTORY_REF` to a SHA on `main`), the resolution is proven by the repo's own suite, and the merge to shared `main` stays human-gated by this `LANDING=pr` review. idss `FACTORY_REF` is deliberately **not** bumped here — idss adopts df-main-HEAD on its own cadence (#1684). 🤖 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandcastle: #2111 — body-marker strips INLINE code spans, not only block fences (idss #2111)
All checks were successful
ci / static (pull_request) Successful in 3m5s
ci / test (pull_request) Successful in 12m29s
2d14d3f89f
marker($key) de-fenced only BLOCK fences, so a marker someone merely quoted in
inline backticks while describing it — `<!-- origin: app-report -->` in a
sentence — was read as a live marker. Two confirmed mis-reads on idss: #2036
read as a ROOT app report (wedging landing-tripwire leg 2) and #2054 read
session-landing=pr off prose about the opt-in knob.

Fix: strip CommonMark inline code spans (a run of N backticks closed by the next
run of N on the same line) after outside_fences, then match as before. This is
narrower than the ticket's "alone on its own line" proposal, which would have
broken the #206 agent-merge gate: close-report stamps its gates-passed marker
SHARING its line with prose (`<!-- close-report: gates-passed --> …`), a
prose-adjacent marker that is NOT in a code span and must keep parsing.

tests/body-marker-lib-test.sh group 7 now asserts prose-adjacent markers still
parse, inline-span markers (single + double backtick) do not, and a lone
unmatched backtick opens no span; group 8 adds the #2036 inline-span origin
phantom. Red-before-green verified; landing-lib/close-report/session-runner/
ticket-landing suites stay green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit a4189e0548)
All checks were successful
ci / static (pull_request) Successful in 3m5s
ci / test (pull_request) Successful in 12m29s
This pull request has changes conflicting with the target branch.
  • body-marker-lib.sh
  • body-marker.jq
  • tests/body-marker-lib-test.sh
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin forward-port/idss-2111:forward-port/idss-2111
git switch forward-port/idss-2111

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff forward-port/idss-2111
git switch forward-port/idss-2111
git rebase main
git switch main
git merge --ff-only forward-port/idss-2111
git switch forward-port/idss-2111
git rebase main
git switch main
git merge --no-ff forward-port/idss-2111
git switch main
git merge --squash forward-port/idss-2111
git switch main
git merge --ff-only forward-port/idss-2111
git switch main
git merge forward-port/idss-2111
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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/dev-factory!318
No description provided.