Index

public.agent_changeset_call_entities

Description

Each entity an agent write call touched, with its full snapshot just before the call and a digest of its snapshot just after it. Reverting the call restores the before snapshots. No deleted_at: part of the call’s audit log.

Columns

Name Type Default Nullable Children Parents Comment
after_digest text true Hex BLAKE3 digest (headless_lms_utils::stable_digest) of the entity’s snapshot JSON just after the call. Null if the call deleted it. Reverting compares it with the entity’s current snapshot to refuse undoing later changes.
before_snapshot jsonb true The entity just before the call. Null if it did not exist.
call_id uuid false public.agent_changeset_calls The call that touched the entity.
created_at timestamp with time zone now() false Timestamp when the record was created.
entity_id uuid false Id of the entity; the course id for course settings.
entity_type content_entity_type false Which table entity_id points to, and which snapshot shape the snapshots have.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
label text false What people call the entity just after the call, or just before it for deletes. Kept so that history listings need not read the snapshots.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.

Viewpoints

Name Definition
AI agent changesets How a teacher’s AI agent edits course material through the MCP server without touching what students see. Every agent write is staged in the teacher’s open changeset for the course and reaches students only when the changeset is published; each call is logged with what it changed so that it can be reverted, and saves from the web UI and agents alike leave history.

Constraints

Name Type Definition
agent_changeset_call_entities_call_id_fkey FOREIGN KEY FOREIGN KEY (call_id) REFERENCES agent_changeset_calls(id)
agent_changeset_call_entities_call_id_not_null n NOT NULL call_id
agent_changeset_call_entities_created_at_not_null n NOT NULL created_at
agent_changeset_call_entities_entity_id_not_null n NOT NULL entity_id
agent_changeset_call_entities_entity_type_not_null n NOT NULL entity_type
agent_changeset_call_entities_has_snapshot CHECK CHECK (((before_snapshot IS NOT NULL) OR (after_digest IS NOT NULL)))
agent_changeset_call_entities_id_not_null n NOT NULL id
agent_changeset_call_entities_label_not_null n NOT NULL label
agent_changeset_call_entities_pkey PRIMARY KEY PRIMARY KEY (id)
agent_changeset_call_entities_unique_entity UNIQUE UNIQUE (call_id, entity_type, entity_id)
agent_changeset_call_entities_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
agent_changeset_call_entities_pkey CREATE UNIQUE INDEX agent_changeset_call_entities_pkey ON public.agent_changeset_call_entities USING btree (id)
agent_changeset_call_entities_unique_entity CREATE UNIQUE INDEX agent_changeset_call_entities_unique_entity ON public.agent_changeset_call_entities USING btree (call_id, entity_type, entity_id)
idx_agent_changeset_call_entities_entity CREATE INDEX idx_agent_changeset_call_entities_entity ON public.agent_changeset_call_entities USING btree (entity_id)

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.agent_changeset_call_entities FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls