Commit Graph
2 Commits
Author SHA1 Message Date
mathiasandClaude Opus 5.5 809420070b test(extract): enforce the raw/ open discipline with the Go parser
CI / Lint / Test / Vet (pull_request) Successful in 35s
CI / Mirror to GitHub (pull_request) Skipped
PR #156 round 2: the FIFO fix lives in OpenRegular, and reverting any of
its three callers to a plain Root.Open stayed green; the extract.Text
guard was a text search that an aliased import or a func value passed.

- TestRawReadersOpenOnlyThroughOpenRegular parses rawroot.go,
  extract.go and watcher.go and fails on any .Open/.OpenFile call
  outside OpenRegular, except a named os.OpenFile log append.
- TestNoPackageReferencesExtractTextOutsideExtract resolves the extract
  import under any alias and fails on any reference to its Text,
  called or taken as a value.

Each was flipped: the three caller reverts, an os.Open revert, an
alias and a func value all go red.

Refs #153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:03:09 +02:00
mathiasandClaude Opus 5.5 87c80e4e82 fix(ingestion): close the PR #156 review findings on raw/ reads
CI / Lint / Test / Vet (pull_request) Successful in 34s
CI / Mirror to GitHub (pull_request) Skipped
- Reverting the ingest call sites to extract.Text(path) stayed green;
  a test now fails if anything outside internal/extract calls
  extract.Text( (only TextIn, through an os.Root, may be used).
- The watcher symlink test passed for a watcher that ingested nothing,
  or stopped at the first symlink (SkipAll: one synced link halting all
  ingestion). It now plants a real note after the symlink and asserts
  exactly one ingest, and the symlinked-raw refusal has its own test.
- A FIFO swapped in between Lstat and Open hung open(2) forever.
  extract.OpenRegular opens non-blocking and checks the type on the
  handle; readRawNote, TextIn and the watcher's archive copy use it.
- The symlinked-root test covers pending, promote, reject, resolve and
  ReadIngestFile, and is named for exactly those.
- The hard-link residual is documented where it is accepted.

Out of scope, filed: #157 (symlinks elsewhere in the Syncthing-shared
brain dir reach search and other readers), #158 (writes under raw/
follow symlinks).

Refs #153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 16:59:08 +02:00