refactor: extract actor + langgraph + templates into the new cleveractors library #11239

Open
freemo wants to merge 5 commits from feature/extract-cleveractors-library into master

5 Commits

Author SHA1 Message Date
controller-ci-rerun 3769c46486 chore: re-trigger CI [controller]
CI / typecheck (pull_request) Has been cancelled
CI / security (pull_request) Has been cancelled
CI / quality (pull_request) Has been cancelled
CI / unit_tests (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / helm (pull_request) Has been cancelled
CI / push-validation (pull_request) Has been cancelled
CI / lint (pull_request) Successful in 45s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 5s
2026-06-18 11:01:54 -04:00
HAL9000 2faf430a55 fix(ci): unstick PR-11239 CI infrastructure for the cleveractors extraction
CI / push-validation (pull_request) Successful in 35s
CI / helm (pull_request) Successful in 41s
CI / lint (pull_request) Successful in 50s
CI / build (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 1m35s
CI / typecheck (pull_request) Successful in 1m36s
CI / security (pull_request) Successful in 1m37s
CI / integration_tests (pull_request) Failing after 2m53s
CI / unit_tests (pull_request) Failing after 2h50m23s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
Five CI gates were failing for deterministic, structural reasons unrelated
to the extraction's correctness:

1. typecheck / security / quality / build jobs only installed `nodejs` in
   their container, not `git`. `uv pip install -e '.[dev]'` then crashed
   trying to fetch `cleveractors @ git+https://...` with "Git executable
   not found." Added `git` to the apt-get install line in all four jobs.

2. build job additionally failed because hatchling refuses to build a
   wheel whose `project.dependencies` carries a VCS URL unless
   `tool.hatch.metadata.allow-direct-references` is explicitly opted in.
   Added that section to pyproject.toml.

3. lint job hit 30 E501 line-too-long errors in the new PEP-562 re-export
   shims — the docstring template introduced by the extraction did not
   fit within the project's 88-char ruff limit for the longer module
   paths (`cleveragents.acms.uko.vocabulary_registry`,
   `cleveragents.domain.models.acms.detail_level`, etc.). Rewrapped the
   docstring in the 18 affected shim files.

4. typecheck — once unstuck — surfaced 64 real pyright errors. The
   PEP-562 `__getattr__` pattern is opaque to pyright in strict mode, so
   downstream `from cleveragents.X.Y.Z import A, B, C` callers saw
   `A/B/C` as unknown. Added `from cleveractors.X.Y.Z import *` to each
   of the 27 shim files (after the existing `import ... as _impl` line);
   `# noqa: F403` silences ruff's per-line check. The PEP-562 fallback
   is retained for any private-name access not covered by the star
   import, preserving the original backward-compatibility surface.

5. One residual pyright error remained: `langgraph/graph.py` instantiates
   `Node` (re-exported from `cleveractors.langgraph.nodes`) with
   `self.agents: dict[str, cleveragents.agents.base.Agent]`, but `Node`
   expects `dict[str, cleveractors.agents.base.Agent]`. The two classes
   are runtime-compatible; pyright sees them as distinct because
   `agents/base.py` is intentionally NOT part of this extraction's
   27-module scope. Added a single targeted `pyright: ignore` with an
   explanatory comment.

6. Vulture (under `security_scan` and `dead_code` sessions) flagged two
   imports in `domain/models/acms/crp.py` (`DetailLevelCycleError`,
   `DetailLevelError`) as unused. They are surfaced via `__all__` for
   the historic public API but vulture can no longer trace through the
   shim layer. Added both to `vulture_whitelist.py`.

Local verification (worktree at the PR head):
  - lint            PASS
  - typecheck       PASS  (0 errors, 30 warnings; warnings are
                           reportWildcardImportFromLibrary on the
                           star imports, plus 3 pre-existing optional
                           langchain provider warnings)
  - security_scan   PASS  (bandit, semgrep, vulture)
  - dead_code       PASS  (vulture)
  - complexity      PASS  (covers CI / quality)
  - build           PASS  (cleveragents-1.0.0-py3-none-any.whl built)

Unit / integration tests are not addressed here: the prior tier's
analysis identified 9 residual scenario failures (time-travel tests
in `consolidated_langgraph.feature` reading the migrated `history`
attribute, and 7 actor-loading error-message assertions where the
cleveractors-extracted equivalents emit slightly different messages).
Both categories are outside this 27-module extraction's scope and
require either a `.feature`-file update or a cleveractors-core
release re-pin — the reviewer should decide which path to take in a
follow-up.
2026-05-29 07:16:20 -04:00
controller-ci-rerun 630a865b67 chore: re-trigger CI [controller] 2026-05-29 07:12:22 -04:00
controller-ci-rerun babf64c403 chore: re-trigger CI [controller] 2026-05-29 07:12:22 -04:00
freemo 094af0efd1 refactor: depend on cleveractors-core; replace extracted modules with re-export shims
The actor schema, loader, compiler, role validation, Jinja2 template
engine, LangGraph node/edge/state data classes, LSP binding data
class, and ACMS UKO vocabularies have moved into the new
`cleveractors` library (cleveragents/cleveractors-core@d2d26f17). This
commit replaces 27 files in cleveragents-core with re-export shims so
every existing import path remains valid.

  pyproject.toml — adds the dep:
    cleveractors @ git+https://git.cleverthis.com/cleveragents/
      cleveractors-core@d2d26f17809810e056c178cad9cb8b9b1e1da61f

  Re-export shim pattern (PEP 562):

      import cleveractors.<X> as _impl

      def __getattr__(name): return getattr(_impl, name)
      def __dir__():         return dir(_impl)

  27 files shimmed: actor/{compiler,config,loader,role_validation,
  schema,utils,yaml_loader,yaml_template_engine}.py; langgraph/{nodes,
  state,pure_graph,dynamic_router,message_router,routing_adapter}.py;
  templates/{renderer,secure_renderer}.py; lsp/models.py; acms/index.py;
  acms/uko/{detail_level_maps,layer3_*,vocabular*}.py; domain/models/
  acms/detail_level.py.

  Untouched (deliberately stay in cleveragents-core): actor/{registry,
  v3_registry,reconciliation}.py (import cleveragents.application —
  would create a cyclic dep with the library); actor/__init__.py
  (lazy importer keeps working through shims); langgraph/{graph,
  bridge}.py (rx-coupled reactive); lsp/* runtime; agents/* runtime.

Class identity preserved end-to-end:

    from cleveragents.actor.compiler import compile_actor as a
    from cleveractors.actor.compiler import compile_actor as b
    assert a is b  # ✓

The shim approach means no edits to the 70+ test files in
features/steps/, benchmarks/, or any downstream consumers — every
existing `from cleveragents.X import Y` keeps working.
2026-05-29 07:12:22 -04:00