jhshuai/moontestledger/wire does not have a README file

    Bundle

    pub(all) struct Bundle {
    documents : Array[ReportFile]
    } derive(Eq,
    Debug
    )

    Bundle::equal

    fn Bundle::equal(Bundle, Bundle) -> Bool

    Bundle::not_equal

    fn Bundle::not_equal(x : Bundle, y : Bundle) -> Bool

    Bundle::to_repr

    CollectedXml

    pub(all) struct CollectedXml {
    id : String
    xml : String
    } derive(Eq,
    Debug
    )

    Original XML supplied by a storage adapter for a declared report ID.

    CollectedXml::equal

    CollectedXml::not_equal

    fn CollectedXml::not_equal(x : CollectedXml, y : CollectedXml) -> Bool

    CollectionFile

    pub(all) struct CollectionFile {
    id : String
    path : String
    } derive(Eq,
    Debug
    )

    One explicitly expected relative artifact path; forward slashes only.

    CollectionFile::equal

    CollectionFile::not_equal

    fn CollectionFile::not_equal(x : CollectionFile, y : CollectionFile) -> Bool

    CollectionSpec

    type CollectionSpec

    A complete expected inventory and exact artifact path mapping. Paths never define run/revision/test identities; the caller owns the declared contract.

    CollectionSpec::collect

    Atomically collect only explicitly supplied original reports. Omitted reports/cases remain incomplete against the full inventory. An invalid report refuses the whole operation; no input or previous spec is modified.

    CollectionSpec::collect_tar

    Collect regular-file POSIX USTAR against the full declared path inventory. Missing paths retain incompleteness; unknown paths/extensions are refused.

    CollectionSpec::collect_zip

    Collect a bounded classic ZIP against the full expected inventory. Missing declared members remain incomplete; unlisted members are refused. Paths never create report/run identities; all bindings come from the spec.

    CollectionSpec::files

    CollectionSpec::new

    Construct a complete path contract before artifacts arrive.

    test {
    let reports : Array[@ledger.ExpectedReport] = [
    {
    id: "report",
    environment: "linux",
    shard: "all",
    attempt: 1,
    cases: [{ classname: "C", name: "a", }],
    },
    ]
    let plan = @ledger.RunPlan::new("run", "revision", reports)
    let files : Array[@wire.CollectionFile] = [
    { id: "report", path: "job/results.xml", },
    ]
    let spec = @wire.CollectionSpec::new(plan, files[:])
    let absent : Array[@wire.CollectedXml] = []
    inspect(spec.collect(absent[:]).exit_code(), content="3")
    }

    Evidence

    type Evidence

    A validated, replayable JUnit archive. Storage and gate policy are opaque.

    Evidence::check_integrity

    Check every manifest component against the replayed archive. Raises on any discrepancy without mutating either input. Success does not change the archive's existing gate: call Evidence::exit_code after checking integrity.

    Evidence::deny_recovered

    fn Evidence::deny_recovered(self : Evidence) -> Bool

    Evidence::detach

    Detach exact original XML without losing the full plan, policy or bindings. Both returned values are independent of the input. Index and members can be passed to any storage adapter; restore checks all hashes before replay.

    Evidence::exit_code

    fn Evidence::exit_code(self : Evidence) -> Int

    Evidence::ingest_reports

    Append original JUnit documents without mutating the archive. The batch is atomic; custom projections, conflicts and unsupported XML are refused.

    Evidence::integrity

    Bind the full validated inventory, recovery policy, accepted report bindings and original XML. Incomplete and failing archives can have valid manifests. Canonicalization is versioned MoonTestLedger JSON, not RFC 8785.

    Evidence::snapshot

    Independent inventory/document copies, including accepted empty reports.

    Evidence::source

    fn Evidence::source(self : Evidence, report_id : String) -> String?

    Evidence::tar_pack

    Deterministic uncompressed USTAR carrier with fixed regular-file metadata.

    Evidence::zip_pack

    Deterministic classic ZIP carrier for the sealed full-plan file pack. Compression is supplied by hustcer/fzip; this API is not a general archiver.

    IntegrityDocument

    pub(all) struct IntegrityDocument {
    binding :
    ReportBinding

    sha256 : String
    utf8_bytes : Int
    } derive(Eq,
    Debug
    )

    Receipt for an accepted report, including its full binding and exact UTF-8 source digest. Returned arrays are independent copies of manifest storage.

    IntegrityDocument::equal

    IntegrityDocument::not_equal

    fn IntegrityDocument::not_equal(x : IntegrityDocument, y : IntegrityDocument) -> Bool

    IntegrityManifest

    type IntegrityManifest

    A validated checksum manifest. Trust the expected manifest separately from the archive: checksums do not authenticate its author or prove execution.

    IntegrityManifest::documents

    IntegrityManifest::encode

    Deterministic JSON: receipts and missing IDs are sorted by exact report ID. Refuses output beyond the configured JSON budget instead of truncating it.

    IntegrityManifest::missing_reports

    fn IntegrityManifest::missing_reports(self : IntegrityManifest) -> Array[String]

    PackFile

    pub(all) struct PackFile {
    name : String
    xml : String
    } derive(Eq,
    Debug
    )

    Exact decoded UTF-8 XML and a content-addressed flat filename. No arbitrary paths or binary members are supported by the evidence file-pack profile.

    PackFile::equal

    fn PackFile::equal(PackFile, PackFile) -> Bool

    PackFile::not_equal

    fn PackFile::not_equal(x : PackFile, y : PackFile) -> Bool

    PackFile::to_repr

    PackIndex

    type PackIndex

    Full expected inventory plus an integrity manifest; accepted XML is stored separately. A missing expected report remains missing, not a missing member.

    PackIndex::filenames

    fn PackIndex::filenames(self : PackIndex) -> Array[String]

    Independent sorted list of required members, deduplicated by exact digest.

    PackIndex::restore

    Require exactly the declared members, verify original UTF-8 bytes, then replay all XML against the full plan and verify the complete archive digest. Missing stored members and undeclared extras are invalid, never truncated.

    PlanChange

    pub(all) struct PlanChange {
    kind : PlanChangeKind
    report_id : String
    key :
    CaseKey
    ?
    } derive(Eq,
    Debug
    )

    Report additions/removals cover the whole report in the retained plans. An empty report_id denotes run metadata; key is set only for case changes.

    PlanChange::equal

    fn PlanChange::equal(PlanChange, PlanChange) -> Bool

    PlanChange::not_equal

    fn PlanChange::not_equal(x : PlanChange, y : PlanChange) -> Bool

    PlanChangeKind

    pub(all) enum PlanChangeKind {
    RunMetadataChanged
    ReportAdded
    ReportRemoved
    ReportBindingChanged
    CaseAdded
    CaseRemoved
    CaseOrderChanged
    } derive(Eq,
    Debug
    )

    PlanChangeKind::equal

    PlanChangeKind::not_equal

    fn PlanChangeKind::not_equal(x : PlanChangeKind, y : PlanChangeKind) -> Bool

    PlanReview

    type PlanReview

    A bounded, deterministic review of two complete declared inventories. Its token binds both plans and every derived change; it is not a signature.

    PlanReview::approve

    Acknowledge this exact review against an unchanged baseline, for a fresh run. Returns a copy of the proposed plan. Existing evidence is never rewritten. The caller must obtain approval before supplying the displayed token; this checks content/staleness, not the identity or presence of a human reviewer.

    PlanReview::changes

    fn PlanReview::changes(self : PlanReview) -> Array[PlanChange]

    PlanReview::encode

    Full plans and deterministic changes are retained. Over-budget reviews are refused, never shortened. Digests use the existing canonical plan encoding.

    PlanReview::token

    fn PlanReview::token(self : PlanReview) -> String

    ReportFile

    pub(all) struct ReportFile {
    binding :
    ReportBinding

    path : String
    } derive(Eq,
    Debug
    )

    A producer-supplied binding and path to an unchanged XML artifact.

    ReportFile::equal

    fn ReportFile::equal(ReportFile, ReportFile) -> Bool

    ReportFile::not_equal

    fn ReportFile::not_equal(x : ReportFile, y : ReportFile) -> Bool

    RetryReport

    pub(all) struct RetryReport {
    id : String
    environment : String
    shard : String
    } derive(Eq,
    Debug
    )

    A new producer report identity for one failing environment/shard group.

    RetryReport::equal

    fn RetryReport::equal(RetryReport, RetryReport) -> Bool

    RetryReport::not_equal

    fn RetryReport::not_equal(x : RetryReport, y : RetryReport) -> Bool

    decode_bundle

    Decode producer bindings separately from the expected plan. Paths are relative to the bundle file in the CLI, or supplied directly by library users.

    decode_collection

    decode_evidence

    Strictly replay all stored reports against the stored plan. Missing artifacts stay incomplete; unknown fields and malformed XML are rejected.

    decode_integrity

    Strict versioned manifest reader. Unknown fields/algorithms, duplicates, conflicting IDs and rounded integer lexemes are refused.

    decode_pack_index

    Strict index validation before any member access. Every planned report must have exactly one matching receipt or an explicit missing-report ID.

    decode_plan

    Decode a complete expected artifact/test inventory. Unknown versions and fields are refused; duplicate keys are checked in the original JSON text.

    decode_plan_review

    Strictly decode then recompute both plan hashes, every change and the token. Duplicate/unknown fields and any supplied projection mismatch are refused.

    decode_retry_reports

    decode_tar_pack

    fn decode_tar_pack(data : Bytes, limits? :
    Limits
    , max_bytes? : Int) -> Evidence raise
    InputError

    Restore only a sealed evidence pack; reject unsupported USTAR extensions, duplicate/extra members, changed original XML or inconsistent full plan.

    decode_zip_pack

    fn decode_zip_pack(data : Bytes, limits? :
    Limits
    , max_bytes? : Int) -> Evidence raise
    InputError

    Reject unsupported carrier metadata, then verify original XML, full plan, policy and whole evidence digest. This does not authenticate the sender.

    encode_bundle

    fn encode_bundle(bundle : Bundle) -> String

    encode_diagnostic

    fn encode_diagnostic(diagnostic :
    Diagnostic
    ) -> String

    encode_evidence

    Archive the full inventory, exact original XML and recovery policy. Custom projections that do not match the supported JUnit parser are refused.

    encode_plan

    fn encode_plan(plan :
    RunPlan
    ) -> String

    encode_retry_reports

    fn encode_retry_reports(reports : ArrayView[RetryReport]) -> String

    encode_summary

    fn encode_summary(summary :
    Summary
    , deny_recovered? : Bool) -> String

    Render derived evidence. Original XML is retained by the ledger and input files; this is not a JUnit conversion or a lossless XML export.

    merge_evidence

    Combine partial archives of one run with the same full inventory and policy. Identical documents are idempotent; conflicting replacements are refused. Inputs are never modified. Inventory order is normalized for deterministic output.

    prepare_retry

    Extend a complete run by exactly one selective retry for every group with a final failed/error/unresolved case. All existing inventory/source/policy stays. The returned archive is incomplete until the newly declared reports arrive.

    review_plan

    Compare reviewed declarations, never received reports or observed outcomes. Reordering reports follows RunPlan's existing canonical report ordering; changed case order remains visible because it affects evidence identity.