shadowgraph_record_fact
Record an observed fact under a project and key with claimed provenance and optional expiry; supersedes the prior active fact as history while verification remains outside caller control.
Instructions
Record one observed fact as a project and key, with a claimed provenance class and optional validity window. Use for the fact keys reopenWhen rules name; shadowgraph_remember stores durable memory that is not an observation. Supersedes the previous active fact, keeping it as history. No input can make a fact verified. Each call commits a revision.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Fact name, unique per project among active facts. Required and non-empty. Use the same key that a decision’s reopenWhen rules refer to. | |
| actor | No | Who performed this write, such as an agent or person name. Stored for audit; never used to grant trust. | |
| value | No | Any lossless JSON value: string, finite number, boolean, null, array, or object. | |
| client | No | Which client software performed this write, such as the host application name. | |
| source | No | Legacy alias for sourceClass. An unknown label downgrades to agent_claimed with the raw label kept in sourceRaw. | |
| project | No | Project namespace. Defaults to "default"; an empty string is rejected. | |
| expiresAt | No | ISO 8601 instant after which shadowgraph_maintain expires this fact. Combined with validTo, the earlier boundary wins. | |
| sessionId | No | Caller-owned identifier that groups related writes in the audit trail. | |
| confidence | No | How much the caller trusts this observation, 0-1. Defaults to 0.5. It does not verify anything. | |
| sourceClass | No | Claimed origin, never proof: agent_claimed (the default), tool_observed, human_confirmed, or production_verified. It weights confidence only. An unrecognised label downgrades to agent_claimed, kept verbatim in sourceRaw. | |
| idempotencyKey | No | Retry key scoped by project and operation: reuse it so a retry returns the first result instead of writing a duplicate. Without it every call creates a new entity. | |
| verificationStatus | No | Only "contradicted" may be set by a caller, because it lowers trust. "verified" and "expired" are rejected: verification is not self-assertable and expiry is owned by shadowgraph_maintain. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Stable entity identifier. | |
| key | Yes | Fact name, unique per project among active facts. | |
| kind | No | Entity kind: decision, attempt, memory, fact, relation, review, or alternative. | |
| actor | No | Who performed the write. | |
| value | No | The observed value, any lossless JSON value. | |
| client | No | Which client performed the write. | |
| source | No | Legacy alias of sourceClass, retained for compatibility. | |
| status | No | active, superseded, or expired. | |
| project | No | Project namespace; records imported from a schema that predates projects may carry null. | |
| temporal | No | Bi-temporal window: validFrom, validTo, recordedAt, invalidatedAt. | |
| createdAt | No | ISO 8601 creation time. | |
| expiresAt | No | Caller-declared expiry instant, or null. | |
| sessionId | No | Session identifier recorded with the write. | |
| sourceRaw | No | The original origin label when it differed from sourceClass. Audit only; never evidence. | |
| updatedAt | No | ISO 8601 time of the last change. | |
| confidence | No | Caller-declared confidence in the observation, 0-1. | |
| observedAt | No | ISO 8601 time the fact was observed. | |
| sourceClass | No | Claimed origin class recorded with the write. A claim, never proof. | |
| verification | No | Present only on a signed verification: the attestation this build checked. | |
| schemaVersion | No | Storage schema version this entity was written under. A value above the build’s own version is preserved rather than downgraded. | |
| validityPolicy | No | Declared expiry inputs and the effective expiration boundary derived from them. | |
| verificationStatus | No | unverified, contradicted, expired, or verified. Only the separately configured signed-evidence verifier can produce verified. |