Add service readiness contracts

This commit is contained in:
2026-05-18 20:33:45 +02:00
parent 1efb7d4c13
commit 2a4301d22f
7 changed files with 437 additions and 20 deletions

View File

@@ -4,7 +4,7 @@ type: workplan
title: "Service Readiness And External Adapters"
domain: markitect
repo: phase-memory
status: proposed
status: finished
owner: phase-memory
topic_slug: service-readiness
planning_priority: P2
@@ -48,11 +48,40 @@ tests, runtime configuration, health checks, or deployment guidance.
- Do not add operational complexity before PMEM-WP-0002 through PMEM-WP-0006
stabilize.
## Implementation Update - 2026-05-18
The service-readiness and external-adapter slice is complete.
Implemented outputs:
- `phase_memory.service` defines service contract catalog, runtime config,
health reports, local service runner, adapter conformance helpers, and
Kontextual delegation envelopes.
- Service contracts cover profile planning, graph import, lifecycle planning,
lifecycle apply, activation planning, package compile handoff, audit query,
and health check.
- `RuntimeConfig` models local store path, adapter registry, policy mode,
audit sink mode, package compiler mode, semantic index mode, dry-run default,
and trust-zone labels.
- Health reports expose adapter availability, config diagnostics, stale memory
counts, pending review counts, and store counts.
- Adapter conformance helpers cover graph stores, event logs, context package
compilers, policy gateways, and audit sinks.
- `kontextual_delegation_envelope` documents the JSON boundary that avoids
circular imports while preserving ownership between phase-memory and
`kontextual-engine`.
- `docs/service-readiness.md` documents contracts, config, health,
conformance, delegation, and deployment modes.
Validation:
- `python3 -m pytest` -> 51 passed.
## T01 - Define runtime service API contracts
```task
id: PMEM-WP-0007-T01
status: todo
status: done
priority: high
state_hub_task_id: "48dc8e83-ff0f-4c25-b1c9-d94c3a2ac0eb"
```
@@ -74,7 +103,7 @@ Output: API contract docs and fixture request/response envelopes.
```task
id: PMEM-WP-0007-T02
status: todo
status: done
priority: high
state_hub_task_id: "da22d548-3123-46fc-acac-8bbcf8b54fb7"
```
@@ -95,7 +124,7 @@ Output: reusable test helpers that any external adapter must pass.
```task
id: PMEM-WP-0007-T03
status: todo
status: done
priority: high
state_hub_task_id: "2a0fc3d0-3dda-4c58-95de-3f70cf097ff1"
```
@@ -113,7 +142,7 @@ Output: adapter design note, envelope fixtures, and local fake adapter tests.
```task
id: PMEM-WP-0007-T04
status: todo
status: done
priority: medium
state_hub_task_id: "10934c46-db81-4a68-be4f-2ce95408d279"
```
@@ -128,7 +157,7 @@ clear installation extras if a framework is used.
```task
id: PMEM-WP-0007-T05
status: todo
status: done
priority: medium
state_hub_task_id: "a7129077-b736-4d69-94ab-d6921cd8ed15"
```
@@ -150,7 +179,7 @@ Output: config model, default local config, and validation diagnostics.
```task
id: PMEM-WP-0007-T06
status: todo
status: done
priority: medium
state_hub_task_id: "24ef8feb-90f8-454d-8c8f-7b3468454f57"
```
@@ -171,7 +200,7 @@ Output: health report helpers and tests.
```task
id: PMEM-WP-0007-T07
status: todo
status: done
priority: medium
state_hub_task_id: "89c8802c-f536-441b-a514-8d3e56b3c6e5"
```
@@ -193,3 +222,26 @@ Output: service-readiness guide and scorecard update.
- External adapters can be validated with reusable conformance tests.
- Local library and CLI use remain first-class.
- The Kontextual delegation boundary is explicit and avoids ownership drift.
## Closure Review - 2026-05-18
**Outcome:** All tasks completed.
### Completed
- PMEM-WP-0007-T01 - Define runtime service API contracts
- PMEM-WP-0007-T02 - Add adapter conformance tests
- PMEM-WP-0007-T03 - Add Kontextual delegation adapter design
- PMEM-WP-0007-T04 - Add optional service runner
- PMEM-WP-0007-T05 - Add runtime configuration model
- PMEM-WP-0007-T06 - Add observability and health diagnostics
- PMEM-WP-0007-T07 - Document deployment modes
### Cancelled
None.
### Carried Forward
Future work should focus on live external adapters, broader evaluation corpora,
and optional framework-specific service bindings.