spectest

package
v0.2026331.837 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 2 Imported by: 0 modules, 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.

Documentation

Overview

Package spectest holds the sdk-INTERNAL, test-only helpers that more than one sdk package's test binary needs.

It is a package rather than a per-file copy because R3 (one canonical implementation per behaviour — charly/AGENTS.md) admits no "a second copy is fine" threshold: the op-context classifier below is a pure ~15-line function, but it was carried as an independent port in BOTH deploykit's and loaderkit's test binaries, and a divergence between the two would make two sdk packages disagree about which ops run where. Under internal/ it stays unimportable from outside the module, so it adds nothing to the sdk's published surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install()

Install wires the spec.OpInContext DI hook to this package's port. Call it from a test binary's init(); calling it more than once is a harmless no-op (it assigns the same func).

func OpEffectiveContexts

func OpEffectiveContexts(c *spec.Op) []spec.ExecContext

OpEffectiveContexts returns the execution context(s) an op actually runs in: the op's OWN declared `context:` when it declares any, else the verb's catalog default.

spec.OpInContext is a package-level DI hook (spec/spec/injection_seams.go) that production charly core wires from its own init() (charly/charly/layers.go: spec.OpInContext = opInContext), safe there because charly always shares that process with the compile/scan call. An sdk-only test binary links no charly core, so the hook stays nil and the first call to it panics. The classifier is PURE — spec.VerbCatalog is static data plus the op's own declared Context, no registry consult — so it is ported verbatim from charly/planrun_adapter.go's opInContext/opEffectiveContexts.

func OpInContext

func OpInContext(c *spec.Op, ctx spec.ExecContext) bool

OpInContext reports whether the op runs in ctx, by the same rule as OpEffectiveContexts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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