Bezel API api_data_model
internal prototype · canonical JSON + Dreamborn Forge HTML
internal generated
api_data_model · supabase_json

Bezel API api_data_model

api_data_model artifact · for Bezel API · status draft

Planning Surface

Use this to decide what happens next.

Status

draft

Agent Handoff
Start Here

api_data_model artifact · for Bezel API · status draft

Completion Evidence

No explicit evidence field yet. Require tests, screenshots, linked PRs, or reviewed outputs before marking complete.

Artifact Shape
  • product: Bezel API
  • version: 0.1
  • entities: 17 items
  • event model: lite_mode: object, verified_mode: object, non_metered_reads: object, hcs_payload_boundary: string, metered_hcs_backed_events: object
  • product modes: lite: object, verified: object
  • storage principle: Bezel API owns product tables in its implementation repo/database. RedKey Studio owns design artifacts until approval.
  • tenant invariants: 5 items
  • redkey studio mapping: project_row: string, approved_path: string, artifact_rows: string
Structured Payload

Machine-readable source fields

product

Bezel API

version

0.1

entities
namefieldspurpose
users- id - name - email - auth_provider - created_at - last_login_atHuman identities
sessions- id - user_id - expires_at - revoked_at - created_atHuman browser/API dashboard sessions
workspaces- id - name - company_name - owner_user_id - intended_use - free_verified_events_remaining - created_atTenant boundary
workspace_members- workspace_id - user_id - role: owner|admin|member|viewer - created_atHuman membership and workspace role
api_keys- id - workspace_id - name - environment - key_hash - scopes - created_by - last_used_at - revoked_atWorkspace-scoped runtime/server credentials
agents- id - workspace_id - name - description - framework - endpoint_url - agent_card - verification_status - development_mode - created_at - deactivated_atRegistered agent identities
roles- id - workspace_id - name - description - required_capabilities - default_lease_seconds - hcs_topic_id - topic_status - created_atClaim eligibility groups
role_agents- role_id - agent_id - workspace_id - created_atAgent eligibility assignment
queues- id - workspace_id - name - eligible_role_ids - default_priority - default_retry_policy - default_lease_seconds - created_atCoordination domains inside a workspace
tasks- id - workspace_id - queue_id - workflow_id - title - required_role_id - required_capabilities - input_ref_or_json - status - priority - created_by - created_at - updated_atMaterialized task read model
claims- id - workspace_id - task_id - agent_id - status - lease_expires_at - claimed_at - completed_at - failed_at - failure_reasonClaim leases and outcomes
workflow_definitions- id - workspace_id - name - version - plan_json - status - created_by - published_atSaved plan.json definitions
workflow_runs- id - workspace_id - definition_id - queue_id - status - started_at - completed_at - paused_at - cancelled_atActive workflow execution state
events- id - workspace_id - type - actor_type - actor_id - subject_type - subject_id - payload - receipt_status - created_atPublic event projection/read model
receipts- event_id - workspace_id - verification_status - sequence - consensus_timestamp - hcs_topic_id_internal - transaction_id_internal - receipt_url - verified_atVerified coordination receipt projection
usage_events- id - workspace_id - event_id - event_type - credits_used - created_atMetered event-credit accounting
artifacts- id - workspace_id - task_id - artifact_type - artifact_ref - hash - metadata - created_atSmall product artifact references produced by tasks; large bodies stay in external storage
event model
lite mode
db is task source

true

hcs forbidden fields
  • task title
  • task input
  • plan_json
  • brief_ref revealing task data
  • artifact details
  • completion summaries
hcs is claim arbitration only

true

verified mode
contract

contracts/agent-wire/v1.1/hcs-transport-contract.json

hcs agent wire lifecycle

true

non metered reads
  • event receipt reads
  • queue/task list reads
  • usage reads
hcs payload boundary

Coordination facts, lifecycle facts, routing facts, artifact references, and receipts only. No raw model logs, secrets, large files, private memory, or document bodies.

metered hcs backed events
  • workspace.created
  • role.created
  • role.assigned
  • queue.created
  • agent.registered
  • task.published
  • task.claim_attempted
  • task.claimed
  • task.claim_missed
  • task.claim_rejected
  • task.completed
  • task.failed
  • workflow.started
  • workflow.completed
product modes
lite
value

Lowest-friction hosted coordination: verified claim races without publishing customer task data to HCS.

principle

Use HCS only for claim arbitration/proof. Do not store task briefs, task details, plan details, lifecycle summaries, or artifact details in HCS.

db content
  • workspace
  • roles
  • agents
  • queues
  • workflow_definitions.plan_json
  • workflow_runs
  • tasks
  • claims read model
  • artifacts
  • usage
hcs content
  • claim_attempted minimal commitment
  • claim_won/claim_result proof metadata or minimal claim decision
  • optional receipt anchor
verified
value

Full verified ledger replay for higher-trust/enterprise workflows.

principle

Use Agent Wire v1.1 for broader lifecycle/task/artifact reference events on HCS.

hcs content
  • task.created/available refs
  • claim lifecycle
  • artifact.ready refs
  • task.complete/fail summaries and verification refs
  • workflow/reducer events
storage principle

Bezel API owns product tables in its implementation repo/database. RedKey Studio owns design artifacts until approval.

tenant invariants
  • Every tenant-owned table has workspace_id except users and sessions.
  • workspace_members authorizes human access.
  • api_keys authorize runtime/server access and are scoped to exactly one workspace.
  • All object lookups must include workspace_id in query predicates after auth resolution.
  • No API route may return objects from multiple workspaces unless the caller is a human user listing their own workspace memberships.
redkey studio mapping
project row

studio_projects.id c8bc3eed-c513-4dc8-9bc1-30c6723e232c tracks design state for Bezel API.

approved path

Approved design artifacts can be anchored through approved_artifacts/HFS before dispatching implementation tasks.

artifact rows

studio_artifacts rows hold draft/approved planning artifacts before execution.