graphnative

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 37 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Graph-native interaction-scenario launch contract

Use this reference to prepare a scenario profile, understand its required interfaces, and interpret retained evidence. For suite selection, start with Benchmarks; for the case descriptions, see Demos.

Reading order: composition contract → local protocol check → live run → focused selection → retained artifacts. Local conformance checks exercise wiring and lifecycle; live behavior requires model services and recorded input.

Composition contract

This package is the scenario suite's fail-closed composition boundary. It does not contain a server, model, provider, credential, UI, or binding-name switch. It decorates an explicitly selected graph/launch adapter plugin, checks the adapter against the exact immutable plan, and returns the prepared NativeBinding for a host to compose as its server.SessionProvider.

The complete contract covers the twelve repository-owned interaction cases. The ordinary path requires:

  • session settings (gateway.input.update);
  • continuous realtime PCM input (gateway.input.audio);
  • turn, activity, transcript, speech, and failure outputs; and
  • audio input/output, transcription, turn generation, and concurrent I/O in the adapter's frozen capability projection.

Two cases add protocol seams without adding a launcher species:

  • a recorded menu requires the function-call, tool-result, and response.create round trip;
  • telling them what it saw requires a typed text/message input carrying the still image, an ordered explicit response.create after each durable image item, plus visual-input and text-injection capability evidence.

BuildContract derives and fingerprints those requirements from the reviewed suite. GuardAdapter is the composable plugin decorator. GuardLaunch applies it to an exact selected graph/launch config for direct composition through server.NewGraphBundle. New is the provider-only convenience constructor. Both delegate topology, lock, values, deployment, secret-catalog, assembly, adapter-artifact, and mount-dependency validation to graph/launch.

For the normal descriptor-locked server path, NewApplicationPlugin wraps an installed graph application as another application plugin. Its strict configuration records the complete ordered scenario case list, this contract's fingerprint, and the delegate application's exact registration, runtime artifact, SessionProvider artifact, and plugin-owned configuration. There is no application-kind or binding switch. FreezeLaunchProfile obtains the Plan and adapter identities by actually preparing that selected resource-free launch configuration, then freezes the ordinary graph/launch/profile document. The host still exact-matches the installed application, provider, and gateway artifacts before it can open a listener or start a session. Presentation hosts remain clients of the same Realtime and management APIs; this package installs no HTTP or UI route.

Local protocol check

TestProfiledGraphNativeWebSocketExercisesExactTwelveScenarioContract is the credential-free protocol checkpoint. It starts twelve independent sessions through that generic profile registry and exact graph-native server path. Every case crosses session configuration, realtime PCM input, concurrent input/output, and a complete response lifecycle. The recorded-menu case additionally crosses function call, result, and response.create; the visual case sends the checked PNG as an official input_image message and then explicitly creates its response. A separate deterministic failure event covers the adapter's typed failure boundary. This catches profile, mount, gateway, and wire regressions, but deliberately does not score the scripted interaction behavior.

The checked release matrix runs that test as the required default local gate local.scenario.profiled-websocket. Its skip policy is forbid, and it has no credential, browser, network, or provider prerequisite; a release cannot turn an unavailable live benchmark into a local pass by skipping this checkpoint.

The checked full-suite contract fingerprint is in testdata/full-suite-contract.sha256. Changing a case's external composition surface requires an explicit artifact review.

Static launch compatibility is not behavioral evidence. In particular, it does not prove that the graph waits through requested silence, interrupts at the right moment, distinguishes nearby speakers, handles acknowledgements, chooses the correct tool, understands the image, or meets a latency bound. Those claims still require the preregistered live run of all twelve scenarios at the required repetitions with authenticated runtime evidence. Provider credentials and live results are intentionally outside this package.

The repository-owned scenario-conversation graph now composes the reusable interaction.PostCommitSilence element at an explicit 15,000 ms. Virtual-clock tests prove that only a successful durable audio/message commit arms or resets the deadline and that expiry emits a response invocation bound to the latest committed prefix. That establishes the case-7 mechanism, not a live behavioral pass: the model still has to interpret the user's request and produce the requested check-in in the retained 15-repeat run.

Run a live evaluation

The provisioned candidate remains wired as external.benchmark.scenario in scripts/release-matrix.json. It runs the existing public scenario client against the graph-native endpoint with the reviewed architecture cell, authenticated inspection graph, sealed review bundle, speech service, and fifteen repetitions per case:

