Skip to content

Introduce Effect-based ACL for runtime resolution engine boundary#146

Open
danielbdyer wants to merge 1 commit into
mainfrom
codex/introduce-strict-acl-in-application-boundary
Open

Introduce Effect-based ACL for runtime resolution engine boundary#146
danielbdyer wants to merge 1 commit into
mainfrom
codex/introduce-strict-acl-in-application-boundary

Conversation

@danielbdyer
Copy link
Copy Markdown
Owner

Motivation

  • Enforce a strict ACL at the application/runtime boundary so lib/application only consumes Effect-based ports and typed TesseractError failures instead of dynamically importing or awaiting Promises directly.
  • Prevent runtime coupling and implicit dynamic imports from application code, making engine selection injectable and testable via dependency injection.
  • Normalize runtime failures into domain TesseractError variants before they cross into application code to preserve typed error semantics.

Description

  • Added a new application port ResolutionEngineResolver and its port interface in lib/application/ports.ts so the application resolves engines via an Effect service instead of dynamic import.
  • Refactored lib/application/resolution-engine.ts to require an explicit engine registry input and to return Effect.Effect<ResolutionEngine, TesseractError> for resolution checks and capability validation (no synchronous throws).
  • Updated scenario interpretation to use the injected resolver (yield* ResolutionEngineResolver.resolve(...)) in lib/application/execution/interpret.ts so the application consumes only Effect-based resolution.
  • Introduced a deterministic Effect adapter deterministicResolutionEngine in lib/runtime/agent/index.ts that exposes resolveStep as an Effect and normalizes runtime failures via toTesseractError before returning to the application boundary.
  • Added a typed runtime adapter interface in lib/runtime/agent/types.ts and adjusted the local runner bridging to call Effect.runPromise(...) when the runtime must execute Promise-based internals (lib/composition/local-runtime-scenario-runner.ts).
  • Wired the new resolver into composition layers and local service context (lib/composition/local-services.ts, lib/composition/layers.ts) and exported the deterministic adapter for composition injection (lib/runtime/agent.ts).
  • Updated contract tests to exercise the Effect-based resolver contract and mode parity across diagnostic vs dry-run headless modes (tests/resolution-engine-contract.spec.ts).

Testing

  • Ran npm test -- tests/resolution-engine-contract.spec.ts; the suite passed (3 tests passed).
  • Ran npm run types (build + type projection); the type build completed successfully with build ok and generated projections.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant