Bezel API api_data_model
api_data_model artifact · for Bezel API · status draft
api_data_model artifact · for Bezel API · status draft
No explicit evidence field yet. Require tests, screenshots, linked PRs, or reviewed outputs before marking complete.
- 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
Machine-readable source fields
Bezel API
0.1
| name | fields | purpose |
|---|---|---|
| users | - id - name - email - auth_provider - created_at - last_login_at | Human identities |
| sessions | - id - user_id - expires_at - revoked_at - created_at | Human browser/API dashboard sessions |
| workspaces | - id - name - company_name - owner_user_id - intended_use - free_verified_events_remaining - created_at | Tenant boundary |
| workspace_members | - workspace_id - user_id - role: owner|admin|member|viewer - created_at | Human membership and workspace role |
| api_keys | - id - workspace_id - name - environment - key_hash - scopes - created_by - last_used_at - revoked_at | Workspace-scoped runtime/server credentials |
| agents | - id - workspace_id - name - description - framework - endpoint_url - agent_card - verification_status - development_mode - created_at - deactivated_at | Registered agent identities |
| roles | - id - workspace_id - name - description - required_capabilities - default_lease_seconds - hcs_topic_id - topic_status - created_at | Claim eligibility groups |
| role_agents | - role_id - agent_id - workspace_id - created_at | Agent eligibility assignment |
| queues | - id - workspace_id - name - eligible_role_ids - default_priority - default_retry_policy - default_lease_seconds - created_at | Coordination 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_at | Materialized task read model |
| claims | - id - workspace_id - task_id - agent_id - status - lease_expires_at - claimed_at - completed_at - failed_at - failure_reason | Claim leases and outcomes |
| workflow_definitions | - id - workspace_id - name - version - plan_json - status - created_by - published_at | Saved plan.json definitions |
| workflow_runs | - id - workspace_id - definition_id - queue_id - status - started_at - completed_at - paused_at - cancelled_at | Active workflow execution state |
| events | - id - workspace_id - type - actor_type - actor_id - subject_type - subject_id - payload - receipt_status - created_at | Public event projection/read model |
| receipts | - event_id - workspace_id - verification_status - sequence - consensus_timestamp - hcs_topic_id_internal - transaction_id_internal - receipt_url - verified_at | Verified coordination receipt projection |
| usage_events | - id - workspace_id - event_id - event_type - credits_used - created_at | Metered event-credit accounting |
| artifacts | - id - workspace_id - task_id - artifact_type - artifact_ref - hash - metadata - created_at | Small product artifact references produced by tasks; large bodies stay in external storage |
true
- task title
- task input
- plan_json
- brief_ref revealing task data
- artifact details
- completion summaries
true
contracts/agent-wire/v1.1/hcs-transport-contract.json
true
- event receipt reads
- queue/task list reads
- usage reads
Coordination facts, lifecycle facts, routing facts, artifact references, and receipts only. No raw model logs, secrets, large files, private memory, or document bodies.
- 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
Lowest-friction hosted coordination: verified claim races without publishing customer task data to HCS.
Use HCS only for claim arbitration/proof. Do not store task briefs, task details, plan details, lifecycle summaries, or artifact details in HCS.
- workspace
- roles
- agents
- queues
- workflow_definitions.plan_json
- workflow_runs
- tasks
- claims read model
- artifacts
- usage
- claim_attempted minimal commitment
- claim_won/claim_result proof metadata or minimal claim decision
- optional receipt anchor
Full verified ledger replay for higher-trust/enterprise workflows.
Use Agent Wire v1.1 for broader lifecycle/task/artifact reference events on HCS.
- task.created/available refs
- claim lifecycle
- artifact.ready refs
- task.complete/fail summaries and verification refs
- workflow/reducer events
Bezel API owns product tables in its implementation repo/database. RedKey Studio owns design artifacts until approval.
- 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.
studio_projects.id c8bc3eed-c513-4dc8-9bc1-30c6723e232c tracks design state for Bezel API.
Approved design artifacts can be anchored through approved_artifacts/HFS before dispatching implementation tasks.
studio_artifacts rows hold draft/approved planning artifacts before execution.