Commit Graph

2 Commits

Author SHA1 Message Date
agra
c2acd0e449 P3.1: wire dist CLI into build + test (0100 unblocked)
The sx 0100 fix (cli.parse / json.parse name collision) is merged on sx
master, so `dist.sx` — co-importing std.cli (via dist) and std.json (via
json_out) — now lowers and builds. Finish the step:

- dist.sx: fix two real frontend errors the old IR-lowering crash had
  masked — `main` returns `!` (noreturn exit tails), and the post-parse
  dispatch is guarded by `if !perr` so the failable `p` is used only with
  its error proven absent. Drop the stale BLOCKED narration.
- Makefile: `make build` now also compiles src/dist.sx -> build/dist;
  `make test` depends on `build` so the acceptance test finds the binary.
- tests/cli_dispatch.sx: drives the BUILT build/dist via process.run and
  asserts the std.cli exit-code + --json purity contract: no-args and
  unknown-command -> human text on stderr + EX_USAGE (64); `ci publish
  --json` -> stdout is a single valid JSON object (std.json.parse, no
  trailing junk) with the human ack on stderr; `--help` lists ci/release.

Handlers stay honest stubs (real ci publish is P3.4). Gate green:
make build (build/dist), make test (7/7).
2026-06-06 03:33:20 +03:00
agra
e0f8b96d33 P1.1: repo skeleton + sx build/test gate
Stand up the foundation every later step depends on:

- Source layout: src/, src/infra/, tests/, examples/ (.gitkeep markers).
- Makefile: `build` compiles the smoke program via $SX, `test` runs the
  runner over tests/**/*.sx, `publish-example` placeholder (real in P3.4).
  Compiler located via `SX ?= /Users/agra/projects/sx/zig-out/bin/sx`.
- tests/run.sh: POSIX-sh runner; discovers tests/**/*.sx, runs each via
  `$SX run`, prints ok/FAIL, exits 0 only when all pass (errors on zero
  tests so the gate is never silently empty).
- tests/smoke.sx: passing smoke test importing modules/std.sx — proves
  toolchain wiring end-to-end (std resolves via the binary's own location).
- .gitignore: ignore build/ artifacts.
2026-06-03 17:18:19 +03:00