Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,12 @@ jobs:
python3 scripts/ci/cargo-bazel-drift-check.py
python3 scripts/ci/test-cargo-bazel-drift-check.py

- name: Migration ledger + release platform inventory (fail-closed)
run: |
python3 scripts/ci/bazel-migration-ledger-check.py
python3 scripts/ci/test-bazel-migration-ledger-check.py
python3 scripts/ci/test-cargo-bazel-parity-check.py

- name: Bazel smoke + first-party libs/tests/CLI/resources
run: |
# Do not set --remote_cache; Blacksmith injects repository cache.
Expand All @@ -884,14 +890,33 @@ jobs:
//:first_party_libs \
//:runtime_libs \
//:cli_bins \
//:resource_inputs
//:resource_inputs \
//:release_bins

- name: Bazel binding cdylibs + packaging handoff
run: |
# Do not set --remote_cache; Blacksmith injects repository cache.
bazelisk build //:binding_cdylibs //:python_wheel_smoke //:node_package_smoke
python3 scripts/ci/test-assemble-bazel-binding-packages.py

- name: Same-SHA Cargo/Bazel dual-build parity
run: |
# Dual-build remains under CI Gate; Bazel is not sole authority yet (#4).
# Do not set --remote_cache; Blacksmith injects repository cache.
mkdir -p dist
python3 scripts/ci/cargo-bazel-parity-check.py \
--mode all \
--write-evidence "dist/cargo-bazel-parity-evidence.json"

- name: Upload Cargo/Bazel parity evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: cargo-bazel-parity-evidence-${{ github.run_id }}
path: dist/cargo-bazel-parity-evidence.json
if-no-files-found: error
retention-days: 1

