compute

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package compute runs one hypothesis against a connector and reports what crossed.

Extracted when toolkit mode needed the same pipeline the LocalComputeActor runs. Two copies of it would have been two places for §12's rules to drift apart, and the rules are the product: render only from a template, parse-gate the statement, aggregate behind the k-anonymity floor, record every crossing including the refusals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeTextColumns

func FreeTextColumns(c connector.Connector) []string

FreeTextColumns are the names the connector's profile flagged as prose.

The gate re-derives the flag from the result anyway — a result column can be an expression the profile never saw — and takes the union. This is the profile's half of that.

func PlanDescriptor

func PlanDescriptor(p hypothesis.Plan) string

PlanDescriptor identifies an attempt that never became a statement.

Not SQL and not pretending to be: the template and the columns chosen, which is what a reader auditing a refusal needs and all that exists at that point. Identifiers only — the columns are names from the profile, which already crossed when the schema was shown.

Types

type Result

type Result struct {
	// Envelope is empty unless Err is nil.
	Envelope gate.AggregateEnvelope
	// Query is the rendered statement, or a plan descriptor when rendering itself
	// failed and there is no statement to name.
	Query string
	// Outcome and Detail are what the audit trail records. A refusal is the gate
	// working; a withholding is a rule upstream having broken in a way the exfil
	// backstop caught, and folding the two together would make §14.3's number
	// unmeasurable.
	Outcome core.CrossingOutcome
	Detail  string
	// Record summarizes a successful envelope for the audit trail.
	Record gate.Record

	Err error
}

Result is one hypothesis run: what crossed, and the audit rows describing it.

func Run

Run renders a plan, checks it, executes it behind the aggregation gate, and reports the outcome.

Every exit produces an Outcome, including the ones that never reach the database. A trail that began at the gate would show only the questions that got as far as a statement — and the ones refused earlier, a free-text column asked to be a grouping key or a template whose slots were filled wrongly, are exactly the attempts somebody auditing this would want to see.

func (Result) Crossing

func (r Result) Crossing(sessionID, leadID, connectorName string) core.Crossing

Crossing turns a Result into the audit row for it.

Directories

Path Synopsis
Package coderunner executes model-authored analysis inside the sandbox (§12.1).
Package coderunner executes model-authored analysis inside the sandbox (§12.1).
Package connector registers local data sources and hands out read-only handles to them (M8, §12).
Package connector registers local data sources and hands out read-only handles to them (M8, §12).
Package gate is §12.1's aggregation boundary: the only path by which anything derived from local data reaches a model.
Package gate is §12.1's aggregation boundary: the only path by which anything derived from local data reaches a model.
Package hypothesis renders the only SQL that may reach a connector (M8, §12.3).
Package hypothesis renders the only SQL that may reach a connector (M8, §12.3).
Package sandbox detects a container runtime and runs code inside one (§3.6).
Package sandbox detects a container runtime and runs code inside one (§3.6).
Package sqlguard is §12.2's parse gate: the check every statement passes before it reaches a connector database.
Package sqlguard is §12.2's parse gate: the check every statement passes before it reaches a connector database.
Package stats is the arithmetic behind §4's statistical-validity check.
Package stats is the arithmetic behind §4's statistical-validity check.

Jump to

Keyboard shortcuts

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