Skip to content

proof: expose completeness and cap reasons in read envelopes #252

Description

@toeknee-figma

Describe the bug

The flatbread proof read envelope in 1.0.1 does not expose whether its
artifact is complete or why it was capped. Those facts exist only in the
summary string and digest Markdown.

The packaged Proof reference says programs must not parse digest files as data
feeds because the envelope is the machine surface. A caller therefore cannot
fail closed when the 50-edge or 64 KiB cap is reached.

Reproduction

Using exact @flatbread/proof@1.0.1 and flatbread@1.0.1, compare four reads:

  1. a small, complete proof get;
  2. proof records --limit 5 with more records available;
  3. proof relations over 51 stored edges;
  4. proof get for a Blob body larger than 64 KiB.

All four JSON envelopes have the same keys:

summary
artifact_path
artifact_sha256
served_generation
consistency
page
hints

For the 51-edge and oversized-Blob cases, page.has_more can be false even
though the digest is capped. The named reasons (displayed_edges and bytes)
appear only inside the digest or prose summary.

The public ReadEnvelope type confirms that complete and cap_reasons are
absent.

Expected behavior

Add stable machine-readable completeness fields to every Proof read envelope:

interface ReadEnvelope {
  // existing fields...
  complete: boolean;
  cap_reasons: Array<"primary_records" | "displayed_edges" | "bytes">;
}

Expected examples:

{ "complete": true, "cap_reasons": [] }
{ "complete": false, "cap_reasons": ["displayed_edges"] }
{ "complete": false, "cap_reasons": ["bytes"] }

Ordinary paging should set complete: false while page.has_more names the
cause; it need not call pagination a hard cap.

Acceptance criteria:

  • The envelope and digest derive their completeness from one calculation.
  • Complete, paged, record-capped, edge-capped, and byte-capped reads have tests.
  • cap_reasons is deterministic and contains no duplicates.
  • The public TypeScript declaration, CLI JSON, packaged reference, and
    changelog agree.
  • Callers can detect every incomplete artifact without reading or parsing the
    digest file or summary prose.

Published package identity

  • @flatbread/proof@1.0.1
    • integrity: sha512-khANh86EXyZ0bPPOkUzGU0VRAPOpv+5h4vGKjpuFwLdfI/Eihxk63+YHbIxtFp08gffahxgViz/SlyFPJ1LR/A==
    • SHA-1: ec969767685bec108c04d78a4dcf4e7e1ad2cf78
  • flatbread@1.0.1
    • integrity: sha512-WNqK93IlIRBKq6IeyAZjEqVMDcsKVBi0v3yihU+JVXSYHJMQGX7i6wt0L53RQZJ06BPxFJNG9k4yiyBGdkuIgA==

The executable Harnessflow Gate-0 fixture reproduces all four envelopes and
does not parse digest Markdown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions