Skip to content

test(#1106): register writeFile sites individually in the ownership gate - #1117

Merged
admarble merged 4 commits into
mainfrom
feature/1106-test-ownership-gate-register-writefile-sites-indiv
Sep 20, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1106-test-ownership-gate-register-writefile-sites-indiv

Conversation

@admarble

@admarble admarble commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New src/lib/ownership-gate.ts: per-site writeFile( scan (awaited or not, any function form), keyed file#fn#destExpr.
  • Side (b) in templates.test.ts now uses it; registry re-keyed (12 sites), site-count cross-check added. The block stays in place (same describe) so the AC-4 command still counts it.
  • Real writers unchanged; test-only plus CHANGELOG.

Acceptance criteria

  • AC-1: non-awaited/void/fs. writeFile sites are registered (ownership-gate.test.ts, 6 cases named 1106)
  • AC-2: second write to a new destination in a registered function fails, naming it
  • AC-3: const name = async () => {…} attributed to itself
  • AC-4: real writers pass; templates.test.ts + new file: 65 passed. -t "ownership policy covers" still runs side a and side b (2 tests)

Mutation-verified: AC-1 — matched await writeFile( only; src/lib/ownership-gate.test.ts > ownership gate write-site scan > 1106 AC-1: registers a non-awaited writeFile( and names its destination failed; restored.

Only the two named test files were run, plus build and lint (per runner context); the full suite is left to the runner.

Closes #1106

🤖 Generated with Claude Code

Runner verification (guard-2026-09 wave 1, 2026-09-20)

  • qa verdict: AC_MET_BUT_NOT_A_PLUS. Runner ran AC-1 (6 passed, cases named 1106) and AC-4 (2 passed) in the worktree; marker classifier-valid.
  • templates.test.ts hunks sit at lines 31 and 230–311 (the old side-(b) block); fix(#1053): copy-mode sync replaces foreign scripts/dev symlinks #1111 appends at 1215. Trial merge: clean.
  • Left for review (qa gaps): the follow-up issue for widening the gate beyond writeFile( was not filed; the guard-the-guard count can misfire on a comment mentioning writeFile(.
  • Full npm test from a clean shell on this branch: 323 files, 6555 passed, 1 expected fail, 3 skipped, 386 s.

@admarble
admarble merged commit bec1345 into main Sep 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant