Repair the CodeQL findings introduced by this integration without
dismissing any alert:
- OpenSpec validators: express the empty-symbol check as an explicit
slice instead of an index-versus-length comparison (#2679).
- OpenSpec tests: create file and outside-target fixtures inside private
mkdtemp directories (#2679).
- Antigravity policy test: give the bridge a private TMPDIR/TEMP/TMP so
its edit accumulator never lands in the shared temp directory (#3221).
- Session recording test: write partial bytes through the staging
descriptor and read the saved file through one opened handle (#3952).
Behavior and assertions are unchanged; each focused suite passes.
Address review feedback on PR #2679: collectEnforcedAnchors had no fence
awareness, so a spec merely SHOWING the anchor or delta syntax inside a
fenced code block or inline code span was collected and validated as if
the spec declared it — silent over-constraint (a target file could fail
freshness for a spec that never enforced it) or grammar errors on an
otherwise-fine file.
Both validators now strip fenced code blocks (``` / ~~~) and inline code
spans (`...`) before any comment/anchor/marker sweep; fenced blocks are
replaced with an equal number of blank lines so line-oriented parsing is
unaffected. The documented contract gains one line: code is illustrative,
never declarative.
Adds fixtures proving: fenced/tilde-fenced/inline example anchors are
ignored, fenced unknown-key and ADDED markers are ignored, a fenced anchor
does NOT satisfy an Invariant, and freshness only enforces the real anchor.