ci-gate:
name: CI Gate
runs-on: blacksmith-4vcpu-ubuntu-2404
Expand Down
48 changes: 47 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Root Bazel package for GraphForge (#10/#9/#7 libs+cdylibs + #8 tests/CLI/resources)."""
"""Root Bazel package for GraphForge (#10–#6 libs/tests/bindings/release/parity)."""

load("@bazel_skylib//rules:build_test.bzl", "build_test")

Expand Down Expand Up @@ -207,6 +207,7 @@ build_test(
"//examples/agent_grounding:notebooks",
"//tests/features:api_features",
"//tests/tck:corpus",
"//tests/release_workflows:sna_phase2_advisory",
"//crates/graphforge-cypher:corpus_data",
"//crates/graphforge-exec:explain_goldens",
"//crates/graphforge-ir:ir_goldens",
Expand Down Expand Up @@ -235,3 +236,48 @@ test_suite(
"//crates/graphforge-api:value_semantics",
],
)

# Host-native release artifact aggregate (#6). Cross-OS Binding RC surfaces are
# modeled under //platforms:* and tools/bazel/release/release_platforms.json.
build_test(
name = "release_bins",
targets = [
"//crates/graphforge-cli:gf",
"//crates/graphforge-api:atomic_recovery_workflow",
"//crates/graphforge-api:correction_churn_workflow",
"//crates/graphforge-api:cyber_intrusion_workflow",
"//crates/graphforge-api:derived_state_freshness_workflow",
"//crates/graphforge-api:finance_fraud_workflow",
"//crates/graphforge-api:knowledge_evolution_workflow",
"//crates/graphforge-api:ontology_emergence_strict_handoff",
"//crates/graphforge-api:probate_genealogy_workflow",
"//crates/graphforge-api:release_load_probe",
"//crates/graphforge-api:sna_intelligence_workflow",
"//crates/graphforge-api:strict_add_node_fixture",
],
)

alias(
name = "release_platforms",
actual = "//tools/bazel/release:release_platforms",
visibility = ["//visibility:public"],
)

alias(
name = "migration_target_map",
actual = "//tools/bazel/parity:migration_target_map",
visibility = ["//visibility:public"],
)

# Dual-build parity suite labels (#6); outcomes compared by
# scripts/ci/cargo-bazel-parity-check.py against Cargo at the same SHA.
test_suite(
name = "parity_suite",
tests = [
"//crates/graphforge-ast:graphforge_ast_test",
"//crates/graphforge-ir:golden",
"//crates/graphforge-api:clear",
"//crates/graphforge-api:value_semantics",
"//crates/graphforge-rel:logical_plan_golden",
],
)
7 changes: 4 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""GraphForge Bazel module (M2 / #10–#7 libs+cdylibs + #8 tests/CLI).
"""GraphForge Bazel module (M2 / #10–#6 libs/tests/bindings/release/parity).

Canonical build-system contract: GitHub issue #1.
Activates crate_universe `from_cargo` against the frozen Cargo workspace and
models first-party libraries, tests, CLI, resources, and PyO3/napi cdylibs as
real rules_rust targets (no Cargo shell-out for ordinary compilation or tests).
models first-party libraries, tests, CLI, resources, PyO3/napi cdylibs, and
release platforms as real rules_rust / platforms targets (no Cargo shell-out
for ordinary compilation or tests).
"""

module(
Expand Down
51 changes: 49 additions & 2 deletions crates/graphforge-api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
"""Bazel targets for graphforge-api (#9 runtime + #8 integration/BDD)."""
"""Bazel targets for graphforge-api (#9 runtime + #8 integration/BDD + #6 examples)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_integration_test", "gf_rust_library", "gf_rust_test")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load(
"//tools/bazel:gf_rust.bzl",
"gf_rust_binary",
"gf_rust_integration_test",
"gf_rust_library",
"gf_rust_test",
)

exports_files(["Cargo.toml"])

Expand Down Expand Up @@ -441,3 +448,43 @@ test_suite(
":graphforge_api_test",
],
)

# API example binaries (#6). Release load probe is required for M1 certification;
# remaining examples are opt-in workflow evidence mapped for ledger completeness.
_EXAMPLE_RUSTC_ENV = {
"CARGO_MANIFEST_DIR": "crates/graphforge-api",
}

_EXAMPLE_NAMES = [
"atomic_recovery_workflow",
"correction_churn_workflow",
"cyber_intrusion_workflow",
"derived_state_freshness_workflow",
"finance_fraud_workflow",
"knowledge_evolution_workflow",
"ontology_emergence_strict_handoff",
"probate_genealogy_workflow",
"release_load_probe",
"sna_intelligence_workflow",
"strict_add_node_fixture",
]

_EXAMPLE_COMPILE_DATA = {
"sna_intelligence_workflow": ["//tests/release_workflows:sna_phase2_advisory"],
}

[
gf_rust_binary(
name = example_name,
srcs = ["examples/%s.rs" % example_name],
compile_data = _EXAMPLE_COMPILE_DATA.get(example_name, []),
rustc_env = _EXAMPLE_RUSTC_ENV,
deps = _API_DEPS + [":graphforge_api"],
)
for example_name in _EXAMPLE_NAMES
]

build_test(
name = "api_example_bins",
targets = [":%s" % name for name in _EXAMPLE_NAMES],
)
29 changes: 19 additions & 10 deletions docs/development/bazel-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ skills are declared via root `//:project_skills_bundle` / `//:project-skills/man
| Integration-test mapped | 59 | `//:integration_tests` (+ BDD harness) |
| CLI `bin` mapped | 1 | `//crates/graphforge-cli:gf` |
| CLI `custom-build` mapped | 1 | `cargo_build_script` + `//:project_skills_bundle` |
| Explicit retained exception | 1 | API examples (`RT-examples` → #6) |
| Justified Cargo tool | 1 | `RT-fuzz` (cargo-fuzz workflow; keep until #6) |
| Example binaries mapped | 11 | `//crates/graphforge-api:*` + `//:release_bins` (#6) |
| Justified Cargo tools | 2 | `RT-fuzz`, `RT-publish-crates` |
| Release platforms | 5 OS/arch + 8 Binding RC surfaces | `//platforms:*` + `tools/bazel/release/release_platforms.json` |

### Residual gaps (justified)

Expand All @@ -102,13 +103,14 @@ skills are declared via root `//:project_skills_bundle` / `//:project-skills/man
for lint CI until a later slice).
- Doctests are not separate Bazel targets (documented equivalent: coverage attaches
to crate unit-test targets; same policy as #10/#9).
- API `example` binaries are `RT-examples` for #6 (not required to close #8).
- Blacksmith `Bazel Bootstrap` runs `//:bazel_test_graph_smoke` (unit + CLI +
representative integration/snapshot probes). Full `//:integration_tests` and
`//:bdd_tests` remain executable under Bazel for parity (#6) and local runs.
- Full cross-platform binding/release matrix remains #6.
- Blacksmith `Bazel Bootstrap` runs `//:bazel_test_graph_smoke`, release bins,
binding smokes, and the #6 dual-build parity gate. Full `//:integration_tests`
and `//:bdd_tests` remain executable under Bazel for local/full runs.
- Cross-OS Binding RC still produces macOS/Windows natives on those runners;
Bazel models every certified platform and builds host-native release artifacts.
Sole Bazel authority is #4 after #5 cache/perf.
- Bazel storage always enables `test-failpoints` (env-gated no-ops); Cargo release
builds keep the const no-op body — track under #6 parity if needed.
builds keep the const no-op body — documented dual-build parity surface.

## Local commands

Expand All @@ -124,6 +126,12 @@ bazelisk build //:first_party_libs //:cli_bins //:resource_inputs
bazelisk build //:binding_cdylibs //:python_wheel_smoke //:node_package_smoke
python3 scripts/ci/test-assemble-bazel-binding-packages.py

# Release bins + dual-build parity (#6)
bazelisk build //:release_bins
python3 scripts/ci/bazel-migration-ledger-check.py
python3 scripts/ci/cargo-bazel-parity-check.py --mode all \
--write-evidence dist/cargo-bazel-parity-evidence.json

# Full mapped suites (longer)
bazelisk test //:unit_tests //:integration_tests //:snapshot_tests //:cli_tests
bazelisk test //:bdd_tests
Expand All @@ -145,5 +153,6 @@ CARGO_BAZEL_REPIN=1 bazelisk build --repo_env=CARGO_BAZEL_REPIN=1 //:first_party

## Next

1. [#6](https://github.com/CurateLabs/graphforge/issues/6) — cross-platform release
targets and same-SHA Cargo/Bazel parity (blocked by #7 and #8).
1. [#5](https://github.com/CurateLabs/graphforge/issues/5) — Blacksmith remote-cache
enablement + cold/warm performance gates (may need org-admin Bazel Build Caching).
2. See [bazel-migration-parity.md](bazel-migration-parity.md) for #6 evidence.
Loading
Loading