# Issue view protocol contract This document defines the researched protocol boundary for a repository issue detail read. The base issue record and its related state and comment records have different authorities and completeness properties; a single Bobbin response is not an authoritative issue object. ## Evidence scope The contract was researched and observed on 2026-07-29 against: - Tangled core commit [`0dc54771380cd1bfec25d775fedfb66db7869b74`](https://tangled.org/tangled.org/core/tree/0dc54771380cd1bfec25d775fedfb66db7869b74), which was still the advertised `master` commit at the observation time; - the `sh.tangled.repo.issue`, `sh.tangled.repo.issue.state`, `sh.tangled.feed.comment`, `sh.tangled.repo.getIssue`, `sh.tangled.repo.issue.listStates`, and `sh.tangled.feed.listComments` lexicons at that commit; - the Bobbin XRPC and state-index implementations at that commit; - the managed PLC directory, PDS at `tngl.sh`, and Bobbin at `api.tangled.org`. The managed services did not expose deployed component versions. The source commit establishes current lexicon and implementation intent, but it does not prove which revision each managed endpoint runs. Sanitized observations under `test/contract/fixtures/issue_view/v1` preserve an authoritative issue read, matching Bobbin hydration, a state record, a comment, continuation and terminal cursors, a reply, coverage, and representative errors. Live behavior proves only the deployment state at the observation time. ## Locator boundary The command accepts one canonical issue identity: ```console camlet issue view ISSUE_AT_URI camlet issue view --json ISSUE_AT_URI camlet issue view --bobbin ORIGIN ISSUE_AT_URI ``` `ISSUE_AT_URI` must: - use a `did:plc` authority; - use the `sh.tangled.repo.issue` collection; - contain a valid record key; and - contain no query or fragment component. The full AT URI is required because the record key is only scoped to its author repository. A bare record key, repository DID, Tangled web URL, or local repository context does not identify one issue without an additional index lookup or an assumption of global record-key uniqueness. Camlet does not make that assumption. The default Bobbin is `https://api.tangled.org`. `--bobbin` accepts an explicit HTTPS origin and takes precedence over the default. Persisted configuration and repository-controlled Bobbin selection are outside this contract. ## Authority chain ```text issue AT URI -> resolve the issue-author did:plc document -> author PDS com.atproto.repo.getRecord for the current issue record -> read the repository DID from the verified issue value -> verify the repository through PLC, knot describeRepo, and owner-PDS getRecord -> observe Bobbin coverage -> completely paginate Bobbin issue state and comment edges -> verify accepted state and every comment against its source-author PDS -> observe Bobbin coverage again -> derive state and render the verified indexed relation set ``` The issue author's PDS is authoritative for the current base record. Bobbin is necessary to discover records from other AT repositories that refer to the issue, but it is not authoritative for their absence. The repository verification chain establishes the current repository owner used when deciding which state records may control the issue. Every request shares one operation deadline. Failure of a required authority fails the command; Camlet does not return a partially verified issue view. ## Why `sh.tangled.repo.getIssue` is not the base authority The current `sh.tangled.repo.getIssue` lexicon returns only `uri`, optional `cid`, and an embedded issue value. Its Bobbin handler hydrates the record through the same record-fetch path used by bulk reads. It does not return derived state, comments, coverage, or authoritative absence evidence. The managed endpoint returned the same URI, CID, and value as the issue author's PDS for an existing record. For a missing record, however, the author PDS returned `400 RecordNotFound` while Bobbin returned `502 UpstreamFailed`. Camlet therefore reads the base record directly from the author PDS and does not require Bobbin to have indexed it. `getIssue` remains useful protocol evidence, not a runtime dependency for this command. ## Base issue validation The author-PDS `com.atproto.repo.getRecord` request uses the authority, collection, and record key parsed from the supplied AT URI. Camlet omits the optional CID and observes the latest record served at request time. The response must contain: 1. the exact requested AT URI; 2. an optional valid CID; 3. a unique `$type` equal to `sh.tangled.repo.issue`; 4. a `repo` value that is a valid `did:plc` repository identity; 5. a non-empty UTF-8 title no larger than 16 KiB; 6. an optional UTF-8 body no larger than 1 MiB; 7. a valid creation timestamp; 8. at most 256 valid DID mentions; 9. at most 256 valid AT URI references; and 10. at most 64 valid image blob descriptors, each within the lexicon's 1,000,000-byte declared maximum. Absent optional arrays decode as empty arrays. Unknown object fields remain forward-compatible, but duplicate trust-critical fields, malformed known fields, unsupported blob forms, or exceeded local bounds fail the command. The repository DID from the issue value is verified through the existing repository-read contract. An issue whose repository identity cannot be resolved or whose knot and owner-PDS observations disagree is not emitted. `RecordNotFound` from the issue author's PDS means the supplied issue record is not currently present at that authority and maps to a not-found result. It does not claim that the AT URI never existed. ## Related state records Camlet calls `sh.tangled.repo.issue.listStates` with the issue AT URI as `subject`, `limit=100`, and `order=asc`, following every cursor within the supported bounds. Every structurally valid item identifies a `sh.tangled.repo.issue.state` record. Only state records authored by the issue author or by the repository owner verified during this operation may control the derived state. This matches Bobbin's current `accept_state_source` rule. Records from other authors are ignored for state derivation; their presence does not make the whole issue unreadable. The managed Bobbin currently repeats the identical record `$type` value in hydrated state and comment records. Camlet accepts one occurrence, or exactly two occurrences when both have the expected literal value, on Bobbin relation-page boundaries only. Missing, conflicting, non-string, or further occurrences fail. Source-PDS records and every other trust-critical field retain the ordinary uniqueness rule. An accepted state record is resolved against its author's current PDS record. The PDS response must agree with Bobbin on URI, optional CID, and decoded value. Its `issue` field must equal the requested issue AT URI and its creation timestamp and state string must be valid. A disagreement is a consistency failure, not a reason to silently use either side. The latest accepted state is selected by creation timestamp, with case-sensitive state-record URI as the deterministic tie-breaker. Known wire values are rendered as `open` and `closed`. A syntactically safe unknown value is preserved rather than coerced. With no accepted state record, the derived state defaults to `open` and has no state-record provenance. Bobbin currently ignores unknown state variants in its in-memory state index. Camlet's explicit preservation rule is intentionally stricter about not erasing protocol evolution. ## Related comments Camlet calls `sh.tangled.feed.listComments` with the issue AT URI as `subject`, `limit=100`, and `order=asc`, following every cursor within the supported bounds. Each item must identify a `sh.tangled.feed.comment` record. Camlet resolves the record authority, reads the current record from that author's PDS, and requires URI, optional CID, and decoded value to agree with Bobbin. The comment subject URI must exactly match the requested issue URI. Its subject CID is validated but is not required to equal the issue's current CID because a comment may legitimately refer to an earlier issue version. The supported comment body is `sh.tangled.markup.markdown`. Its rendered `text` is required; `original` and image blob references are optional and bounded. An optional `replyTo` strong reference is preserved. Its target need not appear in the observed comment set because the parent may have been deleted or missed by the index. Camlet does not invent a complete reply tree from incomplete evidence. Comments are rendered in ascending creation-time order with case-sensitive comment URI as a deterministic tie-breaker. Remote-controlled text is escaped at the human presentation boundary. ## Pagination, verification, and mutation Both Bobbin list operations use opaque cursors. Camlet continues whenever a non-null cursor string is present, including after a short or empty page. The managed service returned explicit `null` on terminal state and comment pages even though both lexicons declare an optional string; absent and explicit `null` are therefore terminal, while every other JSON type is rejected. The supported profile applies these independent safety bounds: - at most 100 items per requested page; - at most 10,000 comments, 1,000 state records, and 100 page requests per relation type; - at most 4 KiB per cursor and 8 MiB per Bobbin response; - at most 2 MiB per PDS record response; and - one operation-wide deadline, including identity, repository, Bobbin, and PDS verification requests. These limits bound memory and amplification; they are not throughput promises. The operation deadline remains independent and normally dominates large relation sets. A repeated cursor, duplicate related-record URI, oversized page, exceeded bound, malformed item, unsupported duplicate outside the narrow hydrated-record exception, or mismatch with an authoritative source record fails the command. Bobbin and the source PDS repositories can change while Camlet is reading them, so the result remains non-atomic even when every observed record was verified. ## Coverage and absence semantics Camlet observes `sh.tangled.bobbin.getCoverage` immediately before and after state and comment traversal. The same coherence rules as `issue list` apply: counters may advance and warming may become ready, while counter regression or a transition from ready to warming is a consistency failure. Coverage describes Bobbin's Hydrant stream, not repository-specific completeness. Consequently: - the base issue's current presence or absence is authoritative at its author PDS at observation time; - every emitted state or comment is a Bobbin observation verified against its current source PDS record; - complete cursor traversal proves only that Camlet followed every cursor Bobbin exposed; and - an empty state or comment set does not prove that no such record exists. The view therefore combines an authoritative base record with verified but index-limited relations. ## Machine output contract `camlet issue view --json` emits `org.camlet.issue.v1`: ```json { "schema": "org.camlet.issue.v1", "result": { "repository": { "did": "did:plc:aaaaaaaaaaaaaaaaaaaaaaaa" }, "issue": { "id": "3exampleissue", "author": { "did": "did:plc:bbbbbbbbbbbbbbbbbbbbbbbb" }, "record": { "uri": "at://did:plc:bbbbbbbbbbbbbbbbbbbbbbbb/sh.tangled.repo.issue/3exampleissue", "cid": "bafyreigfkphxytbcofvk7bjh622rep55av3l3anzp2isioecbidkgzjzkm", "created_at": "2026-01-02T03:04:05Z" }, "content": { "title": "Example issue", "body": "Example body", "mentions": [], "references": [], "blobs": [] }, "derived": { "state": "closed", "state_updated_at": "2026-01-02T04:05:06Z", "state_record": { "uri": "at://did:plc:bbbbbbbbbbbbbbbbbbbbbbbb/sh.tangled.repo.issue.state/3examplestate", "cid": "bafyreiergfi2oj5or54hagpsnkfogk6pucxlab7nzgjioxa2zjf74wpmpu" } } }, "comments": [ { "author_did": "did:plc:dddddddddddddddddddddddd", "record": { "uri": "at://did:plc:dddddddddddddddddddddddd/sh.tangled.feed.comment/3examplecomment", "cid": "bafyreihlgzuqong7z3gch3lridgwwt5m5j6i7qon3rcc2m5gx4wzzsvv3y", "created_at": "2026-01-02T05:06:07Z" }, "content": { "format": "markdown", "text": "A verified comment.", "original": "A verified comment.", "blobs": [] }, "subject": { "uri": "at://did:plc:bbbbbbbbbbbbbbbbbbbbbbbb/sh.tangled.repo.issue/3exampleissue", "cid": "bafyreigfkphxytbcofvk7bjh622rep55av3l3anzp2isioecbidkgzjzkm" }, "reply_to": null } ], "observation": { "observed_at": "2026-01-02T06:07:08Z", "base": { "freshness": "author_pds_latest_record_at_observation" }, "relations": { "source": { "kind": "bobbin", "endpoint": "https://api.tangled.org" }, "enumeration": "bobbin_complete_pagination", "verification": "source_pds_current_record_match", "snapshot": "non_atomic", "completeness": "indexed_observation_only", "coverage": { "before": { "ready": true, "events_processed": 200000, "last_cursor": 230000 }, "after": { "ready": true, "events_processed": 200010, "last_cursor": 230010 } } }, "authorities": [ "plc_directory", "issue_author_pds_record", "repository_identity_chain", "bobbin_relation_index", "related_record_author_pds" ] } } } ``` Optional base CID, body, state record, state-update timestamp, comment CID, comment original text, and reply reference are JSON `null` when absent. The schema exposes Bobbin as the relation-enumeration source without misrepresenting it as the authority for emitted record contents or for relation absence. Each issue or comment `blobs` entry contains `cid`, `mime_type`, and integer `size` fields. Mention entries are validated DID strings, reference entries are validated AT URI strings, and subject and reply objects retain the wire strong-reference `uri` and `cid` pair. ## Error and network boundaries The shared HTTP adapter applies the existing HTTPS, public-peer, redirect, credential, content-encoding, header, body, and operation-deadline policy to every authority. Input-shape failures are usage errors. An author-PDS `RecordNotFound` for the requested issue is a not-found error. Malformed responses are protocol errors. Cross-authority identity, URI, CID, value, state-source, repository-owner, cursor, duplicate, or coverage disagreements are consistency errors. Transport and valid XRPC errors retain their shared category mapping. Errors never include raw response bodies, query strings, endpoint-controlled titles or comment text, resolved IP addresses, infrastructure headers, or DID-document content. Explicit successful source endpoints may appear only in the result's provenance. ## Explicit exclusions This contract does not provide: - bare-ID, web-URL, handle, `did:web`, or local-context issue lookup; - authoritative absence claims for comments or state records; - reactions, labels, backlinks, profiles, vouch relationships, or subscription state; - blob downloads or rendered Markdown/HTML; - authenticated reads or writes; or - a compatibility claim for an unobserved self-hosted Bobbin.