Skip to main content

anvilcore

A Cordis-style plugin kernel for Python long-running processes.

Attribution: anvilcore is an independent Python implementation of the Cordis kernel semantics (@cordiverse/cordis 4.0.4). Not affiliated with or endorsed by the cordiverse project.

Rename note: this package was previously developed as plugin_kernel inside agent-capability-forge and renamed anvilcore before open-sourcing.

Every side effect a capability introduces — a tool entry, an event listener, a background task — must hand over its own disposer at registration time and live inside a container that dies with the capability. Uninstalling therefore leaves no residue, and a failed install rolls back the effects it already collected.

Examples

Run any of them directly — each is standalone and prints what it proves:

file demonstrates
examples/context_and_services.py Context attribute reads, extend/isolate, scoped tenancy, teardown
examples/event_bus.py five dispatch modes (emit/parallel/serial/bail/waterfall), scope filtering
examples/capability_lifecycle.py install -> unload -> reinstall with zero residue (needs agentscope)
examples/epoch_reload_and_hot_config.py dependency auto-reload and schema-validated config hot update
examples/webhook_verifier.py best-practice business plugin: HMAC webhook verification + secret rotation (needs agentscope)

Start with context_and_services.py, then capability_lifecycle.py.

The core runs on the standard library alone; the two AgentScope integration examples additionally need pip install agentscope.

Usage

from anvilcore import CapabilityDescriptor, PluginManager

manager = PluginManager()

manager.register(CapabilityDescriptor(
    id="my-capability",
    version="1",
    factory=MyCapability,            # sync factory -> instance with install()/dispose
    dependencies=("other-capability",),
))

await manager.install("my-capability")   # dependency-first install order
await manager.unload("my-capability")    # cascades to dependents only in the right order

A capability's install() registers host resources through scope.effect(label, publish), where publish(collect) calls collect(name, disposer) for every resource it creates. That pairing — register and give up the way to undo it in the same moment — is the core invariant of the whole design.

Semantics

  • dependency-first install order; unloading a provider with active dependents is rejected
  • failed install rolls back the collected prefix of effects, then re-raises
  • unload is idempotent; reinstall creates a fresh generation
  • every effect is owned by exactly one scope; owner disposal reclaims it

The semantic baseline is the Cordis kernel (cordiverse/cordis, TypeScript), ported to Python with documented, deliberate divergences (sequential in-batch teardown, no HMR file watching).

Status

0.1.0. Consumers: agent-capability-forge (forge pipeline + pilot). The kernel itself has zero runtime dependencies.

Metadata

Release files for anvilcore 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anvilcore 0.1.0
File Size Uploaded Provenance Actions
anvilcore-0.1.0.tar.gz 22.3 kB With provenance Details for anvilcore-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anvilcore 0.1.0
File Interpreter ABI Platform Actions
anvilcore-0.1.0-py3-none-any.whl Python 3 none any Details for anvilcore-0.1.0-py3-none-any.whl

Total release size: 48.1 kB

Release files / anvilcore-0.1.0.tar.gz

Download URL anvilcore-0.1.0.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
228fd43c52b5b0a2c15b9a2eee1c595c74ac0bdf52c5492ac2bb17aa5d8c641c
BLAKE2b-256 checksum
How to use checksums
dc463b595d7cfe4b0b483cb8cb1918cf284ad983e339de2f1a926203c07c24db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / anvilcore-0.1.0-py3-none-any.whl

Download URL anvilcore-0.1.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0600dc68c7807535ebceb3f87eba5660f19094d3da6516f7b3637a9630b69686
BLAKE2b-256 checksum
How to use checksums
526cf9f9a30a70e3d97ddc3679192d0dade9b383c2940ee717d7d35accfdd996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for anvilcore 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anvilcore-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page