go run ./cmd/openrealtime scenario \
  -url "$OPENREALTIME_BENCH_ENDPOINT" \
  -speech-url "$OPENREALTIME_SPEECH_ENDPOINT" \
  -transcribe-url "$OPENREALTIME_SCENARIO_TRANSCRIBE_ENDPOINT" \
  -transcribe-model "$OPENREALTIME_SCENARIO_TRANSCRIBE_MODEL" \
  -repeat 15 \
  -architecture-manifest "$OPENREALTIME_SCENARIO_ARCHITECTURE_MANIFEST" \
  -architecture-cell "$OPENREALTIME_SCENARIO_ARCHITECTURE_CELL" \
  -launch-profile "$OPENREALTIME_SCENARIO_LAUNCH_PROFILE" \
  -inspection-graph "$OPENREALTIME_BENCH_INSPECTION_GRAPH" \
  -review-dir results/candidate-scenario-review \
  -review-receipt results/candidate-scenario-review.receipt.json \
  -record results/candidate-scenario.json

For a graph-native architecture cell the command fails before credentials or protocol work unless the launch profile, cell graph requirement, adapter name, and the cell's exact runtime adapter-profile fingerprint form one valid frozen checklist selection. By default the graph-native path runs the complete canonical suite through NewLiveExecutor and RunChecklist.

Select a focused case

For a focused diagnostic, use scenario -list to obtain exact case names, then pass the same repeated -case flags to profile scenario and scenario. For example, select -case 'an acknowledgement is not an interruption' when freezing the profile and when running its reviewed architecture cell. The profile freezes the selected contract; an omitted, additional, duplicate, unknown, or whitespace-altered selection cannot silently run a different population. Names are ordered by the authored suite regardless of flag order. The removed substring-based -only flag remains unsupported.

-case 'acknowledgements during observed speech' explicitly selects the optional speech-triggered diagnostic in both profile creation and execution. Its actual cue positions and audible opportunities are retained and rescored from the recorded input and output PCM. It is excluded from the default twelve-case contract and cannot earn complete-suite credit, regardless of repetitions.

Subset runs retain the same source/media and review receipts as full runs. Their case ordinals and media filenames start at one within the selected population, with the exact case names and contract fingerprint retained beside them. The command labels them DIAGNOSTIC SUBSET; checklist.json records full_suite: false, reportable: false, and passed: false, even with fifteen or more repetitions and individually passing cases. Architecture reportability describes its declared population; the checklist additionally enforces the complete-suite behavioral gate. A subset cannot replace any required campaign.

Retained results and verification

The selected -review-dir plug-in writes create-only per-attempt stereo WAVs, the exact submitted visual bytes, independently verified media manifests, per-attempt checklist rows, checklist.json, and a case-by-case CHECKLIST.md. The existing sanitized REVIEW.md and review manifest remain alongside those graph-native artifacts. After the final architecture result is finished and retained, the plug-in closes every writable review handle, snapshots the exact flat evidence tree, and publishes source-manifest.json last. That source manifest cross-binds every checklist row to its exact scorer result, media manifest, stereo WAV, submitted visual bytes, final architecture-result.json, and complete file-set digest. The create-only portable receipt selected by -review-receipt is written outside the review directory and is required to reopen the source bundle; its default is <review-dir>.receipt.json.

A checklist is reportable only when all 180 attempts have exact live graph evidence and verifier-backed media; a smaller diagnostic run is labeled non-reportable even when its individual behavior checks pass. Behavioral failures are still published case by case with their recordings. The deterministic checklist and source receipt are the authority; any multimodal model review is a separate, secondary evaluation bound to that immutable source receipt and cannot convert a failed checklist row into a pass.

Run that secondary pass only after retaining the external source receipt. The reviewer is an offline plug-in client; it does not start or alter a Realtime session:

GEMINI_API_KEY="$GEMINI_API_KEY" go run ./cmd/openrealtime review scenario \
  -source-dir results/candidate-scenario-review \
  -source-receipt results/candidate-scenario-review.receipt.json \
  -out results/candidate-scenario-evaluations \
  -provider google.gemini-3.7-flash \
  -parallel 4

The command verifies the complete source population before opening the selected provider. Each attempt gets a create-only evaluation directory, its own external sibling receipt, and a link from the case-by-case REVIEW.md. The aggregate manifest.json and portable receipt are published only after every attempt bundle reopens against its receipt, the source re-verifies unchanged, and the provider closes successfully. A provider failure leaves no aggregate marker; any completed per-attempt bundles remain diagnostic evidence for that failed invocation. Evaluation provenance describes a provider-verified in-process exchange and local digest retention, not independent remote-service attestation.

Reopen a copied bundle later without a provider credential or network access:

go run ./cmd/openrealtime review verify-scenario \
  -source-dir results/candidate-scenario-review \
  -source-receipt results/candidate-scenario-review.receipt.json \
  -evaluation-dir results/candidate-scenario-evaluations \
  -evaluation-receipt results/candidate-scenario-evaluations.receipt.json

Verification requires both external receipt levels and reopens all source and evaluation bytes; a local manifest by itself is not authority.

New recordings also support deterministic replay, independently of the advisory evaluation. From the repository root:

go run ./cmd/openrealtime review replay-scenario \
  -source-dir results/candidate-scenario-review \
  -source-receipt results/candidate-scenario-review.receipt.json

