Skip to main content

ABDUCTIO MVP core engine

Project description

abductio-core

ABDUCTIO MVP core engine: deterministic scheduling, ledger updates, and a strict application boundary. You supply evaluator/decomposer/audit ports; the engine handles orchestration and invariant enforcement.

Project status: library-only (no CLI/API layer yet). See architecture.md and docs/white_paper.org for the spec.

Install

Requires Python 3.11+.

From PyPI:

pip install abductio-core

Optional OpenAI adapter dependency (used by abductio_core.adapters.openai_llm):

pip install abductio-core[e2e]

Local path install (for use inside another codebase):

pip install /path/to/abductio-core

Editable install for local development:

pip install -e /path/to/abductio-core

If you host this repo, you can also install directly from VCS:

pip install git+ssh://<your-host>/<org>/abductio-core.git

Quickstart

from dataclasses import dataclass, field
from typing import Any, Dict, List

from abductio_core import RootSpec, SessionConfig, SessionRequest, run_session
from abductio_core.application.ports import RunSessionDeps
from abductio_core.domain.audit import AuditEvent


@dataclass
class MemAudit:
    events: List[AuditEvent] = field(default_factory=list)

    def append(self, event: AuditEvent) -> None:
        self.events.append(event)


@dataclass
class NoChildrenDecomposer:
    def decompose(self, target_id: str) -> Dict[str, Any]:
        if ":" in target_id:
            return {"ok": True, "type": "AND", "coupling": 0.80, "children": []}
        return {"ok": True, "feasibility_statement": f"{target_id} feasible"}


@dataclass
class SimpleEvaluator:
    def evaluate(self, node_key: str) -> Dict[str, Any]:
        return {"p": 0.8, "A": 1, "B": 1, "C": 1, "D": 1, "evidence_refs": "ref1"}


request = SessionRequest(
    claim="Example claim",
    roots=[RootSpec("H1", "Mechanism A", "x")],
    config=SessionConfig(tau=0.70, epsilon=0.05, gamma=0.20, alpha=0.40),
    credits=5,
    required_slots=[{"slot_key": "feasibility", "role": "NEC"}],
)

result = run_session(
    request,
    RunSessionDeps(
        evaluator=SimpleEvaluator(),
        decomposer=NoChildrenDecomposer(),
        audit_sink=MemAudit(),
    ),
)

print(result)

API surface

Public imports from abductio_core:

  • RootSpec, SessionConfig, SessionRequest
  • SessionResult, StopReason
  • run_session, replay_session

Ports (implement in your app):

  • EvaluatorPort, DecomposerPort, AuditSinkPort
  • RunSessionDeps

Development

pytest

Release (PyPI)

Recommended: automated publish on tags via GitHub Actions + PyPI trusted publishing.

One-time setup (PyPI):

  1. Go to https://pypi.org/manage/account/publishing/
  2. Add a trusted publisher for Promise-Foundation/abductio-core
  3. Select workflow: .github/workflows/publish.yml

Release flow:

  1. Update version in pyproject.toml
  2. Ensure tests pass: pytest
  3. Commit changes
  4. Tag + push: git tag vX.Y.Z && git push --tags

The GitHub Action publishes the build to PyPI on tag push.

Helper script:

scripts/release.sh X.Y.Z
git push
git push --tags

Manual fallback:

python -m pip install --upgrade build twine
python -m build
twine upload dist/*

Token-based auth:

export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-<your-token>

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abductio_core-0.1.1.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abductio_core-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file abductio_core-0.1.1.tar.gz.

File metadata

  • Download URL: abductio_core-0.1.1.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for abductio_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a24eab1e6f09c4a19a049d87af8a9e259148c95416bccfd61f815e8aacb7be55
MD5 6b8df585845ead1a7bf7c45f8c2ca0f1
BLAKE2b-256 e222bbc2d26f3fe5611a97ce38d2fd8a551734cdb164bdec3e6db16777c51b51

See more details on using hashes here.

Provenance

The following attestation bundles were made for abductio_core-0.1.1.tar.gz:

Publisher: publish.yml on Promise-Foundation/abductio-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file abductio_core-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: abductio_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for abductio_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d0450eaca7a0c9978dead1fb5c97bf1b937adfc9791cdda85f0f73b3b5457be
MD5 5844e557e5b4a76f47526d30dfff2bba
BLAKE2b-256 2c2a40cfc4d9e47d29a7c24d75d88a27c48fec6bec6c666d1c3457d235adef77

See more details on using hashes here.

Provenance

The following attestation bundles were made for abductio_core-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Promise-Foundation/abductio-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page