Repository navigation
chassis-harness 0.6.0
pip install chassis-harness==0.6.0- Documentation: https://andreolli-davide.github.io/chassis/
- PyPI: https://pypi.org/project/chassis-harness/0.6.0/
Makes composition transactional and generation-safe: identity-keyed
registrations, exact capability contract binding, runtime enforcement of
composition visibility, deeply immutable published state, transactional
AgentSpec materialization and declarative configuration, and validated
composition-tree ownership, paths, and names. Every change that can break a
caller from 0.5.1 is listed in
migrations.
Fixed
- Tool and agent registrations are keyed by identity (roadmap R006). Every
registration now carries an immutable registration id, with name indexes
maintained separately from the store, so old and new generations can reference
same-named registrations concurrently and each generation's tool view selects
the registrations owned by its own instances. Cleanup is identity-checked: an
old scope closing can never unregister its successor, in either release order,
and hot replacement of same-named tools and runtimes works while an old run
remains leased (the leased run keeps the objects it resolved). - Migration note: a duplicate tool name is no longer rejected at
registration; a candidate generation that would expose two same-named tools is
rejected at publication withConfigurationErrorand rolled back. Agent
runtime names stay explicitly unique unlessreplace=True.
ToolRegistry.unregister/AgentRegistry.unregistergained keyword-only
owner_id/scope_idfilters so a plugin's early unregister touches only its
own registration. - Requirements bind the exact selected capability contract (roadmap R007).
RequirementResolutionnow carries the selected contract key
(provider_key) alongside the provider identity and version, and
materialization filters registrations with the original requirement
predicate instead of selecting by capability name and provider instance —
registration order and random ids no longer decide which registration a
consumer gets (snapshot and registry ordering are insertion-stable).
Application provisions are keyed by the fullCapabilityKey, sodatabase@1
anddatabase@2provisions coexist. Contract-generation inference from a
specifier now proves a single major before pinning:>1.9,<3,>=1, and
similar open or multi-major ranges stay generation-neutral instead of being
pinned to the lower-bound major.PluginManifest.providesaccepts a sequence
of versions for multi-contract providers. - Migration note: a requirement like
>=2no longer pins@2; pass an
explicitapi_versionwhen a specific contract generation is required.
Harness.provide/withdraware keyed byCapabilityKey;withdrawwith a
name removes every contract generation of that name.PluginManifest.provides
values may now bestr | tuple[str, ...]. - AgentSpec composition visibility is enforced at runtime (roadmap R008).
Runs now receive a capability snapshot filtered by the acquired
ResolvedScope.visibleregistrations, soHarnessRunContext.require_capability()
and graph build-time capability versions observe exactly the composed view:
hidden, narrowed, and sibling-local capabilities are invisible in both the
invoke and stream paths, while inherited and versioned ones resolve as
composed. This is isolation of composition, not security authorization. An
unknown scope path is now rejected withConfigurationErrorinstead of
silently exposing an empty tool view (Harness.scoped_capabilitiesis new). - Migration note: run code that reached capabilities outside its agent's
composition view will now raiseCapabilityNotFound/CapabilityVersionMismatch;
widen the spec'scapabilitiesview where that access is intended. Lookups
against an undeclared scope path raise instead of returning empty results. - Published state is deeply immutable (roadmap R009). Recursive
copy-and-freeze now applies at every publication boundary — plugin config and
manifest metadata, scopes and resolved scopes, generation metadata, capability
and tool registrations,ToolPolicy, run metadata (AgentRequest,
AgentResult,HarnessRunContext), and runtime snapshots — so nested mutation
of any published container raisesTypeErrorand author-owned dicts, lists,
and sets can never alias published state. Semantic fingerprints are computed
from exactly the frozen state a generation exposes. The intentional exception
is documented: executable provider and tool objects are live runtime objects —
their contracts and metadata are frozen, not their internals. - Migration note: code that mutated nested containers obtained from
entry.config,manifest.metadata,scope.metadata,generation.metadata,
registration/tool metadata,ToolPolicy.metadata, run metadata, or snapshot
metadata must mutate its own copies instead; published containers now raise at
every depth. - AgentSpec materialization is transactional and owner-safe (roadmap R010).
Contributions are staged and validated before any desired state is mutated,
and a failed materialization restores the exact previous scope and registry
state — including entries a replacement had swapped. A revision that moves to
a new scope withdraws the old one only after the new one materialized, so a
failed replacement never destroys the active revision.installnow refuses
to take over a pre-existing user-owned composition scope instead of rewriting
it, an agent-owned entry id squatted by a foreign entry is rejected, reserved
metadata keys (chassis.agent,chassis.agent_revision) are rejected at
AgentSpecconstruction, and withdrawal removes only the state a revision
owns. - Migration note: code that pointed an
AgentSpec.scopeat an existing
user-owned scope relied on implicit takeover; declare the agent's own scope
(the default/agents/<name>), or empty the user scope first. Specs carrying
reserved metadata keys now fail construction. - Declarative configuration applies atomically (roadmap R011). The complete
configuration is parsed, migrated, validated, and catalog-resolved before any
desired state is mutated; entries, config-owned preferences, and the stored
config commit as one transaction, and a failure (unknown plugin, invalid
preference, or a failing entry change) restores the exact previous state
including partial removals. Unsupported schema versions are rejected by an
explicit migration dispatcher (and byHarnessConfigitself), config-owned
provider preferences are replaced wholesale on every application, and
programmaticprefer_providerpreferences are stored separately and take
precedence over config-owned ones with the same key. - Migration note: a re-applied configuration now replaces its provider
preferences — a preference omitted from the new document no longer lingers
(re-declare it, or set it programmatically withprefer_provider, which now
outranks the document). Configurations with a schemaversionother than1
are rejected instead of being accepted silently. - Composition-tree ownership and naming are validated (roadmap R012). A
parent scope belonging to anotherCompositionTreeis rejected, and every
tree/AgentSpec/harness API accepts the same canonical absolute scope paths (no relative forms, empty or untrimmed segments,./.., or trailing
slashes) via one sharedchassis.core.paths.canonical_scope_path. Whitespace- only or untrimmed capability, permission, catalog, entry, and agent-runtime
names are rejected, and config/manifest schema versions must be non-negative. - Migration note: non-canonical scope paths (relative,
"//"-containing,
untrimmed, or trailing-slash forms) and whitespace-padded names that were
previously accepted silently now raiseConfigurationError; trim and
canonicalize before calling. Negativeconfig_versionvalues are rejected.