VerifyScoredSourceBundle verifies source integrity, reconstructs the current canonical scenario's inputs and captured output, and exactly reproduces the retained result and architecture-task metrics. Behavioral campaign acceptance requires this stronger verifier. VerifySourceBundle remains the historical integrity reader. Replay requires versioned inputs from a completed recording; missing/partial dynamic cues currently lack recoverable source PCM. Counting uses retained independent-recognizer observations bound to their exact audio windows. Neither that binding nor local receipts prove recognizer accuracy or provider/runtime authenticity. See the benchmark guide for the retained inputs and remaining acceptance requirements.

Missing endpoints, provider credentials, reviewed manifests, inspection authority, or sealed review publication are an unavailable provisioned gate—not a passing synthetic result. The credential-free WebSocket test above must never be substituted for the required 180 live candidate attempts or the documented comparison with the benchmark owner's trusted historical result.

Documentation

Overview

Package graphnative binds the owned interaction-scenario suite to an exact graph-native Realtime adapter contract.

This package does not score behavior and does not turn static compatibility into benchmark evidence. It identifies the external session seams exercised by each scenario, fingerprints that inventory, and rejects a selected graph adapter that cannot carry the suite before a listener or session is started.

Index

Constants

View Source
const (
	ChecklistFormatVersion       uint64 = 1
	MinimumReportableRepetitions        = 15
)
View Source
const (
	MediaPolicyRequired   = "required"
	MediaPolicyUnattested = "unattested"

	BehaviorPassed   = "passed"
	BehaviorFailed   = "failed"
	BehaviorUnscored = "unscored"
)
View Source
const (
	ContractFormatVersion uint64 = 1
	SuiteName                    = "scenario"
)
View Source
const (
	// ApplicationReference is the production host key for the scenario-suite
	// decorator. The delegate remains an independently registered application;
	// a strict launch profile selects this reference only when it requires the
	// reviewed scenario contract around that delegate.
	ApplicationReference = "application.openrealtime.scenario-suite.v1"

	// ApplicationConfigurationFormatVersion identifies the scenario suite's
	// plugin-owned portion of a generic graph launch profile.
	ApplicationConfigurationFormatVersion uint64 = 1
)
View Source
const (
	SourceReviewContextFormat        = "openrealtime.scenario-source-review-context"
	SourceReviewContextFormatVersion = 3
)
View Source
const (
	SourceBundleFormat        = "openrealtime.scenario-source-bundle"
	SourceBundleFormatVersion = 1
	SourceReceiptFormat       = "openrealtime.scenario-source-receipt"
	SourceReceiptVersion      = 1
	SourceManifestName        = "source-manifest.json"
	SourceArchitectureName    = "architecture-result.json"
)

Variables

This section is empty.

Functions

func BuildSourceReviewRequests

func BuildSourceReviewRequests(
	ctx context.Context,
	options SourceBundleOptions,
	expected SourceReceipt,
) ([]review.Request, error)

BuildSourceReviewRequests converts one externally anchored scenario source bundle into provider-neutral offline review requests. It performs no model, credential, or network work. The source tree is receipt-verified before and after request construction; Evaluate will independently reopen and validate every referenced media payload immediately before invoking a provider.

func FingerprintResult

func FingerprintResult(result scenario.Result) (string, error)

FingerprintResult binds a checklist row to the complete scorer result, including its transcript and execution evidence. Callers retaining result artifacts can recompute this digest without depending on checklist internals.

func FreezeApplicationConfiguration

func FreezeApplicationConfiguration(
	contract Contract,
	delegate launchprofile.Registration,
	delegateConfiguration json.RawMessage,
) (json.RawMessage, error)

FreezeApplicationConfiguration creates the canonical plugin-owned data for one scenario contract and exact delegate registration. The complete case list is always materialized, including for the reviewed full suite, so a checked profile never relies on an empty-list convention.

func FreezeLaunchProfile

func FreezeLaunchProfile(
	ctx context.Context, config LaunchProfileConfig,
) (launchprofile.Document, error)

FreezeLaunchProfile derives and freezes the generic launch profile for an exact scenario application. Application factory and graph launch preparation are metadata-only operations; provider clients, secrets, graph elements, session adapters, and listeners stay behind SessionProvider.Start/Mount.

func GuardAdapter

func GuardAdapter(
	contract Contract,
	plugin graphlaunch.AdapterPlugin,
) (graphlaunch.AdapterPlugin, error)

GuardAdapter decorates one resource-free adapter plugin with a scenario contract check. The underlying binder still derives its profile from the immutable selected plan; the guard then verifies exact graph boundaries and capability projection before graph/launch can expose the provider.

This is the plugin-composition seam for a host that assembles the catalog itself. New uses the same function and adds exact selected-plugin checks.

func GuardLaunch

func GuardLaunch(
	contract Contract,
	config graphlaunch.Config,
) (graphlaunch.Config, error)

GuardLaunch returns a launch config whose exact selected adapter is guarded by contract. This is the direct seam for server.NewGraphBundle: a host can keep graph preparation and server compilation in that generic bundle while adding the scenario contract as an ordinary adapter-plugin decorator.

GuardLaunch does not invoke any binder or acquire any resource. It owns the returned adapter slice so installing the guard never mutates the caller's catalog.

func MarshalChecklist

func MarshalChecklist(checklist Checklist) ([]byte, error)

MarshalChecklist emits deterministic, newline-terminated JSON for a plugin-owned review/persistence layer.

func NewApplicationPlugin

func NewApplicationPlugin(config ApplicationPluginConfig) (launchprofile.Registration, error)

NewApplicationPlugin builds the everything-as-a-plugin scenario decorator. Construction only validates and snapshots registrations. Its factory strict decodes the profile-owned data, reconstructs the exact repository contract, invokes the resource-free delegate factory, and installs GuardLaunch before the generic launcher can bind an adapter.

func ValidateChecklistConfig

func ValidateChecklistConfig(config ChecklistConfig) error

ValidateChecklistConfig verifies and freezes the complete checklist selection without invoking the executor, media verifier, or retention sink. Hosts can therefore reject a drifted contract/profile/evidence composition before they open credentials, storage, speech, or Realtime resources.

Types

type ApplicationPluginConfig

type ApplicationPluginConfig struct {
	Reference string
	Artifact  inspect.ArtifactIdentity
	Delegate  launchprofile.Registration
}

ApplicationPluginConfig describes one scenario-suite application plugin.

The plugin is a decorator over another exact application registration. Its own Reference and Artifact identify the scenario contract enforcement code; Delegate identifies the application that supplies the graph, providers, and adapter. The resulting registration retains Delegate.ProviderArtifact so the generic profile resolver can attest the installed SessionProvider bytes.

type AttemptCapture

type AttemptCapture struct {
	Key          AttemptKey
	Result       scenario.Result
	Audio        bench.SessionAudioCapture
	Submitted    []SubmittedInputCapture
	RunSucceeded bool
}

AttemptCapture is the provider-neutral evidence handed to one caller-selected retention plug-in after a canonical scenario attempt. Result and Audio are independent copies. RunSucceeded distinguishes a behavioral result from a diagnostic artifact without retaining an unsanitized provider/transport error inside the capture contract.

type AttemptExecution

type AttemptExecution struct {
	ContractFingerprint       string `json:"contract_fingerprint"`
	LaunchProfileFingerprint  string `json:"launch_profile_fingerprint"`
	PlanFingerprint           string `json:"plan_fingerprint"`
	GraphFingerprint          string `json:"graph_fingerprint"`
	AdapterProfileFingerprint string `json:"adapter_profile_fingerprint"`
	ResultSHA256              string `json:"result_sha256,omitempty"`
	EvidenceFingerprint       string `json:"evidence_fingerprint,omitempty"`
	Validated                 bool   `json:"validated"`
}

AttemptExecution makes each row independently attributable to the complete frozen selection. ResultSHA256 binds the retained scorer result, while EvidenceFingerprint refers to the separately retained bench.ExecutionEvidence whose exact content was matched before Validated was set. Expected plan/profile identities are not inferred from either digest.

type AttemptExecutor

type AttemptExecutor func(
	context.Context, AttemptKey, scenario.Scenario,
) (AttemptObservation, error)

func NewLiveExecutor

func NewLiveExecutor(config LiveExecutorConfig) (AttemptExecutor, error)

NewLiveExecutor freezes the live client composition without opening a connection or invoking a plug-in. Attempts through one returned executor are serialized so stateful speech and retention plug-ins need only implement a single-attempt lifecycle.

type AttemptFailure

type AttemptFailure struct {
	Code   string `json:"code"`
	Detail string `json:"detail,omitempty"`
}

type AttemptKey

type AttemptKey struct {
	CaseOrdinal int    `json:"case_ordinal"`
	CaseName    string `json:"case_name"`
	Trial       int    `json:"trial"`
	TaskID      string `json:"task_id"`
}

AttemptKey is the canonical identity shared by the executor, attestor, media verifier, and checklist sink. It deliberately matches the public scenario client's task scope so live inspection cannot be attributed to a different repetition.

type AttemptObservation

type AttemptObservation struct {
	Result scenario.Result
	Media  *MediaReference
}

AttemptObservation is returned by the caller-selected executor. Result is the repository scenario scorer's output; Media only names evidence for a verifier and is never accepted by assertion.

type AttemptRecord

