From 4756d70d954d91fdb1645e7ed622724adc2c3b99 Mon Sep 17 00:00:00 2001 From: argenis de la rosa Date: Sun, 1 Mar 2026 00:38:20 -0500 Subject: [PATCH 1/2] feat(workspace): scaffold M4-5 crate shells and CI package lanes --- .github/workflows/ci-run.yml | 48 ++++++++++++++++++++++++++++++-- Cargo.lock | 13 ++++++++- Cargo.toml | 7 ++++- crates/zeroclaw-core/Cargo.toml | 12 ++++++++ crates/zeroclaw-core/src/lib.rs | 6 ++++ crates/zeroclaw-types/Cargo.toml | 9 ++++++ crates/zeroclaw-types/src/lib.rs | 6 ++++ 7 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 crates/zeroclaw-core/Cargo.toml create mode 100644 crates/zeroclaw-core/src/lib.rs create mode 100644 crates/zeroclaw-types/Cargo.toml create mode 100644 crates/zeroclaw-types/src/lib.rs diff --git a/.github/workflows/ci-run.yml b/.github/workflows/ci-run.yml index d28abcf0a..07a8c91c4 100644 --- a/.github/workflows/ci-run.yml +++ b/.github/workflows/ci-run.yml @@ -70,6 +70,44 @@ jobs: BASE_SHA: ${{ needs.changes.outputs.base_sha }} run: ./scripts/ci/rust_strict_delta_gate.sh + workspace-check: + name: Workspace Check + needs: [changes] + if: needs.changes.outputs.rust_changed == 'true' + runs-on: [self-hosted, aws-india] + timeout-minutes: 45 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable + with: + toolchain: 1.92.0 + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v3 + with: + prefix-key: ci-run-workspace-check + - name: Check workspace + run: cargo check --workspace --locked + + package-check: + name: Package Check (${{ matrix.package }}) + needs: [changes] + if: needs.changes.outputs.rust_changed == 'true' + runs-on: [self-hosted, aws-india] + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + package: [zeroclaw-types, zeroclaw-core] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable + with: + toolchain: 1.92.0 + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v3 + with: + prefix-key: ci-run-package-check + - name: Check package + run: cargo check -p ${{ matrix.package }} --locked + test: name: Test needs: [changes] @@ -274,7 +312,7 @@ jobs: ci-required: name: CI Required Gate if: always() - needs: [changes, lint, test, build, docs-only, non-rust, docs-quality, lint-feedback, license-file-owner-guard] + needs: [changes, lint, workspace-check, package-check, test, build, docs-only, non-rust, docs-quality, lint-feedback, license-file-owner-guard] runs-on: ubuntu-22.04 steps: - name: Enforce required status @@ -322,10 +360,14 @@ jobs: # --- Rust change path --- lint_result="${{ needs.lint.result }}" + workspace_check_result="${{ needs.workspace-check.result }}" + package_check_result="${{ needs.package-check.result }}" test_result="${{ needs.test.result }}" build_result="${{ needs.build.result }}" echo "lint=${lint_result}" + echo "workspace-check=${workspace_check_result}" + echo "package-check=${package_check_result}" echo "test=${test_result}" echo "build=${build_result}" echo "docs=${docs_result}" @@ -333,8 +375,8 @@ jobs: check_pr_governance - if [ "$lint_result" != "success" ] || [ "$test_result" != "success" ] || [ "$build_result" != "success" ]; then - echo "Required CI jobs did not pass: lint=${lint_result} test=${test_result} build=${build_result}" + if [ "$lint_result" != "success" ] || [ "$workspace_check_result" != "success" ] || [ "$package_check_result" != "success" ] || [ "$test_result" != "success" ] || [ "$build_result" != "success" ]; then + echo "Required CI jobs did not pass: lint=${lint_result} workspace-check=${workspace_check_result} package-check=${package_check_result} test=${test_result} build=${build_result}" exit 1 fi diff --git a/Cargo.lock b/Cargo.lock index 2409834cc..dc3375684 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "accessory" @@ -9161,6 +9161,13 @@ dependencies = [ "zip", ] +[[package]] +name = "zeroclaw-core" +version = "0.1.0" +dependencies = [ + "zeroclaw-types", +] + [[package]] name = "zeroclaw-robot-kit" version = "0.1.0" @@ -9182,6 +9189,10 @@ dependencies = [ "tracing", ] +[[package]] +name = "zeroclaw-types" +version = "0.1.0" + [[package]] name = "zerocopy" version = "0.8.40" diff --git a/Cargo.toml b/Cargo.toml index de94f453b..627f86168 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,10 @@ [workspace] -members = [".", "crates/robot-kit"] +members = [ + ".", + "crates/robot-kit", + "crates/zeroclaw-types", + "crates/zeroclaw-core", +] resolver = "2" [package] diff --git a/crates/zeroclaw-core/Cargo.toml b/crates/zeroclaw-core/Cargo.toml new file mode 100644 index 000000000..47e1f1315 --- /dev/null +++ b/crates/zeroclaw-core/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "zeroclaw-core" +version = "0.1.0" +edition = "2021" +license = "MIT OR Apache-2.0" +description = "Core contracts and boundaries for staged multi-crate extraction." + +[lib] +path = "src/lib.rs" + +[dependencies] +zeroclaw-types = { path = "../zeroclaw-types" } diff --git a/crates/zeroclaw-core/src/lib.rs b/crates/zeroclaw-core/src/lib.rs new file mode 100644 index 000000000..74b9ee3d2 --- /dev/null +++ b/crates/zeroclaw-core/src/lib.rs @@ -0,0 +1,6 @@ +//! Core contracts for the staged workspace split. +//! +//! This crate is intentionally minimal in PR-1 (scaffolding only). + +/// Marker constant proving dependency linkage to `zeroclaw-types`. +pub const CORE_CRATE_ID: &str = zeroclaw_types::CRATE_ID; diff --git a/crates/zeroclaw-types/Cargo.toml b/crates/zeroclaw-types/Cargo.toml new file mode 100644 index 000000000..2b3ff2eb5 --- /dev/null +++ b/crates/zeroclaw-types/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "zeroclaw-types" +version = "0.1.0" +edition = "2021" +license = "MIT OR Apache-2.0" +description = "Foundational shared types for staged multi-crate extraction." + +[lib] +path = "src/lib.rs" diff --git a/crates/zeroclaw-types/src/lib.rs b/crates/zeroclaw-types/src/lib.rs new file mode 100644 index 000000000..2b4288779 --- /dev/null +++ b/crates/zeroclaw-types/src/lib.rs @@ -0,0 +1,6 @@ +//! Shared foundational types for the staged workspace split. +//! +//! This crate is intentionally minimal in PR-1 (scaffolding only). + +/// Marker constant proving the crate is linked in workspace checks. +pub const CRATE_ID: &str = "zeroclaw-types"; From b0f2832b14d3cc6208f690154e56691f093ccf2c Mon Sep 17 00:00:00 2001 From: xj Date: Sun, 1 Mar 2026 17:05:03 -0800 Subject: [PATCH 2/2] fix(ci): stabilize workspace/package gates for crate split --- .github/workflows/ci-run.yml | 12 ++++++++++-- crates/zeroclaw-core/src/lib.rs | 2 ++ crates/zeroclaw-types/src/lib.rs | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-run.yml b/.github/workflows/ci-run.yml index f2d3062ea..5b81dc82e 100644 --- a/.github/workflows/ci-run.yml +++ b/.github/workflows/ci-run.yml @@ -78,16 +78,20 @@ jobs: name: Workspace Check needs: [changes] if: needs.changes.outputs.rust_changed == 'true' - runs-on: [self-hosted, aws-india] + runs-on: ubuntu-22.04 timeout-minutes: 45 steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Self-heal Rust toolchain cache + shell: bash + run: ./scripts/ci/self_heal_rust_toolchain.sh 1.92.0 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable with: toolchain: 1.92.0 - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v3 with: prefix-key: ci-run-workspace-check + cache-bin: false - name: Check workspace run: cargo check --workspace --locked @@ -95,7 +99,7 @@ jobs: name: Package Check (${{ matrix.package }}) needs: [changes] if: needs.changes.outputs.rust_changed == 'true' - runs-on: [self-hosted, aws-india] + runs-on: ubuntu-22.04 timeout-minutes: 25 strategy: fail-fast: false @@ -103,12 +107,16 @@ jobs: package: [zeroclaw-types, zeroclaw-core] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Self-heal Rust toolchain cache + shell: bash + run: ./scripts/ci/self_heal_rust_toolchain.sh 1.92.0 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable with: toolchain: 1.92.0 - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v3 with: prefix-key: ci-run-package-check + cache-bin: false - name: Check package run: cargo check -p ${{ matrix.package }} --locked diff --git a/crates/zeroclaw-core/src/lib.rs b/crates/zeroclaw-core/src/lib.rs index 74b9ee3d2..9040040b8 100644 --- a/crates/zeroclaw-core/src/lib.rs +++ b/crates/zeroclaw-core/src/lib.rs @@ -1,3 +1,5 @@ +#![forbid(unsafe_code)] + //! Core contracts for the staged workspace split. //! //! This crate is intentionally minimal in PR-1 (scaffolding only). diff --git a/crates/zeroclaw-types/src/lib.rs b/crates/zeroclaw-types/src/lib.rs index 2b4288779..95c3cf66a 100644 --- a/crates/zeroclaw-types/src/lib.rs +++ b/crates/zeroclaw-types/src/lib.rs @@ -1,3 +1,5 @@ +#![forbid(unsafe_code)] + //! Shared foundational types for the staged workspace split. //! //! This crate is intentionally minimal in PR-1 (scaffolding only).