- Atomic — partial revisions are never externally visible (RFC 15.7).
- Auditable — every change is recorded in the record’s
audit_log. - Provenance-tracked — new records include source references to the records they replace or derive from.
RevisionStatus
Semantic records track their current state viaRevisionState.Status:
| Status | Value | Meaning |
|---|---|---|
| Active | active | Record is currently valid |
| Contested | contested | Conflicting evidence exists; status is uncertain |
| Retracted | retracted | Record has been withdrawn |
AuditAction values
Every change appends anAuditEntry to the record’s audit_log:
| Action | Value | When recorded |
|---|---|---|
| Create | create | New record is created |
| Revise | revise | Record is superseded or contested |
| Fork | fork | Record is forked into a conditional variant |
| Merge | merge | Record is merged into a consolidated record |
| Delete | delete | Record is retracted or auto-pruned |
| Reinforce | reinforce | Record’s salience is boosted |
| Decay | decay | Record’s salience is decayed or penalized |
Supersede
Atomically replaces an old record with a new version. The old record is retracted (salience set to 0, semantic status set toretracted). The new record is linked to the old via a supersedes relation and provenance source.
- Old record is fetched and checked as revisable.
- Old record’s salience is set to 0; semantic status set to
retracted;SupersededByset to the new record’s ID. - New record gets a
supersedesrelation pointing to the old record ID. - New record’s provenance includes the old record as a source.
- Audit entry (
revise) is added to the old record; audit entry (create) is added to the new record. - Both updates are committed in a single transaction.
The new record must include at least one evidence reference or provenance source if it is a semantic record.
Fork
Creates a new record derived from an existing source record. Unlike Supersede, both the source and the forked record remain active. Fork is used for conditional variants — facts that are true under specific conditions (ValidityModeConditional).
- Source record is fetched and checked as revisable.
- Forked record gets a
derived_fromrelation pointing to the source. - Audit entry (
fork) is added to the source record; audit entry (create) is added to the forked record. - Both records remain active with their original salience.
ValidityModeConditional on the new record:
Contest
Marks a record as contested, indicating that conflicting evidence exists. The record remains visible but its semantic status is set tocontested. A contested_by relation is added pointing to the conflicting record or evidence reference.
- Target record is fetched and checked as revisable.
- Semantic revision status is set to
contested. - A
contested_byrelation is added from the target tocontestingRef. - Audit entry (
revise) is added to the target record.
Contested records are still returned by retrieval queries. Callers can inspect
Revision.Status to determine whether a record is actively contested before acting on it.Retract
Marks a record as no longer valid without deleting it. Salience is set to 0 and the semantic revision status is set toretracted. The record is preserved for auditability.
- Target record is fetched and checked as revisable.
- Salience is set to 0; semantic status set to
retracted. - Audit entry (
delete) is added to the target record.
Retracted records are not deleted. They remain in the store with salience 0 and
status: retracted. Their audit trail is preserved. Salience-filtered retrieval (MinSalience > 0) will exclude them from results.Merge
Combines multiple source records into a single consolidated record. All source records are retracted, and the merged record receivesderived_from relations to each source.
- All source records are fetched and checked as revisable.
- Each source record’s salience is set to 0; semantic status set to
retracted. - Merged record gets
derived_fromrelations to each source. - Audit entry (
merge) is added to each source; audit entry (create) is added to the merged record. - All changes are committed in a single transaction.
Provenance tracking
Every revision operation updates theProvenance field of the new or modified record to link back to its source:
ProvenanceSource with Kind: event. This creates a complete chain from any current record back to its origins.
Operation summary
| Operation | Source fate | Target status | Relation created |
|---|---|---|---|
| Supersede | Retracted | active | supersedes (new → old) |
| Fork | Stays active | active | derived_from (fork → source) |
| Contest | Status → contested | — | contested_by (target → evidence) |
| Retract | Retracted | — | none |
| Merge | All retracted | active | derived_from (merged → each source) |