type AttemptRecord struct {
	FormatVersion  uint64           `json:"format_version"`
	Fingerprint    string           `json:"fingerprint"`
	Key            AttemptKey       `json:"key"`
	Behavior       string           `json:"behavior"`
	Failures       []string         `json:"behavior_failures,omitempty"`
	Infrastructure []AttemptFailure `json:"infrastructure_failures,omitempty"`
	Execution      AttemptExecution `json:"execution"`
	Media          *VerifiedMedia   `json:"media,omitempty"`
	Reportable     bool             `json:"reportable"`
}

func (AttemptRecord) Clone

func (record AttemptRecord) Clone() AttemptRecord

type AttemptRetainer

type AttemptRetainer func(context.Context, AttemptCapture) (MediaReference, error)

AttemptRetainer owns evidence persistence. It must retain the supplied audio and every submitted input create-only, then return an opaque handle and final manifest digest. RunChecklist invokes an independently selected verifier before treating the reference as evidence.

type CaseChecklist

type CaseChecklist struct {
	Ordinal              int    `json:"ordinal"`
	Name                 string `json:"name"`
	Expected             int    `json:"expected"`
	Executed             int    `json:"executed"`
	Reportable           int    `json:"reportable"`
	Passed               int    `json:"passed"`
	Failed               int    `json:"failed"`
	InfrastructureFailed int    `json:"infrastructure_failed"`
}

type CaseRequirement

type CaseRequirement struct {
	Name         string                          `json:"name"`
	Seams        []Seam                          `json:"seams"`
	Operations   []graphbinding.AdapterOperation `json:"operations"`
	Capabilities StackRequirement                `json:"capabilities"`
}

CaseRequirement is the exact external composition surface for one owned scenario. Operations and seams are canonical, sorted, duplicate-free sets.

type Checklist

type Checklist struct {
	FormatVersion              uint64               `json:"format_version"`
	Fingerprint                string               `json:"fingerprint"`
	Suite                      string               `json:"suite"`
	ContractFingerprint        string               `json:"contract_fingerprint"`
	LaunchProfileFingerprint   string               `json:"launch_profile_fingerprint"`
	Plan                       graphconfig.Identity `json:"plan"`
	AdapterProfileFingerprint  string               `json:"adapter_profile_fingerprint"`
	ExecutionRequirementSHA256 string               `json:"execution_requirement_sha256"`
	MediaPolicy                string               `json:"media_policy"`
	Repetitions                int                  `json:"repetitions"`
	Expected                   int                  `json:"expected"`
	Executed                   int                  `json:"executed"`
	ReportableAttempts         int                  `json:"reportable_attempts"`
	PassedAttempts             int                  `json:"passed_attempts"`
	FailedAttempts             int                  `json:"failed_attempts"`
	InfrastructureFailures     int                  `json:"infrastructure_failures"`
	FullSuite                  bool                 `json:"full_suite"`
	Complete                   bool                 `json:"complete"`
	Reportable                 bool                 `json:"reportable"`
	Passed                     bool                 `json:"passed"`
	Cases                      []CaseChecklist      `json:"cases"`
	Attempts                   []AttemptRecord      `json:"attempts"`
}

Checklist is the deterministic case-by-case review index. Complete means every configured attempt returned a record. Reportable additionally needs the complete twelve-case contract, the reviewed repetition floor, exact graph evidence, and verifier-backed media for every row. Passed is only the behavioral result after those evidence conditions hold.

func RunChecklist

func RunChecklist(ctx context.Context, config ChecklistConfig) (Checklist, error)

RunChecklist executes the canonical case/trial order. Behavioral and infrastructure failures are records, not early returns, so a bad first case cannot erase the other ten. Context cancellation and retention-plugin failure stop the run because continuing could not produce honest evidence.

func (Checklist) Clone

func (checklist Checklist) Clone() Checklist

func (Checklist) Validate

func (checklist Checklist) Validate() error

Validate proves deterministic ordering, summaries, per-attempt identities, and the content fingerprint. It intentionally cannot re-verify external execution/media evidence after those separately retained artifacts are no longer supplied.

type ChecklistConfig

type ChecklistConfig struct {
	Contract                  Contract
	Profile                   launchprofile.Document
	AdapterProfileFingerprint string
	ExecutionRequirement      bench.ExecutionRequirement
	Repetitions               int
	RequireMedia              bool
	Executor                  AttemptExecutor
	VerifyMedia               MediaVerifier
	SanitizeError             ErrorSanitizer
	Sink                      ChecklistSink
}

type ChecklistSink

type ChecklistSink struct {
	Attempt  func(context.Context, AttemptRecord) error
	Finalize func(context.Context, Checklist) error
}

ChecklistSink is a caller-selected retention plugin. Attempt is invoked after each independently fingerprinted record; Finalize receives the exact final checklist. Supplying only one callback is rejected before execution.

type Config

type Config struct {
	Launch graphlaunch.Config
	Cases  []string
}

Config contains an exact generic graph launch plus the scenario slab that launch must support. Cases empty means the complete reviewed suite.

