Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

---

## Reference Implementation Vocabulary
Expand Down Expand Up @@ -557,11 +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 |
| **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 | 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 |
Expand Down
2 changes: 1 addition & 1 deletion notes/wire-core-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
13 changes: 7 additions & 6 deletions specs/architecture.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 14 additions & 10 deletions specs/datalayer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,18 @@ 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
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). Reconstructing 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
Expand Down Expand Up @@ -681,10 +685,10 @@ 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
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
Expand Down
4 changes: 3 additions & 1 deletion specs/object-ids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion specs/vocabulary-model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion vultron/wire/as2/vocab/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading