diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 055a386..48d19c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "FogMachine development", + "name": "fogmachine development", "build": {"context": "..", "dockerfile": "../Dockerfile"}, "remoteUser": "ubuntu", "workspaceFolder": "/workspace", diff --git a/AGENTS.md b/AGENTS.md index 0a12487..cbfb6d6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,4 @@ -# FogMachine engineering rules +# fogmachine engineering rules Keep shared environment mechanics here and product semantics in their own repositories. Read docs/architecture.md before changing the toolchain contract. @@ -7,3 +7,5 @@ Run `python3 -m unittest discover -s tests` and `actionlint` before submitting w User-facing changes require an Unreleased changelog entry; internal-only PRs require both `no-changelog` and `Changelog exemption: ` in the body. Keep audit output free of secrets. Publish images only after the pilot matrix succeeds. + +Use `fogmachine` in lowercase in all user-facing prose and labels. diff --git a/CHANGELOG.md b/CHANGELOG.md index 476f471..4dc77a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## [Unreleased] +### Fixed + +- Make maturin available through Python module invocation as required by Core builds. + +### Changed + +- Use lowercase fogmachine branding in developer UI labels, documentation, and command messages. + ### Added - Shared Rust/Node/Python/WASM development image and Core/MCP pilot adapters with retained verification reports. diff --git a/Dockerfile b/Dockerfile index d524757..b8352d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,9 @@ USER ubuntu ENV PATH="/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:${PATH}" RUN RUST_VERSION=$(python3 /opt/fogmachine/scripts/pin.py rust) && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh && sh /tmp/rustup.sh -y --default-toolchain "$RUST_VERSION" --profile minimal --component rustfmt --component clippy && rm /tmp/rustup.sh && rustup target add wasm32-unknown-unknown RUN UV_VERSION=$(python3 /opt/fogmachine/scripts/pin.py uv) && curl -LsSf "https://astral.sh/uv/$UV_VERSION/install.sh" -o /tmp/uv.sh && sh /tmp/uv.sh && rm /tmp/uv.sh -RUN uv tool install "maturin==$(python3 /opt/fogmachine/scripts/pin.py maturin)" && cargo install wasm-bindgen-cli --version "$(python3 /opt/fogmachine/scripts/pin.py wasm_bindgen)" --locked +RUN python3 -m venv /home/ubuntu/.fogmachine-python && uv pip install --python /home/ubuntu/.fogmachine-python/bin/python "maturin==$(python3 /opt/fogmachine/scripts/pin.py maturin)" +ENV PATH="/home/ubuntu/.fogmachine-python/bin:${PATH}" +RUN cargo install wasm-bindgen-cli --version "$(python3 /opt/fogmachine/scripts/pin.py wasm_bindgen)" --locked USER root RUN mkdir -p /opt/fogmachine/browser /workspace && chown -R ubuntu:ubuntu /opt/fogmachine/browser /workspace USER ubuntu diff --git a/README.md b/README.md index ee27b8c..670ec50 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FogMachine +# fogmachine Shared development environments for DataFog Core and MCP. Initial pilot; see CI for qualification status. @@ -25,7 +25,7 @@ implicit side effect of doctor. See [architecture](docs/architecture.md) and Development images are published to `ghcr.io/datafog/fogmachine` only after Core and MCP pass on the candidate image. Consumers pin the resulting digest; no -consumer should track `latest`. Private package access must be granted to consuming -repos, and developers need a registry credential with read:packages. No credentials +consumer should track `latest`. Package visibility is managed separately in GHCR. If the package is private, grant +consuming repos access and authenticate developers with read:packages. No credentials are included in images. ARM64 qualification and native macOS/Windows lanes remain separate from this initial Linux AMD64 pilot. diff --git a/dev b/dev index c96e99d..a9e283e 100755 --- a/dev +++ b/dev @@ -36,18 +36,18 @@ def validate_repo(root, profile): if profile == "core": toolchain = tomllib.loads((root / "rust-toolchain.toml").read_text())["toolchain"] if toolchain["channel"] != PINS["rust"]: - raise ValueError("Core Rust pin differs from FogMachine; select a compatible environment") + raise ValueError("Core Rust pin differs from fogmachine; select a compatible environment") if int((root / ".nvmrc").read_text().strip()) != PINS["node_major"]: - raise ValueError("Core Node pin differs from FogMachine") + raise ValueError("Core Node pin differs from fogmachine") packages = tomllib.loads((root / "Cargo.lock").read_text())["package"] versions = {p["version"] for p in packages if p["name"] == "wasm-bindgen"} if versions != {PINS["wasm_bindgen"]}: - raise ValueError("Core wasm-bindgen pin differs from FogMachine") + raise ValueError("Core wasm-bindgen pin differs from fogmachine") browser = json.loads((root / "bindings/wasm/package.json").read_text()) if browser["devDependencies"]["playwright"] != PINS["playwright"]: - raise ValueError("Core Playwright pin differs from FogMachine") + raise ValueError("Core Playwright pin differs from fogmachine") elif (root / ".python-version").read_text().strip() != PINS["python"]: - raise ValueError("MCP Python pin differs from FogMachine") + raise ValueError("MCP Python pin differs from fogmachine") def doctor_commands(): # Assertions make a mismatch fail instead of merely displaying versions. @@ -57,6 +57,7 @@ def doctor_commands(): ["bash", "-c", f"test \"$(uv --version | cut -d' ' -f2)\" = {PINS['uv']}"], ["bash", "-c", f"test \"$(maturin --version | cut -d' ' -f2)\" = {PINS['maturin']}"], ["bash", "-c", f"test \"$(wasm-bindgen --version | cut -d' ' -f2)\" = {PINS['wasm_bindgen']}"], + ["python3", "-m", "maturin", "--version"], ["node", "--input-type=module", "-e", "import {chromium} from '/opt/fogmachine/browser/node_modules/playwright/index.mjs'; const browser=await chromium.launch(); console.log(await browser.version()); await browser.close();"]] def main(): @@ -72,7 +73,7 @@ def main(): raise ValueError(f"Unsupported profile: {profile}") validate_repo(root, profile) except (OSError, ValueError, KeyError) as error: - parser.exit(1, f"FogMachine configuration: {error}\n") + parser.exit(1, f"fogmachine configuration: {error}\n") steps = doctor_commands() if args.operation == "doctor" else commands(profile, args.operation) if args.dry_run: print(json.dumps(steps, indent=2)) diff --git a/docs/architecture.md b/docs/architecture.md index 730d60d..fb86392 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Environment contract -FogMachine owns the shared image, tool installation, pilot adapters, and environment +fogmachine owns the shared image, tool installation, pilot adapters, and environment qualification. Product repositories own public behavior, tests, lockfiles, and their supported runtime/platform matrices. An environment update must not rewrite those contracts to get a green build. diff --git a/scripts/adopt.py b/scripts/adopt.py index 333d8f2..9021bdf 100644 --- a/scripts/adopt.py +++ b/scripts/adopt.py @@ -12,7 +12,7 @@ def configuration(profile, image): if not re.fullmatch(r"ghcr\.io/datafog/fogmachine@sha256:[0-9a-f]{64}", image): raise ValueError("a qualified ghcr.io/datafog/fogmachine digest is required") directories = [".venv"] if profile == "mcp" else ["target", "bindings/node/node_modules", "bindings/wasm/node_modules"] - config = {"name": "DataFog " + profile.upper() + " / FogMachine", + config = {"name": "DataFog " + profile.upper() + " / fogmachine", "image": image, "remoteUser": "ubuntu", "workspaceFolder": "/workspace", "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", "containerEnv": {"FOGMACHINE_IMAGE": image}, @@ -21,10 +21,10 @@ def configuration(profile, image): "postCreateCommand": "sudo chown -R ubuntu:ubuntu " + " ".join("/workspace/" + directory for directory in directories) + " && ./dev setup"} files = {".devcontainer/devcontainer.json": json.dumps(config, indent=2) + "\n", ".fogmachine.json": json.dumps({"profile": profile}, indent=2) + "\n", - "dev": '#!/usr/bin/env bash\nset -euo pipefail\nif [[ ! -x /opt/fogmachine/dev ]]; then\n echo "Open this checkout in its FogMachine devcontainer first." >&2\n exit 1\nfi\nexec /opt/fogmachine/dev "$@"\n'} + "dev": '#!/usr/bin/env bash\nset -euo pipefail\nif [[ ! -x /opt/fogmachine/dev ]]; then\n echo "Open this checkout in its fogmachine devcontainer first." >&2\n exit 1\nfi\nexec /opt/fogmachine/dev "$@"\n'} if profile == "core": files[".cursor/Dockerfile"] = "FROM " + image + "\n" - files[".cursor/environment.json"] = json.dumps({"name": "DataFog Core / FogMachine", "build": {"dockerfile": "Dockerfile", "context": ".."}, "user": "ubuntu", "install": "./dev setup"}, indent=2) + "\n" + files[".cursor/environment.json"] = json.dumps({"name": "DataFog Core / fogmachine", "build": {"dockerfile": "Dockerfile", "context": ".."}, "user": "ubuntu", "install": "./dev setup"}, indent=2) + "\n" return files diff --git a/tests/test_dev.py b/tests/test_dev.py index 4e51470..d6de466 100644 --- a/tests/test_dev.py +++ b/tests/test_dev.py @@ -19,6 +19,9 @@ def test_mcp_uses_frozen_lock_and_real_groups(self): self.assertEqual(dev.commands("mcp", "setup"), [["uv", "sync", "--frozen", "--group", "dev", "--group", "ci"]]) self.assertIn(["uv", "run", "--frozen", "pytest"], dev.commands("mcp", "check")) + def test_doctor_checks_python_module_entrypoint(self): + self.assertIn(["python3", "-m", "maturin", "--version"], dev.doctor_commands()) + def test_core_keeps_required_rust_checks(self): self.assertIn(["cargo", "test", "--workspace", "--all-features"], dev.commands("core", "check"))