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.2.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.2.0
File Size Uploaded Provenance Actions
anvilcore-0.2.0.tar.gz 23.1 kB With provenance Details for anvilcore-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 49.9 kB

Release files / anvilcore-0.2.0.tar.gz

Download URL anvilcore-0.2.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
37ebb09edbcac66c8eb873c4e6cf5afe164eda9b04f336cf0e5719190dfe74cd
BLAKE2b-256 checksum
How to use checksums
8791fcb3078f5086a34843be32bc4ff85729ed2fd4ae3cb594255b55ed976480
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 30, 2026.

Transparency log

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

Download URL anvilcore-0.2.0-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
604be05d936690107a5f3f16cc9d709d3e977c7cea83f5bfc1f1ba2f01e91187
BLAKE2b-256 checksum
How to use checksums
c51389968667fd4a7f963407ad3442282d621ec2cfeaa1d261d0632bd577f4c7
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 30, 2026.

Transparency log

Security for anvilcore 0.2.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.2.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 30, 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