gabriel / musehub public
type-contracts.md markdown
4,654 lines 174.3 KB
Raw
sha256:a10adeeb7a0169cb9900f9806ed7a973047258abb6283724fe55e8eb68ff3f0a init: musehub initial commit Human 71 days ago

Musehub — Type Contracts Reference

Auto-generated: 2026-04-07 Source: scripts/gen_type_contracts.py (repo: musehub) Check for drift: python scripts/gen_type_contracts.py --check

Do not edit this file manually. It is regenerated from source on every commit. To update, change the source types and re-run the generator.


Table of Contents


Enums

Permissionmusehub/api/routes/musehub/collaborators.py

Collaborator permission levels in ascending order of authority.

Bases: StrEnum

Member Value
read 'read'
write 'write'
admin 'admin'
owner 'owner'

KeyAlgorithmmusehub/crypto/keys.py

Supported key algorithm identifiers (wire strings).

Bases: str, Enum

Member Value
ED25519 'ed25519'
ML_DSA_65 'ml-dsa-65'

ContextDepthmusehub/models/musehub_context.py

Depth level controlling how much data the context endpoint returns.

Bases: StrEnum

Member Value
brief 'brief'
standard 'standard'
verbose 'verbose'

ContextFormatmusehub/models/musehub_context.py

Wire format for the context response.

Bases: StrEnum

Member Value
json 'json'
yaml 'yaml'

MuseHubDivergenceLevelmusehub/services/musehub_divergence.py

Qualitative label for a per-dimension or overall divergence score.

Bases: StrEnum

Member Value
NONE 'NONE'
LOW 'LOW'
MED 'MED'
HIGH 'HIGH'

TypedDicts

DAWToolCallMessagemusehub/contracts/mcp_types.py

Message sent from the MCP server to the connected DAW over WebSocket.

Bases: TypedDict

Field Type Required Default
type Literal['toolCall']
requestId str
tool str
arguments dict[str, JSONValue]

DAWToolResponsemusehub/contracts/mcp_types.py

Response sent from the DAW back to the MCP server after tool execution.

Bases: TypedDict

Field Type Required Default
success Required[bool]
content list[MCPContentBlock]
isError bool

ElicitationActionmusehub/contracts/mcp_types.py

The action taken by the user in response to an elicitation request.

Bases: TypedDict

Field Type Required Default
action Required[str]
content NotRequired[dict[str, object]]

ElicitationRequestmusehub/contracts/mcp_types.py

An elicitation/create request sent from the server to the client.

Bases: TypedDict

Field Type Required Default
mode Required[str]
message Required[str]
requestedSchema NotRequired[dict[str, object]]
url NotRequired[str]
elicitationId NotRequired[str]

ElicitationResponsemusehub/contracts/mcp_types.py

A JSON-RPC 2.0 response from the client to an elicitation/create request.

Bases: TypedDict

Field Type Required Default
action Required[str]
content NotRequired[dict[str, object]]

MCPCallResponsemusehub/contracts/mcp_types.py

Full JSON-RPC response for the tools/call method.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | str | ✓ | | | id | str | int | None | ✓ | | | result | MCPCallResult | ✓ | |

MCPCallResultmusehub/contracts/mcp_types.py

Result body for the tools/call JSON-RPC method.

Bases: TypedDict

Field Type Required Default
content Required[list[MCPContentBlock]]
isError bool

MCPCapabilitiesmusehub/contracts/mcp_types.py

MCP server capabilities advertised during the initialize handshake.

Bases: TypedDict

Field Type Required Default
tools MCPToolsCapability
resources MCPResourcesCapability

MCPCapabilitiesResultmusehub/contracts/mcp_types.py

Result body for initialize — capability block.

Bases: TypedDict

Field Type Required Default
tools MCPToolsCapability

MCPContentBlockmusehub/contracts/mcp_types.py

A content block in an MCP tool result (currently always text).

Bases: TypedDict

Field Type Required Default
type str
text str

MCPErrorDetailmusehub/contracts/mcp_types.py

The error object inside a JSON-RPC 2.0 error response.

Bases: TypedDict

Field Type Required Default
code Required[int]
message Required[str]
data JSONValue

MCPErrorResponsemusehub/contracts/mcp_types.py

A JSON-RPC 2.0 error response.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | str | ✓ | | | id | str | int | None | ✓ | | | error | MCPErrorDetail | ✓ | |

MCPInitializeParamsmusehub/contracts/mcp_types.py

Params for the initialize JSON-RPC method.

Bases: TypedDict

Field Type Required Default
protocolVersion Required[str]
clientInfo dict[str, str]
capabilities dict[str, JSONValue]

MCPInitializeResponsemusehub/contracts/mcp_types.py

Full JSON-RPC response for the initialize method.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | str | ✓ | | | id | str | int | None | ✓ | | | result | MCPInitializeResult | ✓ | |

MCPInitializeResultmusehub/contracts/mcp_types.py

Result body for the initialize JSON-RPC method.

Bases: TypedDict

Field Type Required Default
protocolVersion str
serverInfo MCPServerInfo
capabilities MCPCapabilitiesResult

MCPInputSchemamusehub/contracts/mcp_types.py

JSON Schema describing an MCP tool's accepted arguments.

Bases: TypedDict

Field Type Required Default
type Required[str]
properties Required[dict[str, MCPPropertyDef]]
required list[str]

MCPPropertyDefmusehub/contracts/mcp_types.py

JSON Schema definition for a single MCP tool property.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | type | Required[str] | ✓ | | | description | str | ✓ | | | enum | list[str | int | float] | ✓ | | | minimum | float | ✓ | | | maximum | float | ✓ | | | default | JSONValue | ✓ | | | items | dict[str, JSONValue] | ✓ | | | properties | dict[str, 'MCPPropertyDef'] | ✓ | |

MCPRequestmusehub/contracts/mcp_types.py

An incoming JSON-RPC 2.0 message from an MCP client.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | Required[str] | ✓ | | | method | Required[str] | ✓ | | | id | str | int | None | ✓ | | | params | JSONObject | ✓ | |

MCPResourcesCapabilitymusehub/contracts/mcp_types.py

The resources entry in MCPCapabilities.

Bases: TypedDict

No annotated fields.

MCPServerInfomusehub/contracts/mcp_types.py

MCP server info returned in initialize responses and get_server_info().

Bases: TypedDict

Field Type Required Default
name str
version str
protocolVersion str
capabilities MCPCapabilities

MCPSuccessResponsemusehub/contracts/mcp_types.py

A JSON-RPC 2.0 success response.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | str | ✓ | | | id | str | int | None | ✓ | | | result | JSONObject | ✓ | |

MCPToolAnnotationsmusehub/contracts/mcp_types.py

MCP 2025-11-25 tool annotations — behavioural hints for LLM clients.

Bases: TypedDict

Field Type Required Default
readOnlyHint bool
destructiveHint bool
idempotentHint bool
openWorldHint bool

MCPToolCallParamsmusehub/contracts/mcp_types.py

Params for the tools/call JSON-RPC method.

Bases: TypedDict

Field Type Required Default
name str
arguments JSONObject

MCPToolDefmusehub/contracts/mcp_types.py

Definition of a single MCP tool exposed to LLM clients.

Bases: TypedDict

Field Type Required Default
name Required[str]
description Required[str]
inputSchema Required[MCPInputSchema]
annotations MCPToolAnnotations
server_side bool

MCPToolsCapabilitymusehub/contracts/mcp_types.py

The tools entry in MCPCapabilities.

Bases: TypedDict

No annotated fields.

MCPToolsListResponsemusehub/contracts/mcp_types.py

Full JSON-RPC response for the tools/list method.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | jsonrpc | str | ✓ | | | id | str | int | None | ✓ | | | result | MCPToolsListResult | ✓ | |

MCPToolsListResultmusehub/contracts/mcp_types.py

Result body for the tools/list JSON-RPC method.

Bases: TypedDict

Field Type Required Default
tools list[MCPToolDef]

SessionInfomusehub/contracts/mcp_types.py

Summary of an active MCP session — returned in server metadata endpoints.

Bases: TypedDict

| Field | Type | Required | Default | |-------|------|:--------:|---------| | session_id | Required[str] | ✓ | | | user_id | Required[str | None] | ✓ | | | client_capabilities | NotRequired[dict[str, object]] | ✓ | | | pending_count | NotRequired[int] | ✓ | | | sse_queue_count | NotRequired[int] | ✓ | | | created_at | NotRequired[float] | ✓ | | | last_active | NotRequired[float] | ✓ | | | supports_form_elicitation | NotRequired[bool] | ✓ | | | supports_url_elicitation | NotRequired[bool] | ✓ | |

MCPPromptArgumentmusehub/mcp/prompts.py

A single named argument for an MCP prompt.

Bases: TypedDict

Field Type Required Default
name Required[str]
description str
required bool

MCPPromptDefmusehub/mcp/prompts.py

Definition of a single MCP prompt exposed to agents.

Bases: TypedDict

Field Type Required Default
name Required[str]
description Required[str]
arguments list[MCPPromptArgument]

MCPPromptMessagemusehub/mcp/prompts.py

A single message in an MCP prompt response.

Bases: TypedDict

Field Type Required Default
role str
content MCPPromptMessageContent

MCPPromptMessageContentmusehub/mcp/prompts.py

The content of a single prompt message.

Bases: TypedDict

Field Type Required Default
type str
text str

MCPPromptResultmusehub/mcp/prompts.py

The result returned by prompts/get.

Bases: TypedDict

Field Type Required Default
description str
messages list[MCPPromptMessage]

MCPResourcemusehub/mcp/resources.py

A concrete MCP resource (static URI).

Bases: TypedDict

Field Type Required Default
uri Required[str]
name Required[str]
description str
mimeType str

MCPResourceContentmusehub/mcp/resources.py

The content object returned inside a resources/read response.

Bases: TypedDict

Field Type Required Default
uri str
mimeType str
text str

MCPResourceTemplatemusehub/mcp/resources.py

An MCP resource template (RFC 6570 URI template).

Bases: TypedDict

Field Type Required Default
uriTemplate Required[str]
name Required[str]
description str
mimeType str

IssueEventPayloadmusehub/models/musehub.py

Payload emitted when an issue is opened or closed.

Bases: TypedDict

Field Type Required Default
repoId str
action str
issueId str
number int
title str
state str

ProposalEventPayloadmusehub/models/musehub.py

Payload emitted when a merge proposal is opened or merged.

Bases: TypedDict

Field Type Required Default
repoId str
action str
proposalId str
title str
fromBranch str
toBranch str
state str
mergeCommitId NotRequired[str]

PushEventPayloadmusehub/models/musehub.py

Payload emitted when commits are pushed to a MuseHub repo.

Bases: TypedDict

Field Type Required Default
repoId str
branch str
headCommitId str
pushedBy str
commitCount int

Pydantic Models

CollaboratorInviteRequestmusehub/api/routes/musehub/collaborators.py

Body for POST /collaborators — invite a new collaborator.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | handle | str | ✓ | | | permission | Permission | ✓ | Field(Permission.write, description='Initial permission level (read | write | admin)') |

CollaboratorListResponsemusehub/api/routes/musehub/collaborators.py

Paginated list of repository collaborators.

Bases: CamelModel

Field Type Required Default
collaborators list[CollaboratorResponse]
total int

CollaboratorPermissionUpdatemusehub/api/routes/musehub/collaborators.py

Body for PUT /collaborators/{handle}/permission — update permission.

Bases: CamelModel

Field Type Required Default
permission Permission

CollaboratorResponsemusehub/api/routes/musehub/collaborators.py

A single collaborator entry.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | collaborator_id | str | ✓ | | | repo_id | str | ✓ | | | handle | str | ✓ | | | permission | str | ✓ | | | invited_by | str | None | | Field(None, description='Handle of the inviter (null if added programmatically)') |

RegisterDomainRequestmusehub/api/routes/musehub/domains.py

Body for registering a new domain plugin.

Bases: BaseModel

Field Type Required Default
author_slug str
slug str
display_name str
description str ''
capabilities dict[str, object]
viewer_type str 'generic'
version str '1.0.0'

AssignLabelsRequestmusehub/api/routes/musehub/labels.py

Body for bulk-assigning labels to an issue or proposal.

Bases: BaseModel

Field Type Required Default
label_ids list[str]

LabelCreatemusehub/api/routes/musehub/labels.py

Payload for creating a new label.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | ✓ | | | color | str | ✓ | | | description | str | None | | Field(None, max_length=200, description='Optional human-readable description') |

LabelListResponsemusehub/api/routes/musehub/labels.py

Paginated list of labels.

Bases: BaseModel

Field Type Required Default
items list[LabelResponse]
total int

LabelResponsemusehub/api/routes/musehub/labels.py

Public representation of a label.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | label_id | str | ✓ | | | repo_id | str | ✓ | | | name | str | ✓ | | | color | str | ✓ | | | description | str | None | | None |

LabelUpdatemusehub/api/routes/musehub/labels.py

Payload for updating an existing label (all fields optional).

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | None | | Field(None, min_length=1, max_length=50) | | color | str | None | | Field(None, pattern='^#[0-9a-fA-F]{6}$') | | description | str | None | | Field(None, max_length=200) |

MilestoneUpdatemusehub/api/routes/musehub/milestones.py

Body for PATCH /repos/{repo_id}/milestones/{number}.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | title | str | None | | Field(None, min_length=1, max_length=255, description='New milestone title') | | description | str | None | | Field(None, description='New description (Markdown)') | | due_on | datetime | None | | Field(None, description='New due date (ISO-8601 UTC); null to clear') | | state | str | None | | Field(None, pattern='^(open|closed)$', description="Transition state: 'open' or 'closed'") |

