--- id: PMEM-WP-0008 type: workplan title: "Profile-Driven Runtime Configuration" domain: markitect repo: phase-memory status: finished owner: codex topic_slug: phase-memory created: "2026-05-18" updated: "2026-05-18" state_hub_workstream_id: "c41f1d67-c4da-4372-b943-b9ea32d9ff4c" --- # PMEM-WP-0008: Profile-Driven Runtime Configuration ## Goal Turn Markitect-compatible memory profile metadata into concrete local runtime configuration, then resolve that configuration into adapter instances without silently pretending external adapters exist. This advances the scorecard rows for profile contract ingress, profile execution planning, service readiness, and developer experience. ## Current Evidence PMEM-WP-0007 added `RuntimeConfig`, local service contracts, health reports, and conformance helpers. The remaining gap was that `runtime_from_config` returned a default in-memory runtime regardless of config content, so profiles could not drive local file-backed runtime construction. ## Non-Goals - Build live Markitect, Kontextual, telemetry, or external policy adapters. - Add framework-specific HTTP service bindings. - Change runtime envelope schemas. ## Implementation Update - 2026-05-18 Implemented the first profile-driven runtime configuration slice: - Added `RuntimeConfig.from_profile(...)` for Markitect-compatible profile mapping and `ProfileIntent` inputs. - Added adapter mode normalization for the local aliases already used in fixtures, including `local-graph-store`, `local-event-log`, and `markitect-context-package`. - Added `RuntimeAdapterBundle` and `resolve_runtime_adapters(...)`. - Updated `runtime_from_config(...)` and `LocalServiceRunner` to use adapter resolution. - Wired local file-backed graph stores, JSONL event logs, JSONL audit sinks, in-memory semantic indexes, and in-memory runtime registries. - Added diagnostics that block unresolved external adapters instead of falling back silently. - Added regression tests and service readiness docs. ## T01 - Derive runtime config from profiles ```task id: PMEM-WP-0008-T01 status: done priority: high state_hub_task_id: "ee84e24c-0014-418d-9b10-8c65dfea9a89" ``` Map profile stores, policy, activation, observability, and runtime metadata into `RuntimeConfig`. ## T02 - Normalize local adapter aliases ```task id: PMEM-WP-0008-T02 status: done priority: medium state_hub_task_id: "a90aecac-9d88-44b7-a960-9878db1f8ee8" ``` Support fixture-compatible aliases such as `local-graph-store`, `local-event-log`, and `markitect-context-package`. ## T03 - Resolve config to local adapters ```task id: PMEM-WP-0008-T03 status: done priority: high state_hub_task_id: "a13d2b1a-af39-4ec8-9064-bce78736c79b" ``` Materialize supported local adapter modes into concrete adapter instances and return a reusable adapter bundle. ## T04 - Block unresolved external adapters ```task id: PMEM-WP-0008-T04 status: done priority: high state_hub_task_id: "58970721-2cca-4735-9997-33ed5fe808b0" ``` Emit diagnostics and prevent runtime construction when a profile or config declares an external adapter that the caller did not provide. ## T05 - Add regression tests and docs ```task id: PMEM-WP-0008-T05 status: done priority: medium state_hub_task_id: "b7298161-e096-4009-92da-02b92558fadf" ``` Cover file-backed profile-driven resolution, missing external adapter diagnostics, and document the supported first-slice adapter modes. ## Acceptance Criteria - A profile can configure a file-backed local runtime. - Adapter resolution is deterministic and inspectable. - External adapter modes cannot silently degrade to local allow-all behavior. - Tests cover success and failure paths. ## Closure Review - 2026-05-18 Closed after adding profile-derived runtime config, adapter bundles, local resolver tests, and service readiness documentation.