CultLib/packages/cultnet-rs/contracts/cultnet/cultnet.error.schema.json

46 lines
2.8 KiB
JSON
Raw Normal View History

Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/GameCult/CultLib/contracts/cultnet/cultnet.error.schema.json",
"title": "CultNet Error Message",
"description": "R-X (docs/cultnet-selection-cut.md, fix batch 4): CultNetErrorMessage is a MessagePack-CSharp map-mode object, so every declared key is written on the wire, nil included - routingHint, code and details are `required` here the same as cultnet.raw-document-header.schema.json's nullable fields, not optional just because a given refusal leaves them null.",
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
"type": "object",
"required": [
"schemaVersion",
"error",
"routingHint",
"code",
"details"
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
],
"additionalProperties": false,
"properties": {
"schemaVersion": { "const": "cultnet.error.v0" },
"error": { "type": "string", "minLength": 1 },
"routingHint": {
"description": "Optional shard routing detail for an authority failure. Null for every selection/cursor refusal code (R-N).",
"type": ["object", "null"],
"additionalProperties": false,
"required": ["shard", "reason"],
"properties": {
"shard": { "type": ["object", "null"] },
"reason": { "type": "string" }
}
},
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
"code": {
"description": "Machine-readable refusal code (R-N). Additive: a v0 peer that does not know this field ignores it. The set is a closed enum: Rust and TypeScript refuse a message whose code is not listed, so adding a code is one coordinated change across every runtime (this schema, the C# factory, the Rust CultNetErrorCode, and a captured-bytes case for each).",
"type": ["string", "null"],
"enum": [null, "selection_invalid", "cursor_stale", "cursor_invalid", "reference_outside_target", "variant_unsupported", "unowned_schema"]
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
},
"details": {
"description": "Code-specific structured detail (R-N). Every field is populated only for the code that defines it; the others are null, not omitted.",
"type": ["object", "null"],
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
"additionalProperties": false,
"required": ["field", "value", "asOf", "current"],
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
"properties": {
"field": { "description": "selection_invalid: the selection field that failed. variant_unsupported: \"subscriptionId\", when a subscription was ended. unowned_schema: \"schemaId\".", "type": ["string", "null"] },
"value": { "description": "selection_invalid: the offending value, when there is one string worth naming. variant_unsupported: the id of the subscription that ended. unowned_schema: the schema id no shard owns.", "type": ["string", "null"] },
"asOf": { "description": "cursor_stale: the cursor's own minted asOf.", "type": ["integer", "null"], "minimum": 0 },
"current": { "description": "cursor_stale: the answering server's current asOf.", "type": ["integer", "null"], "minimum": 0 }
Rust R-AB: make cultnet-rs self-contained enough for cargo-mutants schema_discovery.rs embedded the 22 contract schemas via include_str!("../../../contracts/cultnet/*.schema.json"), three levels above src/ and outside packages/cultnet-rs entirely. There is no workspace Cargo.toml tying this crate to its siblings, so cargo-mutants treats this package's own directory as the whole tree it copies - every one of those paths escaped it, and the unmutated baseline build failed on all 22 with "No such file or directory". There was no mutation evidence for the Rust half of this cut at all. Fix: vendor byte-identical copies of the 22 schemas under packages/cultnet-rs/contracts/cultnet/, git-tracked so they travel with the package, and repoint every include_str! at the vendored copy. A build script staging files into OUT_DIR was the other option named for this rule, but it does not actually solve the problem: the script would still have to read from outside the package to find its source, and would fail the same way inside cargo-mutants' copy. Vendoring is "another route that keeps every source path inside the package." Vendoring duplicates files this repo treats as canonical (contracts/cultnet/*.schema.json, shared across every runtime per docs/cultnet-selection-cut.md section 1), so a new test, schema_discovery_contracts.rs, compares every vendored file against its repo-root original byte for byte and fails loudly on drift. It skips (not fails) when the canonical contracts/ tree is not present beside the package - the isolated-copy case R-AB exists to survive - so the check cannot reintroduce the same escape it guards against. cargo-mutants run on the crate, at least covering this cut's diff: report to follow with every survivor triaged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 21:05:06 +02:00
}
}
}
}