SetTopicsRequestmusehub/api/routes/musehub/topics.py

Body for POST /repos/{repo_id}/topics.

Bases: BaseModel

Field Type Required Default
topics list[str]

SetTopicsResponsemusehub/api/routes/musehub/topics.py

Result of POST /repos/{repo_id}/topics.

Bases: BaseModel

Field Type Required Default
repo_id str
topics list[str]

TopicItemmusehub/api/routes/musehub/topics.py

A single topic entry returned by GET /topics.

Bases: BaseModel

Field Type Required Default
name str
repo_count int

TopicListResponsemusehub/api/routes/musehub/topics.py

Response for GET /musehub/topics.

Bases: BaseModel

Field Type Required Default
topics list[TopicItem]

TopicReposResponsemusehub/api/routes/musehub/topics.py

Paginated repo list for GET /musehub/topics/{tag}/repos.

Bases: BaseModel

Field Type Required Default
tag str
repos list[ExploreRepoResult]
total int
page int
page_size int

_LabelActionResponsemusehub/api/routes/musehub/ui_labels.py

Returned by create / edit / delete / reset — confirms the result.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | ok | bool | ✓ | | | message | str | ✓ | | | label_id | str | None | | None |

_LabelCreateBodymusehub/api/routes/musehub/ui_labels.py

Request body for creating a label.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | ✓ | | | color | str | ✓ | | | description | str | None | | Field(None, max_length=200) |

_LabelEditBodymusehub/api/routes/musehub/ui_labels.py

Request body for editing a label (all fields optional).

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | None | | Field(None, min_length=1, max_length=50) | | color | str | None | | Field(None, pattern='^#[0-9a-fA-F]{6}$') | | description | str | None | | Field(None, max_length=200) |

_LabelListPayloadmusehub/api/routes/musehub/ui_labels.py

JSON payload for the labels list — consumed by the template JS and agents.

Bases: BaseModel

Field Type Required Default
labels list[_LabelRow]
total int

_LabelRowmusehub/api/routes/musehub/ui_labels.py

Internal representation of a label row with issue count.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | label_id | str | ✓ | | | repo_id | str | ✓ | | | name | str | ✓ | | | color | str | ✓ | | | description | str | None | | None | | issue_count | int | | 0 |

CuratedGroupmusehub/api/routes/musehub/ui_topics.py

A labelled set of topic items surfaced on the topics index page.

Bases: CamelModel

Field Type Required Default
label str
topics list[TopicItem]

TopicsIndexResponsemusehub/api/routes/musehub/ui_topics.py

JSON response for GET /topics.

Bases: CamelModel

Field Type Required Default
all_topics list[TopicItem]
curated_groups list[CuratedGroup]
total int

CreateProfileBodymusehub/api/routes/musehub/users.py

Body for POST /api/musehub/users — create a public profile for the authenticated user.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | username | str | ✓ | | | bio | str | None | | Field(None, max_length=500, description='Short bio (Markdown supported)') | | avatar_url | str | None | | Field(None, max_length=2048, description='Avatar image URL') |

UserCardResponsemusehub/api/routes/musehub/users.py

Compact user card returned by followers-list and following-list endpoints.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | username | str | ✓ | | | bio | str | None | | None | | avatar_url | str | None | | None |

Settingsmusehub/config.py

Application settings loaded from environment variables.

Bases: BaseSettings

| Field | Type | Required | Default | |-------|------|:--------:|---------| | app_name | str | | 'Muse' | | app_version | str | | _app_version_from_package() | | debug | bool | | False | | muse_env | str | | 'production' | | host | str | | '0.0.0.0' | | port | int | | 10001 | | database_url | str | None | | None | | db_password | str | None | | None | | cors_origins | list[str] | | [] | | aws_region | str | | 'eu-west-1' | | aws_s3_asset_bucket | str | None | | None | | aws_cloudfront_domain | str | None | | None | | presign_expiry_seconds | int | | 1800 | | r2_bucket | str | None | | None | | r2_endpoint | str | None | | None | | r2_access_key_id | str | None | | None | | r2_secret_access_key | str | None | | None | | r2_region | str | | 'auto' | | asset_rate_limit_per_device | str | | '30/minute' | | asset_rate_limit_per_ip | str | | '120/minute' | | mcp_rate_limit_human | str | | '60/minute' | | mcp_rate_limit_agent | str | | '600/minute' | | mcp_rate_limit_anonymous | str | | '20/minute' | | db_pool_timeout | int | | 30 | | slow_query_threshold_ms | int | | 100 | | mcp_push_per_user_quota_bytes | int | | 10 * 1024 * 1024 * 1024 | | per_repo_quota_bytes | int | | 5 * 1024 * 1024 * 1024 | | object_retention_days | int | | 30 | | muse_mcp_url | str | None | | None | | mcp_token | str | None | | None | | musehub_objects_dir | str | | '/data/musehub/objects' | | webhook_secret_key | str | None | | None | | require_signed_commits | bool | | False | | trusted_agent_ids | list[str] | | [] |

MCPInputSchemaWiremusehub/contracts/mcp_types.py

Pydantic-safe wire model for an MCP tool's JSON Schema input descriptor.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | type | str | | 'object' | | properties | dict[str, MCPPropertyDefWire] | | (factory) | | required | list[str] | None | | None |

MCPPropertyDefWiremusehub/contracts/mcp_types.py

Pydantic-safe wire model for a single JSON Schema property definition.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | type | str | ✓ | | | description | str | None | | None | | enum | list[str | int | float] | None | | None | | minimum | float | None | | None | | maximum | float | None | | None | | default | PydanticJson | None | | None | | items | dict[str, PydanticJson] | None | | None | | properties | dict[str, 'MCPPropertyDefWire'] | None | | None |

MCPToolDefWiremusehub/contracts/mcp_types.py

Pydantic-safe wire model for a single MCP tool definition.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | ✓ | | | description | str | ✓ | | | inputSchema | MCPInputSchemaWire | | (factory) | | annotations | dict[str, bool] | None | | None | | server_side | bool | None | | None |

CamelModelmusehub/models/base.py

Base model that serializes to camelCase on the wire.

Bases: BaseModel

No annotated fields.

CoordPollRequestmusehub/models/coord.py

Request body for POST /{owner}/{slug}/coord/pull.

Bases: BaseModel

Field Type Required Default
since_id int 0
kinds list[str] (factory)
limit int 500

CoordPullResponsemusehub/models/coord.py

Response for POST /{owner}/{slug}/coord/pull.

Bases: BaseModel

Field Type Required Default
records list[CoordRecordOut]
cursor int

CoordPushRequestmusehub/models/coord.py

Request body for POST /{owner}/{slug}/coord/push.

Bases: BaseModel

Field Type Required Default
records list[CoordRecordIn]

CoordPushResponsemusehub/models/coord.py

Response for POST /{owner}/{slug}/coord/push.

Bases: BaseModel

Field Type Required Default
inserted int
skipped int

CoordRecordInmusehub/models/coord.py

A single coordination record to be pushed to MuseHub.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | kind | str | ✓ | | | record_uuid | str | ✓ | | | run_id | str | | '' | | payload | dict[str, Any] | ✓ | | | expires_at | datetime | None | | None |

CoordRecordOutmusehub/models/coord.py

A coordination record returned from MuseHub (pull or watch).

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | int | ✓ | | | repo_id | str | ✓ | | | kind | str | ✓ | | | record_uuid | str | ✓ | | | run_id | str | ✓ | | | payload | dict[str, Any] | ✓ | | | created_at | datetime | ✓ | | | expires_at | datetime | None | | None |

ActivityEventResponsemusehub/models/musehub.py

Wire representation of a single repo-level activity event.

Bases: CamelModel

Field Type Required Default
event_id str
repo_id str
event_type str
actor str
description str
metadata dict[str, object] (factory)
created_at datetime

ActivityFeedResponsemusehub/models/musehub.py

Paginated activity event feed for a repo (newest-first).

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | events | list[ActivityEventResponse] | ✓ | | | total | int | ✓ | | | page | int | ✓ | | | page_size | int | ✓ | | | event_type_filter | str | None | | None |

AgentCardEntrymusehub/models/musehub.py

A single agent that has committed to repos owned by a human identity.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | agent_id | str | ✓ | | | model_id | str | None | | None | | model_label | str | ✓ | | | commit_count | int | ✓ | | | repo_count | int | ✓ | | | last_seen | datetime | ✓ | |

AgentFleetResponsemusehub/models/musehub.py

All agents deployed by a given handle, sorted by commit volume.

Bases: CamelModel

Field Type Required Default
handle str
agents list[AgentCardEntry]
total int

ApiChangeSummaryResponsemusehub/models/musehub.py

A public-API symbol that was added, removed, or modified.

Bases: CamelModel

Field Type Required Default
address str
language str ''
kind str ''
change str ''

BlobMetaResponsemusehub/models/musehub.py

Wire representation of a single file (blob) in the Muse tree browser.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | object_id | str | ✓ | | | path | str | ✓ | | | filename | str | ✓ | | | size_bytes | int | ✓ | | | sha | str | ✓ | | | created_at | datetime | ✓ | | | raw_url | str | ✓ | | | file_type | str | ✓ | | | content_text | str | None | | Field(None, description='UTF-8 content for JSON/XML files up to 256 KB; None for binary or oversized files') |

BranchDetailListResponsemusehub/models/musehub.py

List of branches with detail — used by the branch list page and its JSON variant.

Bases: CamelModel

Field Type Required Default
branches list[BranchDetailResponse]
default_branch str Field('main', description="Name of the repo's default branch")

BranchDetailResponsemusehub/models/musehub.py

Branch pointer enriched with ahead/behind counts and musical divergence.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | branch_id | str | ✓ | | | name | str | ✓ | | | head_commit_id | str | None | | Field(None, description='HEAD commit ID; null for an empty branch') | | is_default | bool | | Field(False, description="True when this is the repo's default branch") | | ahead_count | int | | Field(0, ge=0, description='Commits on this branch not yet on the default branch') | | behind_count | int | | Field(0, ge=0, description='Commits on the default branch not yet on this branch') | | divergence | BranchDivergenceScores | | (factory) |

BranchDivergenceScoresmusehub/models/musehub.py

Placeholder musical divergence scores between a branch and the default branch.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | melodic | float | None | | Field(None, description='Melodic divergence (0–1)') | | harmonic | float | None | | Field(None, description='Harmonic divergence (0–1)') | | rhythmic | float | None | | Field(None, description='Rhythmic divergence (0–1)') | | structural | float | None | | Field(None, description='Structural divergence (0–1)') | | dynamic | float | None | | Field(None, description='Dynamic divergence (0–1)') |

BranchListResponsemusehub/models/musehub.py

Paginated list of branches.

Bases: CamelModel

Field Type Required Default
branches list[BranchResponse]

BranchResponsemusehub/models/musehub.py

Wire representation of a branch pointer.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | branch_id | str | ✓ | | | name | str | ✓ | | | head_commit_id | str | None | | Field(None, description='HEAD commit ID; null for an empty branch', examples=['a3f8c1d2e4b5']) |

ChangelogEntryResponsemusehub/models/musehub.py

A single changelog entry auto-generated from commit metadata.

Bases: CamelModel

Field Type Required Default
commit_id str
message str
sem_ver_bump str ''
breaking_changes list[str] (factory)
author str ''
timestamp str ''

CollaboratorAccessResponsemusehub/models/musehub.py

Response for the collaborator access-check endpoint.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | username | str | ✓ | | | permission | str | ✓ | | | accepted_at | datetime | None | | Field(None, description='UTC timestamp when the collaborator accepted the invitation; null for owners') |

CommitDiffDimensionScoremusehub/models/musehub.py

Per-dimension change score between a commit and its parent.

Bases: CamelModel

Field Type Required Default
dimension str
score float
label str
color str

CommitDiffSummaryResponsemusehub/models/musehub.py

Multi-dimensional diff summary between a commit and its parent.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | str | ✓ | | | parent_id | str | None | | Field(None, description='Parent commit ID; None for root commits') | | dimensions | list[CommitDiffDimensionScore] | ✓ | | | overall_score | float | ✓ | |

CommitInputmusehub/models/musehub.py

A single commit record transferred in a push payload.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | str | ✓ | | | parent_ids | list[str] | | (factory) | | message | str | ✓ | | | snapshot_id | str | None | | None | | timestamp | datetime | ✓ | | | author | str | None | | None |

CommitListResponsemusehub/models/musehub.py

Paginated list of commits (newest first).

Bases: CamelModel

Field Type Required Default
commits list[CommitResponse]
total int

CommitResponsemusehub/models/musehub.py

Wire representation of a pushed commit.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | str | ✓ | | | branch | str | ✓ | | | parent_ids | list[str] | ✓ | | | message | str | ✓ | | | author | str | ✓ | | | timestamp | datetime | ✓ | | | snapshot_id | str | None | | None |

CompareResponsemusehub/models/musehub.py

Multi-dimensional musical comparison between two refs in a MuseHub repo.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repo_id | str | ✓ | | | base_ref | str | ✓ | | | head_ref | str | ✓ | | | common_ancestor | str | None | | None | | dimensions | list[DivergenceDimensionResponse] | ✓ | | | overall_score | float | ✓ | | | commits | list[CommitResponse] | ✓ | | | emotion_diff | EmotionDiffResponse | ✓ | | | create_proposal_url | str | ✓ | |

ContributionDaymusehub/models/musehub.py

A single day in the contribution heatmap.

Bases: CamelModel

Field Type Required Default
date str
count int

ContributorCreditsmusehub/models/musehub.py

Wire representation of a single contributor's credit record.

Bases: CamelModel

Field Type Required Default
author str
session_count int
contribution_types list[str]
first_active datetime
last_active datetime

CreateRepoRequestmusehub/models/musehub.py

Body for POST /musehub/repos — creation wizard.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | ✓ | | | owner | str | ✓ | | | visibility | str | | Field('private', pattern='^(public|private)$') | | description | str | | Field('', description='Short description shown on the explore page') | | tags | list[str] | | (factory) | | license | str | None | | Field(None, max_length=100, description="License identifier (e.g. 'CC BY 4.0', 'MIT')") | | topics | list[str] | | (factory) | | initialize | bool | | Field(True, description='When true, create an initial empty commit + default branch so the repo is immediately browsable') | | default_branch | str | | Field('main', min_length=1, max_length=255, description='Name of the default branch created when initialize=true') | | template_repo_id | str | None | | Field(None, description='UUID of a public repo to copy topics/description/labels from; must be public') | | domain_scoped_id | str | None | | Field(None, description="Scoped domain ID (e.g. '@gabriel/midi') — always set when created via /domains/@author/slug/new") |

CreditsResponsemusehub/models/musehub.py

Wire representation of the full credits roll for a repo.

Bases: CamelModel

Field Type Required Default
repo_id str
contributors list[ContributorCredits]
sort str
total_contributors int

DagEdgemusehub/models/musehub.py

A directed edge in the commit DAG.

Bases: CamelModel

Field Type Required Default
source str
target str

DagGraphResponsemusehub/models/musehub.py

Topologically sorted commit graph for a MuseHub repo.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | nodes | list[DagNode] | ✓ | | | edges | list[DagEdge] | ✓ | | | head_commit_id | str | None | | None |

DagNodemusehub/models/musehub.py

A single commit node in the repo's directed acyclic graph.

Bases: CamelModel

Field Type Required Default
commit_id str
message str
author str
timestamp datetime
branch str
parent_ids list[str]
is_head bool False
branch_labels list[str] (factory)
tag_labels list[str] (factory)
commit_type str ''
sem_ver_bump str 'none'
is_breaking bool False
is_agent bool False
sym_added int 0
sym_removed int 0

DivergenceDimensionResponsemusehub/models/musehub.py

Wire representation of divergence scores for a single musical dimension.

Bases: CamelModel

Field Type Required Default
dimension str
level str
score float
description str
branch_a_commits int
branch_b_commits int

DivergenceResponsemusehub/models/musehub.py

Full musical divergence report between two MuseHub branches.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repo_id | str | ✓ | | | branch_a | str | ✓ | | | branch_b | str | ✓ | | | common_ancestor | str | None | ✓ | | | dimensions | list[DivergenceDimensionResponse] | ✓ | | | overall_score | float | ✓ | |

EmotionDiffResponsemusehub/models/musehub.py

Delta between the emotional character of base and head refs.

Bases: CamelModel

Field Type Required Default
energy_delta float
valence_delta float
tension_delta float
darkness_delta float
base_energy float
base_valence float
base_tension float
base_darkness float
head_energy float
head_valence float
head_tension float
head_darkness float

ExploreRepoResultmusehub/models/musehub.py

A public repo card shown on the explore/discover page.

Bases: CamelModel

Field Type Required Default
repo_id str
name str
owner str
slug str
owner_user_id str
description str
tags list[str]
star_count int
commit_count int
created_at datetime

ExploreResponsemusehub/models/musehub.py

Paginated response from GET /api/discover/repos.

Bases: CamelModel

Field Type Required Default
repos list[ExploreRepoResult]
total int
page int
page_size int

FileHotspotResponsemusehub/models/musehub.py

A file and how many times it was touched across the release's commits.

Bases: CamelModel

Field Type Required Default
file_path str
change_count int 0
language str ''

ForkNetworkNodemusehub/models/musehub.py

A single node in the fork network tree.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | owner | str | ✓ | | | repo_slug | str | ✓ | | | repo_id | str | ✓ | | | divergence_commits | int | ✓ | | | forked_by | str | ✓ | | | forked_at | datetime | None | | Field(None, description='Timestamp when the fork was created (None for root repo)') | | children | list['ForkNetworkNode'] | | (factory) |

ForkNetworkResponsemusehub/models/musehub.py

Fork network graph for a repo — root with recursive children.

Bases: CamelModel

Field Type Required Default
root ForkNetworkNode
total_forks int

GlobalSearchCommitMatchmusehub/models/musehub.py

A single commit that matched the search query in a cross-repo search.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | str | ✓ | | | message | str | ✓ | | | author | str | ✓ | | | branch | str | ✓ | | | timestamp | datetime | ✓ | | | repo_id | str | ✓ | | | repo_name | str | ✓ | | | repo_owner | str | ✓ | | | repo_visibility | str | ✓ | | | audio_object_id | str | None | | None |

GlobalSearchRepoGroupmusehub/models/musehub.py

All matching commits for a single repo, with repo-level metadata.

Bases: CamelModel

Field Type Required Default
repo_id str
repo_name str
repo_owner str
repo_slug str
repo_visibility str
matches list[GlobalSearchCommitMatch]
total_matches int

GlobalSearchResultmusehub/models/musehub.py

Top-level response for GET /search?q={query}.

Bases: CamelModel

Field Type Required Default
query str
mode str
groups list[GlobalSearchRepoGroup]
total_repos_searched int
page int
page_size int

GrooveCheckResponsemusehub/models/musehub.py

Rhythmic consistency dashboard data for a commit range in a MuseHub repo.

Bases: CamelModel

Field Type Required Default
commit_range str
threshold float
total_commits int
flagged_commits int
worst_commit str
entries list[GrooveCommitEntry] (factory)

GrooveCommitEntrymusehub/models/musehub.py

Per-commit groove metrics within a groove-check analysis window.

Bases: CamelModel

Field Type Required Default
commit str
groove_score float
drift_delta float
status str
track str
section str
midi_files int

IssueAssignRequestmusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/issues/{number}/assign.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | assignee | str | None | | Field(None, description='Display name or user ID to assign; null to unassign', examples=['miles_davis']) |

IssueCommentCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/issues/{number}/comments.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | body | str | ✓ | | | parent_id | str | None | | Field(None, description='Parent comment UUID for threaded replies; omit for top-level comments') |

IssueCommentListResponsemusehub/models/musehub.py

Threaded discussion on a single issue.

Bases: CamelModel

Field Type Required Default
comments list[IssueCommentResponse]
total int

IssueCommentResponsemusehub/models/musehub.py

Wire representation of a single issue comment.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | comment_id | str | ✓ | | | issue_id | str | ✓ | | | author | str | ✓ | | | body | str | ✓ | | | parent_id | str | None | | Field(None, description='Parent comment UUID; null for top-level comments') | | is_deleted | bool | | Field(False, description='True when the comment has been soft-deleted') | | created_at | datetime | ✓ | | | updated_at | datetime | ✓ | |

IssueCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/issues.

Bases: CamelModel

Field Type Required Default
title str
body str Field('', max_length=10000, description='Issue description (Markdown)', examples=["The Dm→Am→E7→Am progression in the verse doesn't resolve — suggest Dm→G7→CMaj7."])
labels list[str] (factory)

IssueLabelAssignRequestmusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/issues/{number}/labels.

Bases: CamelModel

Field Type Required Default
labels list[str]

IssueListResponsemusehub/models/musehub.py

Paginated list of issues for a repo.

Bases: CamelModel

Field Type Required Default
issues list[IssueResponse]
total int Field(0, ge=0, description='Total matching issues across all pages')

IssueResponsemusehub/models/musehub.py

Wire representation of a MuseHub issue.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | issue_id | str | ✓ | | | number | int | ✓ | | | title | str | ✓ | | | body | str | ✓ | | | state | str | ✓ | | | labels | list[str] | ✓ | | | author | str | | '' | | assignee | str | None | | Field(None, description='Display name of the assigned collaborator') | | milestone_id | str | None | | Field(None, description='Milestone UUID; null when not assigned') | | milestone_title | str | None | | Field(None, description='Milestone title for display; null when not assigned') | | created_at | datetime | ✓ | | | updated_at | datetime | None | | Field(None, description='Last update timestamp (ISO-8601 UTC)') | | comment_count | int | | Field(0, description='Number of non-deleted comments on this issue') |

IssueUpdatemusehub/models/musehub.py

Body for PATCH /musehub/repos/{repo_id}/issues/{number} — partial update.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | title | str | None | | Field(None, min_length=1, max_length=500, description='Updated issue title') | | body | str | None | | Field(None, max_length=10000, description='Updated issue body (Markdown)') | | labels | list[str] | None | | Field(None, description='Replacement label list') |

LanguageStatResponsemusehub/models/musehub.py

File and symbol counts for a single programming language.

Bases: CamelModel

Field Type Required Default
language str
files int 0
symbols int 0

MilestoneCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/milestones.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | title | str | ✓ | | | description | str | | Field('', description='Milestone description (Markdown)', examples=['All tracks balanced and mastered for the first release cut.']) | | due_on | datetime | None | | Field(None, description='Optional due date (ISO-8601 UTC)') |

MilestoneListResponsemusehub/models/musehub.py

List of milestones for a repo.

Bases: CamelModel

Field Type Required Default
milestones list[MilestoneResponse]

MilestoneResponsemusehub/models/musehub.py

Wire representation of a MuseHub milestone.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | milestone_id | str | ✓ | | | number | int | ✓ | | | title | str | ✓ | | | description | str | | Field('', description='Milestone description (Markdown)') | | state | str | ✓ | | | author | str | | '' | | due_on | datetime | None | | Field(None, description='Optional due date; null when not set') | | open_issues | int | | Field(0, description='Number of open issues assigned to this milestone') | | closed_issues | int | | Field(0, description='Number of closed issues assigned to this milestone') | | created_at | datetime | ✓ | |

MuseHubContextCommitInfomusehub/models/musehub.py

Minimal commit metadata included in a MuseHub context document.

Bases: CamelModel

Field Type Required Default
commit_id str
message str
author str
branch str
timestamp datetime

MuseHubContextHistoryEntrymusehub/models/musehub.py

A single ancestor commit in the evolutionary history of the composition.

Bases: CamelModel

Field Type Required Default
commit_id str
message str
author str
timestamp datetime
active_tracks list[str]

MuseHubContextMusicalStatemusehub/models/musehub.py

State at the target commit, derived from stored artifact paths.

Bases: CamelModel

Field Type Required Default
active_tracks list[str]

MuseHubContextResponsemusehub/models/musehub.py

Human-readable and agent-consumable musical context document for a commit.

Bases: CamelModel

Field Type Required Default
repo_id str
current_branch str
head_commit MuseHubContextCommitInfo
musical_state MuseHubContextMusicalState
history list[MuseHubContextHistoryEntry]
missing_elements list[str]
suggestions dict[str, str]

ObjectInputmusehub/models/musehub.py

A binary object transferred in a push payload.

Bases: CamelModel

Field Type Required Default
object_id str
path str
content_b64 str

ObjectMetaListResponsemusehub/models/musehub.py

List of artifact metadata for a repo.

Bases: CamelModel

Field Type Required Default
objects list[ObjectMetaResponse]

ObjectMetaResponsemusehub/models/musehub.py

Wire representation of a stored artifact -- metadata only, no content bytes.

Bases: CamelModel

Field Type Required Default
object_id str
path str
size_bytes int
created_at datetime

ObjectResponsemusehub/models/musehub.py

A binary object returned in a pull response.

Bases: CamelModel

Field Type Required Default
object_id str
path str
content_b64 str

ProfileRepoSummarymusehub/models/musehub.py

Compact repo summary shown on a user's profile page.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repo_id | str | ✓ | | | name | str | ✓ | | | owner | str | ✓ | | | slug | str | ✓ | | | visibility | str | ✓ | | | star_count | int | ✓ | | | last_activity_at | datetime | None | ✓ | | | created_at | datetime | ✓ | |

ProfileResponsemusehub/models/musehub.py

Full wire representation of a MuseHub user profile.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | user_id | str | ✓ | | | username | str | ✓ | | | display_name | str | None | | None | | bio | str | None | | None | | avatar_url | str | None | | None | | location | str | None | | None | | website_url | str | None | | None | | twitter_handle | str | None | | None | | is_verified | bool | | False | | cc_license | str | None | | None | | pinned_repo_ids | list[str] | ✓ | | | repos | list[ProfileRepoSummary] | ✓ | | | contribution_graph | list[ContributionDay] | ✓ | | | session_credits | int | ✓ | | | created_at | datetime | ✓ | | | updated_at | datetime | ✓ | |

ProfileUpdateRequestmusehub/models/musehub.py

Body for PUT /api/users/{username}.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | display_name | str | None | | Field(None, max_length=255, description='Human-readable display name') | | bio | str | None | | Field(None, max_length=500, description='Short bio (Markdown supported)') | | avatar_url | str | None | | Field(None, max_length=2048, description='Avatar image URL') | | location | str | None | | Field(None, max_length=255, description='City or region') | | website_url | str | None | | Field(None, max_length=2048, description='Personal website or project URL') | | twitter_handle | str | None | | Field(None, max_length=64, description='Twitter/X handle without leading @') | | pinned_repo_ids | list[str] | None | | Field(None, max_length=6, description='Up to 6 repo_ids to pin on the profile page') |

ProposalCommentCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/proposals/{proposal_id}/comments.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | body | str | ✓ | | | target_type | str | | Field('general', pattern='^(general|track|region|note)$', description='Comment target granularity', examples=['region']) | | target_track | str | None | | Field(None, max_length=255, description='Instrument track name for track/region/note targets', examples=['bass']) | | target_beat_start | float | None | | Field(None, ge=0, description='First beat of the targeted region (inclusive)', examples=[16.0]) | | target_beat_end | float | None | | Field(None, ge=0, description='Last beat of the targeted region (exclusive)', examples=[24.0]) | | target_note_pitch | int | None | | Field(None, ge=0, le=127, description='MIDI pitch (0-127) for note-level targets', examples=[46]) | | parent_comment_id | str | None | | Field(None, description='ID of the parent comment when creating a threaded reply', examples=['a1b2c3d4-e5f6-7890-abcd-ef1234567890']) | | symbol_address | str | None | | Field(None, max_length=512, description="Symbol address to anchor this comment to (e.g. 'auth.py::AuthService.login'). Binds the comment to a specific named symbol in the Symbol Delta. Takes precedence over target_type for code-domain proposals.", examples=['core/engine.py::Engine.process']) |

ProposalCommentListResponsemusehub/models/musehub.py

Threaded list of review comments for a merge proposal.

Bases: CamelModel

Field Type Required Default
comments list[ProposalCommentResponse] (factory)
total int Field(0, ge=0, description='Total number of comments (all levels)')

ProposalCommentResponsemusehub/models/musehub.py

Wire representation of a single proposal review comment.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | comment_id | str | ✓ | | | proposal_id | str | ✓ | | | author | str | ✓ | | | body | str | ✓ | | | target_type | str | ✓ | | | target_track | str | None | | Field(None, description='Instrument track name when targeted') | | target_beat_start | float | None | | Field(None, description='Region start beat (inclusive)') | | target_beat_end | float | None | | Field(None, description='Region end beat (exclusive)') | | target_note_pitch | int | None | | Field(None, description='MIDI pitch for note-level targets') | | parent_comment_id | str | None | | Field(None, description='Parent comment ID for threaded replies') | | symbol_address | str | None | | Field(None, description='Symbol address anchor, if set') | | created_at | datetime | ✓ | | | replies | list[ProposalCommentResponse] | | (factory) |

ProposalCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/proposals.

Bases: CamelModel

Field Type Required Default
title str
from_branch str
to_branch str
body str Field('', max_length=10000, description='Merge proposal description (Markdown)', examples=['This branch adds an 8-bar bossa nova bridge in 5/4 with guitar and upright bass.'])

ProposalDiffDimensionScoremusehub/models/musehub.py

Per-dimension musical change score between the from_branch and to_branch of a merge proposal.

Bases: CamelModel

Field Type Required Default
dimension str
score float
level str
delta_label str
description str
from_branch_commits int
to_branch_commits int

ProposalDiffResponsemusehub/models/musehub.py

Musical diff between the from_branch and to_branch of a merge proposal.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | proposal_id | str | ✓ | | | repo_id | str | ✓ | | | from_branch | str | ✓ | | | to_branch | str | ✓ | | | dimensions | list[ProposalDiffDimensionScore] | ✓ | | | overall_score | float | None | | Field(None, ge=0.0, le=1.0, description='Mean of all five dimension scores; None for code-domain proposals') | | common_ancestor | str | None | | Field(None, description='Merge-base commit ID; None if no common ancestor') | | affected_sections | list[str] | | (factory) |

ProposalListResponsemusehub/models/musehub.py

Paginated list of merge proposals for a repo.

Bases: CamelModel

Field Type Required Default
proposals list[ProposalResponse]
total int Field(0, ge=0, description='Total matching merge proposals across all pages')

ProposalMergeRequestmusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/proposals/{proposal_id}/merge.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | merge_strategy | str | | Field('merge_commit', pattern='^(merge_commit|squash|rebase)$', description="Merge strategy: 'merge_commit' (default), 'squash', or 'rebase'") |

ProposalMergeResponsemusehub/models/musehub.py

Confirmation that a merge proposal was merged.

Bases: CamelModel

Field Type Required Default
merged bool
merge_commit_id str

ProposalResponsemusehub/models/musehub.py

Wire representation of a MuseHub merge proposal.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | proposal_id | str | ✓ | | | proposal_number | int | | Field(0, description='Per-repo sequential proposal number (1-based)') | | title | str | ✓ | | | body | str | ✓ | | | state | str | ✓ | | | from_branch | str | ✓ | | | to_branch | str | ✓ | | | merge_commit_id | str | None | | None | | merged_at | datetime | None | | None | | author | str | | '' | | created_at | datetime | ✓ | |

ProposalReviewCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/proposals/{proposal_id}/reviews.

Bases: CamelModel

Field Type Required Default
event str
body str Field('', max_length=10000, description="Review body (Markdown). Required when event='request_changes'.", examples=['Sounds great — the harmonic transitions in the bridge are exactly right.'])

ProposalReviewListResponsemusehub/models/musehub.py

List of reviews for a merge proposal.

Bases: CamelModel

Field Type Required Default
reviews list[ProposalReviewResponse] (factory)
total int Field(0, ge=0, description='Total number of review rows')

ProposalReviewResponsemusehub/models/musehub.py

Wire representation of a single proposal review.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | str | ✓ | | | proposal_id | str | ✓ | | | reviewer_username | str | ✓ | | | state | str | ✓ | | | body | str | None | | Field(None, description='Review comment body (Markdown); null for bare assignments') | | submitted_at | datetime | None | | Field(None, description='UTC timestamp when the review was submitted') | | created_at | datetime | ✓ | |

ProposalReviewerRequestmusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/proposals/{proposal_id}/reviewers.

Bases: CamelModel

Field Type Required Default
reviewers list[str]

PullResponsemusehub/models/musehub.py

Response for POST /musehub/repos/{repo_id}/pull.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commits | list[CommitResponse] | ✓ | | | objects | list[ObjectResponse] | ✓ | | | remote_head | str | None | ✓ | | | has_more | bool | | False | | next_cursor | str | None | | None |

PushResponsemusehub/models/musehub.py

Response for POST /musehub/repos/{repo_id}/push.

Bases: CamelModel

Field Type Required Default
ok bool
remote_head str

RefactorEventResponsemusehub/models/musehub.py

A single structural refactoring event detected in the release.

Bases: CamelModel

Field Type Required Default
kind str ''
address str ''
detail str ''
commit_id str ''

ReleaseAssetCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/releases/{tag}/assets.

Bases: CamelModel

Field Type Required Default
name str
label str Field('', max_length=255, description="Optional human-readable label, e.g. 'MIDI Bundle'")
content_type str Field('', max_length=128, description="MIME type, e.g. 'audio/midi', 'application/zip'")
size int Field(0, ge=0, description='File size in bytes; 0 when unknown')
download_url str

ReleaseAssetDownloadCountmusehub/models/musehub.py

Per-asset download count entry in a release download stats response.

Bases: CamelModel

Field Type Required Default
asset_id str
name str
label str Field('', description='Optional human-readable label')
download_count int Field(0, ge=0, description='Number of times this asset has been downloaded')

ReleaseAssetListResponsemusehub/models/musehub.py

List of assets attached to a release, returned by GET .../releases/{tag}/assets.

Bases: CamelModel

Field Type Required Default
release_id str
tag str
assets list[ReleaseAssetResponse]

ReleaseAssetResponsemusehub/models/musehub.py

Wire representation of a single release asset.

Bases: CamelModel

Field Type Required Default
asset_id str
release_id str
name str
label str Field('', description='Optional human-readable label')
content_type str Field('', description='MIME type of the artifact')
size int Field(0, ge=0, description='File size in bytes; 0 when unknown')
download_url str
download_count int Field(0, ge=0, description='Number of times the asset has been downloaded')
created_at datetime

ReleaseCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/releases.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | tag | str | ✓ | | | title | str | | Field('', max_length=500, description='Release title', examples=['Summer Sessions 2024 — Final Mix']) | | body | str | | Field('', max_length=10000, description='Release notes (Markdown)', examples=['## Summer Sessions 2024\n\nFinal arrangement with full brass section and 132 BPM tempo.']) | | commit_id | str | None | | Field(None, description='Commit to pin this release to', examples=['a3f8c1d2e4b5']) | | snapshot_id | str | None | | Field(None, description='Snapshot ID for reproducible builds') | | channel | str | | Field('stable', description='Distribution channel: stable | beta | alpha | nightly', examples=['stable']) | | semver_major | int | | Field(0, ge=0) | | semver_minor | int | | Field(0, ge=0) | | semver_patch | int | | Field(0, ge=0) | | semver_pre | str | | Field('', max_length=255, description="Pre-release label, e.g. 'beta.1'") | | semver_build | str | | Field('', max_length=255, description="Build metadata, e.g. '20250101'") | | agent_id | str | | Field('', max_length=255) | | model_id | str | | Field('', max_length=255) | | changelog | list[ChangelogEntryResponse] | | (factory) | | is_draft | bool | | Field(False, description='Save as draft — not yet publicly visible') | | gpg_signature | str | None | | Field(None, description='ASCII-armoured GPG signature for the tag object; omit when unsigned') | | semantic_report | SemanticReleaseReportResponse | None | | Field(None, description='Semantic analysis blob computed by the Muse CLI at push time.') |

ReleaseDownloadStatsResponsemusehub/models/musehub.py

Download counts per asset for a single release.

Bases: CamelModel

Field Type Required Default
release_id str
tag str
assets list[ReleaseAssetDownloadCount] (factory)
total_downloads int Field(0, ge=0, description='Sum of download_count across all assets')

ReleaseDownloadUrlsmusehub/models/musehub.py

Structured download package URLs for a release.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | metadata | str | None | | None |

ReleaseListResponsemusehub/models/musehub.py

List of releases for a repo (newest first).

Bases: CamelModel

Field Type Required Default
releases list[ReleaseResponse]

ReleaseResponsemusehub/models/musehub.py

Wire representation of a MuseHub release.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | release_id | str | ✓ | | | tag | str | ✓ | | | title | str | | '' | | body | str | | '' | | commit_id | str | None | | None | | snapshot_id | str | None | | None | | channel | str | | 'stable' | | semver_major | int | | 0 | | semver_minor | int | | 0 | | semver_patch | int | | 0 | | semver_pre | str | | '' | | semver_build | str | | '' | | download_urls | ReleaseDownloadUrls | ✓ | | | author | str | | '' | | agent_id | str | | '' | | model_id | str | | '' | | changelog | list[ChangelogEntryResponse] | | (factory) | | is_prerelease | bool | | False | | is_draft | bool | | False | | gpg_signature | str | None | | None | | semantic_report | SemanticReleaseReportResponse | None | | None | | created_at | datetime | ✓ | |

RepoListResponsemusehub/models/musehub.py

Paginated list of repos for the authenticated user.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repos | list[RepoResponse] | ✓ | | | next_cursor | str | None | | Field(None, description='Pagination cursor — pass as ?cursor= to get the next page') | | total | int | ✓ | |

RepoResponsemusehub/models/musehub.py

Wire representation of a MuseHub repo.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repo_id | str | ✓ | | | name | str | ✓ | | | owner | str | ✓ | | | slug | str | ✓ | | | visibility | str | ✓ | | | owner_user_id | str | ✓ | | | clone_url | str | ✓ | | | description | str | | Field('', description='Short description shown on the explore page', examples=['Classic jazz standards arranged for quartet']) | | tags | list[str] | | (factory) | | domain_id | str | None | | Field(None, description='ID of the registered Muse domain plugin for this repo') | | key_signature | str | None | | Field(None, description="Musical key signature, e.g. 'Bb major'") | | tempo_bpm | int | None | | Field(None, description='Tempo in beats per minute') | | created_at | datetime | ✓ | |

RepoSettingsPatchmusehub/models/musehub.py

Partial update body for PATCH /api/repos/{repo_id}/settings.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | None | | Field(None, description='New repo name') | | description | str | None | | Field(None, description='New description') | | visibility | str | None | | Field(None, pattern='^(public|private)$', description="'public' or 'private'") | | default_branch | str | None | | Field(None, description='New default branch name') | | has_issues | bool | None | | Field(None, description='Enable/disable issues tracker') | | has_projects | bool | None | | Field(None, description='Enable/disable projects board') | | has_wiki | bool | None | | Field(None, description='Enable/disable wiki') | | topics | list[str] | None | | Field(None, description='Replace topic tags (full list)') | | license | str | None | | Field(None, description='SPDX license identifier or display name') | | homepage_url | str | None | | Field(None, description='Project homepage URL') | | allow_merge_commit | bool | None | | Field(None, description='Allow merge commits on proposals') | | allow_squash_merge | bool | None | | Field(None, description='Allow squash merges on proposals') | | allow_rebase_merge | bool | None | | Field(None, description='Allow rebase merges on proposals') | | delete_branch_on_merge | bool | None | | Field(None, description='Auto-delete head branch after proposal merge') | | domain_id | str | None | | Field(None, description='UUID of the Muse domain plugin for this repo') |

RepoSettingsResponsemusehub/models/musehub.py

