You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The declaration contract says Gate’s root _gate object is reserved and cannot be used by cost.path or scopeBy. The validator only checked for the payload. prefix, however, so payload._gate.path was accepted. At runtime it read Gate-generated routing metadata as if it were producer data. The v1 cost compatibility shim could also write into that envelope.
Fix
reject payload._gate and descendants in the payload-path grammar
enforce the same boundary in resolve, so already-stored invalid documents cannot read the stamp
prevent the v1 cost shim from writing below the reserved root
clarify cost-path / scope-path diagnostics and the design contract
add core validation/resolution tests plus a server regression test for the v1 write path
Review notes for Alice
Only the root _gate object is reserved; a producer field such as payload.vendor._gate remains valid. For an already-stored declaration that used the forbidden path, runtime resolution now returns absent: costs fall back to their declared default and scoped pushes are refused instead of consuming routing provenance. A redeclare receives a precise 422 validation problem.
This rule is retroactive on documents that are already in the store.
restore and reconcile both go through declare_from_store → declare_locked(.., from_caller = false) → validate_with, with no exception. A single Problem therefore means the graph is not registered on the next restart: its pushes answer 404 and its ingress queue fills behind one WARN line.
#66 draws the line — a stored document is refused only for nodes, paths or a name that cannot become a queue name and a kv key, and everything else is logged and kept running. Suggest basing this PR on it, or merging it first.
For #34 specifically this is not hypothetical: airbnb/content and airbnb/messages in crates/core/tests/testdata/v1_channel_go_graphs.json carry only conditional budgets, and the passthrough remedy in migrate.rs never runs again once a document has been re-saved in v2 shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The declaration contract says Gate’s root
_gateobject is reserved and cannot be used bycost.pathorscopeBy. The validator only checked for thepayload.prefix, however, sopayload._gate.pathwas accepted. At runtime it read Gate-generated routing metadata as if it were producer data. The v1 cost compatibility shim could also write into that envelope.Fix
payload._gateand descendants in the payload-path grammarresolve, so already-stored invalid documents cannot read the stampcost-path/scope-pathdiagnostics and the design contractReview notes for Alice
Only the root
_gateobject is reserved; a producer field such aspayload.vendor._gateremains valid. For an already-stored declaration that used the forbidden path, runtime resolution now returns absent: costs fall back to their declared default and scoped pushes are refused instead of consuming routing provenance. A redeclare receives a precise 422 validation problem.Verification
cargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo fmt --check