authorresult

package
v0.0.0-...-3107470 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package authorresult builds the private deterministic output of one authenticated goal-directed authoring session. It contains inert candidate profiles and digest-bound review metadata, never browser session material.

Index

Constants

View Source
const Schema = "browsertools.authenticated-authoring.v2"

Variables

This section is empty.

Functions

func MarshalDeterministic

func MarshalDeterministic(envelope *Envelope) ([]byte, error)

MarshalDeterministic validates the envelope's digest bindings and returns canonical compact JSON with a trailing newline.

Types

type Bounds

type Bounds struct {
	NavigationTimeoutMS int64 `json:"navigationTimeoutMs"`
	TotalTimeoutMS      int64 `json:"totalTimeoutMs"`
	MaxRequests         int   `json:"maxRequests"`
	MaxResponseBytes    int64 `json:"maxResponseBytes"`
	MaxObservations     int   `json:"maxObservations"`
	MaxCandidates       int   `json:"maxCandidates"`
	MaxOutputs          int   `json:"maxOutputs"`
}

Bounds records the finite authority used by the live author session.

type BuildRequest

type BuildRequest struct {
	ObservedAt          time.Time
	Title               string
	Goal                string
	InitialURL          string
	DashboardURL        string
	Origins             []string
	Contexts            map[string]Context
	Bounds              Bounds
	Trace               []TraceStep
	OutputSelections    []OutputSelection
	GoalPredicate       GoalPredicate
	GoalProof           GoalProof
	AuthenticationProof GoalProof
	HumanConfirmed      bool
	Diagnostics         []string
}

BuildRequest contains only already reduced and reviewed authoring facts.

type Context

type Context struct {
	Kind   string `json:"kind"`
	Parent string `json:"parent"`
	Origin string `json:"origin"`
	Path   string `json:"path,omitempty"`
	Name   string `json:"name,omitempty"`
}

Context is one portable popup/frame relationship discovered and reviewed in the live context. Main is implicit and never appears in the map.

type Envelope

type Envelope struct {
	Schema                string             `json:"schema"`
	ObservedAt            string             `json:"observedAt"`
	Goal                  string             `json:"goal"`
	GoalPredicate         GoalPredicate      `json:"goalPredicate"`
	GoalProof             GoalProof          `json:"goalProof"`
	HumanConfirmed        bool               `json:"humanConfirmed"`
	Origins               []string           `json:"origins"`
	Contexts              map[string]Context `json:"contexts"`
	Bounds                Bounds             `json:"bounds"`
	Trace                 []TraceStep        `json:"trace"`
	OutputSelections      []OutputSelection  `json:"outputSelections"`
	AuthenticationProfile json.RawMessage    `json:"authenticationProfile"`
	AuthenticationReview  Review             `json:"authenticationReview"`
	CapabilityProfile     json.RawMessage    `json:"capabilityProfile"`
	CapabilityReview      Review             `json:"capabilityReview"`
	Diagnostics           []string           `json:"diagnostics"`
}

Envelope is the private, non-publishable authoring result.

func Build

func Build(request BuildRequest) (*Envelope, error)

Build produces the oldest sufficient profile versions. Context topology or exact authentication success paths require the additive profile versions.

type GoalPredicate

type GoalPredicate struct {
	Origin    string `json:"origin"`
	Path      string `json:"path"`
	Context   string `json:"context,omitempty"`
	Role      string `json:"role"`
	Label     string `json:"label,omitempty"`
	Candidate string `json:"candidateId,omitempty"`
}

GoalPredicate is the reviewed typed completion condition.

type GoalProof

type GoalProof struct {
	Origin  string `json:"origin"`
	Path    string `json:"path"`
	Context string `json:"context"`
	Role    string `json:"role"`
	Label   string `json:"label,omitempty"`
	Matches int    `json:"matches"`
}

GoalProof records value-free evidence for the exact predicate.

type OutputSelection

type OutputSelection struct {
	CandidateID string `json:"candidateId"`
	Key         string `json:"key"`
	Type        string `json:"type"`
	LocatorMode string `json:"locatorMode"`
	Observation int    `json:"observation"`
	Context     string `json:"context"`
	Role        string `json:"role"`
	Name        string `json:"name,omitempty"`
	Matches     int    `json:"matches"`
	RoleMatches int    `json:"roleMatches"`
}

OutputSelection is one human-reviewed, action-time-revalidated output locator. It proves accessible matching without carrying the page value.

type Review

type Review struct {
	Schema        string   `json:"schema"`
	Kind          string   `json:"kind"`
	ProfileDigest string   `json:"profileDigest"`
	AssessedAt    string   `json:"assessedAt"`
	Decisions     []string `json:"decisions"`
}

Review binds one exact candidate profile to the completed authoring review.

type TraceStep

type TraceStep struct {
	Kind          string `json:"kind"`
	Phase         string `json:"phase"`
	CandidateID   string `json:"candidateId,omitempty"`
	Context       string `json:"context,omitempty"`
	Role          string `json:"role,omitempty"`
	Label         string `json:"label,omitempty"`
	InputKind     string `json:"inputKind,omitempty"`
	ChallengeKind string `json:"challengeKind,omitempty"`
	URL           string `json:"url,omitempty"`
	POSTBudget    int    `json:"postBudget,omitempty"`
	POSTObserved  int    `json:"postObserved,omitempty"`
	OpensContext  string `json:"opensContext,omitempty"`
}

TraceStep is one executed portable authoring action. Backend selectors and input values are intentionally absent.

Jump to

Keyboard shortcuts

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