Mutable settings for a MuseHub repo.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | name | str | ✓ | | | description | str | | Field('', description='Short description shown on the explore page') | | visibility | str | ✓ | | | default_branch | str | | Field('main', description='Default branch name (used for clone and proposals)') | | has_issues | bool | | Field(True, description='Whether the issues tracker is enabled') | | has_projects | bool | | Field(False, description='Whether the projects board is enabled') | | has_wiki | bool | | Field(False, description='Whether the wiki is enabled') | | topics | list[str] | | (factory) | | license | str | None | | Field(None, description="SPDX license identifier or display name, e.g. 'CC BY 4.0'") | | homepage_url | str | None | | Field(None, description='Project homepage URL') | | allow_merge_commit | bool | | Field(True, description='Allow merge commits on proposals') | | allow_squash_merge | bool | | Field(True, description='Allow squash merges on proposals') | | allow_rebase_merge | bool | | Field(False, description='Allow rebase merges on proposals') | | delete_branch_on_merge | bool | | Field(True, description='Auto-delete head branch after proposal merge') | | domain_id | str | None | | Field(None, description='UUID of the Muse domain plugin for this repo') |

RepoStatsResponsemusehub/models/musehub.py

Aggregated counts for the repo home page stats bar.

Bases: CamelModel

Field Type Required Default
commit_count int Field(0, ge=0, description='Total number of commits across all branches')
branch_count int Field(0, ge=0, description='Number of branches (including default)')
release_count int Field(0, ge=0, description='Number of published releases / tags')

SearchCommitMatchmusehub/models/musehub.py

A single commit returned by a search query.

Bases: CamelModel

Field Type Required Default
commit_id str
branch str
message str
author str
timestamp datetime
score float Field(1.0, ge=0.0, le=1.0, description='Match score (0–1); always 1.0 for exact-match modes')
match_source str Field('message', description="Where the match was found: 'message', 'branch', or 'property'")

SearchResponsemusehub/models/musehub.py

Response envelope for all four in-repo search modes.

Bases: CamelModel

Field Type Required Default
mode str
query str
matches list[SearchCommitMatch]
total_scanned int
limit int

SemanticReleaseReportResponsemusehub/models/musehub.py

Semantic analysis of a release, computed by the Muse CLI at push time.

Bases: CamelModel

Field Type Required Default
languages list[LanguageStatResponse] (factory)
total_files int 0
semantic_files int 0
total_symbols int 0
symbols_by_kind list[SymbolKindCountResponse] (factory)
files_changed int 0
api_added list[ApiChangeSummaryResponse] (factory)
api_removed list[ApiChangeSummaryResponse] (factory)
api_modified list[ApiChangeSummaryResponse] (factory)
file_hotspots list[FileHotspotResponse] (factory)
refactor_events list[RefactorEventResponse] (factory)
breaking_changes list[str] (factory)
human_commits int 0
agent_commits int 0
unique_agents list[str] (factory)
unique_models list[str] (factory)
reviewers list[str] (factory)

SessionCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/sessions.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | started_at | datetime | None | | None | | participants | list[str] | | (factory) | | intent | str | | Field('', description='Free-text creative goal for this session', examples=['Finish the bossa nova bridge — add percussion and finalize the chord changes']) | | location | str | | Field('', max_length=255, description='Studio or location label', examples=['Blue Note Studio, NYC']) | | is_active | bool | | Field(True, description='True if the session is currently live') |

SessionListResponsemusehub/models/musehub.py

Paginated list of sessions for a repo (newest first).

Bases: CamelModel

Field Type Required Default
sessions list[SessionResponse]
total int

SessionResponsemusehub/models/musehub.py

Wire representation of a single recording session.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | session_id | str | ✓ | | | started_at | datetime | ✓ | | | ended_at | datetime | None | | None | | duration_seconds | float | None | | None | | participants | list[str] | ✓ | | | commits | list[str] | | (factory) | | notes | str | | Field('', description='Closing notes for the session (markdown)') | | intent | str | ✓ | | | location | str | ✓ | | | is_active | bool | ✓ | | | created_at | datetime | ✓ | |

SessionStopmusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/sessions/{session_id}/stop.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | ended_at | datetime | None | | None |

SnapshotBatchRequestmusehub/models/musehub.py

Request body for the batch snapshot lookup endpoint.

Bases: CamelModel

Field Type Required Default
snapshot_ids list[str]
include_entries bool Field(False, description='When true, each result includes its file-tree entries (heavier)')

SnapshotDiffEntrymusehub/models/musehub.py

A single file-level change between two snapshots.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | path | str | ✓ | | | status | str | ✓ | | | base_object_id | str | None | | Field(None, description='Object ID in the base snapshot (null for added files)', examples=['b2a7d9e1c3f4']) | | new_object_id | str | None | | Field(None, description='Object ID in the new snapshot (null for removed files)', examples=['c3b8e0f2d5a6']) | | base_size_bytes | int | | Field(0, ge=0, description='File size in base snapshot') | | new_size_bytes | int | | Field(0, ge=0, description='File size in new snapshot') |

SnapshotDiffResponsemusehub/models/musehub.py

File-level diff between two snapshots.

Bases: CamelModel

Field Type Required Default
snapshot_id str
base_snapshot_id str
added_count int Field(0, ge=0, description='Files added in new snapshot')
removed_count int Field(0, ge=0, description='Files removed from base snapshot')
modified_count int Field(0, ge=0, description='Files present in both but with changed content')
unchanged_count int Field(0, ge=0, description='Files identical in both snapshots')
bytes_added int Field(0, ge=0, description='Total bytes added (new file sizes)')
bytes_removed int Field(0, ge=0, description='Total bytes removed (base file sizes)')
changes list[SnapshotDiffEntry] (factory)

SnapshotEntryListResponsemusehub/models/musehub.py

Paginated file-tree entries for a single snapshot.

Bases: CamelModel

Field Type Required Default
snapshot_id str
entries list[SnapshotEntryResponse]
total int

SnapshotEntryResponsemusehub/models/musehub.py

One file-tree entry within a snapshot.

Bases: CamelModel

Field Type Required Default
path str
object_id str
size_bytes int Field(0, ge=0, description='Stored file size in bytes; 0 when unknown', examples=[4096])

SnapshotInputmusehub/models/musehub.py

A snapshot manifest transferred in a push payload.

Bases: CamelModel

Field Type Required Default
snapshot_id str
manifest dict[str, str] (factory)
created_at str ''

SnapshotListResponsemusehub/models/musehub.py

Paginated list of snapshot summaries (newest first).

Bases: CamelModel

Field Type Required Default
snapshots list[SnapshotSummaryResponse]
total int

SnapshotResponsemusehub/models/musehub.py

Full snapshot record including all file-tree entries.

Bases: CamelModel

Field Type Required Default
snapshot_id str
repo_id str
directories list[str] (factory)
entries list[SnapshotEntryResponse] (factory)
entry_count int Field(0, ge=0, description='Total number of entries (equal to len(entries) unless paginated)', examples=[142])
total_size_bytes int Field(0, ge=0, description='Sum of all entry size_bytes', examples=[1048576])
created_at datetime

SnapshotSummaryResponsemusehub/models/musehub.py

Lightweight snapshot summary — no file-tree entries.

Bases: CamelModel

Field Type Required Default
snapshot_id str
repo_id str
entry_count int Field(0, ge=0, description='Number of file-tree entries (files) tracked at this snapshot', examples=[142])
total_size_bytes int Field(0, ge=0, description='Sum of all entry size_bytes; 0 when sizes were not recorded', examples=[1048576])
directories list[str] (factory)
created_at datetime

StarResponsemusehub/models/musehub.py

Confirmation that a star was added or removed.

Bases: CamelModel

Field Type Required Default
starred bool
star_count int

StargazerEntrymusehub/models/musehub.py

A single user who has starred a repo.

Bases: CamelModel

Field Type Required Default
user_id str
starred_at datetime

StargazerListResponsemusehub/models/musehub.py

Paginated list of users who have starred a repo.

Bases: CamelModel

Field Type Required Default
stargazers list[StargazerEntry]
total int

SymbolBlameEntrymusehub/models/musehub.py

One blame annotation attributing a symbol to the commit that last modified it.

Bases: CamelModel

Field Type Required Default
symbol_address str
symbol_name str
commit_id str
commit_message str
author str
timestamp datetime
op str
change_count int 1
is_hotspot bool False
is_dead bool False
is_blast_risk bool False
blast_co_symbols list[str] (factory)

SymbolBlameResponsemusehub/models/musehub.py

Response envelope for symbol-level blame.

Bases: CamelModel

Field Type Required Default
entries list[SymbolBlameEntry] (factory)
total_entries int 0
path str ''

SymbolKindCountResponsemusehub/models/musehub.py

Count of symbols of a specific kind in the release snapshot.

Bases: CamelModel

Field Type Required Default
kind str
count int 0

TagListResponsemusehub/models/musehub.py

All tags for a repo, grouped by namespace.

Bases: CamelModel

Field Type Required Default
tags list[TagResponse]
namespaces list[str] (factory)

TagResponsemusehub/models/musehub.py

A single tag entry for the tag browser page.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | tag | str | ✓ | | | namespace | str | ✓ | | | commit_id | str | None | | Field(None, description='Commit this tag is pinned to') | | message | str | | Field('', description='Release title / description') | | created_at | datetime | ✓ | |

TimelineCommitEventmusehub/models/musehub.py

A commit plotted as a point on the timeline.

Bases: CamelModel

Field Type Required Default
event_type str 'commit'
commit_id str
branch str
message str
author str
timestamp datetime
parent_ids list[str]

TimelineEmotionEventmusehub/models/musehub.py

An emotion-vector data point overlaid on the timeline as a line chart.

Bases: CamelModel

Field Type Required Default
event_type str 'emotion'
commit_id str
timestamp datetime
valence float
energy float
tension float

TimelineResponsemusehub/models/musehub.py

Chronological timeline of musical evolution for a repo.

Bases: CamelModel

Field Type Required Default
commits list[TimelineCommitEvent]
emotion list[TimelineEmotionEvent]
sections list[TimelineSectionEvent]
tracks list[TimelineTrackEvent]
total_commits int

TimelineSectionEventmusehub/models/musehub.py

A detected section change plotted as a marker on the timeline.

Bases: CamelModel

Field Type Required Default
event_type str 'section'
commit_id str
timestamp datetime
section_name str
action str

TimelineTrackEventmusehub/models/musehub.py

A detected track addition or removal plotted as a marker on the timeline.

Bases: CamelModel

Field Type Required Default
event_type str 'track'
commit_id str
timestamp datetime
track_name str
action str

TransferOwnershipRequestmusehub/models/musehub.py

Request body for transferring repo ownership to another user.

Bases: CamelModel

Field Type Required Default
new_owner_user_id str

TreeEntryResponsemusehub/models/musehub.py

A single entry (file or directory) in the Muse tree browser.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | type | str | ✓ | | | name | str | ✓ | | | path | str | ✓ | | | size_bytes | int | None | | Field(None, description='File size in bytes; None for directories') | | object_id | str | None | | Field(None, description='Content-addressed object ID; None for directories and legacy entries') |

TreeListResponsemusehub/models/musehub.py

Directory listing for the Muse tree browser.

Bases: CamelModel

Field Type Required Default
owner str
repo_slug str
ref str
dir_path str
entries list[TreeEntryResponse] (factory)

UserActivityEventItemmusehub/models/musehub.py

A single event in a user's public activity feed.

Bases: CamelModel

Field Type Required Default
id str
type str
actor str
repo str
payload dict[str, object] (factory)
created_at datetime

UserActivityFeedResponsemusehub/models/musehub.py

Cursor-paginated public activity feed for a MuseHub user (newest-first).

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | events | list[UserActivityEventItem] | ✓ | | | next_cursor | str | None | | Field(None, description='Pass as before_id to fetch the next page; None on the last page') | | type_filter | str | None | | Field(None, description='Active type filter value, or None when all types are shown') |

UserForkedRepoEntrymusehub/models/musehub.py

A single forked repo entry shown on a user's profile Forked tab.

Bases: CamelModel

Field Type Required Default
fork_id str
fork_repo RepoResponse
source_owner str
source_slug str
forked_at datetime

UserForksResponsemusehub/models/musehub.py

Paginated list of repos forked by a user.

Bases: CamelModel

Field Type Required Default
forks list[UserForkedRepoEntry]
total int

UserStarredRepoEntrymusehub/models/musehub.py

A single starred-repo entry shown on a user's profile Starred tab.

Bases: CamelModel

Field Type Required Default
star_id str
repo RepoResponse
starred_at datetime

UserStarredResponsemusehub/models/musehub.py

Paginated list of repos starred by a user.

Bases: CamelModel

Field Type Required Default
starred list[UserStarredRepoEntry]
total int

UserWatchedRepoEntrymusehub/models/musehub.py

A single watched-repo entry shown on a user's profile Watching tab.

Bases: CamelModel

Field Type Required Default
watch_id str
repo RepoResponse
watched_at datetime

UserWatchedResponsemusehub/models/musehub.py

Paginated list of repos watched by a user.

Bases: CamelModel

Field Type Required Default
watched list[UserWatchedRepoEntry]
total int

WebhookCreatemusehub/models/musehub.py

Body for POST /musehub/repos/{repo_id}/webhooks.

Bases: CamelModel

Field Type Required Default
url str
events list[str]
secret str Field('', description='Optional HMAC-SHA256 signing secret')

WebhookDeliveryListResponsemusehub/models/musehub.py

Paginated list of delivery attempts for a webhook.

Bases: CamelModel

Field Type Required Default
deliveries list[WebhookDeliveryResponse]

WebhookDeliveryResponsemusehub/models/musehub.py

Wire representation of a single webhook delivery attempt.

