-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add Cloud Agent development environment setup #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rename AGENTS.md reference: AGENTS.md:L123-L123 Useful? React with 👍 / 👎. |
||
| # Cloud Agent install script for WFL. | ||
| # | ||
| # Idempotent repository bootstrap run after the source tree is checked out. | ||
| # It prepares the exact toolchain and build state a Cloud Agent needs to build, | ||
| # test, lint, and run WFL end to end: | ||
| # | ||
| # * a stable Rust toolchain that satisfies the crate's rust-version (>= 1.94, | ||
| # required by edition 2024 and the sqlx 0.9 dependency), with the rustfmt | ||
| # and clippy components the CI gates use; | ||
| # * all Cargo dependencies fetched against the committed Cargo.lock; | ||
| # * the release `wfl` binary, which the integration and web-server test | ||
| # runners (scripts/run_integration_tests.sh, scripts/run_web_tests.sh) | ||
| # require to exist. | ||
| # | ||
| # It starts no long-running processes: WFL has no always-on dev server (the web | ||
| # server is launched per-program by `listen`), so nothing belongs in `start`. | ||
| set -euo pipefail | ||
|
|
||
| # Run from the repository root regardless of the caller's working directory. | ||
| repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| cd "$repo_root" | ||
|
|
||
| # Minimum Rust version required by Cargo.toml (`rust-version`). | ||
| required_rust_minor=94 | ||
|
|
||
| echo "==> Ensuring a stable Rust toolchain (>= 1.${required_rust_minor}) is installed" | ||
| if ! command -v rustup >/dev/null 2>&1; then | ||
| echo "error: rustup is not available on PATH; the base image must provide the Rust toolchain installer." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # The `default` profile pulls in rustfmt and clippy, matching the CI toolchain | ||
| # (dtolnay/rust-toolchain@stable). Re-running is a cheap no-op once installed. | ||
| rustup toolchain install stable --profile default --no-self-update | ||
| rustup default stable | ||
|
Comment on lines
+35
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+35
to
+36
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this canonical manual bootstrap is run by a developer, AGENTS.md reference: AGENTS.md:L207-L209 Useful? React with 👍 / 👎. |
||
|
|
||
| # Fail fast with a clear message if the resolved stable is somehow older than | ||
| # the crate's MSRV, instead of dying deep in a compile. | ||
| rust_minor="$(rustc +stable --version | sed -E 's/^rustc 1\.([0-9]+)\..*/\1/')" | ||
| if [ "${rust_minor:-0}" -lt "$required_rust_minor" ]; then | ||
|
Comment on lines
+40
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository instructions ---'
for f in AGENTS.md GOVERNANCE.md testing.md REPOSITORY_HYGIENE.md AI_POLICY.md CONTRIBUTING.md SECURITY.md Docs/README.md; do
if [ -f "$f" ]; then
echo "--- $f ---"
sed -n '1,220p' "$f"
fi
done
printf '%s\n' '--- scoped knowledge files ---'
find /tmp/coderabbit-repo-knowledge/webfirstlanguage-wfl-2bbfb526 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target script ---'
cat -n scripts/cloud-agent-install.sh
printf '%s\n' '--- toolchain and override files ---'
find . -maxdepth 3 \( -name 'rust-toolchain' -o -name 'rust-toolchain.toml' -o -name '.cargo' -o -name 'Cargo.toml' -o -name 'Cargo.lock' \) -print
printf '%s\n' '--- relevant override references ---'
rg -n --hidden -g '!target' -g '!node_modules' 'RUSTUP_TOOLCHAIN|rust-toolchain|rustup run|cloud-agent-install|wfl\.exe|target/release' .Repository: WebFirstLanguage/wfl Length of output: 50379 🌐 Web query:
💡 Result: Rustup determines the active toolchain by evaluating several potential overrides in a strict order of precedence. It selects the first one encountered in the following sequence [1][2]: 1. Command-line override: The +toolchain shorthand provided directly to the command (e.g., cargo +nightly) [1][2]. 2. Environment variable: The RUSTUP_TOOLCHAIN environment variable [1][2]. 3. Directory override or rust-toolchain.toml file: These are evaluated based on their proximity to the current directory [1][2]. For the third category, Rustup searches for both directory overrides (set via rustup override) and rust-toolchain.toml (or legacy rust-toolchain) files by walking up the directory tree toward the filesystem root [1][2]. Within this category, the override that is physically closest to the current working directory takes precedence, regardless of whether it is a formal directory override or a toolchain file [1][2]. If both a directory override and a rust-toolchain.toml file exist in the same directory, the directory override generally takes precedence [1][2]. 4. Default toolchain: If no overrides are found through the methods above, the globally configured default toolchain is used [1][2]. The official documentation clarifies that these mechanisms allow for a hierarchy of control, where command-line and environment variables provide immediate, transient overrides, while file-based and directory-based methods allow for project-specific or folder-specific configurations [1][3][2]. Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- scripts/cloud-agent-install.sh ---'
cat -n scripts/cloud-agent-install.sh
printf '%s\n' '--- override files and relevant declarations ---'
find . -maxdepth 3 \( -name 'rust-toolchain' -o -name 'rust-toolchain.toml' -o -path '*/.cargo/config' -o -path '*/.cargo/config.toml' \) -print
rg -n --hidden -g '!target' -g '!node_modules' 'RUSTUP_TOOLCHAIN|rust-toolchain|rustup run|cargo fetch|cargo build|rustc \+stable|run_integration_tests' scripts .github Cargo.toml testing.md AGENTS.md
printf '%s\n' '--- Windows integration executable contract ---'
cat -n scripts/run_integration_tests.ps1 2>/dev/null || true
cat -n scripts/run_integration_tests.sh 2>/dev/null || trueRepository: WebFirstLanguage/wfl Length of output: 38570 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- .cargo/config.toml ---'
cat -n .cargo/config.toml
printf '%s\n' '--- Cargo MSRV declaration ---'
rg -n -A3 -B3 '^rust-version|^\[package\]' Cargo.toml
printf '%s\n' '--- toolchain-related tracked configuration ---'
git ls-files | rg '(^|/)(rust-toolchain(\.toml)?|config(\.toml)?|\.cargo/)'Repository: WebFirstLanguage/wfl Length of output: 1691 Run Cargo with the validated stable toolchain. When 🤖 Prompt for AI AgentsSource: MCP tools |
||
| echo "error: stable Rust is 1.${rust_minor}, but WFL requires >= 1.${required_rust_minor}." >&2 | ||
| exit 1 | ||
| fi | ||
| echo "==> Using $(rustc --version)" | ||
|
|
||
| echo "==> Fetching Cargo dependencies (locked to Cargo.lock)" | ||
| cargo fetch --locked | ||
|
|
||
| # Build the release binary the integration/web test runners depend on. The | ||
| # release profile keeps debuginfo (Cargo.toml sets debug = true), so this is the | ||
| # largest single step; running it here bakes the binary into the environment so | ||
| # fresh agents start ready to run WFL programs. | ||
| echo "==> Building the release wfl binary" | ||
| cargo build --release --locked | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Low disk space aborts setup With less than 30 GB free and stale build output present, Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+54
to
+55
|
||
|
|
||
| echo "==> WFL install complete: $(./target/release/wfl --version)" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Bootstrap policy evidence missing
The new setup behavior lacks an automated test and the mandatory risk, acceptance, Red, layer, and residual-risk record. Manual validation cannot provide auditable Red evidence.
Was this helpful? React with 👍 or 👎 to provide feedback.