Skip to content

Latest commit

 

History

History
72 lines (61 loc) · 4.59 KB

SNAPSHOT.md

File metadata and controls

72 lines (61 loc) · 4.59 KB

OpenAPI Snapshot

Date: 2026-12-02

openapi.json is the accepted snapshot of the upstream opencode OpenAPI 3.1 document (ADR-0005). The SDK is built against this snapshot, never against a live branch; the pin is taken at an upstream release tag. Refresh policy is receipt-governed (ADR-0020): a refresh consumes an exact commit, normally with an empty patch list, and temporary Restore patches may repair upstream projection loss under review receipts. spec/receipt.json is the committed receipt of the current accepted snapshot; active patches live under spec/patches/ beside their hash-pinned manifests.

Fact Value
Upstream file packages/protocol/openapi.json
Upstream release tag v2.4.3
Commit 4e517ca4987fd57daffef1b47dd16c31c165b114
Upstream product channel npm @opencode/cli@latest (channel latest); this tag published as 2.4.3, installing the opencode command (plus the transitional opencode2 alias)

Upstream publishes from the @opencode/cli npm scope on the latest channel, versioned as semver release tags (v2.0.0…). This pin is the release tag v2.4.3, so npm install -g @opencode/cli@2.4.3 installs a server built from exactly this commit; later releases usually work but are not what this repository tests. beta and dev tags still exist upstream but are not the release channel. The former @opencode-ai/cli scope is frozen: its next and latest tags stopped at 0.0.0-beta-17823 (published 2026-08-21) and the scope received no publish after 2026-09-07, so its next dist-tag never publishes again and that install line no longer reaches a server this SDK can drive.

openapi.json is derived from upstream's own generator output, so upstream's MIT notice travels with it in THIRD-PARTY-NOTICES.md.

Platform evidence for the OpenCode 2.x line: internal research, 2026-08-16, "The opencode v2 platform: branch, surface, architecture, distribution".

Refresh procedure

The refresh-spec synchronizer owns refreshes (ADR-0020):

  1. dotnet run --file tools/opencode-tool.cs -- refresh-spec --ref <commit-ish> prepares a candidate: it resolves the reference once to a full SHA and produces the normalized document by running the exact pinned upstream generator, over the ordered Restore patches when spec/patches/ has any — never by copying upstream's committed document — writing the receipt and document to .scratchpad/refresh/<sha>/ without touching accepted state. A patch whose repair predicate raw upstream already satisfies refuses, forcing an empty-patch retirement refresh. The production policy owns this rule.
  2. Review the receipt: identity, hashes, operation delta, patch preimages, and prepare's Moved for and Lost anchor for lines. A line for opencode-agents-ai goes to that product; a lost anchor of either owner refuses apply until the anchor is rewritten.
  3. refresh-spec --apply <receipt.json> requires a receipt prepared at a named release tag; a commit-only candidate is a dry run, not an applicable pin. Apply validates the candidate and this file's managed identity text before changing accepted artifacts, then installs spec/openapi.json, renders this file's identity table and pin-bearing prose from the receipt and its date from the injected TimeProvider's UTC date at apply time, moves the external/opencode submodule checkout to the same commit, re-pins spec/source-watch.json for any watched hash that moved, and writes spec/receipt.json; it stages and commits nothing. Until the moved submodule gitlink is staged or committed, the Sdk tests refuse to start: their pinned-server prerequisite compares the gitlink recorded in the index with the checked-out submodule. A fresh worktree on a commit that carries the new gitlink passes after git submodule update --init --depth 1 external/opencode.

Prepare also observes every entry of spec/source-watch.json at the candidate commit and records its hash and the verdict of each anchor in the receipt's watchedSources; verify checks those pins against the submodule checkout and apply re-pins them, so an upstream change under code that this SDK or a product in its family depends on is reviewed before the snapshot moves.

  1. Run generate; resolve what it reports (wall admits, curation rows) and review the regenerated diff. refresh-spec --verify reproduces the committed identity observationally.
  2. After the refresh merges, run the distributed-build consumer leg as docs/engineering/quality-gates.md describes.