Bases: CamelModel

Field Type Required Default
delivery_id str
webhook_id str
event_type str
payload str Field('', description='JSON body sent to the subscriber URL')
attempt int
success bool
response_status int
response_body str
delivered_at datetime

WebhookListResponsemusehub/models/musehub.py

List of webhook subscriptions for a repo.

Bases: CamelModel

Field Type Required Default
webhooks list[WebhookResponse]

WebhookRedeliverResponsemusehub/models/musehub.py

Confirmation that a delivery reattempt was executed.

Bases: CamelModel

Field Type Required Default
original_delivery_id str
webhook_id str
event_type str
success bool
response_status int
response_body str Field('', description='Response body snippet from the final attempt (≤512 chars)')

WebhookResponsemusehub/models/musehub.py

Wire representation of a registered webhook subscription.

Bases: CamelModel

Field Type Required Default
webhook_id str
repo_id str
url str
events list[str]
active bool
created_at datetime

WireTagInputmusehub/models/musehub.py

A single lightweight tag pushed from a Muse CLI client.

Bases: CamelModel

Field Type Required Default
tag_id str
commit_id str
tag str
created_at str Field('', description='ISO-8601 creation timestamp from the client')

AgentRegistrationRequestmusehub/models/musehub_auth.py

Operator-signed agent provisioning request — POST /api/identities/agent.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | handle | str | ✓ | | | public_key_b64 | str | ✓ | | | fingerprint | str | ✓ | | | algorithm | str | | 'ed25519' | | agent_model | str | | '' | | scope | list[str] | | (factory) | | expires_at | str | None | | Field(None, description='ISO-8601 UTC expiry time for this agent key. null = no expiry.') | | label | str | | '' |

AgentRegistrationResponsemusehub/models/musehub_auth.py

Response for POST /api/identities/agent.

Bases: BaseModel

Field Type Required Default
handle str
identity_id str
is_new_identity bool
spawned_by str
key AuthKeyResponse

AuthKeyResponsemusehub/models/musehub_auth.py

Public summary of a registered auth key (never exposes key material).

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | key_id | str | ✓ | | | algorithm | str | ✓ | | | fingerprint | str | ✓ | | | label | str | ✓ | | | created_at | str | ✓ | | | last_used_at | str | None | ✓ | |

ChallengeRequestmusehub/models/musehub_auth.py

Request a challenge nonce for the given public key fingerprint.

Bases: BaseModel

Field Type Required Default
fingerprint str
algorithm str Field(default=KeyAlgorithm.ED25519.value, description=f'Signing algorithm for this key. Implemented: {_IMPLEMENTED_ALGO_VALUES}.')

ChallengeResponsemusehub/models/musehub_auth.py

Challenge nonce to sign and submit to /api/auth/verify.

Bases: BaseModel

Field Type Required Default
challenge_token str
is_new_key bool
expires_in int Field(300, description='Challenge validity in seconds.')
algorithm str

VerifyRequestmusehub/models/musehub_auth.py

Submit a signed challenge to complete authentication.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | challenge_token | str | ✓ | | | public_key_b64 | str | ✓ | | | signature_b64 | str | ✓ | | | handle | str | None | | Field(None, min_length=1, max_length=64, description='Desired handle (username). Required when registering a new key.') | | display_name | str | None | | Field(None, max_length=128, description='Optional display name shown on the profile.') | | label | str | None | | Field(None, max_length=255, description='Optional friendly key label, e.g. "MacBook Pro" or "CI agent".') | | identity_type | str | | 'human' |

VerifyResponsemusehub/models/musehub_auth.py

Successful key registration / re-registration response.

Bases: BaseModel

Field Type Required Default
handle str
identity_id str
is_new_identity bool
auth_method str
key AuthKeyResponse

ActiveProposalContextmusehub/models/musehub_context.py

An open proposal that may inform composition decisions.

Bases: CamelModel

Field Type Required Default
proposal_id str
title str
from_branch str
to_branch str
state str
body str ''

AgentContextResponsemusehub/models/musehub_context.py

Complete agent context document for one project ref.

Bases: CamelModel

Field Type Required Default
repo_id str
ref str Field(description='The resolved branch name or commit ID')
depth str Field(description='Depth level used to build this response')
musical_state MusicalStateContext
history list[HistoryEntryContext] (factory)
analysis AnalysisSummaryContext
active_proposals list[ActiveProposalContext] (factory)
open_issues list[OpenIssueContext] (factory)
suggestions list[str] (factory)

AnalysisSummaryContextmusehub/models/musehub_context.py

Per-dimension analysis highlights for the current state.

Bases: CamelModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | key_finding | Annotated[str | None, Field(description='Key and mode detection summary')] | | None | | chord_progression | Annotated[list[str] | None, Field(description="Detected chord progression (e.g. ['Cm', 'Ab', 'Eb', 'Bb'])")] | | None | | groove_score | Annotated[float | None, Field(description='Groove quality score [0.0, 1.0]')] | | None | | emotion | Annotated[str | None, Field(description='Emotional character')] | | None | | harmonic_tension | Annotated[str | None, Field(description="Harmonic tension assessment ('low', 'medium', 'high')")] | | None | | melodic_contour | Annotated[str | None, Field(description='Melodic contour description')] | | None |

HistoryEntryContextmusehub/models/musehub_context.py

A single commit entry in the composition history.

Bases: CamelModel

Field Type Required Default
commit_id str
message str
author str
timestamp str Field(description='ISO-8601 UTC timestamp')
active_tracks list[str] (factory)

MusicalStateContextmusehub/models/musehub_context.py

Current musical state of the project at the resolved ref.

Bases: CamelModel

Field Type Required Default
active_tracks list[str] (factory)

OpenIssueContextmusehub/models/musehub_context.py

An open issue that may describe desired compositional changes.

Bases: CamelModel

Field Type Required Default
issue_id str
number int
title str
labels list[str] (factory)
body str ''

WireBundlemusehub/models/wire.py

A pack bundle sent in a push request.

Bases: BaseModel

Field Type Required Default
commits list[WireCommit] (factory)
snapshots list[WireSnapshot] (factory)
objects list[WireObject] (factory)
branch_heads dict[str, str] (factory)

WireCommitmusehub/models/wire.py

Muse native commit record — mirrors CommitDict from muse.core.store.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | str | ✓ | | | repo_id | str | | '' | | branch | str | | '' | | snapshot_id | str | None | | None | | message | str | | '' | | committed_at | str | | '' | | parent_commit_id | str | None | | None | | parent2_commit_id | str | None | | None | | author | str | | '' | | metadata | dict[str, str] | | (factory) | | structured_delta | Any | | None | | sem_ver_bump | str | | 'none' | | breaking_changes | list[str] | | (factory) | | agent_id | str | | '' | | model_id | str | | '' | | toolchain_id | str | | '' | | prompt_hash | str | | '' | | signature | str | | '' | | signer_public_key | str | | '' | | signer_key_id | str | | '' | | format_version | int | | 7 | | reviewed_by | list[str] | | (factory) | | test_runs | int | | 0 |

WireFetchObjectsRequestmusehub/models/wire.py

Body for POST /{owner}/{slug}/fetch/objects.

Bases: BaseModel

Field Type Required Default
object_ids list[str] (factory)

WireFetchRequestmusehub/models/wire.py

Body for POST /wire/repos/{repo_id}/fetch.

Bases: BaseModel

Field Type Required Default
want list[str] (factory)
have list[str] (factory)

WireFetchResponsemusehub/models/wire.py

Response for POST /wire/repos/{repo_id}/fetch.

Bases: BaseModel

Field Type Required Default
commits list[WireCommit] (factory)
snapshots list[WireSnapshot] (factory)
branch_heads dict[str, str] (factory)

WireFilterRequestmusehub/models/wire.py

Body for POST /{owner}/{slug}/filter-objects.

Bases: BaseModel

Field Type Required Default
object_ids list[str] (factory)

WireFilterResponsemusehub/models/wire.py

Response for POST /{owner}/{slug}/filter-objects.

Bases: BaseModel

Field Type Required Default
missing list[str]

WireNegotiateRequestmusehub/models/wire.py

Body for POST /{owner}/{slug}/negotiate.

Bases: BaseModel

Field Type Required Default
want list[str] (factory)
have list[str] (factory)

WireNegotiateResponsemusehub/models/wire.py

Response for POST /{owner}/{slug}/negotiate.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | ack | list[str] | ✓ | | | common_base | str | None | ✓ | | | ready | bool | ✓ | |

WireObjectmusehub/models/wire.py

Content-addressed object payload — mirrors ObjectPayload from muse.core.pack.

Bases: BaseModel

Field Type Required Default
object_id str
content bytes Field(max_length=MAX_OBJECT_BYTES)
path str ''

WireObjectsRequestmusehub/models/wire.py

Body for POST /{owner}/{slug}/push/objects — chunked object pre-upload.

Bases: BaseModel

Field Type Required Default
objects list[WireObject] (factory)

WireObjectsResponsemusehub/models/wire.py

Response for POST /{owner}/{slug}/push/objects.

Bases: BaseModel

Field Type Required Default
stored int
skipped int

WirePresignRequestmusehub/models/wire.py

Body for POST /{owner}/{slug}/presign.

Bases: BaseModel

Field Type Required Default
object_ids list[str] (factory)
direction str 'put'
ttl_seconds int 300

WirePresignResponsemusehub/models/wire.py

Response for POST /{owner}/{slug}/presign.

Bases: BaseModel

Field Type Required Default
presigned dict[str, str] (factory)
inline list[str] (factory)

WirePushRequestmusehub/models/wire.py

Body for POST /wire/repos/{repo_id}/push.

Bases: BaseModel

| Field | Type | Required | Default | |-------|------|:--------:|---------| | bundle | WireBundle | ✓ | | | branch | str | ✓ | | | force | bool | | False | | local_head | str | None | | None |

WirePushResponsemusehub/models/wire.py

Response for POST /wire/repos/{repo_id}/push.

Bases: BaseModel

Field Type Required Default
ok bool
message str
branch_heads dict[str, str]
remote_head str ''

WireRefsResponsemusehub/models/wire.py

Response for GET /wire/repos/{repo_id}/refs.

Bases: BaseModel

Field Type Required Default
repo_id str
domain str
default_branch str
branch_heads dict[str, str]

WireSnapshotmusehub/models/wire.py

Muse native snapshot — mirrors SnapshotDict from muse.core.store.

Bases: BaseModel

Field Type Required Default
snapshot_id str
manifest dict[str, str] (factory)
directories list[str] (factory)
created_at str ''

ProtocolInfoResponsemusehub/protocol/responses.py

Response shape for GET /protocol.

Bases: BaseModel

Field Type Required Default
version str
protocol_hash str
event_count int
tool_count int

Mtests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
owner_id str

MyModeltests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
my_field str

MyModeltests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
repo_id str

MyModeltests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
repo_id str

MyModeltests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
repo_id str

MyModeltests/test_api_contracts_section37.py

Bases: CamelModel

Field Type Required Default
repo_id str

_SampleModeltests/test_musehub_negotiate.py

Minimal CamelModel for testing camelCase serialisation via by_alias=True.

Bases: CamelModel

Field Type Required Default
repo_id str
star_count int

SQLAlchemy ORM Models

MusehubCoordRecordmusehub/db/coord_models.py

A single coordination record pushed from a Muse CLI agent.

Bases: Base

Table: musehub_coord_records

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[int] | | mapped_column(Integer, primary_key=True, autoincrement=True) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | kind | Mapped[str] | | mapped_column(String(32), nullable=False) | | record_uuid | Mapped[str] | | mapped_column(String(36), nullable=False) | | run_id | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | payload | Mapped[dict] | | mapped_column(JSON, nullable=False) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | expires_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) |

MusehubCoordReservationmusehub/db/coord_models.py

Persistent store for muse coord reserve events synced from agents.

Bases: Base

Table: musehub_coord_reservations

| Field | Type | Required | Default | |-------|------|:--------:|---------| | reservation_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | symbol_address | Mapped[str] | | mapped_column(String(512), nullable=False) | | agent_id | Mapped[str] | | mapped_column(String(255), nullable=False) | | agent_model_id | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | ttl_s | Mapped[int] | | mapped_column(Integer, nullable=False, default=300) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | expires_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False) | | released_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) |

MusehubCoordTaskmusehub/db/coord_models.py

Persistent task queue mirroring muse coord enqueue/claim/complete.

Bases: Base

Table: musehub_coord_tasks

| Field | Type | Required | Default | |-------|------|:--------:|---------| | task_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | queue | Mapped[str] | | mapped_column(String(255), nullable=False, default='default') | | priority | Mapped[int] | | mapped_column(Integer, nullable=False, default=50) | | payload | Mapped[dict] | | mapped_column(JSON, nullable=False) | | status | Mapped[str] | | mapped_column(String(20), nullable=False, default='pending', index=True) | | claimed_by | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | claimed_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | completed_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | depends_on | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | run_id | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) |

MuseCliCommitmusehub/db/muse_cli_models.py

A versioned commit record pointing to a snapshot and its parent.

Bases: Base

Table: muse_commits

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | Mapped[str] | | mapped_column(String(64), primary_key=True) | | repo_id | Mapped[str] | | mapped_column(String(36), nullable=False, index=True) | | branch | Mapped[str] | | mapped_column(String(255), nullable=False) | | parent_commit_id | Mapped[str | None] | | mapped_column(String(64), nullable=True, index=True) | | parent2_commit_id | Mapped[str | None] | | mapped_column(String(64), nullable=True, index=True) | | snapshot_id | Mapped[str] | | mapped_column(String(64), ForeignKey('muse_snapshots.snapshot_id', ondelete='RESTRICT'), nullable=False) | | message | Mapped[str] | | mapped_column(Text, nullable=False) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | committed_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | commit_metadata | Mapped[dict[str, object] | None] | | mapped_column(JSON, nullable=True, default=None) |

