chore: move the sample's recipes beside it (just module)

- docs/examples/log-watcher/justfile carries build/accept/soak; the
  root mounts it with `mod log-watcher`, so `just log-watcher` still
  runs the acceptance (default recipe) and every doc reference stays
  valid; `just log-watcher::build` / `::soak 60` reach the rest, and
  plain `just build` works from inside the directory
- ROOT is source_directory()-based: inside a `mod`,
  justfile_directory() names the ROOT justfile's directory and every
  path would miss

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
shoney.arickathil 2026-08-15 01:35:56 +02:00
parent d994f153dd
commit c4d2a588ff
2 changed files with 38 additions and 22 deletions

View file

@ -0,0 +1,32 @@
# docs/examples/log-watcher — the systems-track sample workload.
# Mounted into the root justfile as a module: `just log-watcher::<recipe>`
# from the repo root, or plain `just <recipe>` from this directory.
# Recipes run with this directory as the working directory.
# source_directory(), not justfile_directory(): inside a `mod`, the latter
# names the ROOT justfile's directory and every path here would miss
ROOT := source_directory() / "../../.."
# default: the acceptance test (what `just log-watcher::` runs)
default: accept
# build the self-contained executable from wo.toml: `woc <dir>` reads the
# manifest and produces target/log-watcher (needs the compiler and runtime
# built once: `just woc-build` and `just wovm-build` at the root)
build:
{{ROOT}}/compiler/_build/default/bin/woc .
@ls -la target/log-watcher
# the language track's acceptance test: this sample must compile with zero
# diagnostics AND run — watch alerts on an error line, run schedules a
# cron.d entry, the MCP server answers JSON-RPC (initialize, tools/list,
# 401 without a token), and SIGTERM stops a server parked in accept.
accept:
{{ROOT}}/scripts/log-watcher-accept.sh
# the same script's opt-in soak: each mode under load for DURATION seconds,
# resident memory and descriptor count compared against a warmed baseline
# (256 KiB / zero-fd tolerance) — the check that catches what a seconds-long
# run cannot. `just log-watcher::soak 60` for a longer sit.
soak DURATION="30":
LW_SOAK={{DURATION}} {{ROOT}}/scripts/log-watcher-accept.sh

View file

@ -47,28 +47,12 @@ wovm-test:
make -C runtime test-iso
bash runtime/test/cli_smoke.sh
# the language track's acceptance test: docs/examples/log-watcher must compile
# with zero diagnostics AND run — watch alerts on an error line, run schedules
# a cron.d entry, the MCP server answers JSON-RPC (initialize, tools/list,
# 401 without a token), and SIGTERM stops a server parked in accept. This is
# the test the whole track exists to pass; the corpus below gates the
# individual behaviors underneath it.
log-watcher:
./scripts/log-watcher-accept.sh
# the same script's opt-in soak: each mode under load for DURATION seconds,
# resident memory and descriptor count compared against a warmed baseline
# (256 KiB / zero-fd tolerance) — the check that catches what a seconds-long
# run cannot. `just log-watcher-soak 60` for a longer sit.
log-watcher-soak DURATION="30":
LW_SOAK={{DURATION}} ./scripts/log-watcher-accept.sh
# build the sample the way a user would: `woc <dir>` reads wo.toml and
# produces docs/examples/log-watcher/target/log-watcher (self-contained,
# needs woc-build + wovm-build once)
log-watcher-build:
./compiler/_build/default/bin/woc docs/examples/log-watcher
@ls -la docs/examples/log-watcher/target/log-watcher
# the sample workload's own recipes live beside it (build from wo.toml,
# the acceptance test, the soak): `just log-watcher` runs the acceptance,
# `just log-watcher::build` / `::soak 60` the rest — see the module's
# justfile for what each does. This is the test the whole track exists to
# pass; the corpus below gates the individual behaviors underneath it.
mod log-watcher "docs/examples/log-watcher"
# conformance harness (plan 3): walks tests/corpus/{run,compile-fail,trap},
# exact outcome per fixture kind — see docs/plan/oop-vm/02-corpus.md.