draftproof

package
v0.7.17-dev.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package draftproof is the proof that a published version is the one a hosted draft wrote.

A revision is published through the Builder's form, not as the draft's package/: the Builder sets the QuickAgent's own name, namespace, version and licence, writes its own README and LICENSE, drops the fields it cannot hold, renders agent.yaml with its own writer, and a browser posts the instruction file with CRLF line breaks. So no file of the draft is a file of the version byte for byte, and the proof is two digests of what the Builder keeps:

  • the manifest, parsed and canonicalised, without what the Builder sets or cannot hold (Manifest);
  • the instruction file's text with its line breaks as LF and exactly one final newline (Instruction).

The sandbox host computes the proof over the draft's package/ before it seals the output; the registry computes it over the submitted files. One function on both sides, and only digests cross: the registry never reads a draft's body. README.md, LICENSE and every other file are outside the proof and are scanned as for any version.

Index

Constants

View Source
const ManifestFile = "agent.yaml"

ManifestFile is the manifest's path in a package.

Variables

View Source
var ErrNoProof = errors.New("draftproof: no proof for this package")

ErrNoProof is a package the proof cannot read: no manifest, a manifest that does not parse, or no instruction file.

Functions

func Canonical

func Canonical(m *manifest.Manifest) ([]byte, error)

Canonical is the manifest as the proof reads it: what the Builder keeps, in the manifest's canonical JSON (sorted keys, empty values pruned), with the differences that are only how the Builder writes a value taken out.

Left out, because the Builder sets them: schemaVersion, kind, name, namespace, version, license, the instruction entrypoint's path (the instruction file is proved by its text) and publish. Left out, because the Builder cannot hold them and drops them without a word: homepage, authors, the skill and MCP entrypoints, interactive.idleTimeoutSeconds, knowledge.ships, runtime and dependencies.

Read as the same, because the Builder only writes them differently: a capability declared none and one not declared; egress that lists "*" and egress "*"; every text with CRLF line breaks and with the spaces at its ends; an empty text or list item and none; an intake question of type text and one with no type; modes and data categories in any order or repeated. Anything else the Builder changes (a multi-word choice hyphenated, a value with a space dropped) changes what the version declares, and the proof does not hold.

func NormalizeText

func NormalizeText(b []byte) []byte

NormalizeText is an instruction file's text as the proof reads it: CRLF and lone CR line breaks as LF, and the text ending in exactly one newline (none for an empty text).

Types

type Proof

type Proof struct {
	Manifest    string `json:"manifest"`
	Instruction string `json:"instruction"`
}

Proof is the two digests, each "sha256:" and 64 hex digits.

func Of

func Of(manifestYAML, instruction []byte) (Proof, error)

Of computes the proof of a manifest's bytes and its instruction file's.

func OfDir

func OfDir(dir string) (Proof, string, error)

OfDir computes the proof of the package rooted at dir, and names the instruction file it read (slash-separated, relative to dir).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL