Skip to main content

plm-engine-core

TracePulse PLM Engine Core package. Lives next to plm-shared in the monorepo; shipped editable for Wave 1 (pip install -e ../plm-engine-core), internal PyPI publication deferred to Wave 5.

US-CR.1 ships this package as empty scaffolding. Every other US-CR.* story in FTR-607 lands its implementation inside the two sub-packages declared here, on top of contracts published by plm-shared (US-W1.0).

Internal layout

Sub-package Owns Stories landing here
control_plane/ governance, autonomy, HITL, run lifecycle, trace propagation CR.0, CR.3, CR.4, CR.5, CR.6, CR.10, CR.13
agent_runtime/ selector, dispatcher, retry, escalation CR.10, CR.11

The split implements target architecture invariant #5 — execution separated from expertise — and decision D-LOCKED-13. The physical repo split is deferred to V1.1; Wave 1 delivers the logical boundary.

One-way import contract

control_plane  ─────►  plm_shared.*       (frozen contracts)
agent_runtime  ─────►  plm_shared.*       (frozen contracts)
agent_runtime  ─────►  control_plane      (asks for verdicts)
control_plane  ──╳──►  agent_runtime      (FORBIDDEN)
plm_engine_core ─╳──►  plm_accelerators   (FORBIDDEN)

control_plane decides what is allowed; agent_runtime asks how do I run this. Reversing the dependency (control_plane reading runtime state) couples policy to execution and breaks the V1.1 repo split. plm-engine-core MUST NOT import from the Workbench / Accelerators package; reversing this absorption would dissolve the platform / product-line boundary (anti-pattern #8).

Mechanical enforcement (US-CR.2 / Conv F sub-story 3): two import-linter contracts in pyproject.toml fail CI on any violation:

Contract Source Forbidden
control_plane-must-not-depend-on-agent_runtime plm_engine_core.control_plane plm_engine_core.agent_runtime
plm_engine_core-must-not-depend-on-workbench plm_engine_core plm_accelerators

if TYPE_CHECKING: imports across the boundary are blocked by default (CR.2 AC-6) — TYPE_CHECKING leakage is the most common way the boundary erodes silently. tests/ lives outside the package and is naturally excluded.

The CR.1-era by-convention guard in tests/test_imports.py STAYS alongside the mechanical contract. Both fire if either rule trips — belt-and-braces protection if the linter contract has to be relaxed for a transient reason.

Negative-fixture toggling test

A permanent sandbox lives at plm_engine_core/control_plane/_lint_fixtures/violation_demo.py. The tests/test_import_linter.py::test_negative_fixture_trips_* tests (gated by RUN_LINTER_NEGATIVE=1) materialise a temporary sibling file with an offending import, run lint-imports, assert the contract trips with the right name + file:line, then delete the temp file and verify the clean state passes again. Run with:

RUN_LINTER_NEGATIVE=1 pytest tests/test_import_linter.py -v

Exemption process

Genuine exceptions go through an ADR signed off by the architecture team. ADRs live under docs/adr/. Each ADR records the contract relaxed, the scope of the relaxation (typically a specific ignore_imports entry on one contract), the rationale, and the cross-link to D-LOCKED-13 + invariant #5. The contract / ignore_imports edit MUST cite the ADR file path in a comment so a future reader finds the authority for the exemption.

Known limitations

  • Transitive imports via plm-shared are not caught (CR.2 §9 + Edge cases). A control_plane file importing a plm-shared helper that itself transitively imports agent_runtime is invisible to the contract. Intentional — limits blast radius of a single PR's contract scope.
  • Dynamic imports (importlib, string-based) are not caught. Static analysis only.
  • The contracts are scoped to plm-engine-core. Cross-product- line contracts (e.g. agent_runtime → connectors, agent_runtime → workbench) land with Epic 6 / Epic 8.

with_system_identity allowlist (CR.2 Decision #24)

plm_engine_core.control_plane.identity.with_system_identity is a context manager that binds an actor_kind="system" identity for in-process callers without an inbound JWT (cron, BackgroundTask, GC). It bypasses JWT validation by design and MUST NOT be invoked from arbitrary call sites.

The path-based BL6 guardrail in 02_App/backend/scripts/architecture_guardrails.py restricts the importer set. Initial allowlist:

  • plm_engine_core/control_plane/identity/system_identity.py — defining module.
  • plm_engine_core/control_plane/identity/__init__.py — re-export site.
  • plm_engine_core/cli/ — plm-cli future subcommands may bind a system identity for offline operations.
  • tests/ — fixtures may import freely.

Adding a new module to the allowlist requires an ADR.

Install (developer)

cd 02_App/backend
pip install -e ../plm-engine-core

The editable install puts plm_engine_core.* on the sys.path of the backend venv. Like plm-shared, pip install MUST run from 02_App/backend/ because pip resolves -e ../plm-engine-core relative to the invocation CWD.

Tests

cd 02_App/plm-engine-core
python -m pytest tests/ -v

The smoke test verifies:

  • Both sub-packages import cleanly.
  • __all__ placeholders match the documented public surface.
  • No control_plane module imports from agent_runtime (one-way contract guard, AC-10).
  • No business logic has snuck in beyond __init__.py files (AC-9 scope-creep guard).

CI

.github/workflows/test.yml runs a plm-engine-core-tests job mirroring plm-shared-tests — editable-install + pytest on every push to main / FTR575-Codebase-Split and on every PR touching 02_App/**.

Status

  • US-CR.1: scaffold (Conv E close 822c415). Ships placeholders only.
  • US-CR.0 (Wave 1 Conv E + Conv F): IdentityMiddleware, Hs256JwtIdentityProvider, with_system_identity, audit_log migration 0013, and plm-cli auth issue-token all land. 16/16 ACs covered; story closed Conv F (3/3 PRs).
  • US-CR.2 (Wave 1 Conv F): two import-linter Forbidden contracts + permanent negative-fixture toggling test + BL6 path-based guardrail for with_system_identity + ADR exemption process.

Metadata

Release files for plm-engine-core 1.7.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 plm-engine-core 1.7.0
File Size Uploaded Provenance Actions
plm_engine_core-1.7.0.tar.gz 562.1 kB With provenance Details for plm_engine_core-1.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plm-engine-core 1.7.0
File Interpreter ABI Platform Actions
plm_engine_core-1.7.0-py3-none-any.whl Python 3 none any Details for plm_engine_core-1.7.0-py3-none-any.whl

Total release size: 947.5 kB

Release files / plm_engine_core-1.7.0.tar.gz

Download URL plm_engine_core-1.7.0.tar.gz
Size 562.1 kB
Tags Source
SHA-256 checksum
How to use checksums
79549f30c70c33a6f055090eb5e6f43fec7061273d12ff011a57fe1fafa58179
BLAKE2b-256 checksum
How to use checksums
2434acee6f6ce8ea1a24621c375090a23d6e768ee050cb66177cffdcc29ffcc0
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 Oct 6, 2026.

Transparency log

Release files / plm_engine_core-1.7.0-py3-none-any.whl

Download URL plm_engine_core-1.7.0-py3-none-any.whl
Size 385.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02b2bff3e01deaa54272fc7489d142408df6adffc4a73a3f03bb0a60577ef7d0
BLAKE2b-256 checksum
How to use checksums
5faefc4ecaf4b10d6778880e6a22735cbf7fc463d12326d938b5e272a51b7156
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 Oct 6, 2026.

Transparency log

Security for plm-engine-core 1.7.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 plm_engine_core-1.7.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 Oct 6, 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