Purpose
-------
OI-509 / FS-505 regression tests — :func:`oct.core.parsing.header_boundary`
is the single implementation shared by the linter and the formatter for
locating the start of file content after an Option-C 4-line header
(shebang → encoding → file-identity → blank).
Also covers :func:`oct.core.parsing.safe_parse` — shared AST helper that
captures ``SyntaxWarning`` diagnostics instead of leaking them to stderr.
Responsibilities
----------------
- Full 4-line header → boundary is 4.
- Missing shebang → skips straight to encoding.
- No header at all → boundary is 0.
- Trailing blank is only consumed when at least one header element matched.
- Identity comment is matched via either the strict expected string or the
path-basename fallback.
- ``safe_parse`` returns (None, []) on syntax error.
- ``safe_parse`` captures invalid-escape SyntaxWarnings without printing.
Diagnostics
-----------
Domain: CORE-TESTS
Levels:
L2 — test lifecycle
L3 — assertion details
L4 — deep tracing
Contracts
---------
- Tests operate on in-memory strings; no files are created or read.