MuseCliObjectmusehub/db/muse_cli_models.py

A content-addressed blob: sha256(file_bytes) → bytes on disk.

Bases: Base

Table: muse_objects

Field Type Required Default
object_id Mapped[str] mapped_column(String(64), primary_key=True)
size_bytes Mapped[int] mapped_column(Integer, nullable=False)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)

MuseCliSnapshotmusehub/db/muse_cli_models.py

An immutable snapshot manifest: sha256(sorted(path:object_id pairs)).

Bases: Base

Table: muse_snapshots

Field Type Required Default
snapshot_id Mapped[str] mapped_column(String(64), primary_key=True)
manifest Mapped[dict[str, str]] mapped_column(JSON, nullable=False)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)

MuseCliTagmusehub/db/muse_cli_models.py

A music-semantic tag attached to a Muse CLI commit.

Bases: Base

Table: muse_tags

Field Type Required Default
tag_id Mapped[str] mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
repo_id Mapped[str] mapped_column(String(36), nullable=False, index=True)
commit_id Mapped[str] mapped_column(String(64), ForeignKey('muse_commits.commit_id', ondelete='CASCADE'), nullable=False, index=True)
tag Mapped[str] mapped_column(Text, nullable=False, index=True)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)

MusehubAuthKeymusehub/db/musehub_auth_models.py

One registered public key for a MuseHub identity.

Bases: Base

Table: musehub_auth_keys

| Field | Type | Required | Default | |-------|------|:--------:|---------| | key_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | identity_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_identities.id', ondelete='CASCADE'), nullable=False) | | algorithm | Mapped[str] | | mapped_column(String(32), nullable=False, default='ed25519') | | public_key_b64 | Mapped[str] | | mapped_column(Text, nullable=False) | | fingerprint | Mapped[str] | | mapped_column(String(64), nullable=False) | | label | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | last_used_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) |

MusehubCollaboratormusehub/db/musehub_collaborator_models.py

A collaborator record granting a user explicit access to a repo.

Bases: Base

Table: musehub_collaborators

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False) | | identity_handle | Mapped[str] | | mapped_column(String(64), nullable=False) | | permission | Mapped[str] | | mapped_column(String(20), nullable=False, default='write') | | invited_by_handle | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | invited_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | accepted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) |

MusehubDomainmusehub/db/musehub_domain_models.py

A registered Muse domain plugin in the MuseHub registry.

Bases: Base

Table: musehub_domains

| Field | Type | Required | Default | |-------|------|:--------:|---------| | domain_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | author_user_id | Mapped[str | None] | | mapped_column(String(36), nullable=True, index=True) | | author_slug | Mapped[str] | | mapped_column(String(64), nullable=False, index=True) | | slug | Mapped[str] | | mapped_column(String(64), nullable=False, index=True) | | display_name | Mapped[str] | | mapped_column(String(255), nullable=False) | | description | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | version | Mapped[str] | | mapped_column(String(32), nullable=False, default='1.0.0') | | manifest_hash | Mapped[str] | | mapped_column(String(64), nullable=False, default='') | | capabilities | Mapped[dict[str, object]] | | mapped_column(JSON, nullable=False, default=dict) | | viewer_type | Mapped[str] | | mapped_column(String(64), nullable=False, default='generic') | | install_count | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | is_verified | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False) | | is_deprecated | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) |

MusehubDomainInstallmusehub/db/musehub_domain_models.py

Records a user's installation/adoption of a domain plugin.

Bases: Base

Table: musehub_domain_installs

Field Type Required Default
install_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
user_id Mapped[str] mapped_column(String(36), nullable=False, index=True)
domain_id Mapped[str] mapped_column(String(36), nullable=False, index=True)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)

MusehubIssueLabelmusehub/db/musehub_label_models.py

Join table linking issues to labels.

Bases: Base

Table: musehub_issue_labels

Field Type Required Default
issue_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_issues.issue_id', ondelete='CASCADE'), primary_key=True)
label_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_labels.id', ondelete='CASCADE'), primary_key=True)
label Mapped[MusehubLabel] relationship('MusehubLabel', back_populates='issue_labels')

MusehubLabelmusehub/db/musehub_label_models.py

A coloured label tag that can be applied to issues and proposals.

Bases: Base

Table: musehub_labels

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False) | | name | Mapped[str] | | mapped_column(String(50), nullable=False) | | color | Mapped[str] | | mapped_column(String(7), nullable=False) | | description | Mapped[str | None] | | mapped_column(String(200), nullable=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | issue_labels | Mapped[list[MusehubIssueLabel]] | | relationship('MusehubIssueLabel', back_populates='label', cascade='all, delete-orphan') | | proposal_labels | Mapped[list[MusehubProposalLabel]] | | relationship('MusehubProposalLabel', back_populates='label', cascade='all, delete-orphan') |

MusehubProposalLabelmusehub/db/musehub_label_models.py

Join table linking proposals to labels.

Bases: Base

Table: musehub_proposal_labels

Field Type Required Default
proposal_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_proposals.proposal_id', ondelete='CASCADE'), primary_key=True)
label_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_labels.id', ondelete='CASCADE'), primary_key=True)
label Mapped[MusehubLabel] relationship('MusehubLabel', back_populates='proposal_labels')

MusehubBranchmusehub/db/musehub_models.py

A named branch pointer inside a MuseHub repo.

Bases: Base

Table: musehub_branches

| Field | Type | Required | Default | |-------|------|:--------:|---------| | branch_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | name | Mapped[str] | | mapped_column(String(255), nullable=False) | | head_commit_id | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='branches') |

MusehubCommitmusehub/db/musehub_models.py

A commit record pushed to the MuseHub.

Bases: Base

Table: musehub_commits

| Field | Type | Required | Default | |-------|------|:--------:|---------| | commit_id | Mapped[str] | | mapped_column(String(64), primary_key=True) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | branch | Mapped[str] | | mapped_column(String(255), nullable=False, index=True) | | parent_ids | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | message | Mapped[str] | | mapped_column(Text, nullable=False) | | author | Mapped[str] | | mapped_column(String(255), nullable=False) | | timestamp | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, index=True) | | snapshot_id | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | commit_meta | Mapped[dict[str, object]] | | mapped_column(JSON, nullable=False, default=dict) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='commits') |

MusehubFileIntelCachemusehub/db/musehub_models.py

Per-file IntelSnapshot cache, keyed by (repo_id, file_path).

Bases: Base

Table: musehub_file_intel_cache

Field Type Required Default
cache_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
repo_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False)
file_path Mapped[str] mapped_column(String(1024), nullable=False)
ref Mapped[str] mapped_column(String(64), nullable=False)
intel_json Mapped[str] mapped_column(sa.Text, nullable=False)
symbol_history_json Mapped[str] mapped_column(sa.Text, nullable=False)
computed_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)

MusehubIdentitymusehub/db/musehub_models.py

Unified identity — human, agent, or org.

Bases: Base

Table: musehub_identities

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | handle | Mapped[str] | | mapped_column(String(64), nullable=False, index=True) | | identity_type | Mapped[str] | | mapped_column(String(16), nullable=False, default='human') | | display_name | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | bio | Mapped[str | None] | | mapped_column(Text, nullable=True) | | avatar_url | Mapped[str | None] | | mapped_column(String(2048), nullable=True) | | website_url | Mapped[str | None] | | mapped_column(String(2048), nullable=True) | | email | Mapped[str | None] | | mapped_column(String(255), nullable=True, index=True) | | agent_model | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | agent_capabilities | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | location | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | twitter_handle | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | is_verified | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False, index=True) | | cc_license | Mapped[str | None] | | mapped_column(String(50), nullable=True) | | pinned_repo_ids | Mapped[list] | | mapped_column(JSON, nullable=False, default=list) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | deleted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) | | spawned_by | Mapped[str | None] | | mapped_column(String(64), nullable=True, index=True) | | scope | Mapped[list[str] | None] | | mapped_column(JSON, nullable=True) | | expires_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, index=True) | | tos_accepted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) | | tos_version | Mapped[str | None] | | mapped_column(String(16), nullable=True, default=None) |

MusehubIssuemusehub/db/musehub_models.py

An issue opened against a MuseHub repo.

Bases: Base

Table: musehub_issues

| Field | Type | Required | Default | |-------|------|:--------:|---------| | issue_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | number | Mapped[int] | | mapped_column(Integer, nullable=False, index=True) | | title | Mapped[str] | | mapped_column(String(500), nullable=False) | | body | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | state | Mapped[str] | | mapped_column(String(20), nullable=False, default='open', index=True) | | labels | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | assignee | Mapped[str | None] | | mapped_column(String(255), nullable=True) | | milestone_id | Mapped[str | None] | | mapped_column(String(36), ForeignKey('musehub_milestones.milestone_id', ondelete='SET NULL'), nullable=True, index=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='issues') | | milestone | Mapped[MusehubMilestone | None] | | relationship('MusehubMilestone', back_populates='issues', foreign_keys=[milestone_id]) | | comments | Mapped[list[MusehubIssueComment]] | | relationship('MusehubIssueComment', back_populates='issue', cascade='all, delete-orphan', order_by='MusehubIssueComment.created_at') |

MusehubIssueCommentmusehub/db/musehub_models.py

A comment in a threaded discussion on a MuseHub issue.

Bases: Base

Table: musehub_issue_comments

| Field | Type | Required | Default | |-------|------|:--------:|---------| | comment_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | issue_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_issues.issue_id', ondelete='CASCADE'), nullable=False, index=True) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | body | Mapped[str] | | mapped_column(Text, nullable=False) | | parent_id | Mapped[str | None] | | mapped_column(String(36), nullable=True, index=True) | | is_deleted | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, index=True) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | issue | Mapped[MusehubIssue] | | relationship('MusehubIssue', back_populates='comments') |

MusehubIssueMilestonemusehub/db/musehub_models.py

Join table linking issues to milestones (many-to-many).

Bases: Base

Table: musehub_issue_milestones

Field Type Required Default
issue_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_issues.issue_id', ondelete='CASCADE'), primary_key=True)
milestone_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_milestones.milestone_id', ondelete='CASCADE'), primary_key=True)
issue Mapped[MusehubIssue] relationship('MusehubIssue')
milestone Mapped[MusehubMilestone] relationship('MusehubMilestone', back_populates='issue_milestones')

MusehubMilestonemusehub/db/musehub_models.py

A milestone that groups issues within a repo.

Bases: Base

Table: musehub_milestones

| Field | Type | Required | Default | |-------|------|:--------:|---------| | milestone_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | number | Mapped[int] | | mapped_column(Integer, nullable=False, index=True) | | title | Mapped[str] | | mapped_column(String(255), nullable=False) | | description | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | state | Mapped[str] | | mapped_column(String(20), nullable=False, default='open', index=True) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | due_on | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='milestones', foreign_keys=[repo_id]) | | issues | Mapped[list[MusehubIssue]] | | relationship('MusehubIssue', back_populates='milestone', foreign_keys='[MusehubIssue.milestone_id]') | | issue_milestones | Mapped[list[MusehubIssueMilestone]] | | relationship('MusehubIssueMilestone', back_populates='milestone', cascade='all, delete-orphan') |

MusehubObjectmusehub/db/musehub_models.py

A binary artifact (MIDI, MP3, WebP piano roll) stored in MuseHub.

Bases: Base

Table: musehub_objects

| Field | Type | Required | Default | |-------|------|:--------:|---------| | object_id | Mapped[str] | | mapped_column(String(128), primary_key=True) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | path | Mapped[str] | | mapped_column(String(1024), nullable=False) | | size_bytes | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | disk_path | Mapped[str] | | mapped_column(String(2048), nullable=False) | | storage_uri | Mapped[str | None] | | mapped_column(String(2048), nullable=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | deleted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='objects') |

MusehubProposalmusehub/db/musehub_models.py

A merge proposal — the V2 name for a proposal.

Bases: Base

Table: musehub_proposals

| Field | Type | Required | Default | |-------|------|:--------:|---------| | proposal_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | proposal_number | Mapped[int] | | mapped_column(Integer, nullable=False) | | title | Mapped[str] | | mapped_column(String(500), nullable=False) | | body | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | state | Mapped[str] | | mapped_column(String(20), nullable=False, default='open', index=True) | | from_branch | Mapped[str] | | mapped_column(String(255), nullable=False) | | to_branch | Mapped[str] | | mapped_column(String(255), nullable=False) | | merge_commit_id | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | merged_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | domain_diff | Mapped[dict[str, object] | None] | | mapped_column(JSON, nullable=True, default=None) | | risk_score | Mapped[float | None] | | mapped_column(sa.Float, nullable=True) | | blast_delta | Mapped[float | None] | | mapped_column(sa.Float, nullable=True) | | breakage_count | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | test_gap_count | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | symbols_changed | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='proposals') | | reviews | Mapped[list[MusehubProposalReview]] | | relationship('MusehubProposalReview', back_populates='proposal', cascade='all, delete-orphan') | | review_comments | Mapped[list[MusehubProposalComment]] | | relationship('MusehubProposalComment', back_populates='proposal', cascade='all, delete-orphan') |

MusehubProposalCommentmusehub/db/musehub_models.py

