idiolect-records 0.3.0

Rust record types mirroring the dev.idiolect.* Lexicon family.
Documentation
// @generated by idiolect-codegen. do not edit.

//! Minimally-valid fixture records, surfaced from `lexicons/dev/*/examples/`.
//!
//! Each `*_JSON` const is the raw json fixture; each companion
//! function returns the deserialised record. Panics on invalid
//! json are by design — the roundtrip test suite catches drift
//! before anything lands.

#![allow(missing_docs)]
#![allow(clippy::missing_panics_doc)]

/// Raw json for the bundled `dev.idiolect.adapter` fixture.
pub const ADAPTER_JSON: &str = r#"{
  "$nsid": "dev.idiolect.adapter",
  "framework":          "coq",
  "versionRange":       "^8.20",
  "invocationProtocol": { "kind": "subprocess" },
  "isolation":          { "kind": "process" },
  "author":             "did:plc:adapter-author",
  "occurredAt":         "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.adapter` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn adapter() -> crate::Adapter {
    serde_json::from_str(ADAPTER_JSON).expect("bundled dev.idiolect.adapter fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.belief` fixture.
pub const BELIEF_JSON: &str = r#"{
  "$nsid": "dev.idiolect.belief",
  "subject": {
    "uri": "at://did:plc:labeler/dev.idiolect.encounter/3l5fk7aqcco2m",
    "cid": "bafyreidfcm4u3vnuph5ltwdpssiz3a4xfbm2otjrdisftwnbfmnxd6lsxm"
  },
  "holder": "did:plc:user123",
  "basis": {
    "$type": "dev.idiolect.defs#basisExternalSignal",
    "url": "https://user.example.com/profile",
    "signalType": "license:CC-BY-NC-4.0",
    "description": "User published a CC-BY-NC license on their personal site; this belief records our interpretation that the license extends to the referenced encounter."
  },
  "visibility": "public-detailed",
  "occurredAt": "2026-04-23T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.belief` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn belief() -> crate::Belief {
    serde_json::from_str(BELIEF_JSON).expect("bundled dev.idiolect.belief fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.bounty` fixture.
pub const BOUNTY_JSON: &str = r#"{
  "$nsid": "dev.idiolect.bounty",
  "requester":  "did:plc:requester",
  "wants": {
    "$type":  "dev.idiolect.bounty#wantLens",
    "source": { "language": "postgres-sql" },
    "target": { "language": "atproto-lexicon" }
  },
  "constraints": [
    {
      "$type":  "dev.idiolect.bounty#constraintConformance",
      "kind":   "roundtrip-test"
    },
    {
      "$type":    "dev.idiolect.bounty#constraintLicense",
      "spdx":     "MIT OR Apache-2.0"
    }
  ],
  "occurredAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.bounty` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn bounty() -> crate::Bounty {
    serde_json::from_str(BOUNTY_JSON).expect("bundled dev.idiolect.bounty fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.community` fixture.
pub const COMMUNITY_JSON: &str = r#"{
  "$nsid": "dev.idiolect.community",
  "name":        "syntactic-bootstrappers",
  "description": "A small community converging on a shared parse-tree idiolect across Bluesky and HuggingFace.",
  "createdAt":   "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.community` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn community() -> crate::Community {
    serde_json::from_str(COMMUNITY_JSON)
        .expect("bundled dev.idiolect.community fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.correction` fixture.
pub const CORRECTION_JSON: &str = r#"{
  "$nsid": "dev.idiolect.correction",
  "encounter":  { "uri": "at://did:plc:example/dev.idiolect.encounter/abc" },
  "path":       "/foo/bar",
  "reason":     "lens-error",
  "visibility": "public-detailed",
  "occurredAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.correction` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn correction() -> crate::Correction {
    serde_json::from_str(CORRECTION_JSON)
        .expect("bundled dev.idiolect.correction fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.dialect` fixture.
pub const DIALECT_JSON: &str = r#"{
  "$nsid": "dev.idiolect.dialect",
  "owningCommunity": "at://did:plc:example/dev.idiolect.community/syntactic-bootstrappers",
  "name":            "ud-en-2026",
  "createdAt":       "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.dialect` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn dialect() -> crate::Dialect {
    serde_json::from_str(DIALECT_JSON).expect("bundled dev.idiolect.dialect fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.encounter` fixture.
pub const ENCOUNTER_JSON: &str = r#"{
  "$nsid": "dev.idiolect.encounter",
  "lens":         { "uri": "at://did:plc:example/dev.idiolect.lens/abc123" },
  "sourceSchema": { "uri": "at://did:plc:example/dev.idiolect.schema/src" },
  "use": {
    "action":   "annotate",
    "material": { "scope": "classroom_materials" },
    "purpose":  "academic",
    "actor":    "students"
  },
  "kind":         "invocation-log",
  "visibility":   "public-detailed",
  "occurredAt":   "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.encounter` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn encounter() -> crate::Encounter {
    serde_json::from_str(ENCOUNTER_JSON)
        .expect("bundled dev.idiolect.encounter fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.observation` fixture.
pub const OBSERVATION_JSON: &str = r#"{
  "$nsid": "dev.idiolect.observation",
  "observer":   "did:plc:observer",
  "method":     { "name": "weighted-correction-rate" },
  "scope":      { "encounterKinds": ["production"] },
  "output":     { "lenses": [] },
  "version":    "1.0.0",
  "visibility": "public-detailed",
  "occurredAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.observation` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn observation() -> crate::Observation {
    serde_json::from_str(OBSERVATION_JSON)
        .expect("bundled dev.idiolect.observation fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.recommendation` fixture.
pub const RECOMMENDATION_JSON: &str = r#"{
  "$nsid": "dev.idiolect.recommendation",
  "issuingCommunity": "at://did:plc:example/dev.idiolect.community/syntactic-bootstrappers",
  "conditions": [
    {
      "$type":  "dev.idiolect.recommendation#conditionSourceIs",
      "schema": { "uri": "at://did:plc:ud/dev.panproto.schema.schema/ud-2.14" }
    },
    {
      "$type":  "dev.idiolect.recommendation#conditionTargetIs",
      "schema": { "uri": "at://did:plc:en/dev.panproto.schema.schema/en-pos" }
    },
    { "$type": "dev.idiolect.recommendation#conditionAnd" }
  ],
  "lensPath": [
    { "uri": "at://did:plc:example/dev.idiolect.lens/ud-to-en-pos" }
  ],
  "occurredAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.recommendation` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn recommendation() -> crate::Recommendation {
    serde_json::from_str(RECOMMENDATION_JSON)
        .expect("bundled dev.idiolect.recommendation fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.retrospection` fixture.
pub const RETROSPECTION_JSON: &str = r#"{
  "$nsid": "dev.idiolect.retrospection",
  "encounter":      { "uri": "at://did:plc:example/dev.idiolect.encounter/abc" },
  "finding":        { "kind": "merge-divergence", "detail": "left branch lost a record" },
  "detectingParty": "did:plc:detector",
  "detectedAt":     "2026-04-19T06:00:00.000Z",
  "occurredAt":     "2026-04-19T06:30:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.retrospection` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn retrospection() -> crate::Retrospection {
    serde_json::from_str(RETROSPECTION_JSON)
        .expect("bundled dev.idiolect.retrospection fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.verification` fixture.
pub const VERIFICATION_JSON: &str = r#"{
  "$nsid": "dev.idiolect.verification",
  "lens":       { "uri": "at://did:plc:example/dev.idiolect.lens/abc" },
  "kind":       "roundtrip-test",
  "verifier":   "did:plc:verifier",
  "tool":       { "name": "nextest", "version": "0.9.87" },
  "property": {
    "$type":  "dev.idiolect.defs#lpRoundtrip",
    "domain": "all valid UD-2.14 sentences"
  },
  "result":     "holds",
  "occurredAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.verification` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn verification() -> crate::Verification {
    serde_json::from_str(VERIFICATION_JSON)
        .expect("bundled dev.idiolect.verification fixture deserialises")
}

/// Raw json for the bundled `dev.idiolect.vocab` fixture.
pub const VOCAB_JSON: &str = r#"{
  "$nsid": "dev.idiolect.vocab",
  "name": "pedagogical-use-v1",
  "description": "Reference action vocabulary so encounter records can carry a structured purpose without requiring every community to author its own hierarchy. Communities are expected to fork, extend, and re-publish.",
  "world": "closed-with-default",
  "top": "any_purpose",
  "actions": [
    { "id": "any_purpose", "parents": [] },
    { "id": "research", "parents": ["any_purpose"] },
    { "id": "scholarly_analysis", "parents": ["research"] },
    { "id": "corpus_construction", "parents": ["research"] },
    { "id": "replication_study", "parents": ["research"] },
    { "id": "pedagogy", "parents": ["any_purpose"] },
    { "id": "annotate", "parents": ["pedagogy"] },
    { "id": "illustrate", "parents": ["pedagogy"] },
    { "id": "assess", "parents": ["pedagogy"] },
    { "id": "engineering", "parents": ["any_purpose"] },
    { "id": "interop_test", "parents": ["engineering"] },
    { "id": "schema_migration", "parents": ["engineering"] },
    { "id": "data_ingest", "parents": ["engineering"] },
    { "id": "machine_learning", "parents": ["any_purpose"] },
    { "id": "train_model", "parents": ["machine_learning"] },
    { "id": "fine_tune", "parents": ["train_model"] },
    { "id": "evaluate_model", "parents": ["machine_learning"] },
    { "id": "curation", "parents": ["any_purpose"] },
    { "id": "archive", "parents": ["curation"] },
    { "id": "translate_for_preservation", "parents": ["curation"] }
  ],
  "occurredAt": "2026-04-23T00:00:00.000Z"
}
"#;

/// Deserialised `dev.idiolect.vocab` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn vocab() -> crate::Vocab {
    serde_json::from_str(VOCAB_JSON).expect("bundled dev.idiolect.vocab fixture deserialises")
}

/// Raw json for the bundled `dev.panproto.schema.lens` fixture.
pub const PANPROTO_LENS_JSON: &str = r#"{
  "$nsid": "dev.panproto.schema.lens",
  "sourceSchema": "at://did:plc:example/dev.panproto.schema.schema/src",
  "targetSchema": "at://did:plc:example/dev.panproto.schema.schema/tgt",
  "objectHash":   "sha256:deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
  "roundTripClass": "iso",
  "lawsVerified":   true,
  "createdAt":      "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.panproto.schema.lens` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn panproto_lens() -> crate::PanprotoLens {
    serde_json::from_str(PANPROTO_LENS_JSON)
        .expect("bundled dev.panproto.schema.lens fixture deserialises")
}

/// Raw json for the bundled `dev.panproto.schema.schema` fixture.
pub const PANPROTO_SCHEMA_JSON: &str = r#"{
  "$nsid": "dev.panproto.schema.schema",
  "protocol":   "atproto-lexicon",
  "objectHash": "sha256:aaaabbbbccccddddeeeeffff00001111222233334444555566667777888899aa",
  "vertexCount":     7,
  "edgeCount":       9,
  "constraintCount": 4,
  "createdAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.panproto.schema.schema` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn panproto_schema() -> crate::PanprotoSchema {
    serde_json::from_str(PANPROTO_SCHEMA_JSON)
        .expect("bundled dev.panproto.schema.schema fixture deserialises")
}

/// Raw json for the bundled `dev.panproto.vcs.commit` fixture.
pub const PANPROTO_COMMIT_JSON: &str = r#"{
  "$nsid": "dev.panproto.vcs.commit",
  "repo":         "at://did:plc:example/dev.panproto.vcs.repo/main",
  "objectHash":   "sha256:1111111111111111111111111111111111111111111111111111111111111111",
  "schemaHash":   "sha256:2222222222222222222222222222222222222222222222222222222222222222",
  "parentHashes": [
    "sha256:3333333333333333333333333333333333333333333333333333333333333333"
  ],
  "protocol":  "atproto-lexicon",
  "author":    "did:plc:example",
  "message":   "Initial schema commit.",
  "createdAt": "2026-04-19T00:00:00.000Z"
}
"#;

/// Deserialised `dev.panproto.vcs.commit` fixture. Panics if the bundled json is invalid.
#[must_use]
pub fn panproto_commit() -> crate::PanprotoCommit {
    serde_json::from_str(PANPROTO_COMMIT_JSON)
        .expect("bundled dev.panproto.vcs.commit fixture deserialises")
}