There is no binding name, legacy implementation selector, or fallback in this surface. Artifacts, assembly contributions, adapter identity, and mount dependencies are checked by graph/launch after the scenario adapter guard has been installed.

type Contract

type Contract struct {
	FormatVersion uint64                          `json:"format_version"`
	Suite         string                          `json:"suite"`
	Cases         []CaseRequirement               `json:"cases"`
	Operations    []graphbinding.AdapterOperation `json:"operations"`
	Capabilities  StackRequirement                `json:"capabilities"`
	Fingerprint   string                          `json:"fingerprint"`
}

Contract is the immutable aggregate for a selected scenario slab. An empty selection passed to BuildContract means the reviewed twelve-case suite.

func BuildContract

func BuildContract(selected ...string) (Contract, error)

BuildContract freezes the selected scenario composition contract. Names must be exact reviewed case names; whitespace normalization, duplicates, and unknown aliases fail closed instead of silently selecting a different slab.

func (Contract) Clone

func (contract Contract) Clone() Contract

Clone returns an independently mutable copy.

func (Contract) Marshal

func (contract Contract) Marshal() ([]byte, error)

Marshal emits deterministic, newline-terminated JSON suitable for a preregistered launch artifact.

func (Contract) Validate

func (contract Contract) Validate() error

Validate proves that a contract is exactly the canonical contract derivable from the repository-owned suite and that its fingerprint is current.

func (Contract) ValidateProfile

func (contract Contract) ValidateProfile(profile graphbinding.SessionAdapterProfile, graph ir.Graph) error

ValidateProfile proves that one frozen adapter can carry this scenario slab over the exact selected Graph IR. It establishes launch compatibility only; live benchmark results remain required for behavioral or latency claims.

type ErrorSanitizer

type ErrorSanitizer func(string) string

ErrorSanitizer may retain a bounded, redacted detail for infrastructure diagnosis. With no sanitizer, stable failure codes are retained without copying provider or transport errors into the checklist.

type LaunchProfileConfig

type LaunchProfileConfig struct {
	Name          string
	Revision      uint64
	Contract      Contract
	Application   launchprofile.Registration
	Configuration json.RawMessage
	Server        launchprofile.Server
}

LaunchProfileConfig freezes a generic graph/server profile for one exact scenario contract. Configuration must be produced by FreezeApplicationConfiguration for Application.

Every executable identity is caller supplied and subsequently exact-matched by graph/launch/profile and server.NewProfileGraphBundle. The plan and adapter identities are derived from the selected application's real resource-free launch config; this helper never invents runtime digests.

type LiveExecutorConfig

type LiveExecutorConfig struct {
	// Contract fixes the selected case population and its attempt ordinals.
	// Nil preserves the complete-suite default for existing callers.
	Contract *Contract
	Voice    scenario.Voice
	Session  bench.SessionConfig
	Retain   AttemptRetainer
	// EvidenceContext is owned by the complete checklist run rather than one
	// attempt. A timed-out attempt may therefore finish retaining bytes that
	// SessionConfig already captured, while cancellation of the whole run still
	// stops filesystem or provider-side evidence work.
	EvidenceContext context.Context
	// EvidenceTimeout bounds one retention call independently of the live
	// attempt deadline. It is deployment policy, not a behavioral timeout.
	EvidenceTimeout time.Duration
}

LiveExecutorConfig composes the existing scenario harness with an ordinary Realtime endpoint, exact runtime attestor, and evidence-retention plug-in. Voice and Retain are host-selected plug-ins; this package opens no speech, storage, provider, server, presentation, or credential resource itself.

type MediaReference

type MediaReference struct {
	Handle         string                  `json:"handle"`
	ManifestSHA256 string                  `json:"manifest_sha256"`
	Submitted      []SubmittedInputReceipt `json:"submitted_inputs,omitempty"`
}

MediaReference is an opaque verifier-owned handle plus the externally retained completion digest. The checklist never opens a directory or assumes a media implementation.

type Result

type Result struct {
	Contract Contract
	Plan     *graphconfig.Plan
	Binding  *graphbinding.NativeBinding
}

Result is the prepared graph-native provider plus the immutable scenario contract it was checked against. Binding implements server.SessionProvider and can be passed directly to the composable server bundle.

func New

func New(ctx context.Context, config Config) (Result, error)

New prepares an exact graph-native session provider for a scenario slab. It performs no mount, adapter-factory call, secret resolution, network operation, or provider acquisition.

type Seam

type Seam string

Seam names one stable external session composition seam. Seams describe protocol-to-graph wiring only. The scenario checks remain the authority for whether a graph actually waits, interrupts, distinguishes speakers, uses a deadline, or says the right thing.

const (
	SeamSessionConfiguration Seam = "session-configuration"
	SeamContinuousAudio      Seam = "continuous-audio"
	SeamResponseLifecycle    Seam = "response-lifecycle"
	SeamFunctionTool         Seam = "function-tool-round-trip"
	SeamStillImageMessage    Seam = "still-image-message"
)

