idiolect-records 0.1.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.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": "bidirectional, covers all nullable columns",
  "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" },
  "purpose":      "translate source to target",
  "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":       "when translating universal-dependencies trees to en-pos tags",
  "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" },
  "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.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")
}