feat(echo-wesley-gen): generate canonical Edict provider artifacts - #671
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (10)
📝 WalkthroughWalkthroughAdds a deterministic Edict provider pipeline covering pinned contract admission, canonical CBOR validation, Wesley generation input, primary artifacts, provenance, review, corpus rendering, drift checking, filesystem-safe emission, tests, and documentation. ChangesEdict provider generation
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f34f570fea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/echo-wesley-gen/src/bin/echo-edict-provider-artifacts.rs`:
- Around line 205-220: Eliminate path-based TOCTOU races in write_corpus,
preflight_corpus_write, ensure_corpus_directory, and replace_corpus_file by
using directory-handle-relative operations that refuse symlinks. Retain
validated parent directory handles through directory creation, temporary-file
creation, and final replacement, rather than re-resolving paths between checks
and writes. Ensure every opened or renamed entry remains confined to the
canonical corpus root.
- Around line 205-221: Update write_corpus and its preflight flow to inspect the
existing corpus inventory before writing, reject any unexpected files or
directories, and return an error before reporting success; preserve the current
expected-file generation behavior and use the existing corpus validation helpers
where applicable.
- Around line 371-397: Update replace_temporary_file to replace the existing
destination atomically, preserving the old corpus file if replacement fails
instead of calling remove_file before rename. Retain destination validation and
contextual errors, and add a regression test covering a forced replacement
failure when the destination already exists.
In `@crates/echo-wesley-gen/src/provider_canonical.rs`:
- Around line 438-451: Update the length method to compare the declared CBOR
length against self.remaining() before converting it to usize, ensuring
oversized declarations consistently return UnexpectedEof on all platforms. Only
convert the value after that bounds check, preserving the existing
UnsupportedCbor error for values that fit the remaining-byte constraint but
cannot be represented as usize.
In `@crates/echo-wesley-gen/src/provider_provenance.rs`:
- Around line 329-363: Update validate_generator_coordinate to include
input.source_artifacts() when collecting conflicting roles, alongside
generated_artifacts and artifact_resources, so matching source-artifact
coordinates return GeneratorCoordinateConflict. Add a regression case covering
all three source-artifact coordinates and preserve the existing conflict-role
reporting behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d5b13c58-d59a-4c81-a2d3-163df3f03578
⛔ Files ignored due to path filters (24)
Cargo.lockis excluded by!**/*.lockschemas/edict-provider/generated/README.mdis excluded by!**/generated/**schemas/edict-provider/generated/v1/evidence/provenance.provider-generation.jsonis excluded by!**/generated/**schemas/edict-provider/generated/v1/evidence/review.provider-generation.jsonis excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/authority-facts.echo-dpo.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/authority-facts.echo-lawpack.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/generated-artifact-profile.echo-dpo-registration.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/lawpack.echo-dpo.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/schema.echo-provider-artifacts.cddlis excluded by!**/generated/**schemas/edict-provider/generated/v1/primary/target-profile.echo-dpo.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.conformance-corpus.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.lawpack-compatibility.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.lawpack-exports.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.lawpack-target-adapter.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.lawpack-verifier.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-bundle-profile.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-cost-algebra.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-footprint-algebra.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-intrinsics.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-ir.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-lowerer-contract.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-obstruction-taxonomy.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-operation-profiles.cboris excluded by!**/generated/**schemas/edict-provider/generated/v1/resources/resource.target-verifier-contract.cboris excluded by!**/generated/**
📒 Files selected for processing (30)
.gitattributesCHANGELOG.mdcrates/echo-wesley-gen/Cargo.tomlcrates/echo-wesley-gen/README.mdcrates/echo-wesley-gen/src/bin/echo-edict-provider-artifacts.rscrates/echo-wesley-gen/src/lib.rscrates/echo-wesley-gen/src/provider_artifacts.rscrates/echo-wesley-gen/src/provider_canonical.rscrates/echo-wesley-gen/src/provider_contract_pack.rscrates/echo-wesley-gen/src/provider_corpus.rscrates/echo-wesley-gen/src/provider_generation.rscrates/echo-wesley-gen/src/provider_provenance.rscrates/echo-wesley-gen/src/provider_review.rscrates/echo-wesley-gen/src/provider_semantics.rscrates/echo-wesley-gen/tests/provider_artifact_corpus.rscrates/echo-wesley-gen/tests/provider_canonical_contract.rscrates/echo-wesley-gen/tests/provider_contract_pack.rscrates/echo-wesley-gen/tests/provider_generation_input.rscrates/echo-wesley-gen/tests/provider_generation_provenance.rscrates/echo-wesley-gen/tests/provider_generation_review.rscrates/echo-wesley-gen/tests/provider_primary_artifacts.rscrates/echo-wesley-gen/tests/provider_semantic_source.rscrates/echo-wesley-gen/tests/runtime_optic_import.rsdocs/architecture/application-contract-hosting.mdschemas/edict-provider/README.mdschemas/edict-provider/contracts/v1/README.mdschemas/edict-provider/contracts/v1/edict-provider-contracts.cddlschemas/edict-provider/contracts/v1/manifest.jsonschemas/edict-provider/echo-provider-semantics-v1.jsonschemas/edict-provider/generation-settings-v1.json
Summary
Scope
Links
Plain-English architecture walkthrough
none, generation fails closed instead of silently omitting authority bytes.--checkreports missing, changed, extra, symlinked, or non-regular entries without rewriting them.This remains generic provider infrastructure. It adds no Jim-specific checkpoint, rope, causal-anchor, editor, or handwritten adapter semantics.
Wesley dependency rationale
crates.io
wesley-core 0.2.0predates Wesley's public extension-generation contract, so development temporarily used exact commitf66b81cb01918777d5856aa8236b4e46fdf7505dfrom Wesley PR #731.Wesley subsequently published that implementation through signed tag
v0.3.0-alpha.1and its protected release workflow. The tagged and crates.io-packaged extension-generation source is byte-identical to the source tested atf66b81cb. Echo now pins:The exact requirement prevents an implicit move to another prerelease or stable version.
Cargo.lockrecords the crates.io source and checksum77ca44ae03bac1966eaa6d7660621160f10d3e6979bac26f5929a25a3829c1f4. Because the manifest and lockfile participate in generator-source identity, the dependency transition intentionally moves only generator/provenance/review digests; all six primary semantic artifact digests and declared resource bytes remain unchanged.Wesley
0.3.0-alpha.1does not declare an MSRV, so compatibility is established here by the successful Echo Rust 1.90 build/test evidence rather than by an upstream MSRV claim.RED evidence
The campaign was built in focused executable slices:
Initially failed because the
provider_contract_packmodule and admission boundary did not exist.The retained second-slice RED failed because
ProviderGenerationErrorKind::GraphqlSourceMissingandProviderGenerationError::semantic_source_kind()did not exist. GREEN added typed semantic-source error preservation and explicit fail-closed GraphQL-authority handling.Subsequent artifact, provenance, review, and corpus suites were introduced as the executable witnesses for their corresponding absent behavior:
Review-driven RED assertions also demonstrated that public diagnostics previously exposed Rust
Debugspellings; GREEN replaced those with exhaustive stable kebab-case labels.GREEN and final verification
Focused compatibility/admission witnesses:
All-target and strict lint gates:
Full branch gate under Echo's supported Node line:
The full preflight passed all seven checks: full local verification, documentation dead references, Markdown lint, runtime-schema validation, both no-default-feature contracts, and shell syntax.
The pre-push hook also reran the exact affected Rust slices and Markdown formatting successfully.
Compatibility notes
echo-wesley-genfollows Wesley's operation-neutral public names. Source consumers ofimport_runtime_optic_artifactandimport_registration_descriptormust update from Wesley's formerOpticArtifact/OpticRegistrationDescriptorargument types toOperationArtifact/OperationRegistrationDescriptor.Documentation impact
Updated:
CHANGELOG.mdcrates/echo-wesley-gen/README.mdschemas/edict-provider/README.mdschemas/edict-provider/contracts/v1/README.mdschemas/edict-provider/generated/README.mddocs/architecture/application-contract-hosting.mdThese document exact-input generation, canonical/output validation, checked-corpus operation, dependency compatibility, and the separation between provider semantic evidence and runtime authority.
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Documentation