Skip to main content
Use these contracts when another agent or script reads files produced by the local CLI. Configuration owns their locations. Preserve unknown ledger/state fields when editing older files.

Ledger rows

links.jsonl contains one JSON object per line. Blank lines are ignored. IDs are unique; malformed rows are reported with line numbers and excluded from reads. Mutations refuse malformed input. Unknown top-level and origin fields are retained. Lineage stays local; a cloud localReference is bounded and cannot replace it.

Portable single-check artifact

check —source … —target … returns schema:"agentlinkops.local-check.v1", result_id, input, checked_at, observation and provenance. The ID is an lr_ SHA-256 digest of normalized input and observation. input has source, target and scope. provenance records execution:“local”, verifier:“agentlinkops-shared-verifier” and raw_html_included:false. Each occurrence contains href, targetUrl, anchor and context strings; rel string array; visibility:“not_rendered”; and locator:null or an object with integer line, column and offset. A matching HTML link does not prove rendered visibility. Evidence requires method, checkerVersion, complete and fetchedAt (timestamp or null). Optional fields are bytes, nullable contentType/etag/lastModified, baseUrl, rendered, sha256, decodedSha256, capture, parseErrors and renderEligibility (required or comparison). Optional readiness contains requiresRender, nullable reason and possibleLoginWall, plus optional hasVisiblePassword, targetInScript, emptyAppRoot and emptyProfileRoot booleans. Optional capture describes a complete raw_html main-document read, requested/final URLs, acquisition time, byte/decoded hashes, qualified transport identity and excluded iframe/shadow-root coverage. rendered remains false; renderAttempt can record attempted:false and reason render_not_configured. A robots result requires nullable allowed, reason, matchedRule and crawlDelaySeconds, plus nullable fetched. Optional fields are sourceUrl, robotsUrl, nullable httpStatus, productToken, up to five redirects and retryAfterSeconds. Optional robots metadata also records the Googlebot policy result, customer_supplied_monitor policy, decisionReason, fetchAuthorized, overrideUsed:false and a bounded body diagnostic. A diagnostic reports bytes, hashes and truncation; it is not a complete page observation. Nullable fields remain unknown when absent evidence cannot support a conclusion. Adoption validates the portable observation contract, matching source/target/scope, timestamp identity and result identity. Present requires complete evidence and matching occurrences. Absent requires complete evidence and no occurrences. Portable observations cannot include raw HTML, response bodies or headers. The optional capture.body object contains byte counts, hashes and completeness metadata, not page bytes. The artifact size check is 512 KiB of serialized JSON characters. Use adopt-result to persist it.

Observation mirror and activity state

Observation rows contain id (ledger ID), checked_at, state, reason, occurrences (count), complete, checker_version, source, evidence_key and result. Result contains verifier metadata with raw HTML removed. Deduplication uses ledger ID, checked timestamp and source. Cloud projection rows can carry projection metadata in addition to these fields. The observation mirror records changes; state.json records repeated-check activity. State version 3 holds entries, independent cursors, cloud mappings and placement-bound attempt/conclusive projections. Unknown or incomplete attempts do not replace retained conclusive evidence. Newer unsupported state versions are refused before mutation. Source and destination cursors remain independent. Preserve unknown state fields and let the CLI own migration; changing a cursor can skip history.

Receipt input

receipt add accepts a claim object:
The command supplies receipt ID, declared_at, baseline and ledger reference. actor.role is human or agent. acted_at needs a timezone. Optional ledger must identify a matching placement. Optional intent_after defaults to expected for internal and wanted for external claims. expect, ref, tags and note follow ledger rules. An idempotency replay reuses the original claim only when its placement, kind, scope and acted_at match. A claim remains claimed until independent observations can be read alongside it; receipt history reports that evidence without declaring causation.
Source contracts: cli/ledger.js, cli/local-result.js, cli/mirror.js, cli/state.js and cli/receipts.js.