Skip to content

Data models: research objects ​

Assets, notes, and the module and workflow tables reserved for later milestones. Part of the data model reference.

ResearchAsset, AssetObservation, AssetRelation, AssetEvent, AssetSyncState ​

Files: research_asset.py, asset_graph.py · Tables:research_assets, asset_observations, asset_relations, asset_events, asset_sync_states · Exposure: REST /vaults/{id}/assets and MCP asset_* (interface in progress) · Migration: b7e5c3a9d2f8 (additive). Full contract in Asset Intelligence.

ModelKey fields
ResearchAssetvault_id (FK, cascade), asset_type, key (unique per vault and type), value, host, review (discovered / accepted / ignored), scope (in / out / unknown, computed), active, first_seen_at, last_seen_at, reviewed_at, observation_count, confidence, sources JSON, attributes JSON, custom_fields JSON, origin, actor
AssetObservationasset_id (cascade), vault_id, source_kind, source_ref (unique per asset and kind), source_id, observed_at, confidence, details
AssetRelationsource_asset_id / target_asset_id (cascade), relation, peer_kind (asset / finding / target), peer_id (unique per source, relation, peer), origin, sources, confidence, observation_count, first / last seen, details
AssetEventasset_id (cascade), kind, actor, details; newest 100 per asset kept
AssetSyncStatevault_id (unique), flow_watermark, synced_at, rebuilt_at, stats

Types, states, sources and relations are plain strings (enums in app/core/assets/types.py), so no database enum type exists.

Retired assets table. The earlier target-scoped Asset model (AssetType, AssetStatus, global SHA-256 asset_hash) was schema only and never written. Its table stays in existing databases, unmapped and ignored by alembic check (RETIRED_TABLES); the migration copied its rows of known types into research_assets.


Module ​

File: module.py · Table: modules · Exposure: schema only, not exposed yet

A reusable scanner module, meant to be loaded dynamically by python_class. Scans run through the engine registry (GET /api/v1/engines) and do not create Module rows today, so Scan.module_id stays null.

FieldTypeNotes
nameString(255)Not null, unique, indexed
display_nameString(255)Not null
module_typeEnum ModuleTypeNot null
versionString(50)Not null
descriptionTextNullable
authorString(100)Nullable
iconString(50)Nullable
python_classString(255)Not null, dotted path to the implementation
default_configJSONDefault {}
required_configJSONDefault []
outputsJSONDefault []
dependenciesJSONDefault []
tagsJSONDefault []
is_activeBooleanDefault True
statusEnum ModuleStatusNullable, default ACTIVE
execution_countIntegerDefault 0
average_durationIntegerDefault 0
success_rateIntegerNot null, default 100, range 0 to 100
documentation_urlString(500)Nullable

Relationships: scans (backref from Scan.module).

Methods: increment_execution(), activate(), deactivate(), record_execution(duration, success), which updates the running average duration and moves success_rate up or down by 1 (clamped to 0 to 100).

ModuleType ​

RECONNAISSANCE, VULNERABILITY, EXPLOITATION, INTELLIGENCE, NETWORK, UTILITY, CUSTOM, WEB

ModuleStatus ​

ACTIVE, INACTIVE, DEPRECATED, TESTING


Workflow ​

File: workflow.py · Table: workflows · Exposure: schema only, not exposed yet

Automated scan chains, for example Subdomain Enum → DNS Resolution → Port Scan → Vuln Scan.

FieldTypeNotes
nameString(255)Not null, unique
descriptionTextNullable
vault_idFK → vaults.idNullable, ON DELETE CASCADE
stepsJSONNot null, step definitions
triggersJSONDefault []
scheduleString(100)Nullable
is_activeBooleanDefault True
statusEnum WorkflowStatusNullable, default DRAFT
execution_countIntegerDefault 0
last_executed_atDateTimeNullable

Relationships: vault (backref Vault.workflows).

WorkflowStatus ​

DRAFT, ACTIVE, PAUSED, ARCHIVED


File: notes.py · Tables: research_notes, note_folders, note_revisions, note_links, note_tags · Exposure: API (Research notes)

The research notebook. A Note (research_notes) belongs to a vault (ON DELETE CASCADE) and optionally a NoteFolder (ON DELETE SET NULL).

FieldTypeNotes
vault_idFK → vaults.idNot null, ON DELETE CASCADE
folder_idFK → note_folders.idNullable, ON DELETE SET NULL
titleString(200)Not null
bodyTextNot null, Markdown up to 1 MiB
size, tasks_total, tasks_doneIntegerRead from the body on save
pinnedBooleanDefault False
templateString(16)Nullable: journal, hypothesis, checklist, timeline, finding
actorString(8)user or agent (last writer)
archived_atDateTime (tz)Nullable

Relationships: tags (many-to-many with Tag through note_tags, both sides ON DELETE CASCADE).

NoteFolder (note_folders): vault_id (CASCADE), parent_id (self, SET NULL), name String(100). NoteRevision (note_revisions): note_id (CASCADE), title, body, size, actor, created_at, updated_at. NoteLink (note_links): primary key (note_id, kind, object_id), vault_id; no foreign key to the referenced object, so deleting an object never touches a note.

The initial schema's notes table (fields title, content, note_type, note_tags, is_pinned, vault_id, target_id) was an early draft that nothing used. It stays in existing databases, is no longer mapped, and is ignored by alembic check (RETIRED_TABLES in migrations/env.py).


VaultFile, FileRevision ​

File: vault_file.py · Tables: vault_files, file_revisions, file_tags · Exposure: API (Vault files)

A VaultFile (vault_files) is the metadata of one file of a vault; contents live in the managed storage outside the database (File storage).

FieldTypeNotes
vault_idFK → vaults.idNot null, ON DELETE CASCADE
folder_idFK → note_folders.idNullable, ON DELETE SET NULL; the folder tree shared with notes
note_idFK → research_notes.idNullable, unique, ON DELETE CASCADE; set for Markdown files that are notes
name, name_keyString(255)NFC name; case-folded key for the per-folder uniqueness check
extensionString(32)Lower case, without the dot
mime, kindString(127), String(16)Read from the bytes; kind markdown, text, image, pdf, archive, executable, binary
sizeBigIntegerBytes of the current content
sha256String(64)Checksum of the current content
storage_refString(96)local:v<vault>/<sha256>; null for note-backed files
revision, versionIntegerCurrent revision number; change counter for optimistic concurrency
flagsJSONexecutable, script, active_content, mime_mismatch
quarantinedBooleanNever read as text or sent to agents
source, originString(16), String(255)upload, created, duplicate; uploaded name or file:<id>
pinnedBooleanBookmark (a note-backed file uses the note's)
actor, agent_idString(8), FK → agents.idLast writer, SET NULL
creator, creator_agent_idString(8), FK → agents.idFirst writer, SET NULL
archived_at, trashed_atDateTime (tz)Nullable

Relationships: tags (many-to-many with Tag through file_tags, both sides ON DELETE CASCADE).

FileRevision (file_revisions): file_id (CASCADE), vault_id (CASCADE), number (unique per file), size, sha256, storage_ref, mime, message, actor, agent_id (SET NULL), created_at. Revisions are immutable and reference content-addressed bytes; stored contents are removed only when no revision references them.

FileAttachment (file_attachments, file_attachment.py): vault_id (CASCADE), file_id (SET NULL, so evidence outlives a purged file), object_kind (finding or report), object_id (no foreign key; removed with the object), revision (pinned; null for a note's file), name, size, sha256, mime as attached, note, actor, agent_id (SET NULL), created_at, updated_at. Unique per file and object.