Repository navigation
impl(027): increment 2, JSON Schema emission - #126
Conversation
c9c5aa6 to
f0c1aaf
Compare
8eb4c6c to
69c81a9
Compare
AI review (findings)Group 1 of 2Reviewing this group: dependency additions in Cargo / dependency layer
Schema files
No bugs or security issues identified. {"head": "69c81a9159d1aab7fbd18453ac81639238cab409", "verdict": "no-findings", "findings": []}Group 2 of 2Reviewing the PR, which adds JSON Schema emission ( Finding 1 — Silent skip of if let Some(props) = v.get_mut("properties").and_then(|p| p.as_object_mut()) {
props.insert(
"schema".into(),
serde_json::json!({ "type": "string", "const": version }),
);
}If Finding 2 — Versioned documents sharing a single Rust type produce overly-permissive older-version schemas
Minor: unnecessary clone ( v["title"] = title.clone().into();
No security issues found. The {"head": "69c81a9159d1aab7fbd18453ac81639238cab409", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/schema_emit.rs", "line": 52, "summary": "The `schema` const injection is silently skipped if schemars generates a root schema without a top-level `properties` object; no diagnostic or test catches this failure for 27 of the 28 emitted schemas."}, {"path": "crates/rustev-contract/src/schema_emit.rs", "line": 77, "summary": "Multiple document versions share one Rust type (Plan 2/3, Definition 1/2, Run 1/3, etc.), so older-version schemas include newer-version optional fields, contradicting the stated descriptive accuracy."}]}Subject: f0c1aaf...69c81a9, diff digest ac505b5240b24a96882ddd074e637bbe3ca345cd6c5ca5cee4233264cb2fe0d2, 2 call(s). An AI comment is not an approval. |
f0c1aaf to
569ef74
Compare
69c81a9 to
536fe52
Compare
AI review (findings)Group 1 of 2Reviewing the group-1 changes: Cargo dependency additions, Cargo.lock — The added
The {
"head": "536fe52ff904f9e6fb438fd606cca09bebcc6fb0",
"verdict": "findings",
"findings": [
{
"path": "Cargo.lock",
"line": null,
"summary": "`jsonschema-value 0.59.0` lists `zmij` as a resolved dependency but no `[[package]]` entry for `zmij` appears in the lock file, making the lock file inconsistent and likely breaking the build."
},
{
"path": "crates/rustev-contract/schema/rustev.judgment-1.schema.json",
"line": 1,
"summary": "The judgment/1 schema accepts `refused`, `needs_input`, and `ActionableUnresolved` outcomes that are explicitly documented as version-2 additions, making the schema over-permissive and unable to distinguish judgment/1 from judgment/2 documents."
}
]
}Group 2 of 2I reviewed all changed files in group 2 carefully, focusing on the JSON Schema emitter (
Version duplication (
Hand-written Test suite
No bugs, security issues, or inconsistencies found. {"head": "536fe52ff904f9e6fb438fd606cca09bebcc6fb0", "verdict": "no-findings", "findings": []}Subject: 569ef74...536fe52, diff digest ac505b5240b24a96882ddd074e637bbe3ca345cd6c5ca5cee4233264cb2fe0d2, 2 call(s). An AI comment is not an approval. |
536fe52 to
404e143
Compare
AI review (findings)Group 1 of 2Reviewing the dependency additions and new schema files. Cargo.lock / Cargo.toml / crates/rustev-contract/Cargo.toml
Schema files
No actionable bugs or security issues found in this group. {"head": "404e1436a3b342fa1d0e2067d3c53c171a3c3065", "verdict": "no-findings", "findings": []}Group 2 of 2Reviewing the JSON Schema emission increment: Finding 1 — Silent omission of
if let Some(props) = v.get_mut("properties").and_then(|p| p.as_object_mut()) {
props.insert("schema".into(), serde_json::json!({ "type": "string", "const": version }));
}The Finding 2 —
(version, jsonschema::validator_for(&v).unwrap())The spec comment ("without HTTP or file resolution") is not enforced in code. If any future schema inadvertently carries an absolute Finding 3 —
&& let Ok(v) = serde_json::from_slice::<serde_json::Value>(&std::fs::read(&p).unwrap())A read failure on any JSON file under a test directory panics with no indication of which path failed. Compared with the adjacent No issues with the crypto patterns ( {"head": "404e1436a3b342fa1d0e2067d3c53c171a3c3065", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/schema_emit.rs", "line": 50, "summary": "The `schema: const` version constraint is silently omitted when schemars produces no `properties` key; an assertion is needed to ensure every emitted schema carries the version discriminator."},{"path": "crates/rustev-contract/tests/schemas.rs", "line": 110, "summary": "`jsonschema::validator_for` is called without disabling HTTP/file `$ref` resolution, contradicting the documented intent of local-only schema validation."},{"path": "crates/rustev-contract/tests/schemas.rs", "line": 85, "summary": "`std::fs::read(&p).unwrap()` panics on unreadable files with no path context, producing cryptic test failures."}]}Subject: 569ef74...404e143, diff digest 61851e0dd820320df67183e6cf0a1cda0e619b220eee31fb463a27403f3c73b1, 2 call(s). An AI comment is not an approval. |
569ef74 to
59c9a9c
Compare
404e143 to
be2a979
Compare
AI review (findings)Group 1 of 2Looking at the schema files and dependency changes in this group. Cargo.lock / Cargo.toml The lock file correctly handles two coexisting Schema files
Finding: The
{"head": "be2a979ccff98a8e0205615ac0f3bcbf7baf69e8", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.judgment-1.schema.json", "line": 1, "summary": "The Outcome type in judgment/1 schema includes `refused` and `needs_input` variants that the schema's own description identifies as version-2-only additions, making the v1 schema overly permissive and unable to reject v2-only outcomes in documents claiming to be judgment/1."}]}Group 2 of 2Looking at the changed files in group 2: new JSON schema files, all Rust source changes in
The function patches if let Some(props) = v.get_mut("properties").and_then(|p| p.as_object_mut()) {
props.insert("schema".into(), ...);
}For every struct type used in
The bless path calls The
For No bugs or security problems found in this group. {"head": "be2a979ccff98a8e0205615ac0f3bcbf7baf69e8", "verdict": "no-findings", "findings": []}Subject: 59c9a9c...be2a979, diff digest 61851e0dd820320df67183e6cf0a1cda0e619b220eee31fb463a27403f3c73b1, 2 call(s). An AI comment is not an approval. |
be2a979 to
825c89a
Compare
AI review (findings)Group 1 of 3Reviewing the diff for group 1: Cargo / dependency hygiene
Schema files
No bugs, security problems, or inconsistencies found. Group 2 of 3Reviewing the schema emission machinery, the Rust source changes, and the committed schemas.
In If the generator ever produces a root schema without a
Around the file-walk loop (~line 111): The JSON parse error is gracefully handled (
Group 3 of 3The diff adds No issues found. Subject: 59c9a9c...825c89a, diff digest 6292d019787feec51295647e3b66b8dcb5177578bc349e1cc22b4f641a2d1bf2, 3 call(s). An AI comment is not an approval. |
825c89a to
9422236
Compare
AI review (findings)Group 1 of 3Reviewing the Cargo.lock, Cargo.toml dependency additions, and the first batch of emitted JSON Schema files. Finding 1 — In every schema that includes "position":{"description":"1-based.","format":"uint64","minimum":0,"type":"integer"}
Finding 2 — The newly added Alphabetically, a {"head": "942223682254e35002b3eeb9ad60a5a53555d7db", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.evidence-1.schema.json", "line": 1, "summary": "RankEntry.position has minimum:0 but is described as 1-based; 0 would pass schema validation against the stated invariant — minimum should be 1."}, {"path": "Cargo.lock", "line": null, "summary": "jsonschema-value 0.59.0 lists zmij as a dependency but no [[package]] entry for zmij is added to the lock file, leaving it potentially incomplete."}]}Group 2 of 3Reviewing the schema emission infrastructure in this diff: new JSON Schema files, 1. Silent version-const failure in if let Some(props) = v.get_mut("properties").and_then(|p| p.as_object_mut()) {
props.insert("schema".into(), serde_json::json!({ "type": "string", "const": version }));
}If 2. Panic inside filter predicate ( && let Ok(v) =
serde_json::from_slice::<serde_json::Value>(&std::fs::read(&p).unwrap())The inner 3. schemars::json_schema!({
"type": "string",
"minLength": 1,
"maxLength": MAX_HANDLE_BYTES // 256
})JSON Schema 4. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, schemars::JsonSchema)]
#[serde(transparent)]
pub struct Timestamp(i64);
5. Unnecessary v["title"] = title.clone().into();
{"head": "942223682254e35002b3eeb9ad60a5a53555d7db", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/schema_emit.rs", "line": 46, "summary": "If schemars generates a schema without a top-level `properties` object the version-const override is silently skipped, leaving `schema` unconstrained with no error or assertion."}, {"path": "crates/rustev-contract/tests/schemas.rs", "line": 95, "summary": "`std::fs::read(&p).unwrap()` inside the filter predicate panics with an opaque message on any file-read failure; only the JSON-parse failure is caught by the surrounding `if let Ok(v)`."}, {"path": "crates/rustev-contract/src/scope.rs", "line": 63, "summary": "`Handle::json_schema` uses JSON Schema `maxLength` (code points) for a limit that the parser enforces in bytes, so multibyte strings that exceed the byte limit pass schema validation."}, {"path": "crates/rustev-contract/src/time.rs", "line": 12, "summary": "`Timestamp` derives `JsonSchema` from `i64` with no `minimum: 0`, admitting negative timestamps that the parser rejects, inconsistently with `DurationMs` which correctly gets `minimum: 0`."}, {"path": "crates/rustev-contract/src/schema_emit.rs", "line": 42, "summary": "`title.clone().into()` clones a `String` that is never used again; should be `title.into()`."}]}Group 3 of 3The change adds {"head": "942223682254e35002b3eeb9ad60a5a53555d7db", "verdict": "no-findings", "findings": []}Subject: 355db90...9422236, diff digest 6292d019787feec51295647e3b66b8dcb5177578bc349e1cc22b4f641a2d1bf2, 3 call(s). An AI comment is not an approval. |
9422236 to
d066d92
Compare
AI review (findings)Group 1 of 2Reviewing the diff for the schema emission additions in Dependency changes (Cargo.lock, Cargo.toml, crates/rustev-contract/Cargo.toml) Schema files
{"head": "d066d92ba617c34e557d863cceb997498135b8aa", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.plan-2.schema.json", "line": 1, "summary": "Plan/2 schema permits optional plan/3-only fields (`grades`, `sources`, `actionability`) with `additionalProperties:false`, so a plan/2 document carrying those fields passes validation."}, {"path": "crates/rustev-contract/schema/rustev.evidence-1.schema.json", "line": 1, "summary": "Evidence/1 schema includes the `refused` and `needs_input` Outcome variants that are explicitly v2 additions, allowing v2-style outcomes to pass v1 schema validation."}, {"path": "crates/rustev-contract/schema/rustev.judgment-1.schema.json", "line": 1, "summary": "Judgment/1 schema includes the `refused` and `needs_input` Outcome variants that are explicitly v2 additions, allowing v2-style outcomes to pass v1 schema validation."}]}Group 2 of 2Looking through the diff carefully across the schema files, Rust sources, and test code: Schema emission correctness: The Hand-written Test logic: The Coverage gap: Unnecessary derive: No security or correctness bugs found. {"head": "d066d92ba617c34e557d863cceb997498135b8aa", "verdict": "no-findings", "findings": []}Subject: 355db90...d066d92, diff digest 714b9d265d1c89af3e1ff49e2a7f73ff9c8745880f008da0a4e3e06f89ac1e13, 2 call(s). An AI comment is not an approval. |
d066d92 to
7b46c86
Compare
AI review (no-findings)Group 1 of 3Reviewing the Cargo.lock additions, workspace Cargo.toml, crate Cargo.toml, and the new JSON Schema files in group 1. Dependency additions (
Schema files (
No bugs, security problems, or inconsistencies found. {"head": "7b46c862ec1e8f6be0a21d751e5a9ab18ed1d1b7", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing the schema emission infrastructure, schema files, and supporting Rust source changes in this group.
The Version pairing (same Rust type, two schema versions)
Schema titles for plain documents equal the version string (e.g.,
Uses let-chain syntax ( Schema files spot-checked
No bugs, security issues, or inconsistencies found. {"head": "7b46c862ec1e8f6be0a21d751e5a9ab18ed1d1b7", "verdict": "no-findings", "findings": []}Group 3 of 3Both changed files are straightforward and consistent with each other.
Nothing suspicious or incorrect. {"head": "7b46c862ec1e8f6be0a21d751e5a9ab18ed1d1b7", "verdict": "no-findings", "findings": []}Subject: f7437ce...7b46c86, diff digest cc8d63f368eefd5b91ca9f57c33fd9f2337fb725e665fc4f5f9b7d0850686871, 3 call(s). An AI comment is not an approval. |
b918cf7 to
d31dca6
Compare
AI review (findings)Group 1 of 3Reviewing the group-1 files: Cargo dependency additions, and the first batch of new JSON Schema files. Dependency additions (Cargo.lock / Cargo.toml / crates/rustev-contract/Cargo.toml)
No issues in the dependency changes. Schema files The schemas are auto-generated from Rust types via Both The same type ( No security issues or logic bugs found in the Cargo changes or the schema content itself. {"head": "d31dca609fb8d20e849764343cb9f9ac575bd611", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.judgment-2.schema.json", "line": 1, "summary": "The Notice.$defs entry allows `action` to be null and omits it from `required`, but per spec 033 §3.5.4 (noted in the schema's own description) judgment/2 notices must carry a non-null `action`; the schema is identical to judgment-1 on this point and will pass invalid v2 documents."}, {"path": "crates/rustev-contract/schema/rustev.evidence-2.schema.json", "line": 1, "summary": "Same issue as judgment-2: the Notice type in evidence/2 schema still allows null/absent `action`, failing to enforce the version-2 contract from spec 033 §3.5.4."}]}Group 2 of 3Reading through the diff, this PR adds Schema generation /
Request/response schema ambiguity
Test traversal (
No bugs found. {"head": "d31dca609fb8d20e849764343cb9f9ac575bd611", "verdict": "no-findings", "findings": []}Group 3 of 3The change adds No issues found. {"head": "d31dca609fb8d20e849764343cb9f9ac575bd611", "verdict": "no-findings", "findings": []}Subject: d29059a...d31dca6, diff digest c252b60b6e0847cbaf29a816e9980a5c6e6ef3dd4dc8c0f901ec0159dd7a9b8b, 3 call(s). An AI comment is not an approval. |
becc7c4 to
86072c9
Compare
AI review (findings)Group 1 of 3Reviewing the group-1 changes: dependency additions (
Both gaps are generated artifacts:
No security issues found in the schema files themselves. The schemas are well-formed JSON Schema Draft 2020-12 with consistent {"head": "86072c941cd578de2cc0d99ce611616a64fd4343", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.execution-1.schema.json", "line": 1, "summary": "RetryPolicy.max_attempts emits \"minimum\":0 but the spec requires 1..=8; a zero-attempt document passes schema validation."}, {"path": "crates/rustev-contract/schema/rustev.execution-1.schema.json", "line": 1, "summary": "FallbackPolicy.backends has no maxItems constraint despite the description capping it at 4, making the schema over-permissive for external validators."}, {"path": "crates/rustev-contract/schema/rustev.plan-2.schema.json", "line": 1, "summary": "Embedded RetryPolicy and FallbackPolicy carry the same minimum/maxItems gaps as the standalone execution schema."}]}Group 2 of 3Reviewing the schema emission module, test suite, and committed schema JSON files.
The
Schema JSON files (spot-checked)
No bugs, security problems, or inconsistencies found. {"head": "86072c941cd578de2cc0d99ce611616a64fd4343", "verdict": "no-findings", "findings": []}Group 3 of 3Looking at the two files in this review group:
The new
The new entry {"head": "86072c941cd578de2cc0d99ce611616a64fd4343", "verdict": "findings", "findings": [{"path": "specs/027-node-and-wasm-bindings/spec.md", "line": 30, "summary": "The extends entry cites spec '031-public-api-and-release-family' for the tools/rustev-release/ dependency, but both the inline comment and the Increment 2 body text attribute the archive-policy obligation to spec 021 section 3.5; the authority spec reference is inconsistent."}]}Subject: da2ccd6...86072c9, diff digest ca55194ec32c950c3543b339cfbf1da3a08c8059eeaf3c69387c4cf51b6e6bea, 3 call(s). An AI comment is not an approval. |
86072c9 to
87c531d
Compare
AI review (findings)Group 1 of 3Cargo.lock — missing
In Cargo.lock v4, the All other areas look correct: the {"head": "87c531de33282d74f0e7ec4f0afddbfdbda5b68c", "verdict": "findings", "findings": [{"path": "Cargo.lock", "line": null, "summary": "jsonschema-value 0.59.0 lists `zmij` as an activated dependency but no [[package]] entry for zmij appears in the lock file; alphabetically it would follow zeroize, the last visible entry, making the lock file inconsistent and breaking builds."}]}Group 2 of 3Reviewing the schema emission infrastructure and Rust source changes.
The function takes
let mut stack: Vec<PathBuf> = ["crates", "packages", "backends", "tools"]
.iter()
.map(|d| root.join(d))
.collect();The
let _ = std::fs::remove_dir_all(dir());
std::fs::create_dir_all(dir()).unwrap();If {"head": "87c531de33282d74f0e7ec4f0afddbfdbda5b68c", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/bounded.rs", "line": 965, "summary": "schemars::JsonSchema is derived on the private test-only Doc struct where it serves no purpose and adds noise to the dependency surface."}, {"path": "crates/rustev-contract/tests/schemas.rs", "line": 106, "summary": "committed_documents() omits the integrations/ directory, so remote exchange record fixtures (rustev-remote-exchange/1) are never validated against the emitted schema in every_committed_document_validates_against_its_schema."}]}Group 3 of 3The two changed files in this group are a spec documentation update and an archive-policy entry. I'll check each carefully.
The new The Increment 2 prose is internally consistent:
No inconsistencies or missing cross-references observed.
No issues found in either file. {"head": "87c531de33282d74f0e7ec4f0afddbfdbda5b68c", "verdict": "no-findings", "findings": []}Subject: da2ccd6...87c531d, diff digest c71b883fe9f8eeb0bc8b244c441e87d5fd78bddc53bdff3cda5dc7dd6492f7f1, 3 call(s). An AI comment is not an approval. |
90c1fd7 to
5b772dc
Compare
AI review (findings)Group 1 of 3Reviewing the Cargo dependency additions and the new schema files. Cargo.lock / Cargo.toml / crates/rustev-contract/Cargo.toml Both Schema files The Finding — judgment-1 and evidence-1 schemas are too permissive for their version
This is a correctness issue rather than a security issue, but it weakens the intended contract enforcement of the schema versioning system. The v1 schemas should only accept {"head": "5b772dc5267d601e01faff52c00c5fcd90f33368", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.judgment-1.schema.json", "line": 1, "summary": "The Outcome oneOf includes refused and needs_input variants which the schema's own description identifies as v2-only additions, making the v1 schema too permissive to enforce version constraints."}]}Group 2 of 3Reviewing the schema emission infrastructure, committed JSON Schema files, and the Rust type annotations in this group. Schema correctness: The
Parse-limit annotations:
Test coverage: One genuine concern: No other bugs, security issues, or inconsistencies found across the 16 committed schema files, the Rust source additions, and the test harness in this group. {"head": "5b772dc5267d601e01faff52c00c5fcd90f33368", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/actionability.rs", "line": 443, "summary": "ContinuationInputs<'a> derives schemars::JsonSchema despite having a lifetime parameter and never being a Document type, so it cannot appear in any emitted schema and the derive is misleading noise."}]}Group 3 of 3Reviewing the two files in this group:
The new
No issues found in either file. {"head": "5b772dc5267d601e01faff52c00c5fcd90f33368", "verdict": "no-findings", "findings": []}Subject: 124d1c9...5b772dc, diff digest 34cedba6bf24011f977e47a515d182a4843319be0b621da5519b5685b7d81985, 3 call(s). An AI comment is not an approval. |
5b772dc to
40bf9f8
Compare
AI review (findings)Group 1 of 3Reviewing the diff — Cargo dependency additions, workspace pinning, and newly emitted JSON Schema files.
Schema files — structural finding: The v1 schemas (definition-1, evidence-1, judgment-1) include types that the inline descriptions explicitly label as "Version 2" only. Concretely:
This appears to be a side-effect of generating schemas from shared Rust types (schemars derives from the full superset struct), but it means external validators relying on these schemas (especially important for spec 027's Node/WASM bindings audience) cannot catch version misuse — a v1 document containing No security issues, no injection risk in the schema content itself. No other bugs found. {"head": "40bf9f8dbe8c24d4d017f4617025d15524d0ffad", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/schema/rustev.definition-1.schema.json", "line": 1, "summary": "v1 schema includes v2-only TypeDecl variants (nullable, map), InputDecl fields (evidence, on_disagreement) and StepBody variant (corroborate) whose inline descriptions say \"Version 2\", so external validators accept invalid definition/1 documents."}, {"path": "crates/rustev-contract/schema/rustev.judgment-1.schema.json", "line": 1, "summary": "judgment/1 schema includes the v2-only Outcome variants (refused, needs_input) and Notice.action field, all explicitly described as absent in version 1, so external validators cannot catch version misuse."}, {"path": "crates/rustev-contract/schema/rustev.evidence-1.schema.json", "line": 1, "summary": "evidence/1 schema includes the top-level checks array and InputEvidence v2 fields (dropped, entries, presence, resolution, meta) whose descriptions explicitly mark them as Evidence 2, allowing invalid v1 documents to pass schema validation."}]}Group 2 of 3Reviewing the schema emission infrastructure, Rust type derivations, committed JSON schemas, and test suite. schema_emit.rs In
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({
"type": "string",
"minLength": 1,
"maxLength": MAX_HANDLE_BYTES // ← counts Unicode scalar values
})
}JSON Schema's
&& let Ok(b) = std::fs::read(&p)
&& let Ok(v) = serde_json::from_slice::<serde_json::Value>(&b)
let _ = std::fs::remove_dir_all(dir());Permission failures or OS errors are discarded, so a bless run on a read-only directory silently appears to succeed and then fails on No correctness bugs or security problems found in the core logic—schema derivation, canonicalization, determinism test, and the version-compatibility probes are all sound. {"head": "40bf9f8dbe8c24d4d017f4617025d15524d0ffad", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/src/scope.rs", "line": 74, "summary": "Handle's JSON Schema uses maxLength which counts Unicode scalar values, not bytes, so the schema accepts multi-byte UTF-8 strings that the bounded parser would reject on byte-length grounds."}]}Group 3 of 3Reviewing the two files in this group.
The new The Increment 2 description is internally consistent: schemars and jsonschema versions are exact-pinned, the golden-file bless pattern is conventional, the list of emitted schema types matches the schema files listed in the SUBJECT, and the statement "No document, parse bound or canonical byte changes" is a correctness commitment the other groups of this PR (covering
No bugs, security issues, or inconsistencies found. {"head": "40bf9f8dbe8c24d4d017f4617025d15524d0ffad", "verdict": "no-findings", "findings": []}Subject: 124d1c9...40bf9f8, diff digest ea88a275e0efd83452cf86081200d896cdce7780d8fb6959ba2957ae85570748, 3 call(s). An AI comment is not an approval. |
40bf9f8 to
c606867
Compare
AI review (findings)Group 1 of 3Reviewing the diff for the files in group 1: Cargo.lock, Cargo.toml, crates/rustev-contract/Cargo.toml, and the schema JSON files. Cargo.lock / Cargo.toml / crates/rustev-contract/Cargo.toml
Schema JSON files
No bugs, security problems, or meaningful inconsistencies found. {"head": "c6068673c5bc53ad8892a5ac0abb540b418974dd", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing the source changes and committed schema files in this group, focusing on correctness of the new Custom
The function generates a draft 2020-12 root schema, then overwrites
For version-paired types (e.g.,
The committed schemas consistently exclude File naming and schema constants
Cross-checking committed schemas against source Spot-checked No bugs, security issues, or inconsistencies identified. {"head": "c6068673c5bc53ad8892a5ac0abb540b418974dd", "verdict": "no-findings", "findings": []}Group 3 of 3Reviewing the three files in this group.
committed.sort();
let names: Vec<String> = emitted.iter().map(|s| s.file.clone()).collect();
assert_eq!(committed, names, …); // names is unsortedIf
The new increment 2 prose is internally consistent and matches the test file. The
{"head": "c6068673c5bc53ad8892a5ac0abb540b418974dd", "verdict": "findings", "findings": [{"path": "crates/rustev-contract/tests/schemas.rs", "line": 31, "summary": "names is collected in document_schemas() order and compared against a sorted committed list; if emission order is not alphabetical the test fails spuriously despite identical file sets."}]}Subject: 10210e9...c606867, diff digest 15ebb6a193ec38ea136123f4631bbb8b48caead893c99a33cb59278f1b038f8a, 3 call(s). An AI comment is not an approval. |
c606867 to
c9239cd
Compare
c9239cd to
d4fc8eb
Compare
AI review (no-findings)Group 1 of 3Reviewing the diff in group 1: dependency additions ( Dependencies
Schema files
No bugs, security problems, or inconsistencies found in this group. Group 2 of 3The diff adds
Shared-type multi-version schemas: File name derivation: Singletons / unit variants ( No bugs, security issues, or inconsistencies found. Group 3 of 3Reviewing the three files in this group.
The bless path in
In The
The new
No bugs, security issues, or inconsistencies found. Subject: c972cfa...d4fc8eb, diff digest 4638eefdcb9654f872245a227178a8adc4d7ad0a6e543892f856e390a29c1f8c, 3 call(s). An AI comment is not an approval. |
Spec 027, increment 3 of 7: `rustev-surface`, the shared command surface, adopted by the CLI. Stacked on #126. **Merges only after the owner ratifies draft spec 045 (#127)**, which admits `rustev-surface` to the release family in its own layer before the CLI. - `crates/rustev-surface`: `plan check|compile|show`, offline `replay`, `eval`, `gate`, `calibrate fit|qualify`, shared dependency reading, the task adapter, command output and exit codes, and the `run` result envelope. The CLI's code, moved: typed arguments plus a `Host` (bounded/budgeted reads by label, never-overwrite publication, all-or-none writes, label joining) and a rules-descriptor hook. Depends on contract, core, eval, serde, serde_json only. - The CLI keeps argument parsing, its file-system host (`Reads` implements `Host`), the store resolver, the rules backend and the runtime; each command checks flags and calls the surface; `run` prints through the surface envelope. - Every CLI test passes with goldens unchanged (none re-blessed). `tests/memory_host.rs` drives the surface from an in-memory host and gets the CLI's golden bytes for `plan check` and `plan show`. - Release tooling: `rustev-surface` in `release-set.json` (layer 4, CLI layer 5, upload order), the release-set test's member list, and `archive-policy.json` (new surface allowlist; `adapter.rs`/`out.rs` leave the CLI's). `rustev-release` manifests and archives tests pass; `make boundaries` passes. Review round 1 (3 findings): (1) the merge precondition is deliberate: spec 045 is drafted in #127 for the owner's ratification and this increment waits on it, as its record says; (2) fixed: the test host's `write_all` removes what it wrote when a later write fails; (3) the test host reads at most `max` bytes, exactly as the CLI's file host does (a caller detecting an oversized input asks for its limit plus one and compares lengths); it has no aggregate budget, so it reports none; the code says so. Review round 2 (1 finding): as in round 1, the precondition is deliberate and tracked: spec 045 is drafted in #127 for ratification; this pull request is not merged before it. Review round 3 (3 findings): (1) the spec 045 precondition stands as stated (#127, awaiting ratification); (2) `Host::ensure_absent` is documented as a pure, repeatable check, which every command relies on; (3) fixed: `addressing` is private to the envelope; `judged` is the public entry. Review round 4 (2 findings): (1) the spec 045 precondition stands (#127, awaiting ratification); (2) Cargo adds `Cargo.toml.orig`, `Cargo.lock`, `.cargo_vcs_info.json` and the workspace readme beyond `include` (as for every release member), and `rustev-release`'s archives test compares `cargo package --list` with the policy; the manifest comment says so. Review round 5 (2 findings): (1) the spec 045 precondition stands (#127, awaiting ratification); (2) the test host reads at most `max` bytes exactly as the CLI's file host does; a caller detecting an oversized input asks for its limit plus one byte and compares lengths, which the surface's callers do. (Increment 5 replaces this test host with the shared `host::Memory`.) Review round 6 (1 finding): spec 045 is added by #127, not this branch, by design: this PR is held (no auto-merge) until #127 merges and the owner ratifies 045. The spec record now names that dependency and the hold explicitly. Restacked on #126. Review round 7 (1 finding, fixed): `eval::write_all` takes its files by value and moves the bytes into the host's list; nothing is copied. Review round 8 (1 finding): `cargo package` writes `Cargo.lock` into every archive, library or not (`cargo package -l -p rustev-surface` lists it), and every member's allowlist names it; the archive test compares against real `cargo package` output and passes. The spec record now says so, and records spec 045's ratification (A-42). Review round 9 (3 findings): (1, 2) Spec 045 is ratified (A-42) and lands with #127, which waits only on the owner's environment approval; this branch is rebased onto main after #127 merges, before it can merge, so 045 is in the tree it merges into. (3) fixed: the crate's keywords and category describe a library (`decision-engine`, `commands`, `bindings`; `development-tools`). CI `verify` (spec 006's mutation seeds) failed on this branch: the seeds still named `crates/rustev-cli/src/` files whose command logic this PR moves into `rustev-surface`. Fixed: the 13 seeds in moved code now name the surface file their anchor lives in (one anchor changed with the move: `host.ensure_absent`), and run the CLI's tests and the surface's own, since the adapter's unit tests moved with it. Locally all 29 seeds were run: 27 detected by the CLI's tests alone, and the two adapter seeds detected once the surface's tests run too (4/4 in the adapter category). The spec record says so.
Spec 027, increment 5: the WebAssembly package. Stacked on #129. - `integrations/rustev-wasm` (`publish = false`, npm only; excluded from the crates.io release set): `version`, `check`, `compile`, `show`, `replay`, `eval`, `gate`, `calibrateFit`, `calibrateQualify` through `rustev-surface` with an in-memory host (`rustev_surface::host::Memory`, new, also used by the surface's tests). No runtime, backend, sink or clock; time is an argument; external items resolve through a synchronous host callback. - `make bindings`: exact pins (`wasm-bindgen-cli` 0.2.129 = crate, `wasm-opt` 116), `web`/`bundler`/`nodejs` targets at `-Oz` (a `wasm` cargo profile used only here), declaration drift check plus strict type-check, import allowlist, size and instantiation budgets with a measurement document, and the JavaScript conformance runner. - Declarations: `rustev-documents.d.ts` generated offline from the committed schemas by `json-schema-to-typescript` 16.0.0 (committed lockfile), type-checked by TypeScript 5.9.3 strict. Generated: 10k of this PR's lines. - Imports: only `wasm-bindgen` glue, each reviewed in `wasm-imports.json`. - Conformance: the harvest marks pure-command cases for the `wasm` surface and records rules programs' derived descriptors; all 23 such cases print the CLI's golden bytes and exit codes on WebAssembly. - **Measurement (local):** raw 2,215,589 B (over the 2,097,152 B budget by 5.6%), gzip 762,689 B (under 786,432), Brotli 543,501 B, Node instantiation median 3.5 ms (budget 50). `make bindings` fails at the raw gate as 3.10.4 requires; the budget change is drafted as spec 046 for the owner. Chromium timing and the CI measurement come with the `bindings` job (increment 7). Review round 1 (2 findings): (1) the resolver passes up to `maxBytes` plus one byte on purpose, so the library classes an item past its budget `oversized` exactly as for the CLI's store, which reads one byte past the maximum; the comment now says so (anything longer is inaccessible). (2) Fixed: the memory host names the case: an output that already exists, or a label that names an input. Declarations regenerated after #126's schema change (Timestamp range). Review round 2 (3 findings): (1) fixed: `make bindings` refuses first when cargo metadata names no target directory, so no path is built from an empty prefix. (2) fixed: `Memory`'s outputs are private, with an `output(label)` copy accessor; only `create` and `write_all` borrow them, never across a call. (3) No case names `wasm` on a `run` (the harvest gives `run` cases `cli` and `native`; `run` is no WebAssembly command, 3.1.1), so none throws today; the runner now reports such a case as a failure instead of ending, and the code says why. Restacked on #129. Review round 3 (4 findings): (1) `"private": true` is deliberate until publication: spec 031 owns the npm release and makes the package publishable then, so no build of this increment can be published by accident; the spec record says so. (2) fixed: a test pins `join`: an empty directory is the binding's top level, so the label is the name alone. (3) lodash 4.18.1 is published on the public registry (`npm view [email protected] version` answers 4.18.1) and the lockfile resolves it from registry.npmjs.org with its integrity hash. (4) fixed: a throwing module call fails its case and the runner continues. Review round 4 (4 findings): (1) fixed: a derived descriptor that does not canonicalize fails the harvest naming its program, never a silent gap. (2) fixed: `Memory`'s inputs are private like its outputs, read through `inputs()`. (3) Repeated: lodash 4.18.1 is on the public registry (`npm view [email protected] version` answers 4.18.1); the lockfile resolves it from registry.npmjs.org with its integrity hash, so the slot is not unclaimed. (4) No `run` case names `wasm`: the harvest gives a case `wasm` only when its command is pure, and every `run` case's surfaces are `["cli"]` in this branch (`native` joins in #132). Restacked on #129. Review round 5 (6 findings): (1) Refusing an output that names an input is deliberate and matches the CLI: on a file system the input is a file at that path and the file host refuses to replace it, so every surface gives the same outcome; the code says so. (2) fixed: `CARGO_TARGET` is read by parsing cargo's JSON, not by a regex. (3) fixed: the unreachable error arm is an `expect` stating why (`ms` admits at most 2^53 - 1). (4) fixed: the harvest refuses a `--rules` argument that is not a plain relative path before writing a descriptor under it. (5) fixed: `wasm-check.mjs` parses `--chromium-ms`, records the median and fails it against the 3.10.6 budget (the CI job of increment 7 supplies it). (6) Repeated and wrong: lodash 4.18.1 is published (`npm view [email protected] version`), and `npm ci` installs it from the lockfile locally and in CI. Restacked on #129. Review round 6 (3 findings): (1) fixed: the message states the requirement (`must be a non-negative integer`). (2) No case names `wasm` on a `run`: every case whose command is `run` lists `["cli"]` in this branch (checked over all case files), and the manifest aggregates them unchanged. (3) fixed: a flag without a value fails the case naming it; every flag of the harvested commands takes one value (checked over all case files). Review round 7 (1 finding, fixed): `CARGO_TARGET` is evaluated lazily, once, on first use, so only `make bindings` runs cargo metadata and node; other targets pay nothing. Review round 8 (2 findings, the same as rounds before): no `run` case names `wasm`. The diff placed new `derived` entries on the `run` cases next to the `wasm` surface added to neighbouring pure cases. To leave nothing to misread, the harvest now records derived descriptors only for the cases the WebAssembly surface runs (`plan check`, `plan compile`, `plan show`, `replay`), so this PR no longer changes any `run` case: every `run` case keeps its surfaces `["cli"]` and gains nothing. wasm 23/23. Also fixed here (raised on #131, rounds 1 to 4): in the plan namespaces, `AddressOverride.to` and `RemediationDecl.for` showed the `Party` type's description instead of their own rule. The schemas were right; the generator took whichever description a referenced type was first resolved with. `gen-types.mjs` now wraps a reference that has its own description in `allOf`, so every field keeps its own text (`to`: never `caller`) and shared types become named (`Party`, `Grade`, `Predicate`) instead of inlined; shapes are unchanged and `tsc --strict` passes. Review round 9 (2 findings, fixed): (1) the store resolver is `resolveItem`, no longer shadowing `path.resolve`. (2) a failed instantiation sample is recorded as a 3.10.5 failure and the measurement document is still written. Review round 10 (5 findings): (1) fixed: the wasm-opt pin matches the whole version token (`wasm-opt version 116` then a space or the end), so `1160` fails it. (2) Repeated: refusing an output that names an input matches the file host, where the input is an existing file and `ensure_absent` refuses it the same way; the code says so. (3) Known and recorded: the raw size is over its 3.10.4 budget, which draft spec 046 addresses; until the owner decides, the gate reports it rather than the budget being weakened. (4) fixed: an output without `normalize` is read as having none. (5) The allowlist is every module name with every base name on purpose: the same reviewed glue is imported from `wbg` or `./rustev_wasm_bg.js` depending on the target; the check says so. Review round 11 (4 findings): (1) fixed: make expands a recipe's lines before running the first, so the target directory is read before the Node check whatever the order; the refusal now names what it needs (cargo metadata and Node 20 or later on PATH). (2) Not a defect: `max_bytes` goes to the host only as a hint; the guard compares the returned length with it as integers, and on wasm32 a `usize` is 32 bits, exact as an f64; the code says so. (3) A harvest that would write outside its fixtures is a broken test, not a case to skip: the test fails loudly, and the harvest rewrites its output on the next run. (4) Verified: the lockfile's integrity for lodash 4.18.1 equals the registry's (`npm view [email protected] dist.integrity` gives the same `sha512-dMIn...0Q==`). Review round 12 (1 finding, fixed): each case, comparison included, runs in its own `runCase` under the per-case catch, so a throw while reading a golden fails that case only. Review round 13 (1 finding, fixed): a replay case without `--now-ms` fails naming the flag (`flags().need`) instead of passing `NaN` on (which the Rust side would also refuse). Review round 14 (3 findings, all raised before): (1) lodash 4.18.1 is published, and its lockfile integrity equals the registry's (verified in round 13 and earlier). (2) A case that names the `wasm` surface for a command it lacks is a failure by design, counted as run: the suite must not silently skip a case it claims. (3) To settle it, the allowlist is now the exact reviewed `module:name` pairs (22, both targets' module names), checked as pairs. Review round 15 (3 findings): (1) fixed: a case file from an earlier harvest must record the same derived descriptors this harvest wrote, or the harvest fails and says to rebuild; run cases now carry the harvest's own `"derived": []`, so every committed case file is reproduced byte for byte by `make conformance-harvest` (the wall-clock replay bundles aside). (2) fixed: the flags a command cannot run without (`definition`, `out`, `plan`, `bundle`, `now-ms`) fail the case by name when absent. (3) No WebAssembly case pins a written output today (every one pins stdout), so nothing passed vacuously; a case that did is now compared against the artifact the command published under that name, never skipped. Review round 16 (1 finding, raised in earlier rounds too): lodash 4.18.1 was published on the public registry on 2026-04-01 (after the reviewer's knowledge cutoff), and the lockfile's integrity equals the registry's `sha512-dMIn...0Q==` (`npm view [email protected] time dist.integrity`); it is json-schema-to-typescript 16.0.0's dependency and `npm ci` installs it. The package now records this in its `//` note, so the diff carries the evidence. Review round 17 (1 finding): verified, and now verified on every build: `npm view [email protected] dist.integrity` equals the lockfile's `sha512-dMIn...0Q==`, and `make bindings` now runs `npm audit signatures` after `npm ci`, which checks every installed package's registry signature (locally: 16 packages with verified registry signatures, lodash 4.18.1 among them). Review round 18 (2 findings): (1) fixed: every path the `bindings` recipe builds from `BINDINGS_OUT` or `CARGO_TARGET` is quoted, so a target directory with a space is passed whole. (2) The spec says nothing about lodash (no "4.18.1" appears in it), and lodash 4.18.1 is published (2026-04-01) and now verified by registry signature on every `make bindings` (`npm audit signatures`: 16 packages verified); `npm ci` installs it. Review round 19 (3 findings): (1) js-yaml 4.3.2 is published (`npm view [email protected] version dist.integrity`), as is every package in the lockfile; the package's note now covers the whole tree rather than one package at a time: `npm ci` checks each package against its locked integrity, and `make bindings` verifies every installed package's registry signature (16 verified). (2) fixed: each scope mode's fields are required, so a replay case without them fails by name. (3) The hash width is fixed by the exact wasm-bindgen pin (0.2.129, 3.10.2); a new pin that changes it fails the allowlist loudly, which is wanted; the code says so. Review round 20 (4 findings): (1) fixed: a test pins that an output naming an input is refused. (2) fixed: a case file from an earlier harvest must also record the same surfaces. (3) fixed: each built target directory carries its module type (`web` and `bundler` ES modules, `node` CommonJS, written by `make bindings`), and the exports name the matching conditions (`import`, `require`); Node no longer warns that the module type is unspecified. (4) Already done as asked: `make bindings` runs `npm audit signatures` after `npm ci` (16 packages with verified registry signatures, lodash 4.18.1 among them), which checks provenance, not only content. Review round 21 (1 finding, resolved): the owner ratified spec 046 (A-43, #136), raising the raw budget to 2,621,440 bytes and keeping the gzip and instantiation budgets and the gate; `wasm-opt` could not close the gap (`-Oz` is the smallest at 2,216,152 bytes). The measurement check now applies the 046 budget, and `make bindings` passes end to end (wasm conformance 23/23). The spec 027 record says so.
Spec 027, increment 6 (first change): the native Node-API package. Stacked on #130. - `integrations/rustev-node` (napi 3.14.2, Node-API 8; `publish = false`, excluded from the crates.io release set): an `Engine` owning one sized Tokio runtime, rules-program and host backends, a host sink and optional context source; `compile` (or load a compiled plan) and the pure commands on the blocking pool, with sync variants; `decide` on the engine's runtime with `AbortSignal`, deadline, principal handle and `traceparent`; manual clock; gauges; shutdown. - Host seams (3.6) via weak threadsafe functions: bounded per-seam queues refused at once, remaining time, attempt identity, abort, reserved bound and trace context on every call, late settlements discarded and counted, non-`SeamFailure` rejections mapped to permanent / unknown charge / possibly continuing. Context source once before admission; `ContextUnavailable` on failure, nothing defaulted. - JavaScript layer (`index.js`, `index.d.ts`, generated document declarations byte-identical to the wasm package's): the 3.3 API, typed `RustevError` subclasses and codes (3.4), `onGauges` drop-oldest subscription, drain-then-cancel `shutdown`, platform-package loader naming a missing package. - `unsafe`: napi-rs's generated glue needs it, so this crate sets `unsafe_code = "deny"` (reason in the manifest); `tests/no_unsafe.rs` fails on hand-written `unsafe`. - `test/negative.test.mjs`: each section 5 row of the native package (20 tests, deterministic on a manual clock). A decision through the binding produces the CLI's golden run-record bytes. - `ManualClock::pending_delays` (additive, spec 003's crate) for deterministic clock driving; the conformance adapter that uses it follows in the second change. - Two owner findings, recorded in the spec: a host backend's cancellation answer is always `not_observed` (the runtime polls a cancelled attempt once; a host seam answers across threads), and section 5's "output failing the bounded parse" row disagrees with 3.6.5; the binding follows 3.6.5. Review round 1 (5 findings): (1) Under `node -e`, `process.argv[1]` is the first argument after the code (there is no script path), so the copy reads the target directory; it ran that way in local verification, and the Makefile now says so. (2) fixed: a decision is counted in flight by a guard dropped when its task ends, panic included, so shutdown never waits on a panicked task. (3) fixed: `compile` takes exactly one of a definition and a plan, otherwise `InvalidDocument`; declared and tested. (4, 5) The generated types state what each bounded parser accepts (3.2.2: the schema describes the parser), while a field's description can state a compiler rule beyond it (`AddressOverride.to` is never `caller`, `RemediationDecl.for` never `none`: the compiler refuses both). The generated header now says so; both packages' copies regenerated and identical. Restacked on #130. Review round 2 (5 findings): (1) fixed: the no-unsafe check reads source files only and fails on anything else in `src/` rather than panicking. (2) fixed: compiles and commands on the blocking pool are counted, and shutdown waits for them as for decisions. (3) fixed: after raising cancellation, shutdown waits at most 30 seconds and reports what still runs (`stillRunning`). (4) fixed: a local build that does not load is a typed `InternalError` (`local_build_unloadable`) naming it; tested. (5) Repeated: the generated types state what each bounded parser accepts and the generated header says a field's description can state a compile rule beyond that; `compile` refuses `caller` for `AddressOverride.to` in every plan. Review round 3 (6 findings): (1) Repeated, and wrong: under `node -e` the first argument after the code is `process.argv[1]` (`node -e 'console.log(process.argv.slice(1))' x` prints `["x"]`). To leave no doubt, the copy is now a script, `tools/rustev-conformance/js/copy-addon.mjs <target> <package>`, run by `make bindings` and locally. (2) fixed: shutdown's local count is `active`, no longer shadowing the module's `inFlight`. (3) fixed: a seam failure with an empty reason records the status instead (`the host seam failed without a reason (...)`). (4) Repeated: the generated declarations' header states that the types describe what each parser accepts and that a description can state a compile rule beyond it (the compiler refuses `caller` for `AddressOverride.to`); each emitted schema now says the same in a root `$comment` (#126), which the type generator does not copy. (5, 6) These are the two owner findings already recorded in this spec's implementation record (the host backend's cancellation recorded `not_observed`, and section 5 against 3.6.5 for an unparseable answer); they need the owner's reading or an amendment, not a code change here. Restacked on #130. Review round 4 (5 findings): (1) fixed, and it exposed a real defect: `compileSync` takes exactly one of a definition and a plan, refusing otherwise with `InvalidDocument`; the layer's error wrapper also re-typed errors it had thrown itself as `InternalError`, and now passes a `RustevError` through unchanged. Tested. (2) fixed: the no-unsafe check strips a `//` comment only outside string literals; tested. (3) The diagnostic report is the C-library test napi-rs uses; it runs once, on Linux only, and now without the network section where Node allows leaving it out. (4) fixed: `copy-addon.mjs` refuses a platform it has no package for. (5) fixed at the source (#130): the generator gave plan fields the referenced type's description; now every field keeps its own (`AddressOverride.to`: never `caller`), and this package's declarations are regenerated, byte-identical to the WebAssembly package's. Review round 5 (2 findings, fixed): (1) an installed platform package that does not load is `InternalError` (`platform_package_unloadable`, naming it), and only an absent one is `PlatformPackageMissing`. (2) the no-unsafe check blanks `/* */` block comments across lines as well as `//` comments, string literals staying code; tested. Review round 6 (3 findings, fixed): (1) a command is counted before the shutdown check (both sequentially consistent), so either shutdown waits for it or it refuses; it never runs unseen. (2) the no-unsafe check reads raw strings (`r#"…"#`, `br"…"`), escaped strings and char literals (`'"'`) as code, with lifetimes left alone; tested. (3) a package is missing only when Node cannot find the package itself (`Cannot find module '<package>'`); a missing dependency of an installed package makes it unloadable. Review round 7 (3 findings, fixed): (1) a decision is counted in flight before the shutdown check, as a command is, so shutdown either waits for it or it refuses. (2) shutdown's count saturates at `u32::MAX` instead of truncating. (3) the no-unsafe check reads an escaped char literal (`'\''`) whole; tested. Review round 8 (4 findings, fixed): (1) the no-unsafe check blanks string contents (plain, byte and raw) as it blanks comments, so text inside a string is not code; a real `unsafe` block is still found; tested. (2) the missing-package test first asserts that no platform package resolves from its directory (Node also searches ancestors), so it fails rather than passes if one does. (3) `advanceClock` takes any integral, non-negative number up to 2^53 - 1 and refuses the rest instead of truncating to 32 bits; tested. (4) the build-time copy script leaves out the report's network section too. Review round 9 (2 findings, fixed): (1) `clockDelays` reports each pending delay as a JavaScript number, exact to 2^53 - 1 ms, the range `advanceClock` accepts, instead of capping at 32 bits. (2) the no-unsafe check matches the keyword `unsafe`, not a longer identifier such as `unsafe_code`; tested. Split (the AI review was cancelled at its 15-minute limit twice): this PR is now increment 6's first change, the native crate (Rust: engine, seams, commands, errors, the no-unsafe check, the manual clock's pending delays); the JavaScript layer (`index.js`, declarations, generated types, package, tests, copy script) moves to a PR stacked on this one, and #132 is restacked on that. Review round 10 (2 findings, fixed): (1) every usage refusal states the requirement (`must be a string`, `must be a list`, `must list strings`). (2) a compile on the blocking pool is counted and then checked against shutdown before it reaches the pool, as a command is, so both paths behave alike: shutdown waits for it, or it refuses. Review round 11 (2 findings, fixed): (1) `"failure": null` in a host's answer is no failure; only an object is one. (2) the context source's fetch runs on its own task, as a backend's attempt does, so a settlement that arrives after its decision was dropped is discarded and counted (3.6.4). The 23 native tests (#135) and the 34 native conformance cases (#132) pass against this build. Review round 12 (2 findings, fixed): (1) a host answer's `cancel`, when present, must be `stopped` or `unconfirmed`; any other value is refused like an unknown charge or remote end, and only an absent one means not requested. (2) `compile` and `load` on the blocking pool run under `guard`, so a panic crosses as `InternalError` with its message, as a command's does. Rebased on main after #134 merged. Review round 13 (1 finding, fixed): advancing an engine on the system clock is refused with its own code, `not_a_manual_clock`, instead of `out_of_range`, which stays for numbers outside the accepted range; #135 tests both. Review round 14 (1 finding, fixed): the synchronous `command`, `compile` and `load` are counted and then checked against shutdown, as their blocking-pool forms are, so a synchronous call (from a worker thread too) is one shutdown waits for. The native tests (#135, 27) and native conformance (#132, 34) pass against this build. Review round 15 (1 finding, fixed): a compile given neither a definition nor a plan says so (`neither was given`), and one given both says `not both`. Review round 16 (2 findings, fixed): (1) `compile` and `load` count themselves and then call uncounted forms (`compile_uncounted`, `load_uncounted`), which `prepare_async`, already counted, calls directly, so nothing is counted twice. (2) `clockSleepers` saturates at `u32::MAX` instead of truncating. The native tests (#135, 27) and native conformance (#132, 34) pass against this build. Review round 17 (2 findings): (1) Nothing is dropped: the workspace's only lint is `unsafe_code` (`[workspace.lints.rust]`), which this crate overrides to `deny`; Cargo cannot inherit the workspace table and override one lint, so the manifest now says the table restates the workspace's and must mirror any lint it gains. (2) fixed: a host answer missing its charge or its remote end is refused naming the one that is missing.
Spec 027, increment 2 of 7: JSON Schema emission (3.2.2). Stacked on #124 (it covers 033's document types); independent of #125.
rustev_contract::schema_emit::document_schemas(): a draft 2020-12 schema per public document type and version (28 files), derived viaschemars(=1.2.3, pure) from the serde definitions the bounded parser uses; hand-written schemas for identities/digests, decimals and scope handles;schemafixed byconst;ParseLimitsrecorded asx-rustev-parse-limits. Canonical JSON, committed undercrates/rustev-contract/schema/.crates/rustev-contract/tests/schemas.rs: committed bytes and file set equal emission (RUSTEV_BLESS=1rewrites); emission deterministic and canonical; every committed test-directory JSON document naming an emitted version validates against it (jsonschema=0.59.0, dev-only, no HTTP/file resolution); a schema refuses an unknown member and another version.schema_emit.rsjoinsarchive-policy.json(hence 027's newextendsontools/rustev-release/); the release audit (bans, licenses, sources) passes with the new dependency.Review round 1 (2 findings): (1)
zmijis already in the lock file ([[package]] name = "zmij", a dependency ofserde_jsonon main); the diff shows only changed entries. (2) The parser reads judgment 1 and 2 (and the other #76 pairs) with one wire type and does not refuse a later version's members under the earlierschemastring, so the version schemas share that type's schema exceptschema; a stricter version 1 schema would describe something the parser does not enforce (3.2.2: the schema is descriptive).schema_emitdocuments this.Review round 2 (1 finding): as in round 1, now shown by a test: a committed judgment 2 golden relabelled
rustev.judgment/1is accepted byJudgment::parseand by the version 1 schema alike; the schema describes the parser and is never stricter (3.2.2).Review round 3 (7 findings): fixed:
Timestamp's schema states the range its parser enforces (0 to 9999-12-31T23:59:59.999Z); a schema withoutpropertiesis a defect (expect), never silently skipped; the test reads files fallibly; a needless clone removed. Answered:RankEntry.positionis au64the parser accepts from 0, so its schema says so (the "1-based" comment states what the core produces, not what the parser refuses);Handle's byte bound is the parser's and a character bound is looser, never stricter, as the code says;zmijis in the lock file (aserde_jsondependency on main).Review round 4 (3 findings, same class as before): plan 2, evidence 1 and judgment 1 schemas admit the later version's members because the bounded parser reads both versions with one wire type and accepts them; a schema stricter than the parser would describe validity the parser does not enforce (3.2.2). The parity test now shows it for all three pairs: a later-version document relabelled with the earlier version is accepted by the parser and by the earlier schema. Rebased on main.
Review round 5 (1 finding, fixed): a derived schema without
propertiespanics naming the document; the committed-bytes test emits every document, so such a defect fails CI before any schema is committed or shipped, and is never skipped.Review round 6 (2 findings, same class as before): spec 033 writes every version 2 notice with its
action, but the bounded parser does not refuse a notice without one, so the version 2 judgment and evidence schemas do not either (3.2.2: the schema describes the parser, never stricter). The parity test now shows it: a version 2 notice withoutactionis accepted by the parser and by both version 2 schemas.Review round 7 (4 findings): (1-3) The execution policy's ranges (
max_attemptsin1..=8, at most four fallbacks, standalone and embedded) are checked when a plan is compiled against the policy (rustev_core::execution), not by the bounded parser; the schema describes the parser (3.2.2) and the field descriptions state the compile rule. The parity test now shows it: an out-of-range policy is accepted by the parser and the schema. (4) fixed: theextendscomment names both: the archive list follows spec 021 3.5's rule in the directory spec 031 owns, which is why the edge names 031.Review round 8 (3 findings): (1) Repeated and wrong:
Cargo.lockhas[[package]] name = "zmij" version = "1.0.23"from crates.io;cargo build --lockedand CI resolve it. (2) fixed: the private test struct inbounded.rsno longer derivesJsonSchema. (3) fixed: the committed-document sweep includesintegrations/.Review round 9 (2 findings): (1) Repeated: judgment 1's schema admits
refusedandneeds_inputbecause the parser reads both judgment versions with one wire type and accepts them under version 1; the parity test (the_version_schemas_describe_what_the_parser_accepts) relabels a version 2 refusal as version 1 and shows both the parser and the version 1 schema accept it (3.2.2: the schema describes the parser, never stricter). (2) fixed:ContinuationInputsno longer derivesJsonSchema.Review round 10 (4 findings, the same class as earlier rounds): version 1 schemas admitting version 2 members, and a character length standing for a byte bound. Both follow from 3.2.2: a schema is derived from the types the bounded parser reads and is descriptive, the parser being the only authority on validity; the parser reads both versions with one type, and JSON Schema cannot express a UTF-8 byte length. To make every schema say this itself, each now carries a root
$commentstating it (admits what the shared type admits, including later-version members; byte, depth and count bounds inx-rustev-parse-limits, string lengths counting characters; compile rules in descriptions, not enforced). The parity test shows the parser accepting each such document. Rebased on main.Review round 11 (1 finding, fixed): the file-set comparison sorts both lists, so it never depends on emission order.