|
| 1 | +# finance_saa memory integration status |
| 2 | + |
| 3 | +Date: 2026-04-24 |
| 4 | +Repository: `SocioProphet/memory-mesh` |
| 5 | + |
| 6 | +## Purpose |
| 7 | + |
| 8 | +This document records the current integration state of the `finance_saa` runtime work inside `memory-mesh`, including what is merged, what is tested, what remains unproven, and where the work should integrate next across the wider SocioProphet estate. |
| 9 | + |
| 10 | +## Current merged state |
| 11 | + |
| 12 | +`main` now contains the first memory-backed finance committee vertical slice: |
| 13 | + |
| 14 | +- `memoryd` runtime alignment toward the draft `memory.mesh.v1` contract. |
| 15 | +- `finance_saa` bootstrap runtime. |
| 16 | +- finance artifact persistence into `memoryd`. |
| 17 | +- finance session snapshot persistence. |
| 18 | +- snapshot-backed session recovery from `memoryd`. |
| 19 | +- runtime validation workflow. |
| 20 | +- focused finance source-of-truth test workflow. |
| 21 | + |
| 22 | +## Relevant merged PRs |
| 23 | + |
| 24 | +- PR #6 — draft `memory.mesh.v1` and `finance.saa.v1` contracts plus runtime alignment work. |
| 25 | +- PR #8 — finance source-of-truth remediation, moving finance session recovery toward snapshot-backed memory semantics. |
| 26 | +- PR #9 — runtime validation workflow for `memoryd` and `finance_saa`. |
| 27 | +- PR #10 — focused finance source-of-truth tests and dedicated test workflow. |
| 28 | + |
| 29 | +## Runtime surfaces now present |
| 30 | + |
| 31 | +### `memoryd` |
| 32 | + |
| 33 | +`memoryd` now exposes and/or supports the runtime semantics needed by the current bootstrap slice: |
| 34 | + |
| 35 | +- scoped `ScopeEnvelope` context |
| 36 | +- compiled workload configuration |
| 37 | +- `config_hash` support |
| 38 | +- local memory write IDs |
| 39 | +- typed memory events |
| 40 | +- workload/workspace-aware recall filtering |
| 41 | +- policy-gated raw event and relation recall access |
| 42 | + |
| 43 | +### `finance_saa` |
| 44 | + |
| 45 | +`finance_saa` currently provides an HTTP/FastAPI bootstrap service for: |
| 46 | + |
| 47 | +- session start |
| 48 | +- assumptions submit |
| 49 | +- proposal submit |
| 50 | +- proposal critique |
| 51 | +- risk check |
| 52 | +- vote record |
| 53 | +- decision select |
| 54 | + |
| 55 | +The service persists finance artifacts to `memoryd` and now persists `session_snapshot` artifacts after state mutations. On session lookup, it prefers snapshot-backed recovery from `memoryd` when `FINANCE_SAA_MEMORYD_SOURCE_OF_TRUTH=true`. |
| 56 | + |
| 57 | +## Validation surfaces now present |
| 58 | + |
| 59 | +### Runtime validation |
| 60 | + |
| 61 | +Workflow: `.github/workflows/validate-runtime.yml` |
| 62 | + |
| 63 | +Covers: |
| 64 | + |
| 65 | +- dependency installation for `memoryd` and `finance_saa` |
| 66 | +- Python module compilation for runtime services and scripts |
| 67 | +- upstream lock validation |
| 68 | +- deploy asset validation |
| 69 | + |
| 70 | +### Finance source-of-truth tests |
| 71 | + |
| 72 | +Workflow: `.github/workflows/test-finance-source-of-truth.yml` |
| 73 | + |
| 74 | +Covers: |
| 75 | + |
| 76 | +- snapshot round-trip via `build_session_snapshot()` and `hydrate_snapshot()` |
| 77 | +- session recovery from a `memoryd` snapshot |
| 78 | +- fallback to local cache when memory is disabled |
| 79 | +- memory receipt recording when persisting artifacts |
| 80 | + |
| 81 | +## Known limitations |
| 82 | + |
| 83 | +1. **No confirmed workflow result captured here.** The workflows are present on `main`, but a pass/fail status has not yet been recorded in this status document. |
| 84 | +2. **HTTP-first bootstrap remains.** `finance_saa` and `memoryd` are still HTTP/FastAPI surfaces, not TriTRPC-native services. |
| 85 | +3. **Snapshot recovery is not full replay.** `finance_saa` recovers session state from snapshots, not from a deterministic event-sourced replay stream. |
| 86 | +4. **Typed artifact API is incomplete.** Finance artifacts are still persisted through memory write semantics, not through first-class `Artifact.Write`, `Artifact.Latest`, or `Artifact.ReplaySession` APIs. |
| 87 | +5. **Policy is not yet externalized.** Decision gating is still local runtime behavior rather than compiled policy from `policy-fabric`. |
| 88 | +6. **Ontology semantics are not yet integrated.** Finance artifacts do not yet have RDF/OWL/JSON-LD classes and SHACL gates in `ontogenesis`. |
| 89 | +7. **AgentPlane evidence is not yet wired.** Finance sessions do not yet emit AgentPlane `ValidationArtifact`, `RunArtifact`, `ReplayArtifact`, or promotion/reversal artifacts. |
| 90 | +8. **Platform deployment is not yet wired.** `prophet-platform` does not yet carry the deployment profile, platform contract, or eval-fabric receipt surface for this capability. |
| 91 | + |
| 92 | +## Cross-repo ownership map |
| 93 | + |
| 94 | +| Concern | Owning repo | Current status | |
| 95 | +|---|---|---| |
| 96 | +| Memory substrate and bootstrap finance slice | `SocioProphet/memory-mesh` | Active, merged vertical slice | |
| 97 | +| Deterministic RPC and fixtures | `SocioProphet/TriTRPC` | Not yet integrated for this capability | |
| 98 | +| Runtime/deployment hub | `SocioProphet/prophet-platform` | Not yet wired | |
| 99 | +| Execution/evidence/replay | `SocioProphet/agentplane` | Not yet wired | |
| 100 | +| Policy-as-code gates | `SocioProphet/policy-fabric` | Not yet wired | |
| 101 | +| Ontology/SHACL semantics | `SocioProphet/ontogenesis` | Not yet wired | |
| 102 | +| Human/approval/promotion-adjacent intelligence surface | `SocioProphet/human-digital-twin` | Pattern exists; not yet integrated | |
| 103 | + |
| 104 | +## Recommended next implementation phase |
| 105 | + |
| 106 | +Phase 1 should harden `memoryd` as a typed artifact substrate: |
| 107 | + |
| 108 | +- add `Artifact.Write` |
| 109 | +- add `Artifact.Get` |
| 110 | +- add `Artifact.List` |
| 111 | +- add `Artifact.Latest` |
| 112 | +- add `Artifact.ReplaySession` |
| 113 | +- add idempotency keys |
| 114 | +- add parent artifact hashes |
| 115 | +- add monotonic sequence numbers per session |
| 116 | +- add tests for deterministic latest-snapshot selection and stale-snapshot rejection |
| 117 | + |
| 118 | +## Completion definition for Phase 1 |
| 119 | + |
| 120 | +Phase 1 is complete when `finance_saa` no longer recovers snapshots via free-text recall and instead uses typed artifact APIs for deterministic session reconstruction. |
| 121 | + |
| 122 | +## Follow-on phases |
| 123 | + |
| 124 | +1. Add typed artifact APIs in `memoryd` and migrate `finance_saa` onto them. |
| 125 | +2. Add `memory.mesh.v1` and `finance.saa.v1` TriTRPC contract fixtures. |
| 126 | +3. Add platform-facing service/deployment contracts in `prophet-platform`. |
| 127 | +4. Add ontology modules and SHACL gates in `ontogenesis`. |
| 128 | +5. Add policy examples and compiled decision gates in `policy-fabric`. |
| 129 | +6. Add AgentPlane bundle/evidence/replay integration. |
| 130 | +7. Add estate-level ADR documenting ownership boundaries and integration flow. |
0 commit comments