Repository navigation
impl(022): production acceptance, stage 3 records and production construction - #439
Conversation
…truction JevBackend::new_production constructs only with an accepted, checked Qualification for the exact binding, the production journal and batching off; check_production_plan takes the accepted qualifications (3.7.5).
AI review (findings)Reviewing the PR for bugs, security issues, and spec inconsistencies.
Old
After let digest = qualification
.ok_or(SetupError::Production(Unresolved("accepted qualification is missing")))?
.digest()The Order of checks — credential safety holds The ordering is:
Backward-compatibility of
Spec amendment vs. implementation —
Overall: the implementation is internally consistent. The one concrete, actionable issue is the {"head": "fadcd0843bf6e462daac0de3d44cdc8a9e2ec6a7", "verdict": "findings", "findings": [{"path": "integrations/rustev-jev/src/adapter.rs", "line": 449, "summary": "new_production accepts Option<&Qualification> where &Qualification would enforce the spec's unconditional requirement at the call site; after production_eligible already validates Some, the second ok_or guard is unreachable dead code."}]}Subject: 09c3c1b...fadcd08, diff digest fba362a5eedd186b16c19cfa47958bb979ed95cec32eff43a298901969d4e0e7, 1 call(s). An AI comment is not an approval. |
Summary
Spec 022 3.7.5 (A-69): accepting a stage 3 record and constructing a production binding. No network, no live call.
Qualificationgainsestimated_unitsanddigest()(rustev.jev-qualification/1);checkvalidates only the record: exact binding identity (3.6.2), a calls fact that is not stale, owner authorization, report and spend-journal references, and the dataset's admission or stated limitation.ProductionBinding::production_eligibletakes the acceptedQualification: 3.4's facts for the day,productionuse,directtransport, mapping and decision mapping versionrustev-jev-mapping/2, and the record's check. Gateway bindings stay ineligible.JevBackend::new_production(backend_id, binding, credential, qualification, sink, journal, today)refuses before any credential lookup unless eligibility holds, the journal is the production journal, and batching isoff(3.7.5.4, until spec 044 increment 8). It then constructs asnew_qualificationdoes, recording the accepted record's digest and keeping no request or response bytes.check_production_plantakes the accepted qualifications and refuses a reached binding with none or with two.Spec: a dated "Production acceptance implemented" paragraph in 022's implementation record;
implementation:unchanged.Verification
cargo test -p rustev-jev --locked(all targets, includingtests/production.rswith six new tests), clippy-D warningsonrustev-jev,cargo fmt --all --check, the 3.8.1 environment-variable grep,cargo run -p rustev-boundaries,make gate,scripts/check-authored-content.sh.Review note (fadcd08): style nit, not a defect.
new_productiontakesOption<&Qualification>to mirrorproduction_eligibleandcheck_production_plan, where an absent record is a refusal reason reported as "accepted qualification is missing"; the secondok_oris a defensive repeat of the same refusal and changes no behavior.