Skip to content

Watcher server - #1

Merged
AlexMikhalev merged 2 commits into
mainfrom
watcher_server
Dec 4, 2024
Merged

Watcher server#1
AlexMikhalev merged 2 commits into
mainfrom
watcher_server

Conversation

@AlexMikhalev

Copy link
Copy Markdown
Contributor

No description provided.

@AlexMikhalev
AlexMikhalev merged commit 443e4f4 into main Dec 4, 2024
AlexMikhalev added a commit that referenced this pull request Dec 4, 2024
commit 443e4f4
Merge: 4659e0c 49d6bca
Author: Dr Alexander Mikhalev <alex@metacortex.engineer>
Date:   Wed Dec 4 08:44:10 2024 +0000

    Merge pull request #1 from terraphim/watcher_server

    Watcher server

commit 49d6bca
Author: AlexMikhalev <alex@metacortex.engineer>
Date:   Tue Dec 3 15:15:13 2024 +0000

    feat: watcher and serve commands added, ugly but working

commit b04f213
Author: AlexMikhalev <alex@metacortex.engineer>
Date:   Tue Dec 3 11:55:07 2024 +0000

    feat: watcher and serve commands added
AlexMikhalev added a commit that referenced this pull request Aug 8, 2026
…n CI

Finding 4 — `build.create-missing` writes stubs into the source tree, and
the watcher saw its own writes. The created paths were already returned by
book_from_summary but discarded at the pipeline boundary
(`let (book, _created) = ...`), so the mechanism the specification called
for did not exist.

Builds now return a BuildReport carrying the created paths, and
SelfWriteFilter (src/watch.rs) drops the next watcher event naming each
one. The record is consumed on match, so a genuine edit to the same file
immediately afterwards still rebuilds; a batch mixing our stub with a real
edit rebuilds too, since suppressing it would silently lose the user's
change. Verified end to end: a SUMMARY entry for a missing file yields the
stub and zero rebuilds, while editing a chapter yields exactly one.

test_watch_suppresses_created_stub_event now exists as specified, alongside
guards for unrelated edits, mixed batches and empty batches. Testing the
decision rather than the loop keeps it deterministic — no sleeps, no
process spawning.

Finding 8 — the "__trail__" magic title marking the structural terminator
in the sidebar is replaced by NavKind::ListClose.

CI ran only the unit, integration and e2e targets, so the structural
conformance suite that increment B was built around never ran there. All
six targets now run.

Refs #1, Refs #2

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AlexMikhalev added a commit that referenced this pull request Aug 8, 2026
Verifying the feature matrix after the include_dir change surfaced three
latent breaks, all pre-existing and none covered by CI's matrix, which
tested only default, the full set, and wasm-core:

- `search` alone failed: pagefind_service spawns the pagefind CLI via
  tokio::process, which only resolved because `server` pulls in tokio/full.
- `watcher` alone failed: main.rs awaits the watch task with
  futures::future::join_all, and only `server` supplied `futures`.
- `core` alone failed: it drives #[tokio::main] without tokio/macros or a
  runtime.

Fixing the first revealed a fourth, in code this branch touched: the
async/sync build call site keyed its cfg off server/watcher, while
core::build keys off `tokio`. With `search` (which enables tokio/rt but
neither server nor watcher) the sync branch called an async fn. Now both
sides key off the same feature.

CI's feature matrix gains the three single-feature combinations so each
stays honest about its own dependencies.

Refs #1

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant