From 691e43c0093ffb3837b03513cb2c0aa8f1dbd6e3 Mon Sep 17 00:00:00 2001 From: "shoney.arickathil" Date: Sat, 15 Aug 2026 01:35:56 +0200 Subject: [PATCH] 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) --- docs/examples/log-watcher/justfile | 32 ++++++++++++++++++++++++++++++ justfile | 28 ++++++-------------------- 2 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 docs/examples/log-watcher/justfile diff --git a/docs/examples/log-watcher/justfile b/docs/examples/log-watcher/justfile new file mode 100644 index 0000000..db4e570 --- /dev/null +++ b/docs/examples/log-watcher/justfile @@ -0,0 +1,32 @@ +# docs/examples/log-watcher — the systems-track sample workload. +# Mounted into the root justfile as a module: `just log-watcher::` +# from the repo root, or plain `just ` 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 ` 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 diff --git a/justfile b/justfile index b38c8f4..a5b31f1 100644 --- a/justfile +++ b/justfile @@ -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 ` 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.