Inline review comment on a dimensional diff within a merge proposal.

Bases: Base

Table: musehub_proposal_comments

| Field | Type | Required | Default | |-------|------|:--------:|---------| | comment_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | proposal_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_proposals.proposal_id', ondelete='CASCADE'), nullable=False, index=True) | | repo_id | Mapped[str] | | mapped_column(String(36), nullable=False, index=True) | | author | Mapped[str] | | mapped_column(String(255), nullable=False) | | body | Mapped[str] | | mapped_column(Text, nullable=False) | | dimension_ref | Mapped[dict[str, object]] | | mapped_column(JSON, nullable=False, default=dict) | | symbol_address | Mapped[str | None] | | mapped_column(String(512), nullable=True) | | parent_comment_id | Mapped[str | None] | | mapped_column(String(36), nullable=True, index=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, index=True) | | proposal | Mapped[MusehubProposal] | | relationship('MusehubProposal', back_populates='review_comments') |

MusehubProposalReviewmusehub/db/musehub_models.py

A formal review submission on a merge proposal.

Bases: Base

Table: musehub_proposal_reviews

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | proposal_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_proposals.proposal_id', ondelete='CASCADE'), nullable=False, index=True) | | reviewer_username | Mapped[str] | | mapped_column(String(255), nullable=False, index=True) | | state | Mapped[str] | | mapped_column(String(30), nullable=False, default='pending', index=True) | | body | Mapped[str | None] | | mapped_column(Text, nullable=True) | | submitted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | proposal | Mapped[MusehubProposal] | | relationship('MusehubProposal', back_populates='reviews') |

MusehubReleasemusehub/db/musehub_models.py

A published version release for a MuseHub repo.

Bases: Base

Table: musehub_releases

| Field | Type | Required | Default | |-------|------|:--------:|---------| | release_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | tag | Mapped[str] | | mapped_column(String(100), nullable=False, index=True) | | title | Mapped[str] | | mapped_column(String(500), nullable=False, default='') | | body | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | commit_id | Mapped[str | None] | | mapped_column(String(64), nullable=True) | | snapshot_id | Mapped[str | None] | | mapped_column(String(128), nullable=True) | | semver_major | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | semver_minor | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | semver_patch | Mapped[int] | | mapped_column(Integer, nullable=False, default=0) | | semver_pre | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | semver_build | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | channel | Mapped[str] | | mapped_column(String(20), nullable=False, default='stable', index=True) | | download_urls | Mapped[dict[str, str]] | | mapped_column(JSON, nullable=False, default=dict) | | author | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | agent_id | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | model_id | Mapped[str] | | mapped_column(String(255), nullable=False, default='') | | changelog_json | Mapped[str] | | mapped_column(Text, nullable=False, default='[]') | | is_draft | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False) | | gpg_signature | Mapped[str | None] | | mapped_column(Text, nullable=True) | | semantic_report_json | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='releases') | | assets | Mapped[list[MusehubReleaseAsset]] | | relationship('MusehubReleaseAsset', back_populates='release', cascade='all, delete-orphan') |

MusehubReleaseAssetmusehub/db/musehub_models.py

An asset (file attachment) associated with a MuseHub release.

Bases: Base

Table: musehub_release_assets

Field Type Required Default
asset_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
release_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_releases.release_id', ondelete='CASCADE'), nullable=False, index=True)
repo_id Mapped[str] mapped_column(String(36), nullable=False, index=True)
name Mapped[str] mapped_column(String(500), nullable=False)
label Mapped[str] mapped_column(String(255), nullable=False, default='')
content_type Mapped[str] mapped_column(String(128), nullable=False, default='')
size Mapped[int] mapped_column(Integer, nullable=False, default=0)
download_url Mapped[str] mapped_column(String(2048), nullable=False)
download_count Mapped[int] mapped_column(Integer, nullable=False, default=0)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)
release Mapped[MusehubRelease] relationship('MusehubRelease', back_populates='assets')

MusehubRepomusehub/db/musehub_models.py

A remote Muse repository — the hub-side equivalent of a Git remote.

Bases: Base

Table: musehub_repos

| Field | Type | Required | Default | |-------|------|:--------:|---------| | repo_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | name | Mapped[str] | | mapped_column(String(255), nullable=False) | | owner | Mapped[str] | | mapped_column(String(64), nullable=False, index=True) | | slug | Mapped[str] | | mapped_column(String(64), nullable=False, index=True) | | visibility | Mapped[str] | | mapped_column(String(20), nullable=False, default='private') | | owner_user_id | Mapped[str] | | mapped_column(String(36), nullable=False, index=True) | | description | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | tags | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | domain_id | Mapped[str | None] | | mapped_column(String(36), nullable=True, index=True) | | domain_meta | Mapped[dict[str, object]] | | mapped_column(JSON, nullable=False, default=dict) | | settings | Mapped[dict[str, object] | None] | | mapped_column(JSON, nullable=True) | | default_branch | Mapped[str] | | mapped_column(String(255), nullable=False, default='main') | | pushed_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | updated_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now) | | deleted_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True, default=None) | | training_opt_out | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False) | | branches | Mapped[list[MusehubBranch]] | | relationship('MusehubBranch', back_populates='repo', cascade='all, delete-orphan') | | commits | Mapped[list[MusehubCommit]] | | relationship('MusehubCommit', back_populates='repo', cascade='all, delete-orphan') | | objects | Mapped[list[MusehubObject]] | | relationship('MusehubObject', back_populates='repo', cascade='all, delete-orphan') | | issues | Mapped[list[MusehubIssue]] | | relationship('MusehubIssue', back_populates='repo', cascade='all, delete-orphan') | | milestones | Mapped[list[MusehubMilestone]] | | relationship('MusehubMilestone', back_populates='repo', cascade='all, delete-orphan', foreign_keys='[MusehubMilestone.repo_id]') | | proposals | Mapped[list[MusehubProposal]] | | relationship('MusehubProposal', back_populates='repo', cascade='all, delete-orphan') | | releases | Mapped[list[MusehubRelease]] | | relationship('MusehubRelease', back_populates='repo', cascade='all, delete-orphan') | | sessions | Mapped[list[MusehubSession]] | | relationship('MusehubSession', back_populates='repo', cascade='all, delete-orphan') | | webhooks | Mapped[list[MusehubWebhook]] | | relationship('MusehubWebhook', back_populates='repo', cascade='all, delete-orphan') | | wire_tags | Mapped[list[MusehubWireTag]] | | relationship('MusehubWireTag', back_populates='repo', cascade='all, delete-orphan') |

MusehubSessionmusehub/db/musehub_models.py

A recording session record pushed to MuseHub from the CLI.

Bases: Base

Table: musehub_sessions

| Field | Type | Required | Default | |-------|------|:--------:|---------| | session_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | schema_version | Mapped[str] | | mapped_column(String(10), nullable=False, default='1') | | started_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, index=True) | | ended_at | Mapped[datetime | None] | | mapped_column(DateTime(timezone=True), nullable=True) | | participants | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | location | Mapped[str] | | mapped_column(String(500), nullable=False, default='') | | intent | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | commits | Mapped[list[str]] | | mapped_column(JSON, nullable=False, default=list) | | notes | Mapped[str] | | mapped_column(Text, nullable=False, default='') | | is_active | Mapped[bool] | | mapped_column(Boolean, nullable=False, default=False, index=True) | | created_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) | | repo | Mapped[MusehubRepo] | | relationship('MusehubRepo', back_populates='sessions') |

MusehubSnapshotmusehub/db/musehub_models.py

Immutable file-tree record stored alongside commits.

Bases: Base

Table: musehub_snapshots

Field Type Required Default
snapshot_id Mapped[str] mapped_column(String(128), primary_key=True)
repo_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True)
directories Mapped[list[str]] mapped_column(JSON, nullable=False, default=list)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)
entries Mapped[list['MusehubSnapshotEntry']] relationship('MusehubSnapshotEntry', back_populates='snapshot', cascade='all, delete-orphan')

MusehubSnapshotEntrymusehub/db/musehub_models.py

One file-tree entry within a snapshot.

Bases: Base

Table: musehub_snapshot_entries

Field Type Required Default
snapshot_id Mapped[str] mapped_column(String(128), ForeignKey('musehub_snapshots.snapshot_id', ondelete='CASCADE'), primary_key=True)
path Mapped[str] mapped_column(String(1024), primary_key=True)
object_id Mapped[str] mapped_column(String(128), nullable=False)
size_bytes Mapped[int] mapped_column(Integer(), nullable=False, default=0)
snapshot Mapped['MusehubSnapshot'] relationship('MusehubSnapshot', back_populates='entries')

MusehubSymbolIndexmusehub/db/musehub_models.py

Materialized symbol intelligence cache for a repo at a given commit.

Bases: Base

Table: musehub_symbol_index

| Field | Type | Required | Default | |-------|------|:--------:|---------| | index_id | Mapped[str] | | mapped_column(String(36), primary_key=True, default=_new_uuid) | | repo_id | Mapped[str] | | mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True) | | ref | Mapped[str] | | mapped_column(String(64), nullable=False) | | symbol_history | Mapped[bytes | None] | | mapped_column(sa.LargeBinary, nullable=True) | | hash_occurrence | Mapped[bytes | None] | | mapped_column(sa.LargeBinary, nullable=True) | | intel_summary | Mapped[str | None] | | mapped_column(sa.Text, nullable=True) | | intel_full_json | Mapped[str | None] | | mapped_column(sa.Text, nullable=True) | | built_at | Mapped[datetime] | | mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now) |

MusehubWebhookmusehub/db/musehub_models.py

A registered webhook subscription for a MuseHub repo.

Bases: Base

Table: musehub_webhooks

Field Type Required Default
webhook_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
repo_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True)
url Mapped[str] mapped_column(String(2048), nullable=False)
events Mapped[list[str]] mapped_column(JSON, nullable=False, default=list)
secret Mapped[str] mapped_column(Text, nullable=False, default='')
active Mapped[bool] mapped_column(Boolean, nullable=False, default=True)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)
updated_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now, onupdate=_utc_now)
repo Mapped[MusehubRepo] relationship('MusehubRepo', back_populates='webhooks')
deliveries Mapped[list[MusehubWebhookDelivery]] relationship('MusehubWebhookDelivery', back_populates='webhook', cascade='all, delete-orphan')

MusehubWebhookDeliverymusehub/db/musehub_models.py

One delivery attempt for a webhook event.

Bases: Base

Table: musehub_webhook_deliveries

Field Type Required Default
delivery_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
webhook_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_webhooks.webhook_id', ondelete='CASCADE'), nullable=False, index=True)
event_type Mapped[str] mapped_column(String(64), nullable=False, index=True)
payload Mapped[str] mapped_column(Text, nullable=False, default='')
attempt Mapped[int] mapped_column(Integer, nullable=False, default=1)
success Mapped[bool] mapped_column(Boolean, nullable=False, default=False)
response_status Mapped[int] mapped_column(Integer, nullable=False, default=0)
response_body Mapped[str] mapped_column(Text, nullable=False, default='')
delivered_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)
webhook Mapped[MusehubWebhook] relationship('MusehubWebhook', back_populates='deliveries')

MusehubWireTagmusehub/db/musehub_models.py

A lightweight tag pushed from a Muse CLI client via the wire protocol.

Bases: Base

Table: musehub_wire_tags

Field Type Required Default
tag_id Mapped[str] mapped_column(String(36), primary_key=True, default=_new_uuid)
repo_id Mapped[str] mapped_column(String(36), ForeignKey('musehub_repos.repo_id', ondelete='CASCADE'), nullable=False, index=True)
commit_id Mapped[str] mapped_column(String(64), nullable=False)
tag Mapped[str] mapped_column(String(500), nullable=False, index=True)
created_at Mapped[datetime] mapped_column(DateTime(timezone=True), nullable=False, default=_utc_now)
repo Mapped[MusehubRepo] relationship('MusehubRepo', back_populates='wire_tags')

_Atests/test_schema_check.py

Bases: _ABase

Table: a_table

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[int] | | mapped_column(Integer, primary_key=True) | | python_name | Mapped[str | None] | | mapped_column('db_name', String(64), nullable=True) |

_Atests/test_schema_check.py

Bases: _ABase

Table: atbl

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[int] | | mapped_column(Integer, primary_key=True) | | py_name | Mapped[str | None] | | mapped_column('db_name', String(64), nullable=True) |

_Btests/test_schema_check.py

Bases: _BBase

Table: btbl

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[int] | | mapped_column(Integer, primary_key=True) | | new_name | Mapped[str | None] | | mapped_column('old_name', String(64), nullable=True) |

_Cleantests/test_schema_check.py

Bases: _CleanBase

Table: clean

Field Type Required Default
id Mapped[int] mapped_column(Integer, primary_key=True)
value Mapped[str] mapped_column(String(64), nullable=False)

_Gadgettests/test_schema_check.py

Bases: _TestBase

Table: gadgets

| Field | Type | Required | Default | |-------|------|:--------:|---------| | id | Mapped[int] | | mapped_column(Integer, primary_key=True) | | serial | Mapped[str] | | mapped_column(String(64), nullable=False) | | notes | Mapped[str | None] | | mapped_column(String(256), nullable=True) |

Protocols

StorageBackendmusehub/storage/backends.py

Content-addressed binary store protocol.

Bases: Protocol

No annotated fields.

File History 1 commit
sha256:a10adeeb7a0169cb9900f9806ed7a973047258abb6283724fe55e8eb68ff3f0a init: musehub initial commit Human 71 days ago