From b7f86e3c380afe4069899bec43c2963c6624ded5 Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Mon, 30 Nov 2026 20:10:04 +0000 Subject: [PATCH 1/2] docs: separate rehydration, retrieval and reconstruction terms The glossary defined only Rehydration, while "reconstruct" was used both for the plain DataLayer read path (DL-05-001/007, OID-02-003) and for synthesized, unfaithful data (OX-07, CBT-05-008, CLP snapshot rules). Agents reading both called ordinary store reads "reconstruction". Define Rehydration (parse stored data, compute nothing; dehydrated references re-read current state), Retrieval (AKM-05-007 fetch), and Reconstruction (derived data, usually a defect), add flagged ambiguity 23, and reword the neutral "reconstruct" uses to "rehydrate". Co-Authored-By: Claude Opus 5.5 --- docs/reference/glossary.md | 13 +++++++++++-- notes/wire-core-boundary.md | 2 +- specs/datalayer.yaml | 8 ++++---- specs/object-ids.yaml | 2 +- vultron/wire/as2/vocab/AGENTS.md | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/reference/glossary.md b/docs/reference/glossary.md index 4bd86cdef8..7bad1afd34 100644 --- a/docs/reference/glossary.md +++ b/docs/reference/glossary.md @@ -508,6 +508,13 @@ The rows below carry the names and the distinctions, not the obligations. - A refused assertion is the **CASE_MANAGER**'s **Ledger Admission** verdict that an inbound assertion does not enter the ledger, and it is never ledgered (CLP-04-007). - **Recommendation**: Use "Accept" and "Reject" only for the **Activities**; write "admitted" and "refused" for the ledger verdict, never "accepted" and "rejected" (CLP-02-012). +23. **"Rehydrate" vs. "retrieve" vs. "reconstruct"**: + - **Rehydration** reads the actor's own stored record into a typed object and computes nothing. + - **Retrieval** fetches an object the actor lacks from the actor that holds it (AKM-05-007). + - **Reconstruction** derives data that was never stored, received, or fetched, and it is usually a defect (CBT-05-008). + - Rehydrating a record whose reference fields were dehydrated to ids fills them from what the store holds now, so it can differ from what was sent; a sent or received body is read from its sealed copy instead (OX-07-004, DL-06-004). + - **Recommendation**: Write "rehydrate" for a store read and "retrieve" or "fetch" for a dereference; keep "reconstruct" for data that is derived, and name what a deliberate computation computes. + --- ## Reference Implementation Vocabulary @@ -560,8 +567,10 @@ The [Concept Taxonomy](vultron-taxonomy.md) explains the boundary: `vultron/core | **DataLayer** | A broad, generic persistence port that core modules use to store and retrieve case data; provides raw `dict` access | Persistence, storage, database | | **CasePersistence** | A narrow, typed persistence port for case-specific queries; replaces broad `get()`/`by_type()` with domain-specific methods like `read_by_id()` and `list_by_status()` | Case DAO, case repository | | **CaseOutboxPersistence** | A narrow, typed persistence port for outbox (outbound activity queue) queries; separate from case data | Outbox DAO, outbox repository | -| **Auto-Rehydration** | The design contract that `dl.read()` and `dl.list_objects()` MUST return fully typed, rehydrated domain objects (never raw storage records or dehydrated string references), eliminating the need for `model_validate()` coercion in use cases | Automatic deserialization, typed retrieval | -| **Rehydration** | The process of deserializing raw persisted records (dicts) into typed domain objects (Pydantic models) | Deserialization, model coercion, casting | +| **Auto-Rehydration** | The design contract that `dl.read()` and `dl.list_objects()` MUST return fully typed, rehydrated domain objects (never raw storage records or dehydrated string references), eliminating the need for `model_validate()` coercion in use cases | Automatic deserialization, typed retrieval, reconstruction | +| **Rehydration** | Reading an actor's own stored record into a typed domain object (a Pydantic model). It parses what was stored and computes nothing. A field that persistence dehydrated to an id is filled from what the store holds at read time, so rehydrating a record is not a faithful copy of a body that was sent or received; that is why the outbox relays the sealed body and never a re-read (OX-07-004) | Deserialization, model coercion, casting, reconstruction | +| **Retrieval** | Getting an object the actor does not hold by dereferencing its id: fetching it from the actor that holds it, as AKM-05-007 requires. A case object comes from the case's **CASE_MANAGER** and a profile from its actor. An actor never retrieves from itself (AKM-05-011), and an object the protocol requires inline is refused when missing, not retrieved (CBT-05-008). Not the **Retriever** capability shape, which queries an external source | Dereference (as a noun), fetch, lookup, reconstruction | +| **Reconstruction** | Deriving or synthesizing data from something other than what was stored, received, or fetched, such as rebuilding a sent body from a store read or filling missing protocol data from domain knowledge. Usually a defect (CBT-05-008, OX-07-005). A deliberate computation that is part of the protocol, such as computing a chain tail hash, names what it computes | Rehydration, retrieval | | **Compatibility Method** | A deprecated method (`get()`, `by_type()`) still present for backward compatibility but marked for removal | Escape hatch, legacy method | | **Actor Knowledge Model** | The architectural invariant that an **Actor**'s knowledge of the world is bounded only by what it has **received** via AS2 **Activities**. Recipients cannot access senders' DataLayers. Therefore an outbound **Activity** MUST carry an object the recipient does not hold inline, or by a reference the recipient can dereference | Knowledge boundary, isolation invariant | | **Bare Object URI** | An anti-pattern in outbound **Activities** where an object is referenced as a bare string URI (e.g., `object_="urn:uuid:abc123"`) instead of a full inline object. It causes recipient pattern-matching failure when the recipient holds no record of the referenced object and cannot dereference it, as the reference implementation mostly cannot | String reference, bare ID | diff --git a/notes/wire-core-boundary.md b/notes/wire-core-boundary.md index e2e2bb70b9..040e299760 100644 --- a/notes/wire-core-boundary.md +++ b/notes/wire-core-boundary.md @@ -164,7 +164,7 @@ reset the field, losing state without an error (#2232). `rm_state` and `em_state` spellings are retired (SDO-03-003) and raise. A wire-shaped row persisted anyway is projected to core on read -(`hydration.project_wire_row_to_core`). Deliberate snapshot reconstruction in core +(`hydration.project_wire_row_to_core`). Deliberate snapshot projection in core goes through `project_wire_snapshot_to_core`, the one seam ARCH-20-008 names. Two invariants keep `forbid` self-consistent, both validators on `CoreObject`: diff --git a/specs/datalayer.yaml b/specs/datalayer.yaml index 4be42f956e..198fde6f4d 100644 --- a/specs/datalayer.yaml +++ b/specs/datalayer.yaml @@ -474,13 +474,13 @@ groups: priority: MUST kind: project verification_debt: '#2575' - statement: '`dl.read(id)` and `dl.list_objects(type_key)` MUST reconstruct persisted domain entities using the core + statement: '`dl.read(id)` and `dl.list_objects(type_key)` MUST rehydrate persisted domain entities using the core vocabulary registry (`vultron.core.models.registry.CORE_VOCABULARY`) so that the returned instance is a `vultron.core.models` type (e.g. core `VulnerabilityCase`), never a `vultron.wire.as2.vocab` type (e.g. `as_VulnerabilityCase`), whenever the persisted `type_` has a registered core counterpart.' rationale: >- Core code MUST receive core domain objects so that core validators run and static analysis sees the real type - (ARCH-01-002). Reconstructing via the wire `VOCABULARY` returns wire objects that only work in core by structural + (ARCH-01-002). Rehydrating via the wire `VOCABULARY` returns wire objects that only work in core by structural coincidence of field names. Decided in ADR-0034; derived from ARCH-01-002 and DL-03-002. relationships: - rel_type: derives_from @@ -681,9 +681,9 @@ groups: verification_debt: '#2575' statement: >- The wire vocabulary registry MUST NOT be the mechanism by which core objects are - reconstructed on the DataLayer read path. + rehydrated on the DataLayer read path. rationale: >- - Using the wire registry for core object reconstruction leaks wire-layer concerns into the + Using the wire registry for core object rehydration leaks wire-layer concerns into the adapter read path, violating DL-03-002. tags: - persistence diff --git a/specs/object-ids.yaml b/specs/object-ids.yaml index 4f03e645ac..3fb2972473 100644 --- a/specs/object-ids.yaml +++ b/specs/object-ids.yaml @@ -328,7 +328,7 @@ groups: - id: OID-02-003 priority: MUST kind: project - statement: '`record_to_object()` MUST reconstruct objects using the full-URI `as_id` stored in the record' + statement: '`record_to_object()` MUST rehydrate objects using the full-URI `as_id` stored in the record' rationale: >- The id on a rebuilt object is what core compares and what outbound activities carry. Rebuilding it from anything other than the stored full URI could give the diff --git a/vultron/wire/as2/vocab/AGENTS.md b/vultron/wire/as2/vocab/AGENTS.md index 19258bc103..bd42eeb910 100644 --- a/vultron/wire/as2/vocab/AGENTS.md +++ b/vultron/wire/as2/vocab/AGENTS.md @@ -20,7 +20,7 @@ gets a class the wire registry holds (VM-06-008). It never consults `VOCABULARY`, because a class name such as `as_Activity` is not an AS2 `type` value (VM-01-016). - Only a persistence read path that reconstructs whatever was stored passes + Only a persistence read path that rehydrates whatever was stored passes `include_core=True` to fall back to `CORE_TYPE_MAP` (core domain types that MUST NOT appear in the wire `VOCABULARY` per ARCH-12-014), and it says why in a comment at the call. It MUST raise `KeyError` for names not found in any From 3f15b7d10700381730d402394ba57a16a20b5cce Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Mon, 30 Nov 2026 21:29:54 +0000 Subject: [PATCH 2/2] fix(pr-execute): address 7 findings from triage - ci-status: rewrap the edited DL-05-001, DL-05-007 and OID-02-003 lines to 88 chars - spec-conformance: VM-06-014 says "rehydrates whatever was stored" - spec-conformance: ARCH-12-008/009/011 stop calling store reads "reconstruction" - code-review: Retrieval row's avoided aliases no longer contradict Ambiguity 23 - code-review: Ambiguity 23 cites OX-07-004 for the sealed copy, DL-06-004 for the archive - code-review: Reconstruction example matches its own definition - code-review: DataLayer row says "store and read", not "retrieve" Co-Authored-By: Claude Opus 5.5 --- docs/reference/glossary.md | 10 +++++----- specs/architecture.yaml | 13 +++++++------ specs/datalayer.yaml | 22 +++++++++++++--------- specs/object-ids.yaml | 4 +++- specs/vocabulary-model.yaml | 2 +- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/docs/reference/glossary.md b/docs/reference/glossary.md index 7bad1afd34..eb8790dd7c 100644 --- a/docs/reference/glossary.md +++ b/docs/reference/glossary.md @@ -512,8 +512,8 @@ The rows below carry the names and the distinctions, not the obligations. - **Rehydration** reads the actor's own stored record into a typed object and computes nothing. - **Retrieval** fetches an object the actor lacks from the actor that holds it (AKM-05-007). - **Reconstruction** derives data that was never stored, received, or fetched, and it is usually a defect (CBT-05-008). - - Rehydrating a record whose reference fields were dehydrated to ids fills them from what the store holds now, so it can differ from what was sent; a sent or received body is read from its sealed copy instead (OX-07-004, DL-06-004). - - **Recommendation**: Write "rehydrate" for a store read and "retrieve" or "fetch" for a dereference; keep "reconstruct" for data that is derived, and name what a deliberate computation computes. + - Rehydrating a record whose reference fields were dehydrated to ids fills them from what the store holds now, so it can differ from what was sent; a sent body is read from its sealed copy (OX-07-004), and a received one from its archived copy (DL-06-004). + - **Recommendation**: Write "rehydrate" for a store read and "retrieve" or "fetch" for dereferencing an id; keep "reconstruct" for data that is derived, and name what a deliberate computation computes. --- @@ -564,13 +564,13 @@ The [Concept Taxonomy](vultron-taxonomy.md) explains the boundary: `vultron/core | Term | Definition | Aliases to avoid | |------|-----------|-----------------| -| **DataLayer** | A broad, generic persistence port that core modules use to store and retrieve case data; provides raw `dict` access | Persistence, storage, database | +| **DataLayer** | A broad, generic persistence port that core modules use to store and read case data; provides raw `dict` access | Persistence, storage, database | | **CasePersistence** | A narrow, typed persistence port for case-specific queries; replaces broad `get()`/`by_type()` with domain-specific methods like `read_by_id()` and `list_by_status()` | Case DAO, case repository | | **CaseOutboxPersistence** | A narrow, typed persistence port for outbox (outbound activity queue) queries; separate from case data | Outbox DAO, outbox repository | | **Auto-Rehydration** | The design contract that `dl.read()` and `dl.list_objects()` MUST return fully typed, rehydrated domain objects (never raw storage records or dehydrated string references), eliminating the need for `model_validate()` coercion in use cases | Automatic deserialization, typed retrieval, reconstruction | | **Rehydration** | Reading an actor's own stored record into a typed domain object (a Pydantic model). It parses what was stored and computes nothing. A field that persistence dehydrated to an id is filled from what the store holds at read time, so rehydrating a record is not a faithful copy of a body that was sent or received; that is why the outbox relays the sealed body and never a re-read (OX-07-004) | Deserialization, model coercion, casting, reconstruction | -| **Retrieval** | Getting an object the actor does not hold by dereferencing its id: fetching it from the actor that holds it, as AKM-05-007 requires. A case object comes from the case's **CASE_MANAGER** and a profile from its actor. An actor never retrieves from itself (AKM-05-011), and an object the protocol requires inline is refused when missing, not retrieved (CBT-05-008). Not the **Retriever** capability shape, which queries an external source | Dereference (as a noun), fetch, lookup, reconstruction | -| **Reconstruction** | Deriving or synthesizing data from something other than what was stored, received, or fetched, such as rebuilding a sent body from a store read or filling missing protocol data from domain knowledge. Usually a defect (CBT-05-008, OX-07-005). A deliberate computation that is part of the protocol, such as computing a chain tail hash, names what it computes | Rehydration, retrieval | +| **Retrieval** | Getting an object the actor does not hold by dereferencing its id: fetching it from the actor that holds it, as AKM-05-007 requires. A case object comes from the case's **CASE_MANAGER** and a profile from its actor. An actor never retrieves from itself (AKM-05-011), and an object the protocol requires inline is refused when missing, not retrieved (CBT-05-008). Not the **Retriever** capability shape, which queries an external source | Lookup, rehydration, reconstruction | +| **Reconstruction** | Deriving or synthesizing data from something other than what was stored, received, or fetched, such as presenting a store read as a body that was sent, or filling missing protocol data from domain knowledge. Usually a defect (CBT-05-008, OX-07-005). A deliberate computation that is part of the protocol, such as computing a chain tail hash, names what it computes | Rehydration, retrieval | | **Compatibility Method** | A deprecated method (`get()`, `by_type()`) still present for backward compatibility but marked for removal | Escape hatch, legacy method | | **Actor Knowledge Model** | The architectural invariant that an **Actor**'s knowledge of the world is bounded only by what it has **received** via AS2 **Activities**. Recipients cannot access senders' DataLayers. Therefore an outbound **Activity** MUST carry an object the recipient does not hold inline, or by a reference the recipient can dereference | Knowledge boundary, isolation invariant | | **Bare Object URI** | An anti-pattern in outbound **Activities** where an object is referenced as a bare string URI (e.g., `object_="urn:uuid:abc123"`) instead of a full inline object. It causes recipient pattern-matching failure when the recipient holds no record of the referenced object and cannot dereference it, as the reference implementation mostly cannot | String reference, bare ID | diff --git a/specs/architecture.yaml b/specs/architecture.yaml index a13659df29..3c96faecc5 100644 --- a/specs/architecture.yaml +++ b/specs/architecture.yaml @@ -634,17 +634,18 @@ groups: statement: Wire-branch types MUST register in `VOCABULARY`. rationale: >- The `VOCABULARY` registry is the wire layer's type-dispatch table; omitting a wire type - prevents correct AS2 vocabulary lookup and object reconstruction. + prevents correct AS2 vocabulary lookup and object parsing. - id: ARCH-12-009 priority: MUST kind: project verification_debt: '#2575' statement: >- `CoreObject` subclasses MUST register in `CORE_VOCABULARY` as the DataLayer primary - reconstruction path. + rehydration path. rationale: >- `CORE_VOCABULARY` is used by `_from_row()` in `SqliteDataLayer`; every entry must be a - `CoreObject` subclass to guarantee correct domain-object reconstruction from stored rows. + `CoreObject` subclass to guarantee correct domain-object rehydration from stored + rows. - id: ARCH-12-010 priority: MUST kind: project @@ -681,9 +682,9 @@ groups: Wire-branch types MUST NOT register in either core registry (`CORE_VOCABULARY` or `CORE_TYPE_MAP`). rationale: >- - Contaminating either core registry with wire types would allow wire-shaped objects to be - reconstructed via `find_in_vocabulary()`, bypassing the `CORE_VOCABULARY` primary path and - contradicting ARCH-12-014. + Contaminating either core registry with wire types would allow wire-shaped objects + to be rehydrated via `find_in_vocabulary()`, bypassing the `CORE_VOCABULARY` + primary path and contradicting ARCH-12-014. - id: ARCH-12-006 priority: MUST kind: project diff --git a/specs/datalayer.yaml b/specs/datalayer.yaml index 198fde6f4d..9980aa4705 100644 --- a/specs/datalayer.yaml +++ b/specs/datalayer.yaml @@ -474,14 +474,18 @@ groups: priority: MUST kind: project verification_debt: '#2575' - statement: '`dl.read(id)` and `dl.list_objects(type_key)` MUST rehydrate persisted domain entities using the core - vocabulary registry (`vultron.core.models.registry.CORE_VOCABULARY`) so that the returned instance is a - `vultron.core.models` type (e.g. core `VulnerabilityCase`), never a `vultron.wire.as2.vocab` type - (e.g. `as_VulnerabilityCase`), whenever the persisted `type_` has a registered core counterpart.' + statement: >- + `dl.read(id)` and `dl.list_objects(type_key)` MUST rehydrate persisted domain + entities using the core vocabulary registry + (`vultron.core.models.registry.CORE_VOCABULARY`) so that the returned instance is + a `vultron.core.models` type (e.g. core `VulnerabilityCase`), never a + `vultron.wire.as2.vocab` type (e.g. `as_VulnerabilityCase`), whenever the + persisted `type_` has a registered core counterpart. rationale: >- - Core code MUST receive core domain objects so that core validators run and static analysis sees the real type - (ARCH-01-002). Rehydrating via the wire `VOCABULARY` returns wire objects that only work in core by structural - coincidence of field names. Decided in ADR-0034; derived from ARCH-01-002 and DL-03-002. + Core code MUST receive core domain objects so that core validators run and static + analysis sees the real type (ARCH-01-002). Rehydrating via the wire `VOCABULARY` + returns wire objects that only work in core by structural coincidence of field + names. Decided in ADR-0034; derived from ARCH-01-002 and DL-03-002. relationships: - rel_type: derives_from spec_id: ARCH-01-002 @@ -683,8 +687,8 @@ groups: The wire vocabulary registry MUST NOT be the mechanism by which core objects are rehydrated on the DataLayer read path. rationale: >- - Using the wire registry for core object rehydration leaks wire-layer concerns into the - adapter read path, violating DL-03-002. + Using the wire registry for core object rehydration leaks wire-layer concerns + into the adapter read path, violating DL-03-002. tags: - persistence - wire-format diff --git a/specs/object-ids.yaml b/specs/object-ids.yaml index 3fb2972473..bce4f6e2e1 100644 --- a/specs/object-ids.yaml +++ b/specs/object-ids.yaml @@ -328,7 +328,9 @@ groups: - id: OID-02-003 priority: MUST kind: project - statement: '`record_to_object()` MUST rehydrate objects using the full-URI `as_id` stored in the record' + statement: >- + `record_to_object()` MUST rehydrate objects using the full-URI `as_id` stored in + the record rationale: >- The id on a rebuilt object is what core compares and what outbound activities carry. Rebuilding it from anything other than the stored full URI could give the diff --git a/specs/vocabulary-model.yaml b/specs/vocabulary-model.yaml index 1015a8b797..0c9b4d22d7 100644 --- a/specs/vocabulary-model.yaml +++ b/specs/vocabulary-model.yaml @@ -845,7 +845,7 @@ groups: statement: >- A caller that may legitimately receive either branch MUST state that in its call, rather than inherit it from the lookup's default. Such a caller is a persistence - read path that reconstructs whatever was stored. + read path that rehydrates whatever was stored. rationale: >- A stated need is visible at the call site, so a reviewer can see which callers reach the core map and why.