Skip to content

Local Apollo correction and upstream work

NecrassRs maintains its own Apollo Compiler patch for #23. The separate dodok8/apollo-rs fork is a preparation area for the minimal upstream implementation and regression tests. It is not a local path dependency of NecrassRs. The two repositories have different change scopes.

  • Source patch, relative to the compiler crate root, records the five validation/coercion source changes.
  • vendor/apollo-compiler is a minimal buildable copy of the crates.io 1.33.0 package with that patch applied. It contains library source, licenses, provenance, README, and the single example embedded by the library’s rustdoc. Upstream test fixtures, benches, other examples, and development dependencies are omitted. The build-only manifest is a packaging adaptation, not an upstream change.
  • Algorithm experiments and their raw results remain in NecrassRs as the implementation decision record.
  • Direct dependency regressions, subprocess checks, executor cases, external consumer tests, and Cargo/CLI wiring remain NecrassRs integration work.

The package base is upstream commit 5ebcc40bdf6919843c122e9a76b241689edcd6ef, at crates/apollo-compiler. The release archive SHA-256 was verified as 5cf9cb85c9c600cc8ff8154d502a4c8bbf9abb8c3f915d34914c1950a1a6273a. Both upstream license texts (resolved from the base commit, replacing the release package’s relative-path placeholders) and .cargo_vcs_info.json are retained.

To reproduce the source changes, extract that release and apply the patch from the extracted compiler crate root:

Terminal window
patch -p1 < /path/to/apollo-compiler-1.33.0.patch

Keep the vendored source and this patch synchronized. The source diff excludes NecrassRs packaging changes and can be reviewed independently. The corrected schema validator builds a field-default dependency graph and traverses it iteratively. Variable-default and input-field-default branches reuse Apollo’s existing coercion while preserving validated scalar literal representations. Supplied JSON values retain scalar validation; recursive list/object processing keeps the distinction between supplied values and validated defaults. The first cycle diagnostic includes available field locations. Type recursion and the draft unbreakable-cycle rule remain separate checks.

The NecrassRs root selects its own source copy:

[patch.crates-io]
apollo-compiler = { path = "vendor/apollo-compiler" }

No sibling Apollo checkout is required to build NecrassRs. apollo-parser remains a registry dependency; a fork’s workspace configuration does not leak into this lockfile. External consumer roots must declare their own override because Cargo does not inherit one from a dependency manifest:

[patch.crates-io]
apollo-compiler = { path = "../NecrassRs/vendor/apollo-compiler" }

Adjust the path for the checkout. The CLI starter pins all three NecrassRs packages and the Apollo override to ffd953c8c56496677f62583f96794396b5f126c9, containing the numeric default regression fix. This revision must be published before remote consumers can fetch it. The Apollo override is:

[patch.crates-io]
apollo-compiler = { git = "https://github.com/Necrass-Dev/NecrassRs.git", rev = "ffd953c8c56496677f62583f96794396b5f126c9", version = "1.33.0" }

Local automated CLI tests substitute the maintained local source. A separate remote-consumer check on 2026-09-27 used the generated manifest unchanged for its initial build, fetched the earlier Git revision cc3a3b2a77f42b91d3fe417c48e346682f26dc7c, and compiled successfully. This is historical evidence, not verification of the new numeric-fix pin. Cargo metadata showed exactly one Apollo Compiler package at that Git source/revision, shared by necrassrs and necrassrs-build; no sibling checkout or local path override was used.

The generated consumer then passed the four portable apollo_defaults tests (copied into its tests/ directory with apollo-compiler = "1.33.0" as a dev dependency) and a generated-dispatch execution test. The latter rejected a cyclic schema and returned Hello, Sheri from the generated greeting resolver. These five tests passed using the remote dependencies. The test-only additions also included serde_json = "1.0"; production dependencies were unchanged.

Reproduce the remote build from this repository:

Terminal window
cargo run -p necrassrs-cli --locked -- init /tmp/apollo-patch-consumer
cargo build --manifest-path /tmp/apollo-patch-consumer/Cargo.toml
cargo metadata --manifest-path /tmp/apollo-patch-consumer/Cargo.toml --locked --format-version 1

Use a fresh destination. Inspect source for Apollo and dependency edges from both runtime and build packages. Keep the generated consumer’s lockfile when repeating the check. A future source update must update the pins and repeat these checks; the selected commit is not a moving branch.

The regression numeric_literal_defaults_preserve_validated_values covers Float 9007199254740991 and ID 9223372036854775808 as variable and input-field defaults, with scalar, singleton-list, and nested-list types (18 combinations). It also rejects invalid explicitly supplied values on each path. The TDD Red checkpoint is commit 57308d8; the local fix preserves validated scalar literals instead of applying JSON variable numeric restrictions to them.

The CLI source pins now select the numeric fix. The recorded remote checks above remain historical evidence for the original patch; repeat them after publishing the new pinned commit. Local CLI checks validate the updated manifest and build against the corrected maintained source.

The separate fork has local branch fix/input-defaults, based on e106f94195762e9ace7b09655a9be0dc6d4d3d76. Its production patch contains compiler implementation, diagnostics, and native regression tests. It also keeps a portable comparison example, the historical benchmark CSV, and an experiment record as supporting evidence for discussion. Those artifacts distinguish prototype measurements from the production patch; whether to include them in the upstream PR remains open. It does not carry NecrassRs manifests or source packaging. Its diff is independently reviewable and may evolve differently during upstream review.

The maintainer handles the Apollo fork separately. This record makes no claim about its current publication or review status; NecrassRs acceptance does not require an upstream merge. Upstream’s existing compatibility discussion is #928; stricter default-cycle validation rejects schemas previously accepted by 1.33.0.

From NecrassRs:

Terminal window
cargo test -p necrassrs --locked --test apollo_defaults
cargo test -p necrassrs --locked cyclic_
cargo test -p necrassrs-build --test cargo_build --locked
cargo test --workspace --locked
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings

Run upstream’s own tests from the separate fork, not the build-only source copy:

Terminal window
cargo test -p apollo-compiler --test main input_defaults
cargo test -p apollo-compiler

Remove the local patch/source override only after an upstream release passes the portable regressions and external consumer checks. Update the root lockfile and all root/template overrides together. The #23 pinned specification comparison is recorded in specs.md. Transport reference candidates and the complete parent difference inventory remain separate work; local patch verification is not full conformance.