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 #5execution 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.

Download files

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

Source Distribution

plm_engine_core-1.1.0.tar.gz (222.4 kB view details)

Uploaded Source

Built Distribution

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

plm_engine_core-1.1.0-py3-none-any.whl (192.9 kB view details)

Uploaded Python 3

File details

Details for the file plm_engine_core-1.1.0.tar.gz.

File metadata

  • Download URL: plm_engine_core-1.1.0.tar.gz
  • Upload date:
  • Size: 222.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plm_engine_core-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a30e2e5f28fe0f044ee0329de37f1d4c7bbb4528d2130525445ca460aa31233d
MD5 22edd2c84ec7169fec88c95d502c5686
BLAKE2b-256 dc1910373a153a53cd44b5c671097f57daf8954f2d01a5ce1d3feb356c61390b

See more details on using hashes here.

Provenance

The following attestation bundles were made for plm_engine_core-1.1.0.tar.gz:

Publisher: release-please.yml on plm-engine/plm-engine-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 plm_engine_core-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: plm_engine_core-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 192.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plm_engine_core-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39146347cbb2365d5001f2a3838a7fd32d9a46868ff57b711c84c0316e0e8839
MD5 3a9c418337acf0ae8c3251a8a26511f2
BLAKE2b-256 aae786d5a22ef35913c8b22f0dca038073801e125d6a32ff6c0074f4c0f9ed91

See more details on using hashes here.

Provenance

The following attestation bundles were made for plm_engine_core-1.1.0-py3-none-any.whl:

Publisher: release-please.yml on plm-engine/plm-engine-core

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

Release history Release notifications | RSS feed

1.6.0

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

This release

1.1.0 This release

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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