docviews

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Overview

Package docviews compiles proof-bound audience projections from an existing admitted Human Documentation Compiler plan. It does not generate prose, grant access, inspect a repository, or mutate its inputs.

Index

Constants

View Source
const (
	TruthProfile        = "corvint-cross-audience-truth/0"
	ViewProfile         = "corvint-cross-audience-view/0"
	BundleProfile       = "corvint-cross-audience-bundle/0"
	VerificationProfile = "corvint-cross-audience-verification/0"
)

Variables

This section is empty.

Functions

func CanonicalBundle

func CanonicalBundle(source SourcePlan, bundle Bundle) ([]byte, string, error)

Types

type Audience

type Audience string
const (
	AudienceNovice    Audience = "NOVICE"
	AudienceOperator  Audience = "OPERATOR"
	AudienceAPI       Audience = "API"
	AudienceSecurity  Audience = "SECURITY"
	AudienceExecutive Audience = "EXECUTIVE"
)

type AudienceView

type AudienceView struct {
	Audience               Audience `json:"audience"`
	ClaimIDs               []string `json:"claim_ids"`
	Detail                 Detail   `json:"detail"`
	DisclosurePolicySHA256 string   `json:"disclosure_policy_sha256"`
	DisclosureScope        string   `json:"disclosure_scope"`
	Profile                string   `json:"profile"`
	TruthSHA256            string   `json:"truth_sha256"`
}

AudienceView contains presentation choices only. A consumer must resolve ClaimIDs against the bound TruthCorpus.

type Bundle

type Bundle struct {
	Profile     string         `json:"profile"`
	Truth       TruthCorpus    `json:"truth"`
	TruthSHA256 string         `json:"truth_sha256"`
	Views       []AudienceView `json:"views"`
}

func Compile

func Compile(source SourcePlan, options CompileOptions) (Bundle, error)

type ClaimOverlay

type ClaimOverlay struct {
	ClaimID        string      `json:"claim_id"`
	Currency       Currency    `json:"currency"`
	CurrencyReason string      `json:"currency_reason,omitempty"`
	Limitations    []string    `json:"limitations"`
	ReviewState    ReviewState `json:"review_state"`
}

type CompileOptions

type CompileOptions struct {
	DisclosurePolicySHA256 string
	DisclosureScope        string
	Overlays               []ClaimOverlay
	Recipes                []ProjectionRecipe
}

type Currency

type Currency string
const (
	CurrencyCurrent Currency = "CURRENT"
	CurrencyStale   Currency = "STALE"
	CurrencyUnknown Currency = "UNKNOWN"
)

type Detail

type Detail string
const (
	DetailBrief    Detail = "BRIEF"
	DetailStandard Detail = "STANDARD"
	DetailFull     Detail = "FULL"
)

type Divergence

type Divergence struct {
	Audience Audience `json:"audience,omitempty"`
	ClaimID  string   `json:"claim_id,omitempty"`
	Code     string   `json:"code"`
}

type Error

type Error struct {
	Code    string
	Message string
}

func (*Error) Error

func (problem *Error) Error() string

type ProjectionRecipe

type ProjectionRecipe struct {
	Audience Audience `json:"audience"`
	ClaimIDs []string `json:"claim_ids"`
	Detail   Detail   `json:"detail"`
}

type ReviewState

type ReviewState string
const (
	ReviewGenerated ReviewState = "GENERATED"
	ReviewVerified  ReviewState = "VERIFIED"
	ReviewReviewed  ReviewState = "REVIEWED"
)

type SourcePlan

type SourcePlan struct {
	Index *contextindex.Index
	Plan  []byte
	Patch []byte
}

SourcePlan is the exact corvint-human-documentation-plan/0 bytes, the proposal patch they bind, and the in-memory index doccompiler.VerifyAdmittedPlan reproduces them against (CATN-V0-001). The index is only read.

type TruthClaim

type TruthClaim struct {
	Currency       Currency        `json:"currency"`
	CurrencyReason string          `json:"currency_reason,omitempty"`
	Evidence       []TruthEvidence `json:"evidence"`
	Frontier       string          `json:"frontier,omitempty"`
	ID             string          `json:"id"`
	Kind           string          `json:"kind"`
	Limitations    []string        `json:"limitations"`
	ReviewState    ReviewState     `json:"review_state"`
	Scope          string          `json:"scope"`
	State          string          `json:"state"`
	Text           string          `json:"text"`
}

TruthClaim contains every factual or epistemic field exactly once. Audience views may reference its ID but cannot carry replacements for these fields.

type TruthCorpus

type TruthCorpus struct {
	Claims                 []TruthClaim `json:"claims"`
	DisclosurePolicySHA256 string       `json:"disclosure_policy_sha256"`
	DisclosureScope        string       `json:"disclosure_scope"`
	PlanSHA256             string       `json:"plan_sha256"`
	Profile                string       `json:"profile"`
	Revision               string       `json:"revision"`
}

type TruthEvidence

type TruthEvidence = doccompiler.Anchor

TruthEvidence is one admitted HDC evidence anchor, copied with every member into the truth corpus. Its revision is the plan's source revision.

type VerificationReport

type VerificationReport struct {
	Divergences []Divergence `json:"divergences"`
	PlanSHA256  string       `json:"plan_sha256"`
	Profile     string       `json:"profile"`
	Status      string       `json:"status"`
	TruthSHA256 string       `json:"truth_sha256"`
}

func Verify

func Verify(source SourcePlan, bundle Bundle) VerificationReport

Jump to

Keyboard shortcuts

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