type SourceAttempt

type SourceAttempt struct {
	Record        AttemptRecord          `json:"record"`
	Result        SourceFile             `json:"result"`
	MediaManifest SourceFile             `json:"media_manifest"`
	Audio         SourceFile             `json:"audio"`
	Submitted     []SourceSubmittedInput `json:"submitted_inputs,omitempty"`
}

SourceAttempt cross-binds the deterministic checklist row to the exact result, media manifest, stereo recording, and submitted visual inputs. Diagnostic attempts may have a nil checklist Media receipt, but their retained files still remain attributable and cannot become reportable.

type SourceBundle

type SourceBundle struct {
	Manifest           SourceManifest
	Checklist          Checklist
	ArchitectureResult archbench.Result
	Receipt            SourceReceipt
}

func VerifyScoredSourceBundle

func VerifyScoredSourceBundle(ctx context.Context, options SourceBundleOptions, expected SourceReceipt) (verified SourceBundle, resultErr error)

VerifyScoredSourceBundle adds current deterministic scorer replay to source integrity verification. Historical bundles without replay inputs remain readable through VerifySourceBundle but cannot satisfy this acceptance gate. Recognizer text is treated as a retained external observation bound to its exact PCM window; this does not independently establish ASR accuracy.

func VerifySourceBundle

func VerifySourceBundle(
	ctx context.Context, options SourceBundleOptions, expected SourceReceipt,
) (bundle SourceBundle, resultErr error)

VerifySourceBundle reopens a committed source tree and requires the exact portable receipt retained outside it.

type SourceBundleOptions

type SourceBundleOptions struct {
	Directory       string
	SensitiveValues []string
}

type SourceFile

type SourceFile struct {
	Path      string `json:"path"`
	Purpose   string `json:"purpose"`
	SHA256    string `json:"sha256"`
	SizeBytes int64  `json:"size_bytes"`
}

SourceFile is one exact regular file below the source root. Purpose is semantic and stable; Path is always a flat root-relative name.

type SourceManifest

type SourceManifest struct {
	Format                    string          `json:"format"`
	FormatVersion             int             `json:"format_version"`
	Complete                  bool            `json:"complete"`
	Suite                     string          `json:"suite"`
	Cases                     int             `json:"cases"`
	Trials                    int             `json:"trials"`
	ExpectedAttempts          int             `json:"expected_attempts"`
	Origin                    SourceOrigin    `json:"origin"`
	ChecklistFingerprint      string          `json:"checklist_fingerprint"`
	Checklist                 SourceFile      `json:"checklist"`
	ArchitectureResult        SourceFile      `json:"architecture_result"`
	ArchitectureReportable    bool            `json:"architecture_reportable"`
	ArchitectureReportability string          `json:"architecture_reportability,omitempty"`
	Attempts                  []SourceAttempt `json:"attempts"`
	FileSetSHA256             string          `json:"file_set_sha256"`
	Files                     []SourceFile    `json:"files"`
}

SourceManifest is published last inside the source root. Files names the complete pre-manifest tree, so an added, removed, swapped, or hard-linked artifact invalidates verification.

type SourceOrigin

type SourceOrigin struct {
	Kind           string `json:"kind"`
	Transport      string `json:"transport"`
	EndpointSHA256 string `json:"endpoint_sha256"`
}

SourceOrigin distinguishes a live endpoint run from a hermetic fixture. EndpointSHA256 binds the normalized endpoint without retaining credentials, query parameters, or a deployment hostname in the portable evidence index.

func (SourceOrigin) Validate

func (origin SourceOrigin) Validate() error

type SourcePublication

type SourcePublication struct {
	SourceBundleOptions
	ReceiptPath        string
	Origin             SourceOrigin
	Checklist          Checklist
	ArchitectureResult json.RawMessage
	Attempts           []SourceAttempt
}

type SourceReceipt

type SourceReceipt struct {
	Format             string `json:"format"`
	FormatVersion      int    `json:"format_version"`
	Directory          string `json:"directory"`
	ManifestSHA256     string `json:"manifest_sha256"`
	FileSetSHA256      string `json:"file_set_sha256"`
	ChecklistSHA256    string `json:"checklist_sha256"`
	ArchitectureSHA256 string `json:"architecture_sha256"`
	ReceiptSHA256      string `json:"receipt_sha256"`
}

SourceReceipt is portable: ReceiptSHA256 excludes Directory. A caller must retain it outside the mutable source root and supply it to VerifySourceBundle.

func PublishSourceBundle

func PublishSourceBundle(
	ctx context.Context, publication SourcePublication,
) (receipt SourceReceipt, resultErr error)

PublishSourceBundle writes the final architecture result, snapshots the exact existing evidence tree, publishes SourceManifestName last, reopens it against the expected receipt, then writes the caller-owned external receipt create-only. Existing paths are never replaced.

