Documentation
¶
Overview ¶
Package capability owns execution-side capability discovery. It converts private bounded probe observations into the closed, secret-free core inventory contract.
Index ¶
- Variables
- func RecheckAll(mode corecap.RefreshMode, requestID string) corecap.RecheckRequest
- func ValidateRecheckRequest(request corecap.RecheckRequest) error
- type Client
- type CodexAppServerContract
- type CodexAppServerInspector
- type CodexAppServerProcess
- type CodexAppServerStarter
- type CodexContractVerifier
- type CodexInspection
- type CodexInspector
- type CodexSchemaContractVerifier
- type CodexSchemaGenerator
- type CodexSubscriptionResolver
- type CommandExecutor
- type CommandResolver
- type CommandResolverOptions
- type CommandResult
- type DiscoveryError
- type GmailInspection
- type GmailInspector
- type HeldCommand
- type LocalProber
- type MachineRefresher
- type ProbeError
- type ProbeObservation
- type ProbeRequest
- type Prober
- type ProfileGate
- type ProfilePreflightError
- type Registry
- type RegistryOptions
- type ResolverCodexAppServerStarter
- type ResolverCodexSchemaGenerator
- type ResolverExecutor
- type SupabaseInspection
- type SupabaseInspector
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupportedPlatform = errors.New("capability command: unsupported platform") ErrCommandAbsent = errors.New("capability command: absent") ErrCommandOutputLimit = errors.New("capability command: output limit exceeded") ErrCommandIdentityChanged = errors.New("capability command: executable identity changed") )
Functions ¶
func RecheckAll ¶
func RecheckAll(mode corecap.RefreshMode, requestID string) corecap.RecheckRequest
func ValidateRecheckRequest ¶
func ValidateRecheckRequest(request corecap.RecheckRequest) error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithToken ¶
NewClientWithToken reads the mesh token immediately before every request so a token minted by live mesh enrollment takes effect without a daemon restart.
type CodexAppServerContract ¶
type CodexAppServerContract struct {
ExecutableDigest string
NormalSchemaDigest string
NormalSchemaFiles int
ExperimentalSchemaDigest string
ExperimentalSchemaFiles int
GmailIsolationReady bool
SupabaseIsolationReady bool
}
CodexAppServerContract carries facts verified outside the live JSONL session. The inspector copies only these normalized schema/isolation facts; account and model readiness always come from the current app-server session.
type CodexAppServerInspector ¶
type CodexAppServerInspector struct {
// contains filtered or unexported fields
}
func NewCodexAppServerInspector ¶
func NewCodexAppServerInspector(starter CodexAppServerStarter, contract CodexAppServerContract) *CodexAppServerInspector
func NewVerifiedCodexAppServerInspector ¶
func NewVerifiedCodexAppServerInspector(starter CodexAppServerStarter, verifier CodexContractVerifier) *CodexAppServerInspector
NewVerifiedCodexAppServerInspector defers schema generation until a live capability probe needs Codex. A successful proof is immutable for this process; a failed proof is briefly cached so one inventory refresh cannot fan out into repeated expensive schema generation attempts.
func (*CodexAppServerInspector) Inspect ¶
func (i *CodexAppServerInspector) Inspect(ctx context.Context) (CodexInspection, error)
type CodexAppServerProcess ¶
CodexAppServerProcess is the private JSONL process boundary used by the no-turn inspector. Tests substitute an in-memory transcript; production starts the exact executable identity held by CommandResolver.
type CodexAppServerStarter ¶
type CodexAppServerStarter interface {
Start(context.Context) (CodexAppServerProcess, error)
}
type CodexContractVerifier ¶
type CodexContractVerifier interface {
Verify(context.Context) (CodexAppServerContract, error)
}
CodexContractVerifier proves the held Codex executable's no-turn app-server schema contract. Production verification is intentionally lazy: wiring and read-only CLI commands must never run provider commands.
type CodexInspection ¶
type CodexInspection struct {
AccountReady bool
AccountHandle string
AccountType string
AccountPlan string
Models map[string]bool
DefaultModel string
ExecutableDigest string
NormalSchemaDigest string
NormalSchemaFiles int
ExperimentalSchemaDigest string
ExperimentalSchemaFiles int
GmailIsolationReady bool
SupabaseIsolationReady bool
}
CodexInspection contains normalized process-private facts extracted from one no-turn app-server session and its generated schema bundles. The executable digest is compared internally and must never cross a public API boundary.
type CodexInspector ¶
type CodexInspector interface {
Inspect(context.Context) (CodexInspection, error)
}
type CodexSchemaContractVerifier ¶
type CodexSchemaContractVerifier struct {
// contains filtered or unexported fields
}
func NewCodexSchemaContractVerifier ¶
func NewCodexSchemaContractVerifier(resolver *CommandResolver) *CodexSchemaContractVerifier
NewCodexSchemaContractVerifier constructs the catalog-v2 production verifier. Verify must succeed before its contract is supplied to the live app-server inspector.
func (*CodexSchemaContractVerifier) Verify ¶
func (v *CodexSchemaContractVerifier) Verify(ctx context.Context) (CodexAppServerContract, error)
type CodexSchemaGenerator ¶
CodexSchemaGenerator is the bounded command seam for generating both schema bundles from one executable identity.
type CodexSubscriptionResolver ¶ added in v1.0.4
type CodexSubscriptionResolver struct {
// contains filtered or unexported fields
}
CodexSubscriptionResolver bridges capability-authorized, content-addressed Codex bytes into the isolated subscription runtime. It returns no account identifiers or auth paths beyond the process-private environment required by the already authenticated Codex executable.
func NewCodexSubscriptionResolver ¶ added in v1.0.4
func NewCodexSubscriptionResolver(resolver *CommandResolver) *CodexSubscriptionResolver
func (*CodexSubscriptionResolver) ResolveCodex ¶ added in v1.0.4
func (r *CodexSubscriptionResolver) ResolveCodex(ctx context.Context) (codexsubscription.HeldExecutable, error)
type CommandExecutor ¶
type CommandExecutor interface {
Run(context.Context, string, ...string) CommandResult
}
CommandExecutor is the narrow command-probe seam used by LocalProber.
type CommandResolver ¶
type CommandResolver struct {
// contains filtered or unexported fields
}
CommandResolver resolves a command once, reads it through a no-follow file descriptor, and stages immutable content-addressed bytes for both probes and dispatch. Paths and fingerprints stay execution-private.
func NewCommandResolver ¶
func NewCommandResolver(options CommandResolverOptions) (*CommandResolver, error)
func (*CommandResolver) AuthorizeExecutable ¶
func (r *CommandResolver) AuthorizeExecutable(name, digest string) error
AuthorizeExecutable pins one command name to bytes whose capability contract has completed successfully. A running daemon never silently adopts different bytes; an upgrade requires a restart and a fresh capability probe.
func (*CommandResolver) Hold ¶
func (r *CommandResolver) Hold(name string) (*HeldCommand, error)
func (*CommandResolver) ResolveVerifiedExecutable ¶
func (r *CommandResolver) ResolveVerifiedExecutable(name string) (string, error)
ResolveVerifiedExecutable implements native.VerifiedExecutableResolver without importing the concrete native package. It re-holds the current PATH target, compares it with the authorized digest, and returns only the immutable staged path. All failures collapse to one secret-free drift error.
type CommandResolverOptions ¶
type CommandResult ¶
CommandResult is the private result of one bounded, held executable probe. Output must be parsed and discarded by the prober; it never enters public inventory or error text.
type DiscoveryError ¶
func (*DiscoveryError) Error ¶
func (e *DiscoveryError) Error() string
type GmailInspection ¶
type GmailInspector ¶
type GmailInspector interface {
InspectGmail(context.Context) (GmailInspection, error)
}
type HeldCommand ¶
type HeldCommand struct {
// contains filtered or unexported fields
}
func (*HeldCommand) Digest ¶
func (h *HeldCommand) Digest() string
Digest is an internal stable executable-content identity. It must never be copied into public inventory or errors.
func (*HeldCommand) Environment ¶
func (h *HeldCommand) Environment() []string
func (*HeldCommand) Executable ¶
func (h *HeldCommand) Executable() string
Executable returns the immutable staged path for an execution adapter. This is process-private and must not cross an API boundary.
type LocalProber ¶
type LocalProber struct {
// contains filtered or unexported fields
}
LocalProber implements only the catalog's closed predicate IDs. Raw command output and private connector identifiers are reduced to stable binding material before Registry hashes them into opaque revisions.
func NewLocalProber ¶
func NewLocalProber(commands CommandExecutor, codex CodexInspector, gmail GmailInspector, supabase SupabaseInspector) *LocalProber
func (*LocalProber) Probe ¶
func (p *LocalProber) Probe(ctx context.Context, request ProbeRequest) ProbeObservation
type MachineRefresher ¶
type MachineRefresher interface {
RefreshMachine(context.Context, string, corecap.RefreshMode, []string) (corecap.MachineInventory, error)
}
MachineRefresher is the narrow capability-control seam needed immediately before provider dispatch. It refreshes only the machine placement already selected by the deterministic core.
type ProbeError ¶
ProbeError permits a private inspector to return a closed public reason without exposing its underlying output or credentials.
func (*ProbeError) Error ¶
func (e *ProbeError) Error() string
type ProbeObservation ¶
type ProbeObservation struct {
State corecap.PredicateState
Reason corecap.Reason
StableBinding []string
ResolvedModel string
TextOnlyOption *corecap.TextOnlyOptionOffer
}
type ProbeRequest ¶
type Prober ¶
type Prober interface {
Probe(context.Context, ProbeRequest) ProbeObservation
}
type ProfileGate ¶
type ProfileGate struct {
// contains filtered or unexported fields
}
ProfileGate blocks legacy dispatch unless its exact cataloged execution profile is ready on the already-selected machine. It never substitutes a model or changes placement.
func NewProfileGate ¶
func NewProfileGate(next runtime.Runtime, refresher MachineRefresher) *ProfileGate
func (*ProfileGate) Name ¶
func (g *ProfileGate) Name() string
type ProfilePreflightError ¶
ProfilePreflightError is safe to persist and render. It contains only closed catalog identifiers, the public machine name, and a closed reason code.
func (*ProfilePreflightError) Error ¶
func (e *ProfilePreflightError) Error() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(options RegistryOptions) (*Registry, error)
func (*Registry) Current ¶
func (r *Registry) Current() corecap.NodeInventory
func (*Registry) Refresh ¶
func (r *Registry) Refresh(ctx context.Context, request corecap.RecheckRequest) (corecap.NodeInventory, error)
type RegistryOptions ¶
type ResolverCodexAppServerStarter ¶
type ResolverCodexAppServerStarter struct {
Resolver *CommandResolver
}
ResolverCodexAppServerStarter launches the same immutable staged Codex bytes and environment policy used by the ordinary command probes.
func (ResolverCodexAppServerStarter) Start ¶
func (s ResolverCodexAppServerStarter) Start(ctx context.Context) (CodexAppServerProcess, error)
type ResolverCodexSchemaGenerator ¶
type ResolverCodexSchemaGenerator struct {
Resolver *CommandResolver
}
ResolverCodexSchemaGenerator runs both schema commands from one held Codex executable identity. Command output is bounded and discarded.
type ResolverExecutor ¶
type ResolverExecutor struct {
Resolver *CommandResolver
}
ResolverExecutor holds the exact executable bytes before every probe and runs that staged identity with the capability probe bounds.
func (ResolverExecutor) AuthorizeExecutable ¶
func (e ResolverExecutor) AuthorizeExecutable(name, digest string) error
func (ResolverExecutor) Run ¶
func (e ResolverExecutor) Run(ctx context.Context, name string, args ...string) CommandResult
type SupabaseInspection ¶
type SupabaseInspector ¶
type SupabaseInspector interface {
InspectSupabase(context.Context) (SupabaseInspection, error)
}