anvilcore
A Cordis-style plugin kernel for Python long-running processes.
Attribution: anvilcore is an independent Python implementation of the Cordis kernel semantics (
@cordiverse/cordis4.0.4). Not affiliated with or endorsed by the cordiverse project.
Rename note: this package was previously developed as
plugin_kernelinside agent-capability-forge and renamedanvilcorebefore 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anvilcore-0.2.1.tar.gz | 23.5 kB | With provenance | Details for anvilcore-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anvilcore-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for anvilcore-0.2.1-py3-none-any.whl |
Total release size: 50.8 kB
Release files / anvilcore-0.2.1.tar.gz
| Download URL | anvilcore-0.2.1.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c127c72d92063ab72d682d9508f5764beed2c0e39ff097506921bddefbe1e49
|
|
BLAKE2b-256 checksum How to use checksums |
19b58b6dd1f19f1f2187e907f218a26115d6bb5c131b4bef75077650d00a03cb
|
| 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 logRelease files / anvilcore-0.2.1-py3-none-any.whl
| Download URL | anvilcore-0.2.1-py3-none-any.whl |
|---|---|
| Size | 27.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2eeccb125681e00930d573d2d1c98f68502bbbc9929ca0973a06eaa8620e848e
|
|
BLAKE2b-256 checksum How to use checksums |
e58c9ab2c3a5879cbe97faf4e37e1d6da91d15fa29d6cc5dc873329889be9749
|
| 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 logSecurity for anvilcore 0.2.1
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.
Attestation for anvilcore-0.2.1.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 logA 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.