Commit Graph
3 Commits
Author SHA1 Message Date
haelyra 4b28aa9fe4 test: keep integrated fixtures out of the shared temp directory
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.
2026-11-16 22:03:55 -05:00
legeZZZ 528eab1e49 fix: strip code blocks/spans before anchor and metadata sweeps
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.
2026-09-26 10:36:55 +08:00
lege962 2a42ce1889 feat: add OpenSpec validators foundation (v1 schema, file-level freshness)
Standalone read-only tooling for OpenSpec specs — no CI gating in this PR.

- validate-openspec-syntax.js: documented metadata allowlist + typo guard,
  ordinary comments allowed, per-block delta validation (every declared
  ADDED/MODIFIED/REMOVED block must be non-empty), repo-relative path::symbol
  anchors that reject traversal; YAML frontmatter optional.
- check-spec-freshness.js: file-level freshness. Git invoked only via
  execFileSync argv arrays (hostile filename/date fixtures prove no shell
  escape); project root and targets resolved via realpaths and contained
  (symlinked root / escaping target rejected); shallow clones report
  UNVERIFIED, never ORPHANED/STALE; ECC_SPEC_STALE_WARN_ONLY implemented.
- Real git-backed test fixtures (27 + 23 tests).
- Register existing spec-miner agent in install-components.json.
2026-09-06 00:09:04 +08:00