func ReadSourceReceipt

func ReadSourceReceipt(path string) (SourceReceipt, error)

type SourceReviewArchitecture

type SourceReviewArchitecture struct {
	ResultVersion   int                    `json:"result_version"`
	Experiment      string                 `json:"experiment"`
	ManifestID      string                 `json:"manifest_id"`
	FixtureRevision string                 `json:"fixture_revision"`
	Cell            archbench.Cell         `json:"cell"`
	Provenance      bench.Provenance       `json:"provenance"`
	Task            bench.TaskOutcome      `json:"task"`
	Observation     *archbench.Observation `json:"observation,omitempty"`
}

SourceReviewArchitecture is the attempt-local projection of the exact final architecture result. It deliberately excludes unrelated task records while retaining the authored cell, run provenance, deterministic task row, and matching live observation.

type SourceReviewContext

type SourceReviewContext struct {
	Format                 string                   `json:"format"`
	FormatVersion          int                      `json:"format_version"`
	DeterministicAuthority string                   `json:"deterministic_authority"`
	SourceReceiptSHA256    string                   `json:"source_receipt_sha256"`
	SourceManifestSHA256   string                   `json:"source_manifest_sha256"`
	SourceFileSetSHA256    string                   `json:"source_file_set_sha256"`
	ChecklistFingerprint   string                   `json:"checklist_fingerprint"`
	MediaDurationMS        int64                    `json:"media_duration_ms"`
	Attempt                AttemptRecord            `json:"attempt"`
	Result                 scenario.Result          `json:"deterministic_result"`
	Architecture           SourceReviewArchitecture `json:"architecture"`
}

SourceReviewContext is the public, self-contained context sent to an offline secondary reviewer. DeterministicAuthority is a fixed statement of precedence: no model assessment can rewrite Result or Attempt.

type SourceReviewPopulation

type SourceReviewPopulation struct {
	Bundle   SourceBundle
	Requests []review.Request
}

SourceReviewPopulation is one receipt-verified source snapshot and the exact provider-neutral requests derived from it. Returning both avoids an orchestration layer performing a redundant full source verification merely to recover checklist and manifest metadata already authenticated here.

func BuildSourceReviewPopulation

func BuildSourceReviewPopulation(
	ctx context.Context,
	options SourceBundleOptions,
	expected SourceReceipt,
) (population SourceReviewPopulation, resultErr error)

BuildSourceReviewPopulation verifies the externally anchored source before and after deriving every request, and returns the verified bundle metadata from that same operation. It performs no provider, credential, or network work.

type SourceSubmittedInput

type SourceSubmittedInput struct {
	Receipt SubmittedInputReceipt `json:"receipt"`
	File    SourceFile            `json:"file"`
}

type StackRequirement

type StackRequirement struct {
	AudioInput     bool `json:"audio_input"`
	AudioOutput    bool `json:"audio_output"`
	VisualInput    bool `json:"visual_input,omitempty"`
	Transcription  bool `json:"transcription"`
	TurnGeneration bool `json:"turn_generation"`
	ConcurrentIO   bool `json:"concurrent_io,omitempty"`
	TextInjection  bool `json:"text_injection,omitempty"`
}

StackRequirement is the graph adapter's minimum executable capability projection. These fields deliberately mirror only stable, inspectable binding capabilities. Interaction-policy behavior is established by live scenario results, never inferred from this declaration.

type SubmittedInputCapture

type SubmittedInputCapture struct {
	Receipt SubmittedInputReceipt
	Data    []byte
}

SubmittedInputCapture binds one receipt to the immutable bytes submitted in the corresponding successful scheduled Realtime event. Data is owned by the selected retention plug-in; it is deliberately separate from checklist JSON.

type SubmittedInputReceipt

type SubmittedInputReceipt struct {
	SightID   string `json:"sight_id"`
	CueMS     int    `json:"cue_ms"`
	SHA256    string `json:"sha256"`
	SizeBytes int64  `json:"size_bytes"`
	MediaType string `json:"media_type"`
}

SubmittedInputReceipt identifies bytes actually submitted by the harness. The verifier, not this package, establishes the digest from retained bytes. SightID and CueMS bind the receipt to the authored scenario timeline.

type VerifiedMedia

type VerifiedMedia struct {
	Handle         string                  `json:"handle"`
	ManifestSHA256 string                  `json:"manifest_sha256"`
	Audio          bool                    `json:"audio"`
	VideoSources   []string                `json:"video_sources,omitempty"`
	Submitted      []SubmittedInputReceipt `json:"submitted_inputs,omitempty"`
}

VerifiedMedia is the bounded projection returned by the selected media verifier after it has independently checked the referenced bundle. Audio and submitted stills remain separate: a still-image message is not silently reclassified as a continuous video source.

Jump to

Keyboard shortcuts

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