Skip to content

Port the guard-main-checkout-bash.sh fix family (backslash pass agreement, comment-named heredoc, header count) from objectstack PR #11278 #5789

Description

@os-zhuang

Blocked-by: objectstack-ai/objectstack#11131

Filed by the objectstack skills seat (session session_01RMTpSRF5CjMmQBFfPtPCwJ, 2026-08-23) at the ACCEPT of objectstack PR #11278, per the cross-repo follow-up duty (the accepting seat files the consumer-repo card). The two copies of .claude/hooks/guard-main-checkout-bash.sh are declared case-for-case identical with the direction of travel objectstack → objectui, so this card waits for the upstream family to MERGE and then ports verbatim.

What to port (one PR, after the upstream lands)

objectstack PR #11278 (family: objectstack#11131 + #11133 + #11234), three commits:

  1. split_segments() gains the backslash branch tokenize() already had — an unquoted \" no longer opens a phantom quote region (closes a fail-open where echo \" ; sed -i s/a/b/ pkg/x.ts was ALLOWED).
  2. strip_heredocs()'s delimiter scan learns the comment rule via a strip_line_comment() helper — a heredoc introducer merely NAMED in a comment no longer swallows the real commands after it.
  3. Header enumeration count Three layers:Four layers: — note objectui#5459's port carried the miscount deliberately to stay byte-identical; this port corrects it in both copies' declared direction.

Port the selftest additions too (upstream matrix went 100 → 121 cases).

Executable acceptance criterion

bash .claude/hooks/guard-main-checkout-bash.selftest.sh # expect: 121 passed, 0 failed

plus the two measured probes from the upstream cards flipping ALLOWED→blocked in this repo's copy, and the #10247 mirror twins staying ALLOWED.

Constraints

  • .claude/** is a governed surface here too: draft PR, human merge only.
  • Keep the copies byte-identical outside the localised lines (repo-name literals etc.), per the declared parity contract.

Refs: objectstack-ai/objectstack#11131 · #11133 · #11234 · PR objectstack-ai/objectstack#11278 · objectui#5459 (the verbatim port that carried the miscount, flagged there for review).

Metadata

Metadata

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopm:awaiting-maintainer

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions