Add profile-driven runtime adapter resolution

This commit is contained in:
2026-05-18 20:53:16 +02:00
parent 850979ccf1
commit b36a935f48
6 changed files with 618 additions and 19 deletions

View File

@@ -44,22 +44,22 @@ not what adjacent repositories may already provide.
## Current Baseline - 2026-05-18
Overall maturity: **4.2 / 5**
Overall maturity: **4.3 / 5**
The repo has crossed from intent-only into a working deterministic library
foundation, a usable local runtime facade, a CLI, a file-backed local
workspace, first-slice policy/review/audit gates, a concrete Markitect package
bridge, deterministic activation quality helpers, and first-slice service
readiness contracts.
readiness contracts with profile-driven runtime adapter resolution.
| Dimension | Current | Target | Evidence | Needed Next |
| --- | ---: | ---: | --- | --- |
| Intent and boundaries | 4.0 | 5.0 | `INTENT.md`, `SCOPE.md`, `README.md`, architecture doc, PMEM-WP-0001 closure | Keep boundaries current as runtime behavior expands. |
| Package foundation | 4.0 | 4.0 | Python package, exports, runtime facade, CLI entrypoint, config, service contracts, dependency-light tests | Maintain public API compatibility as adapters expand. |
| Profile contract ingress | 2.5 | 4.0 | Markitect-compatible profile loading, diagnostics, runtime envelopes | Add profile-driven runtime configuration and richer compatibility coverage. |
| Profile contract ingress | 3.2 | 4.0 | Markitect-compatible profile loading, diagnostics, runtime envelopes, profile-derived runtime config, local adapter alias normalization | Add richer compatibility coverage. |
| Graph/event contract ingress | 3.5 | 4.0 | Graph loading, edge endpoint diagnostics, event model, JSONL event log, export, repair diagnostics, service import/export contracts | Add broader external adapter fixtures. |
| Phase domain model | 3.0 | 4.0 | Phases, memory kinds, lifecycle states, actions, explicit path records | Add profile-driven transition rule evaluation and migration semantics. |
| Profile execution planning | 3.5 | 4.0 | Adapter plan, capabilities, policy gates, fallback behavior, CLI output, snapshot fixture, service contract | Add external config-driven adapter resolution. |
| Profile execution planning | 3.8 | 4.0 | Adapter plan, capabilities, policy gates, fallback behavior, CLI output, snapshot fixture, service contract, config-driven local adapter resolution | Add external adapter injection coverage. |
| Lifecycle planning | 3.0 | 4.0 | Transition, retention, refresh, compaction dry-run plans, review-gated local apply | Add profile-driven rule evaluation and service apply contracts. |
| Activation planning | 3.8 | 5.0 | Budgeted selection, Markitect-compatible selection output, package request envelope, graph neighborhoods, event paths, ranking, metadata preservation, metrics | Add semantic-index adapters and broader evaluation corpora. |
| Local persistence | 3.0 | 4.0 | Versioned local workspace, file-backed graph store, JSONL event log, JSONL audit sink | Add migration/repair utilities and stronger durability semantics. |
@@ -67,9 +67,9 @@ readiness contracts.
| Observability and diagnostics | 3.5 | 4.0 | Planner diagnostics, runtime diagnostics, event log corruption checks, repair diagnostics, policy denial diagnostics, health envelopes, adapter status | Add production telemetry adapters. |
| Markitect interop | 3.5 | 4.0 | Compatible contract ingress, optional validation boundary, enriched selection metadata, package request/response envelopes | Add live optional Markitect compiler adapter when available. |
| Kontextual/Infospace interop | 2.5 | 4.0 | Boundaries documented, small derived fixtures, activation quality report fixture, Kontextual delegation envelope | Add live fake/real delegation adapters and broader Infospace reports. |
| Testing and evaluation | 4.0 | 4.0 | 51 deterministic tests over planners, adapters, runtime envelopes, CLI, snapshots, file-store round trips, apply denial, review records, audit schema, policy redaction, Markitect bridge fixtures, retrieval, activation metrics, service contracts, config, health, and conformance | Add broader evaluation corpora. |
| Service readiness | 3.5 | 4.0 | Runtime ports, service contracts, config model, health checks, local service runner, adapter conformance helpers | Add framework-specific bindings and production adapter packs. |
| Developer experience | 3.3 | 4.0 | README quick start, package map, runtime facade docs, CLI examples, local persistence guide | Add troubleshooting and richer examples. |
| Testing and evaluation | 4.0 | 4.0 | 54 deterministic tests over planners, adapters, runtime envelopes, CLI, snapshots, file-store round trips, apply denial, review records, audit schema, policy redaction, Markitect bridge fixtures, retrieval, activation metrics, service contracts, config, health, conformance, and adapter resolution | Add broader evaluation corpora. |
| Service readiness | 3.8 | 4.0 | Runtime ports, service contracts, config model, profile-derived adapter resolution, health checks, local service runner, adapter conformance helpers | Add framework-specific bindings and production adapter packs. |
| Developer experience | 3.5 | 4.0 | README quick start, package map, runtime facade docs, CLI examples, local persistence guide, service adapter resolution docs | Add troubleshooting and richer examples. |
## Progress Update - PMEM-WP-0002
@@ -152,6 +152,27 @@ Remaining maturity blockers:
- Optional framework-specific service bindings.
- Production telemetry and audit retention integrations.
## Progress Update - PMEM-WP-0008
Closed on 2026-05-18:
- Added `RuntimeConfig.from_profile(...)` for Markitect-compatible profile
mappings and `ProfileIntent` inputs.
- Added adapter alias normalization for local graph stores, event logs, audit
sinks, package compilers, semantic indexes, and runtime registries.
- Added `RuntimeAdapterBundle` and `resolve_runtime_adapters(...)`.
- Updated `runtime_from_config(...)` and `LocalServiceRunner` to use resolved
adapters.
- Added diagnostics that block unresolved external adapters.
- Added tests and service readiness documentation for the resolver path.
Remaining maturity blockers:
- Live external adapter implementations.
- Broader evaluation corpora.
- Optional framework-specific service bindings.
- Production telemetry and audit retention integrations.
## Progress Update - PMEM-WP-0004
Closed on 2026-05-18:
@@ -215,6 +236,7 @@ flowchart TD
WP5["PMEM-WP-0005\nMarkitect package bridge"]
WP6["PMEM-WP-0006\nRetrieval and activation quality"]
WP7["PMEM-WP-0007\nService readiness and adapters"]
WP8["PMEM-WP-0008\nProfile-driven runtime config"]
WP1 --> WP2
WP2 --> WP3
@@ -227,6 +249,9 @@ flowchart TD
WP4 --> WP7
WP5 --> WP7
WP6 --> WP7
WP3 --> WP8
WP5 --> WP8
WP7 --> WP8
```
## Next Tracking Cadence

View File

@@ -0,0 +1,121 @@
---
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"
---
# 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
```
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
```
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
```
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
```
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
```
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.