Task 1: Workspace scaffold, xtask ci, CI workflows (#1) #28

Closed
charles wants to merge 0 commits from task/1-workspace-scaffold into foundation
Owner

What

Foundation Task 1: the Cargo workspace (resolver 3, edition 2024, Rust 1.98.1 pinned in rust-toolchain.toml with rustfmt+clippy components), the nine Foundation crates (fluxer-proto, -api, -gateway, -core, -ui, -platform, -status-api, -devserver, xtask) as empty libs each with a README (what / how to use / depends on), the fluxer binary (prints fluxer 0.1.0), rustfmt.toml, clippy.toml, deny.toml, .cargo/config.toml (cargo xtask alias) and .forgejo/workflows/ci.yaml.

cargo xtask ci runs, stopping at the first failure: cargo fmt --all -- --check -> cargo clippy --workspace --all-targets -- -D warnings -> cargo deny check -> fluxer-core isolation (cargo tree -p fluxer-core -e normal must not contain iced/wgpu/winit/reqwest/tokio-tungstenite) -> cargo test --workspace -> cargo test --workspace -- --ignored when FLUXER_SCREENSHOT_TESTS=1. gen-theme, vendor-spec, spec-check, extract-parity, parity-check, package print "not implemented" and exit 2.

tools/fj.sh <METHOD> <path> [json] wraps the Forgejo API; the token is read from ~/.git-credentials and handed to curl via a stdin config file (-K -), so it is never on a command line. With it: labels task, bug, follow-up, question, ci, parity, good-first-task; milestone Foundation; issues #1-#26, one per plan task (body = the task's Files + Interfaces blocks + plan link); **Issue:** #n lines added under every task heading in the plan.

How it was tested

  • TDD: xtask/tests/ci_smoke.rs (ci_passes_on_empty_workspace, unimplemented_subcommands_exit_2) written first and seen failing against a stub xtask (exit 1, no ci), then passing.
  • cargo xtask ci exits 0 locally (1.98.1, cargo-deny 0.20.2); cargo test -p xtask runs the full pipeline inside the smoke test and passes; FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci exercises the --ignored path.
  • tools/fj.sh GET "/repos/charles/fluxer-native/issues?labels=task&state=open&limit=50" | jq length prints 26.
  • CI on the runners: this PR is the first run of ci.yaml; please check both jobs before merging (the workflow copies the fork's manual-checkout pattern because actions/* cannot be fetched).

Deviations from the plan

  • xtask lives at xtask/ (as members = [.., "xtask"], xtask/src/main.rs and xtask/tests/ci_smoke.rs say), not also at crates/xtask.
  • deny.toml does not ban iced/wgpu/winit/reqwest/tokio-tungstenite: cargo-deny bans are workspace-wide and those crates are legitimate in fluxer-ui/-api/-gateway. The isolation rule is enforced only by the core-isolation xtask step; deny.toml says so.
  • 26 task issues, not 25: Task 1 got one too (#1) so these commits and this PR can reference it; the plan's Step 7 test line now says 26.
  • Issues #1 and #2 were first created as API probes while debugging a 422, then edited in place into Task 1 / Task 2 (titles, bodies, label, milestone all correct now) so numbering stays 1:1 with task numbers.
  • No Linux build cache in ci.yaml (no actions/cache; ephemeral container). Tracked in #27 (ci, follow-up). Windows uses the persistent C:\\fcargo\\fluxer-native target dir as its cache.
  • Recursion guard: xtask ci sets FLUXER_XTASK_NESTED=1 on its cargo test children and the smoke test is a no-op when it is set (otherwise ci would run itself forever). Documented in xtask/README.md.
  • Screenshot tests convention: the FLUXER_SCREENSHOT_TESTS=1 step runs cargo test --workspace -- --ignored; Task 24 should mark its tests #[ignore] (or adjust this step).

Closes #1

🤖 Generated with Claude Code

## What Foundation Task 1: the Cargo workspace (resolver 3, edition 2024, Rust 1.98.1 pinned in `rust-toolchain.toml` with rustfmt+clippy components), the nine Foundation crates (`fluxer-proto`, `-api`, `-gateway`, `-core`, `-ui`, `-platform`, `-status-api`, `-devserver`, `xtask`) as empty libs each with a README (what / how to use / depends on), the `fluxer` binary (prints `fluxer 0.1.0`), `rustfmt.toml`, `clippy.toml`, `deny.toml`, `.cargo/config.toml` (`cargo xtask` alias) and `.forgejo/workflows/ci.yaml`. `cargo xtask ci` runs, stopping at the first failure: `cargo fmt --all -- --check` -> `cargo clippy --workspace --all-targets -- -D warnings` -> `cargo deny check` -> fluxer-core isolation (`cargo tree -p fluxer-core -e normal` must not contain iced/wgpu/winit/reqwest/tokio-tungstenite) -> `cargo test --workspace` -> `cargo test --workspace -- --ignored` when `FLUXER_SCREENSHOT_TESTS=1`. `gen-theme`, `vendor-spec`, `spec-check`, `extract-parity`, `parity-check`, `package` print "not implemented" and exit 2. `tools/fj.sh <METHOD> <path> [json]` wraps the Forgejo API; the token is read from `~/.git-credentials` and handed to curl via a stdin config file (`-K -`), so it is never on a command line. With it: labels `task`, `bug`, `follow-up`, `question`, `ci`, `parity`, `good-first-task`; milestone `Foundation`; issues #1-#26, one per plan task (body = the task's Files + Interfaces blocks + plan link); `**Issue:** #n` lines added under every task heading in the plan. ## How it was tested - TDD: `xtask/tests/ci_smoke.rs` (`ci_passes_on_empty_workspace`, `unimplemented_subcommands_exit_2`) written first and seen failing against a stub `xtask` (exit 1, no `ci`), then passing. - `cargo xtask ci` exits 0 locally (1.98.1, cargo-deny 0.20.2); `cargo test -p xtask` runs the full pipeline inside the smoke test and passes; `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` exercises the `--ignored` path. - `tools/fj.sh GET "/repos/charles/fluxer-native/issues?labels=task&state=open&limit=50" | jq length` prints 26. - CI on the runners: this PR is the first run of `ci.yaml`; please check both jobs before merging (the workflow copies the fork's manual-checkout pattern because `actions/*` cannot be fetched). ## Deviations from the plan - `xtask` lives at `xtask/` (as `members = [.., "xtask"]`, `xtask/src/main.rs` and `xtask/tests/ci_smoke.rs` say), not also at `crates/xtask`. - `deny.toml` does not ban iced/wgpu/winit/reqwest/tokio-tungstenite: cargo-deny bans are workspace-wide and those crates are legitimate in `fluxer-ui`/`-api`/`-gateway`. The isolation rule is enforced only by the `core-isolation` xtask step; `deny.toml` says so. - 26 task issues, not 25: Task 1 got one too (#1) so these commits and this PR can reference it; the plan's Step 7 test line now says 26. - Issues #1 and #2 were first created as API probes while debugging a 422, then edited in place into Task 1 / Task 2 (titles, bodies, label, milestone all correct now) so numbering stays 1:1 with task numbers. - No Linux build cache in `ci.yaml` (no `actions/cache`; ephemeral container). Tracked in #27 (`ci`, `follow-up`). Windows uses the persistent `C:\\fcargo\\fluxer-native` target dir as its cache. - Recursion guard: `xtask ci` sets `FLUXER_XTASK_NESTED=1` on its `cargo test` children and the smoke test is a no-op when it is set (otherwise `ci` would run itself forever). Documented in `xtask/README.md`. - Screenshot tests convention: the `FLUXER_SCREENSHOT_TESTS=1` step runs `cargo test --workspace -- --ignored`; Task 24 should mark its tests `#[ignore]` (or adjust this step). Closes #1 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Cargo workspace (resolver 3, edition 2024, Rust 1.98.1) with the nine
Foundation crates as empty libs with READMEs, the `fluxer` binary that
prints its version, and `xtask` with `cargo xtask ci` (fmt, clippy -D
warnings, cargo deny, fluxer-core isolation check, tests, screenshot
tests under FLUXER_SCREENSHOT_TESTS=1) plus exit-2 stubs for the later
subcommands. Forgejo CI runs `cargo xtask ci` on the eqemu-build
(ubuntu:22.04 container) and windows runners without external actions.

Refs #1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
chore: Forgejo issue helper, labels, milestone and task issues
Some checks failed
ci / Windows (x64) (push) Failing after 8s
ci / Linux (x86_64) (push) Successful in 43s
ci / Windows (x64) (pull_request) Failing after 5s
ci / Linux (x86_64) (pull_request) Successful in 34s
d23e7f7300
tools/fj.sh wraps the Forgejo API with the token from ~/.git-credentials,
passed to curl through a stdin config file so it never reaches a command
line or output. Used it to create the seven labels, the Foundation
milestone and one `task` issue per plan task (#1-#26); the plan now
carries an `**Issue:** #n` line under every task heading.

Refs #1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ci: capture job logs and publish them on failure
Some checks failed
ci / Windows (x64) (push) Failing after 14s
ci / Windows (x64) (pull_request) Failing after 4s
ci / Linux (x86_64) (push) Successful in 43s
ci / Linux (x86_64) (pull_request) Successful in 39s
640140f9b5
Both jobs tee their output to a log file; a failure() step publishes it as
a prerelease asset (tag ci-log-<run>-<job>), since this Forgejo exposes no
job-log API (same workaround as the fork). Step names no longer use
${{ env.* }} expressions, and the Windows bootstrap resolves the cargo bin
dir explicitly, logs each phase and wraps everything in try/catch so the
first Windows failure becomes diagnosable.

Refs #1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ci: force LF checkouts so cargo fmt passes on the Windows runner
All checks were successful
ci / Windows (x64) (push) Successful in 17s
ci / Windows (x64) (pull_request) Successful in 8s
ci / Linux (x86_64) (push) Successful in 37s
ci / Linux (x86_64) (pull_request) Successful in 37s
cb2b28a0d3
The Windows runner checks out with core.autocrlf=true, turning every .rs
file into CRLF; rustfmt.toml sets newline_style = "Unix", so `cargo fmt
--check` failed on all of them (seen in ci-log-3-windows). .gitattributes
now forces LF for text files on every OS and the Windows checkout sets
core.autocrlf=false before fetching. The Windows job log is written as
UTF-8 (Tee-Object produced UTF-16).

Refs #1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Author
Owner

Independent review — Task 1 (workspace scaffold)

Reviewed git diff origin/foundation...origin/task/1-workspace-scaffold cold at cb2b28a in a fresh worktree.

Checks

  1. Plan tests: xtask/tests/ci_smoke.rs::ci_passes_on_empty_workspace exists, runs cargo run -q -p xtask -- ci from the workspace root via std::process::Command and asserts success, as Step 1 says. unimplemented_subcommands_exit_2 additionally covers the Interfaces line (exit 2 + "not implemented" for all six stubs). Unit tests cover the cargo tree parser (exact-name match, dedupe).
  2. Interfaces: cargo xtask ci runs fmt check -> clippy --workspace --all-targets -- -D warnings -> cargo deny check -> core-isolation -> cargo test --workspace -> cargo test --workspace -- --ignored only when FLUXER_SCREENSHOT_TESTS=1. enum Cmd { Ci, GenTheme, VendorSpec, SpecCheck, ExtractParity, ParityCheck, Package }, fn main() -> ExitCode, fn run_ci() -> anyhow::Result<()> all present as the plan names them. .cargo/config.toml alias is exactly run -q -p xtask --. Workspace resolver = "3", members = ["crates/*", "apps/*", "xtask"], shared deps for serde/serde_json/tokio/anyhow/thiserror/tracing (+clap, needed by Step 3).
  3. Constraints/invariants: all nine crates have empty [dependencies]; fluxer-core isolation is enforced by the core-isolation step (cargo tree -p fluxer-core -e normal) and documented in deny.toml and the crate README. deny.toml license allow-list matches the plan (MIT/Apache-2.0/BSD-2/BSD-3/ISC/Zlib/MPL-2.0/Unicode-3.0), advisories deny, unknown-git/unknown-registry deny. No tokens or flx_… strings anywhere in the diff; tools/fj.sh reads the token into a variable and feeds curl via -K - on stdin (never on argv), set -euo pipefail, no set -x. Both CI checkout steps mask GITHUB_TOKEN in the tee'd log. Every crate README has the three required sections; every lib.rs is a //! doc only. All four commits carry Refs #1 and the Co-Authored-By line; PR title/body follow the convention and end with Closes #1 + attribution.
  4. Review Focus: none of the five items belongs to Task 1.
  5. cargo xtask ci run by me in the review worktree (CARGO_TARGET_DIR=~/src/fluxer-native-target, rustc 1.98.1, cargo-deny 0.20.2): exit 0 — fmt, clippy, deny (license-not-encountered warnings only), core-isolation, test (2+2 xtask tests pass, 0 elsewhere), screenshot-tests skipped. The FLUXER_XTASK_NESTED guard works: the nested cargo test did not recurse.

Forgejo state verified: 26 open task issues #1–#26, titles 1:1 with the plan's task names, all on milestone Foundation; all 7 labels exist; #27 (ci, follow-up) tracks the missing Linux cache. Plan deviations stated in the PR body (xtask at xtask/, no workspace-wide deny bans, 26 issues) are consistent with the plan's own text and are fine.

Findings

  • minor — .forgejo/workflows/ci.yaml "Publish log on failure" (both jobs): creating a release without target_commitish creates a git tag at the default branch HEAD. Two such tags already exist on main (ci-log-3-windows, ci-log-4-windows -> 1faa154) from the early Windows failures, and every git fetch origin now pulls them. Once ci.yaml reaches main, a Forgejo-created tag is also a push event; if main is ever red this can self-trigger (fail -> tag -> run on main -> fail -> tag …). I could not confirm from the fork's recent task list whether API-created tags actually start runs on this instance, so this is a hazard, not an observed loop. Suggest a follow-up: create the release as draft: true (no tag is created, assets still attach) or pass target_commitish: $GITHUB_SHA, and delete the two stray tags. Same pattern as the fork's build-desktop.yaml, so it is an inherited convention rather than a new mistake.
  • minor — xtask/src/main.rs::check_core_isolation runs cargo tree -p fluxer-core -e normal with default features, while deny.toml resolves with all-features = true. A banned crate behind an optional feature of fluxer-core would pass this gate. Harmless today (fluxer-core has no deps or features); add --all-features when Task 8 lands.
  • note — unimplemented_subcommands_exit_2 spawns six nested cargo run processes inside cargo test; it works (verified) and is cheap after the first build. No change requested.

Verdict: APPROVE — zero blocking findings; cargo xtask ci green locally. (Observed, not waited for: runs 5 and 6 at cb2b28a show both Linux and Windows jobs green.)

## Independent review — Task 1 (workspace scaffold) Reviewed `git diff origin/foundation...origin/task/1-workspace-scaffold` cold at `cb2b28a` in a fresh worktree. **Checks** 1. Plan tests: `xtask/tests/ci_smoke.rs::ci_passes_on_empty_workspace` exists, runs `cargo run -q -p xtask -- ci` from the workspace root via `std::process::Command` and asserts success, as Step 1 says. `unimplemented_subcommands_exit_2` additionally covers the Interfaces line (exit 2 + "not implemented" for all six stubs). Unit tests cover the `cargo tree` parser (exact-name match, dedupe). 2. Interfaces: `cargo xtask ci` runs fmt check -> clippy `--workspace --all-targets -- -D warnings` -> `cargo deny check` -> core-isolation -> `cargo test --workspace` -> `cargo test --workspace -- --ignored` only when `FLUXER_SCREENSHOT_TESTS=1`. `enum Cmd { Ci, GenTheme, VendorSpec, SpecCheck, ExtractParity, ParityCheck, Package }`, `fn main() -> ExitCode`, `fn run_ci() -> anyhow::Result<()>` all present as the plan names them. `.cargo/config.toml` alias is exactly `run -q -p xtask --`. Workspace `resolver = "3"`, `members = ["crates/*", "apps/*", "xtask"]`, shared deps for serde/serde_json/tokio/anyhow/thiserror/tracing (+clap, needed by Step 3). 3. Constraints/invariants: all nine crates have empty `[dependencies]`; `fluxer-core` isolation is enforced by the `core-isolation` step (`cargo tree -p fluxer-core -e normal`) and documented in `deny.toml` and the crate README. `deny.toml` license allow-list matches the plan (MIT/Apache-2.0/BSD-2/BSD-3/ISC/Zlib/MPL-2.0/Unicode-3.0), advisories deny, `unknown-git`/`unknown-registry` deny. No tokens or `flx_…` strings anywhere in the diff; `tools/fj.sh` reads the token into a variable and feeds curl via `-K -` on stdin (never on argv), `set -euo pipefail`, no `set -x`. Both CI checkout steps mask `GITHUB_TOKEN` in the tee'd log. Every crate README has the three required sections; every `lib.rs` is a `//!` doc only. All four commits carry `Refs #1` and the Co-Authored-By line; PR title/body follow the convention and end with `Closes #1` + attribution. 4. Review Focus: none of the five items belongs to Task 1. 5. `cargo xtask ci` run by me in the review worktree (`CARGO_TARGET_DIR=~/src/fluxer-native-target`, rustc 1.98.1, cargo-deny 0.20.2): **exit 0** — fmt, clippy, deny (license-not-encountered warnings only), core-isolation, test (2+2 xtask tests pass, 0 elsewhere), screenshot-tests skipped. The `FLUXER_XTASK_NESTED` guard works: the nested `cargo test` did not recurse. Forgejo state verified: 26 open `task` issues #1–#26, titles 1:1 with the plan's task names, all on milestone `Foundation`; all 7 labels exist; #27 (`ci`, `follow-up`) tracks the missing Linux cache. Plan deviations stated in the PR body (xtask at `xtask/`, no workspace-wide deny bans, 26 issues) are consistent with the plan's own text and are fine. **Findings** - **minor** — `.forgejo/workflows/ci.yaml` "Publish log on failure" (both jobs): creating a release without `target_commitish` creates a git tag at the default branch HEAD. Two such tags already exist on `main` (`ci-log-3-windows`, `ci-log-4-windows` -> `1faa154`) from the early Windows failures, and every `git fetch origin` now pulls them. Once `ci.yaml` reaches `main`, a Forgejo-created tag is also a push event; if `main` is ever red this can self-trigger (fail -> tag -> run on main -> fail -> tag …). I could not confirm from the fork's recent task list whether API-created tags actually start runs on this instance, so this is a hazard, not an observed loop. Suggest a follow-up: create the release as `draft: true` (no tag is created, assets still attach) or pass `target_commitish: $GITHUB_SHA`, and delete the two stray tags. Same pattern as the fork's `build-desktop.yaml`, so it is an inherited convention rather than a new mistake. - **minor** — `xtask/src/main.rs::check_core_isolation` runs `cargo tree -p fluxer-core -e normal` with default features, while `deny.toml` resolves with `all-features = true`. A banned crate behind an optional feature of `fluxer-core` would pass this gate. Harmless today (`fluxer-core` has no deps or features); add `--all-features` when Task 8 lands. - **note** — `unimplemented_subcommands_exit_2` spawns six nested `cargo run` processes inside `cargo test`; it works (verified) and is cheap after the first build. No change requested. **Verdict: APPROVE** — zero blocking findings; `cargo xtask ci` green locally. (Observed, not waited for: runs 5 and 6 at `cb2b28a` show both Linux and Windows jobs green.)
xtask: resolve the workspace root at runtime, not compile time
All checks were successful
ci / Windows (x64) (push) Successful in 7s
ci / Windows (x64) (pull_request) Successful in 6s
ci / Linux (x86_64) (push) Successful in 38s
ci / Linux (x86_64) (pull_request) Successful in 38s
bbbd5a468a
`workspace_root()` used `env!("CARGO_MANIFEST_DIR")`, so an `xtask`
binary (or ci_smoke test binary) uplifted into the shared
CARGO_TARGET_DIR from one worktree ran the CI steps in that other
worktree's directory. With the worktree removed, `cargo xtask ci`
failed with "No such file or directory" in every other checkout.
`cargo run`/`cargo test` set CARGO_MANIFEST_DIR at runtime, so read it
from the environment first and keep the compile-time value as a
fallback for running the binary directly.

Refs #1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Author
Owner

Merged into foundation by the integrator as merge commit c3dbebdd4e (Merge task/1: workspace-scaffold, head bbbd5a468a; Linux and Windows CI green on runs 6964-6967). Forgejo did not detect the merge automatically, so this PR is closed by hand.

🤖 Generated with Claude Code

Merged into `foundation` by the integrator as merge commit c3dbebdd4e71e98e2f14f406b0aca847037ed521 (`Merge task/1: workspace-scaffold`, head bbbd5a468a227af456779944b80baf9f0aab5e66; Linux and Windows CI green on runs 6964-6967). Forgejo did not detect the merge automatically, so this PR is closed by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles closed this pull request 2026-11-11 08:24:51 +00:00
All checks were successful
ci / Windows (x64) (push) Successful in 7s
ci / Windows (x64) (pull_request) Successful in 6s
ci / Linux (x86_64) (push) Successful in 38s
ci / Linux (x86_64) (pull_request) Successful in 38s

Pull request closed

Sign in to join this conversation.
No description provided.