Skip to content

chassis-harness 0.6.0

Choose a tag to compare

@andreolli-davide andreolli-davide released this 22 Sep 09:54
· 71 commits to main since this release
pip install 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 with ConfigurationError and rolled back. Agent
    runtime names stay explicitly unique unless replace=True.
    ToolRegistry.unregister/AgentRegistry.unregister gained keyword-only
    owner_id/scope_id filters so a plugin's early unregister touches only its
    own registration.
  • Requirements bind the exact selected capability contract (roadmap R007).
    RequirementResolution now 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 full CapabilityKey, so database@1
    and database@2 provisions 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.provides accepts a sequence
    of versions for multi-contract providers.
  • Migration note: a requirement like >=2 no longer pins @2; pass an
    explicit api_version when a specific contract generation is required.
    Harness.provide/withdraw are keyed by CapabilityKey; withdraw with a
    name removes every contract generation of that name. PluginManifest.provides
    values may now be str | tuple[str, ...].
  • AgentSpec composition visibility is enforced at runtime (roadmap R008).
    Runs now receive a capability snapshot filtered by the acquired
    ResolvedScope.visible registrations, so HarnessRunContext.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 with ConfigurationError instead of
    silently exposing an empty tool view (Harness.scoped_capabilities is new).
  • Migration note: run code that reached capabilities outside its agent's
    composition view will now raise CapabilityNotFound/CapabilityVersionMismatch;
    widen the spec's capabilities view 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 raises TypeError and 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. install now 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
    AgentSpec construction, and withdrawal removes only the state a revision
    owns.
  • Migration note: code that pointed an AgentSpec.scope at 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 by HarnessConfig itself), config-owned
    provider preferences are replaced wholesale on every application, and
    programmatic prefer_provider preferences 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 with prefer_provider, which now
    outranks the document). Configurations with a schema version other than 1
    are rejected instead of being accepted silently.
  • Composition-tree ownership and naming are validated (roadmap R012). A
    parent scope belonging to another CompositionTree is 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 shared chassis.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 raise ConfigurationError; trim and
    canonicalize before calling. Negative config_version values are rejected.