Core¶
Shared domain models, base types, and enums used across the framework.
Types¶
types
¶
Reusable Pydantic type annotations and validators.
ModelTier
module-attribute
¶
Model capability tier: large (most capable), medium, small (cheapest).
AutonomyDetailLevel
module-attribute
¶
Level of autonomy instruction detail in prompt profiles.
PersonalityMode
module-attribute
¶
Personality section verbosity in prompt profiles.
NotBlankStr
module-attribute
¶
NotBlankStr = Annotated[
str, StringConstraints(min_length=1), AfterValidator(_check_not_whitespace)
]
A string that must be non-empty and not consist solely of whitespace.
validate_unique_strings
¶
Validate that every string in values is unique.
Raises:
| Type | Description |
|---|---|
ValueError
|
If duplicates are present. |
Source code in src/synthorg/core/types.py
Enums¶
enums
¶
Domain enumerations for the SynthOrg framework.
SeniorityLevel
¶
Bases: StrEnum
Seniority levels for agents within the organization.
Each level corresponds to an authority scope, typical model tier, and
cost tier defined in synthorg.core.role_catalog.SENIORITY_INFO.
AgentStatus
¶
Bases: StrEnum
Lifecycle status of an agent.
RiskTolerance
¶
Bases: StrEnum
Risk tolerance level for agent personality.
CreativityLevel
¶
Bases: StrEnum
Creativity level for agent personality.
MemoryLevel
¶
Bases: StrEnum
Memory persistence level for an agent (§7.3).
MemoryCategory
¶
Bases: StrEnum
Memory type categories for agent memory (§7.2).
ConsolidationInterval
¶
Bases: StrEnum
Interval for memory consolidation.
OrgFactCategory
¶
Bases: StrEnum
Category of organizational fact (§7.4).
Categorizes shared organizational knowledge entries by their nature and purpose within the company.
CostTier
¶
Bases: StrEnum
Built-in cost tier identifiers.
These are the default tiers shipped with the framework. Users can
define additional tiers via configuration. Fields that accept cost
tiers (e.g. SeniorityInfo.cost_tier) use str rather than
this enum, so custom tier IDs are also valid.
CompanyType
¶
Bases: StrEnum
Pre-defined company template types.
SkillCategory
¶
Bases: StrEnum
Categories for agent skills.
SkillPattern
¶
Bases: StrEnum
Skill interaction patterns for company templates.
Based on the five-pattern taxonomy: Tool Wrapper, Generator, Reviewer, Inversion, and Pipeline.
Attributes:
| Name | Type | Description |
|---|---|---|
TOOL_WRAPPER |
On-demand domain expertise; agents self-direct using specialized context. |
|
GENERATOR |
Consistent structured output from reusable templates. |
|
REVIEWER |
Modular rubric-based evaluation; separates what to check from how to check it. |
|
INVERSION |
Agent interviews user before acting; structured requirements gathering. |
|
PIPELINE |
Strict sequential workflow with hard checkpoints between stages. |
ProficiencyLevel
¶
Bases: StrEnum
Proficiency level for a skill.
DepartmentName
¶
Bases: StrEnum
Standard department names within the organization.
TaskStatus
¶
Bases: StrEnum
Lifecycle status of a task.
The authoritative transition map lives in
synthorg.core.task_transitions.VALID_TRANSITIONS.
Summary for quick reference:
CREATED -> ASSIGNED
ASSIGNED -> IN_PROGRESS | BLOCKED | CANCELLED | FAILED | INTERRUPTED
IN_PROGRESS -> IN_REVIEW | BLOCKED | CANCELLED | FAILED | INTERRUPTED
IN_REVIEW -> COMPLETED | IN_PROGRESS (rework) | BLOCKED | CANCELLED
BLOCKED -> ASSIGNED (unblocked)
FAILED -> ASSIGNED (reassignment for retry)
INTERRUPTED -> ASSIGNED (reassignment on restart)
COMPLETED and CANCELLED are terminal states.
FAILED and INTERRUPTED are non-terminal (can be reassigned).
TaskType
¶
Bases: StrEnum
Classification of the kind of work a task represents.
Priority
¶
Bases: StrEnum
Task urgency and importance level.
Complexity
¶
Bases: StrEnum
Estimated task complexity.
WorkflowType
¶
Bases: StrEnum
Workflow type for organizing task execution.
Matches the four workflow types defined in the Engine design page (docs/design/engine.md, Workflow Types section).
WorkflowNodeType
¶
Bases: StrEnum
Node type in a visual workflow definition.
Each node represents a step or control-flow element in the visual workflow editor.
WorkflowEdgeType
¶
Bases: StrEnum
Edge type connecting nodes in a visual workflow definition.
Encodes the relationship semantics between workflow nodes.
WorkflowExecutionStatus
¶
Bases: StrEnum
Lifecycle status of a workflow execution instance.
Tracks the overall progress of an activated workflow definition from creation through completion or cancellation.
WorkflowNodeExecutionStatus
¶
Bases: StrEnum
Per-node execution status within a workflow execution.
Tracks whether each node in the workflow graph has been processed, skipped (conditional branch not taken), or resulted in a concrete task.
ArtifactType
¶
Bases: StrEnum
Type of produced artifact.
ProjectStatus
¶
Bases: StrEnum
Lifecycle status of a project.
ToolAccessLevel
¶
Bases: StrEnum
Access level for tool permissions.
Determines which tool categories an agent can use.
Levels SANDBOXED through ELEVATED form a hierarchy
where each includes all categories from lower levels.
CUSTOM uses only explicit allow/deny lists, ignoring
the hierarchy.
The concrete category sets for each level are defined in
ToolPermissionChecker._LEVEL_CATEGORIES.
ToolCategory
¶
Bases: StrEnum
Category of a tool for access-level gating.
DecisionMakingStyle
¶
Bases: StrEnum
Decision-making approach used by an agent.
CollaborationPreference
¶
Bases: StrEnum
Preferred collaboration mode for an agent.
CommunicationVerbosity
¶
Bases: StrEnum
Communication verbosity level for an agent.
ConflictApproach
¶
Bases: StrEnum
Conflict resolution approach used by an agent.
TaskStructure
¶
Bases: StrEnum
Classification of how a task's subtasks relate to each other.
Used by the decomposition engine to determine coordination topology and execution ordering. See the Engine design page.
CoordinationTopology
¶
Bases: StrEnum
Coordination topology for multi-agent task execution.
Determines how agents coordinate when executing decomposed subtasks. See the Engine design page.
ActionType
¶
Bases: StrEnum
Two-level action type taxonomy for security classification.
Used by autonomy presets (see Operations design page), SecOps
validation, tiered timeout policies, and progressive trust.
Values follow a category:action naming convention.
Custom action type strings are also accepted by models that use
str for action_type fields -- these enum members are
convenience constants for the built-in taxonomy.
MergeOrder
¶
Bases: StrEnum
Order in which workspace branches are merged back.
Determines the sequence of merge operations when multiple agent workspaces are being merged into the base branch.
ConflictEscalation
¶
Bases: StrEnum
Strategy for handling merge conflicts during workspace merges.
Controls whether merging stops for human review or continues with an automated review agent flagging conflicts.
ApprovalStatus
¶
Bases: StrEnum
Status of a human approval item.
ApprovalRiskLevel
¶
Bases: StrEnum
Risk level assigned to an approval item.
ConflictType
¶
Bases: StrEnum
Type of merge conflict detected during workspace merges.
AutonomyLevel
¶
Bases: StrEnum
Autonomy level controlling approval routing for agents.
Determines which actions an agent can execute autonomously vs. which require human or security-agent approval (see Operations design page).
DowngradeReason
¶
Bases: StrEnum
Reason an agent's autonomy was downgraded at runtime.
ExecutionStatus
¶
Bases: StrEnum
Runtime execution status of an agent.
Tracks whether an agent is currently executing, paused (e.g. waiting
for approval), or idle. Used by AgentRuntimeState for dashboard
queries and graceful-shutdown discovery.
TimeoutActionType
¶
Bases: StrEnum
Action to take when an approval item times out (see Operations design page).
compare_seniority
¶
Compare two seniority levels.
Returns negative if a is junior to b, zero if equal, positive if a is senior to b.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
SeniorityLevel
|
First seniority level. |
required |
b
|
SeniorityLevel
|
Second seniority level. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Integer indicating relative seniority. |
Source code in src/synthorg/core/enums.py
compare_autonomy
¶
Compare two autonomy levels.
Returns negative if a is more restrictive than b, zero if equal, positive if a is less restrictive than b.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
AutonomyLevel
|
First autonomy level. |
required |
b
|
AutonomyLevel
|
Second autonomy level. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Integer indicating relative autonomy. |
Source code in src/synthorg/core/enums.py
Agent¶
agent
¶
Agent identity and configuration models.
PersonalityConfig
pydantic-model
¶
Bases: BaseModel
Personality traits and communication style for an agent.
Big Five (OCEAN) floats (0.0-1.0) are internal scoring dimensions used for compatibility calculations. Behavioral enums produce natural-language labels injected into system prompts that LLMs respond to effectively.
Attributes:
| Name | Type | Description |
|---|---|---|
traits |
tuple[NotBlankStr, ...]
|
Personality trait keywords. |
communication_style |
NotBlankStr
|
Free-text style description. |
risk_tolerance |
RiskTolerance
|
Risk tolerance level. |
creativity |
CreativityLevel
|
Creativity level. |
description |
str
|
Extended personality description. |
openness |
float
|
Big Five openness (curiosity, creativity). 0.0-1.0. |
conscientiousness |
float
|
Big Five conscientiousness (thoroughness). 0.0-1.0. |
extraversion |
float
|
Big Five extraversion (assertiveness). 0.0-1.0. |
agreeableness |
float
|
Big Five agreeableness (cooperation). 0.0-1.0. |
stress_response |
float
|
Emotional stability (1.0 = very calm). 0.0-1.0. |
decision_making |
DecisionMakingStyle
|
Decision-making approach. |
collaboration |
CollaborationPreference
|
Preferred collaboration mode. |
verbosity |
CommunicationVerbosity
|
Communication verbosity level. |
conflict_approach |
ConflictApproach
|
Conflict resolution approach. |
Config:
frozen:Trueextra:forbidallow_inf_nan:False
Fields:
-
traits(tuple[NotBlankStr, ...]) -
communication_style(NotBlankStr) -
risk_tolerance(RiskTolerance) -
creativity(CreativityLevel) -
description(str) -
openness(float) -
conscientiousness(float) -
extraversion(float) -
agreeableness(float) -
stress_response(float) -
decision_making(DecisionMakingStyle) -
collaboration(CollaborationPreference) -
verbosity(CommunicationVerbosity) -
conflict_approach(ConflictApproach)
SkillSet
pydantic-model
¶
Bases: BaseModel
Primary and secondary skills for an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
primary |
tuple[NotBlankStr, ...]
|
Core competency skill names. |
secondary |
tuple[NotBlankStr, ...]
|
Supporting skill names. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
primary(tuple[NotBlankStr, ...]) -
secondary(tuple[NotBlankStr, ...])
ModelConfig
pydantic-model
¶
Bases: BaseModel
LLM model configuration for an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
provider |
NotBlankStr
|
LLM provider name (e.g. |
model_id |
NotBlankStr
|
Model identifier (e.g. |
temperature |
float
|
Sampling temperature (0.0 to 2.0). |
max_tokens |
int
|
Maximum output tokens. |
fallback_model |
NotBlankStr | None
|
Optional fallback model identifier. |
model_tier |
ModelTier | None
|
Capability tier ( |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
provider(NotBlankStr) -
model_id(NotBlankStr) -
temperature(float) -
max_tokens(int) -
fallback_model(NotBlankStr | None) -
model_tier(ModelTier | None)
AgentRetentionRule
pydantic-model
¶
Bases: BaseModel
Per-category retention override for an agent.
Structurally identical to
:class:~synthorg.memory.consolidation.models.RetentionRule but
defined in core to avoid a core -> memory import dependency.
Attributes:
| Name | Type | Description |
|---|---|---|
category |
MemoryCategory
|
Memory category this override applies to. |
retention_days |
int
|
Number of days to retain memories in this category. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
category(MemoryCategory) -
retention_days(int)
MemoryConfig
pydantic-model
¶
Bases: BaseModel
Memory configuration for an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
MemoryLevel
|
Memory persistence type. |
retention_days |
int | None
|
Days to retain memories ( |
retention_overrides |
tuple[AgentRetentionRule, ...]
|
Per-category retention overrides for this agent. These take priority over company-level per-category rules during retention enforcement. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
type(MemoryLevel) -
retention_days(int | None) -
retention_overrides(tuple[AgentRetentionRule, ...])
Validators:
-
_validate_retention_consistency -
_validate_unique_override_categories
ToolPermissions
pydantic-model
¶
Bases: BaseModel
Tool access permissions for an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
access_level |
ToolAccessLevel
|
Tool access level controlling which categories are available. |
allowed |
tuple[NotBlankStr, ...]
|
Explicitly allowed tool names. |
denied |
tuple[NotBlankStr, ...]
|
Explicitly denied tool names. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
access_level(ToolAccessLevel) -
allowed(tuple[NotBlankStr, ...]) -
denied(tuple[NotBlankStr, ...])
Validators:
-
_validate_no_overlap
AgentIdentity
pydantic-model
¶
Bases: BaseModel
Complete agent identity card.
Every agent in the company is represented by an AgentIdentity
containing its role, personality, model backend, memory settings,
tool permissions, and authority configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
UUID
|
Unique agent identifier. |
name |
NotBlankStr
|
Agent display name. |
role |
NotBlankStr
|
Role name (string reference to :class: |
department |
NotBlankStr
|
Department name (string reference). |
level |
SeniorityLevel
|
Seniority level. |
personality |
PersonalityConfig
|
Personality configuration. |
skills |
SkillSet
|
Primary and secondary skill set. |
model |
ModelConfig
|
LLM model configuration. |
memory |
MemoryConfig
|
Memory configuration. |
tools |
ToolPermissions
|
Tool permissions. |
authority |
Authority
|
Authority configuration for this agent. |
autonomy_level |
AutonomyLevel | None
|
Per-agent autonomy level override ( |
hiring_date |
date
|
Date the agent was hired. |
status |
AgentStatus
|
Current lifecycle status. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(UUID) -
name(NotBlankStr) -
role(NotBlankStr) -
department(NotBlankStr) -
level(SeniorityLevel) -
personality(PersonalityConfig) -
skills(SkillSet) -
model(ModelConfig) -
memory(MemoryConfig) -
tools(ToolPermissions) -
authority(Authority) -
autonomy_level(AutonomyLevel | None) -
hiring_date(date) -
status(AgentStatus)
Validators:
-
_validate_seniority_autonomy
Company¶
company
¶
Company structure and configuration models.
ReportingLine
pydantic-model
¶
Bases: BaseModel
Explicit reporting relationship within a department.
Attributes:
| Name | Type | Description |
|---|---|---|
subordinate |
NotBlankStr
|
Role name (or agent identifier) of the subordinate. |
supervisor |
NotBlankStr
|
Role name (or agent identifier) of the supervisor. |
subordinate_id |
NotBlankStr | None
|
Optional unique identifier for the subordinate.
When multiple agents share the same role name, this
disambiguates which agent is meant. Any stable unique
string is valid (e.g. the agent's |
supervisor_id |
NotBlankStr | None
|
Optional unique identifier for the supervisor.
When multiple agents share the same role name, this
disambiguates which agent is meant. Any stable unique
string is valid (e.g. the agent's |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
subordinate(NotBlankStr) -
supervisor(NotBlankStr) -
subordinate_id(NotBlankStr | None) -
supervisor_id(NotBlankStr | None)
Validators:
-
_validate_not_self_report
subordinate_id
pydantic-field
¶
Optional unique identifier for the subordinate
subordinate_key
property
¶
Hierarchy lookup key: subordinate_id when set, else subordinate.
Unlike _identity_key(), returns the raw value without
case-folding or namespace tagging.
supervisor_key
property
¶
Hierarchy lookup key: supervisor_id when set, else supervisor.
Unlike _identity_key(), returns the raw value without
case-folding or namespace tagging.
ReviewRequirements
pydantic-model
¶
Bases: BaseModel
Department review policy.
Attributes:
| Name | Type | Description |
|---|---|---|
min_reviewers |
int
|
Minimum number of reviewers required. |
required_reviewer_roles |
tuple[NotBlankStr, ...]
|
Role names that must be among reviewers. |
self_review_allowed |
bool
|
Whether an agent can review their own work. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
min_reviewers(int) -
required_reviewer_roles(tuple[NotBlankStr, ...]) -
self_review_allowed(bool)
ApprovalChain
pydantic-model
¶
Bases: BaseModel
Ordered approver list for an action type.
Attributes:
| Name | Type | Description |
|---|---|---|
action_type |
NotBlankStr
|
Action type this chain applies to. |
approvers |
tuple[NotBlankStr, ...]
|
Ordered tuple of approver agent names. |
min_approvals |
int
|
Minimum approvals needed (0 = all approvers required). |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
action_type(NotBlankStr) -
approvers(tuple[NotBlankStr, ...]) -
min_approvals(int)
Validators:
-
_validate_approvers
DepartmentPolicies
pydantic-model
¶
Bases: BaseModel
Department-level operational policies.
Attributes:
| Name | Type | Description |
|---|---|---|
review_requirements |
ReviewRequirements
|
Review policy for this department. |
approval_chains |
tuple[ApprovalChain, ...]
|
Approval chains for various action types. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
review_requirements(ReviewRequirements) -
approval_chains(tuple[ApprovalChain, ...])
Validators:
-
_validate_unique_action_types
WorkflowHandoff
pydantic-model
¶
Bases: BaseModel
Cross-department handoff definition.
Attributes:
| Name | Type | Description |
|---|---|---|
from_department |
NotBlankStr
|
Source department name. |
to_department |
NotBlankStr
|
Target department name. |
trigger |
NotBlankStr
|
Condition that triggers this handoff. |
artifacts |
tuple[NotBlankStr, ...]
|
Artifacts passed during handoff. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
from_department(NotBlankStr) -
to_department(NotBlankStr) -
trigger(NotBlankStr) -
artifacts(tuple[NotBlankStr, ...])
Validators:
-
_validate_different_departments
EscalationPath
pydantic-model
¶
Bases: BaseModel
Cross-department escalation path.
Attributes:
| Name | Type | Description |
|---|---|---|
from_department |
NotBlankStr
|
Source department name. |
to_department |
NotBlankStr
|
Target department name. |
condition |
NotBlankStr
|
Condition that triggers escalation. |
priority_boost |
int
|
Priority boost applied on escalation (0-3). |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
from_department(NotBlankStr) -
to_department(NotBlankStr) -
condition(NotBlankStr) -
priority_boost(int)
Validators:
-
_validate_different_departments
Team
pydantic-model
¶
Bases: BaseModel
A team within a department.
The lead is the team's manager. The lead may also appear in
members if they are also an individual contributor.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
NotBlankStr
|
Team name. |
lead |
NotBlankStr
|
Team lead agent name (string reference). |
members |
tuple[NotBlankStr, ...]
|
Team member agent names. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
name(NotBlankStr) -
lead(NotBlankStr) -
members(tuple[NotBlankStr, ...])
Validators:
-
_validate_no_duplicate_members
Department
pydantic-model
¶
Bases: BaseModel
An organizational department.
Department names may be standard values from
:class:~synthorg.core.enums.DepartmentName or custom names defined
by the organization.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
NotBlankStr
|
Department name (standard or custom). |
head |
NotBlankStr | None
|
Department head role name (or agent identifier), or |
head_id |
NotBlankStr | None
|
Optional unique identifier for the department head.
When multiple agents share the same role name used in
|
budget_percent |
float
|
Percentage of company budget allocated (0-100). |
teams |
tuple[Team, ...]
|
Teams within this department. |
reporting_lines |
tuple[ReportingLine, ...]
|
Explicit reporting relationships. |
autonomy_level |
AutonomyLevel | None
|
Per-department autonomy level override
( |
policies |
DepartmentPolicies
|
Department-level operational policies. |
ceremony_policy |
dict[str, Any] | None
|
Per-department ceremony scheduling policy
override as a raw dict for YAML-level flexibility
(templates pass raw dicts before full validation).
|
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
name(NotBlankStr) -
head(NotBlankStr | None) -
head_id(NotBlankStr | None) -
budget_percent(float) -
teams(tuple[Team, ...]) -
reporting_lines(tuple[ReportingLine, ...]) -
autonomy_level(AutonomyLevel | None) -
policies(DepartmentPolicies) -
ceremony_policy(dict[str, Any] | None)
Validators:
-
_deepcopy_ceremony_policy -
_validate_head_id_requires_head -
_validate_unique_team_names -
_validate_unique_subordinates
CompanyConfig
pydantic-model
¶
Bases: BaseModel
Company-wide configuration settings.
Attributes:
| Name | Type | Description |
|---|---|---|
autonomy |
AutonomyConfig
|
Autonomy configuration (level + presets). |
approval_timeout |
ApprovalTimeoutConfig
|
Timeout policy for pending approval items. |
budget_monthly |
float
|
Monthly budget in USD (base currency). |
communication_pattern |
NotBlankStr
|
Default communication pattern name. |
tool_access_default |
tuple[NotBlankStr, ...]
|
Default tool access for all agents. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
autonomy(AutonomyConfig) -
approval_timeout(ApprovalTimeoutConfig) -
budget_monthly(float) -
communication_pattern(NotBlankStr) -
tool_access_default(tuple[NotBlankStr, ...])
communication_pattern
pydantic-field
¶
Default communication pattern
HRRegistry
pydantic-model
¶
Bases: BaseModel
Human resources registry for the company.
available_roles and hiring_queue intentionally allow duplicate
entries to represent multiple openings for the same role or position.
Attributes:
| Name | Type | Description |
|---|---|---|
active_agents |
tuple[NotBlankStr, ...]
|
Currently active agent names (must be unique). |
available_roles |
tuple[NotBlankStr, ...]
|
Roles available for hiring (duplicates allowed). |
hiring_queue |
tuple[NotBlankStr, ...]
|
Roles in the hiring pipeline (duplicates allowed). |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
active_agents(tuple[NotBlankStr, ...]) -
available_roles(tuple[NotBlankStr, ...]) -
hiring_queue(tuple[NotBlankStr, ...])
Validators:
-
_validate_no_duplicate_active_agents
Company
pydantic-model
¶
Bases: BaseModel
Top-level company entity.
Validates that department names are unique and that budget allocations do not exceed 100%. The sum may be less than 100% to allow for an unallocated reserve.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
UUID
|
Company identifier. |
name |
NotBlankStr
|
Company name. |
type |
CompanyType
|
Company template type. |
departments |
tuple[Department, ...]
|
Company departments. |
config |
CompanyConfig
|
Company-wide configuration. |
hr_registry |
HRRegistry
|
HR registry. |
workflow_handoffs |
tuple[WorkflowHandoff, ...]
|
Cross-department workflow handoffs. |
escalation_paths |
tuple[EscalationPath, ...]
|
Cross-department escalation paths. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(UUID) -
name(NotBlankStr) -
type(CompanyType) -
departments(tuple[Department, ...]) -
config(CompanyConfig) -
hr_registry(HRRegistry) -
workflow_handoffs(tuple[WorkflowHandoff, ...]) -
escalation_paths(tuple[EscalationPath, ...])
Validators:
-
_validate_departments
Role¶
role
¶
Role and skill domain models.
Skill
pydantic-model
¶
Bases: BaseModel
A capability an agent possesses.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
NotBlankStr
|
Skill name (e.g. |
category |
SkillCategory
|
Broad skill category. |
proficiency |
ProficiencyLevel
|
Agent's proficiency in this skill. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
Authority
pydantic-model
¶
Bases: BaseModel
Authority scope for an agent or role.
Attributes:
| Name | Type | Description |
|---|---|---|
can_approve |
tuple[NotBlankStr, ...]
|
Task types this role can approve. |
reports_to |
NotBlankStr | None
|
Role this position reports to. |
can_delegate_to |
tuple[NotBlankStr, ...]
|
Roles this position can delegate tasks to. |
budget_limit |
float
|
Maximum spend per task in base currency units. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
can_approve(tuple[NotBlankStr, ...]) -
reports_to(NotBlankStr | None) -
can_delegate_to(tuple[NotBlankStr, ...]) -
budget_limit(float)
SeniorityInfo
pydantic-model
¶
Bases: BaseModel
Mapping from seniority level to authority and model configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
level |
SeniorityLevel
|
The seniority level. |
authority_scope |
NotBlankStr
|
Description of authority at this level. |
typical_model_tier |
ModelTier
|
Recommended model tier (e.g. |
cost_tier |
NotBlankStr
|
Cost tier identifier (built-in |
Config:
frozen:Trueallow_inf_nan:False
Fields:
Role
pydantic-model
¶
Bases: BaseModel
A job definition within the organization.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
NotBlankStr
|
Role name (e.g. |
department |
DepartmentName
|
Department this role belongs to. |
required_skills |
tuple[NotBlankStr, ...]
|
Skills required for this role. |
authority_level |
SeniorityLevel
|
Default seniority level. |
tool_access |
tuple[NotBlankStr, ...]
|
Tools available to this role. |
system_prompt_template |
NotBlankStr | None
|
Template file for system prompt. |
description |
str
|
Human-readable description. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
name(NotBlankStr) -
department(DepartmentName) -
required_skills(tuple[NotBlankStr, ...]) -
authority_level(SeniorityLevel) -
tool_access(tuple[NotBlankStr, ...]) -
system_prompt_template(NotBlankStr | None) -
description(str)
system_prompt_template
pydantic-field
¶
Template file for system prompt
CustomRole
pydantic-model
¶
Bases: BaseModel
User-defined custom role via configuration.
Unlike :class:Role, the department field accepts arbitrary strings
in addition to :class:~synthorg.core.enums.DepartmentName values,
allowing users to define roles in non-standard departments.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
NotBlankStr
|
Custom role name. |
department |
DepartmentName | str
|
Department (standard or custom name). |
required_skills |
tuple[NotBlankStr, ...]
|
Required skills for this role. |
system_prompt_template |
NotBlankStr | None
|
Template file for system prompt. |
authority_level |
SeniorityLevel
|
Default seniority level. |
suggested_model |
NotBlankStr | None
|
Suggested model tier. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
name(NotBlankStr) -
department(DepartmentName | str) -
required_skills(tuple[NotBlankStr, ...]) -
system_prompt_template(NotBlankStr | None) -
authority_level(SeniorityLevel) -
suggested_model(NotBlankStr | None)
Validators:
-
_department_not_empty→department
system_prompt_template
pydantic-field
¶
Template file for system prompt
Role Catalog¶
role_catalog
¶
Built-in role catalog and seniority information.
Provides the canonical set of built-in roles from the Agents design page (Role Catalog) and the seniority mapping (Seniority & Authority Levels).
get_builtin_role
¶
Look up a built-in role by name (case-insensitive, whitespace-stripped).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Role name to search for. |
required |
Returns:
| Type | Description |
|---|---|
Role | None
|
The matching Role, or |
Source code in src/synthorg/core/role_catalog.py
get_seniority_info
¶
Look up seniority info by level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
SeniorityLevel
|
The seniority level to look up. |
required |
Returns:
| Type | Description |
|---|---|
SeniorityInfo
|
The matching SeniorityInfo. |
Raises:
| Type | Description |
|---|---|
LookupError
|
If no entry exists for the given level. |
Source code in src/synthorg/core/role_catalog.py
Task¶
task
¶
Task domain model and acceptance criteria.
AcceptanceCriterion
pydantic-model
¶
Bases: BaseModel
A single acceptance criterion for a task.
Attributes:
| Name | Type | Description |
|---|---|---|
description |
NotBlankStr
|
The criterion text. |
met |
bool
|
Whether this criterion has been satisfied. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
description(NotBlankStr) -
met(bool)
Task
pydantic-model
¶
Bases: BaseModel
A unit of work within the company.
Represents a task from creation through completion, with full lifecycle tracking, dependency modeling, and acceptance criteria. Field schema matches the Engine design page.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
NotBlankStr
|
Unique task identifier (e.g. |
title |
NotBlankStr
|
Short task title. |
description |
NotBlankStr
|
Detailed task description. |
type |
TaskType
|
Classification of the task's work type. |
priority |
Priority
|
Task urgency and importance level. |
project |
NotBlankStr
|
Project ID this task belongs to. |
created_by |
NotBlankStr
|
Agent name of the task creator. |
assigned_to |
NotBlankStr | None
|
Agent ID of the assignee ( |
reviewers |
tuple[NotBlankStr, ...]
|
Agent IDs of designated reviewers. |
dependencies |
tuple[NotBlankStr, ...]
|
IDs of tasks this task depends on. |
artifacts_expected |
tuple[ExpectedArtifact, ...]
|
Artifacts expected to be produced. |
acceptance_criteria |
tuple[AcceptanceCriterion, ...]
|
Structured acceptance criteria. |
estimated_complexity |
Complexity
|
Task complexity estimate. |
budget_limit |
float
|
Maximum spend for this task in USD (base currency). |
deadline |
str | None
|
Optional deadline (ISO 8601 string or |
max_retries |
int
|
Max reassignment attempts after failure (default 1). |
status |
TaskStatus
|
Current lifecycle status. |
parent_task_id |
NotBlankStr | None
|
Parent task ID when created via delegation
( |
delegation_chain |
tuple[NotBlankStr, ...]
|
Ordered agent names of delegators (root first). |
task_structure |
TaskStructure | None
|
Classification of how subtasks relate to each
other ( |
coordination_topology |
CoordinationTopology
|
Coordination topology for multi-agent
execution (defaults to |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(NotBlankStr) -
title(NotBlankStr) -
description(NotBlankStr) -
type(TaskType) -
priority(Priority) -
project(NotBlankStr) -
created_by(NotBlankStr) -
assigned_to(NotBlankStr | None) -
reviewers(tuple[NotBlankStr, ...]) -
dependencies(tuple[NotBlankStr, ...]) -
artifacts_expected(tuple[ExpectedArtifact, ...]) -
acceptance_criteria(tuple[AcceptanceCriterion, ...]) -
estimated_complexity(Complexity) -
budget_limit(float) -
deadline(str | None) -
max_retries(int) -
status(TaskStatus) -
parent_task_id(NotBlankStr | None) -
delegation_chain(tuple[NotBlankStr, ...]) -
task_structure(TaskStructure | None) -
coordination_topology(CoordinationTopology)
Validators:
-
_validate_deadline_format -
_validate_collections -
_validate_delegation_fields -
_validate_assignment_consistency
delegation_chain
pydantic-field
¶
Ordered agent names of delegators (root first)
task_structure
pydantic-field
¶
Classification of subtask relationships (None = not classified)
coordination_topology
pydantic-field
¶
Coordination topology for multi-agent execution
with_transition
¶
Create a new Task with a validated status transition.
Calls :func:~synthorg.core.task_transitions.validate_transition
before producing the new instance, ensuring the state machine is
enforced. Uses model_validate so all validators run on the
new instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
TaskStatus
|
The desired target status. |
required |
**overrides
|
Any
|
Additional field overrides for the new task. |
{}
|
Returns:
| Type | Description |
|---|---|
Task
|
A new Task with the target status. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the transition is not valid or overrides
contain |
Source code in src/synthorg/core/task.py
Task Transitions¶
task_transitions
¶
Task lifecycle state machine transitions.
Defines the valid state transitions for the task lifecycle, based on the Engine design page, extended with BLOCKED, CANCELLED, FAILED, and INTERRUPTED transitions for completeness::
CREATED -> ASSIGNED
ASSIGNED -> IN_PROGRESS | BLOCKED | CANCELLED | FAILED | INTERRUPTED
IN_PROGRESS -> IN_REVIEW | BLOCKED | CANCELLED | FAILED | INTERRUPTED
IN_REVIEW -> COMPLETED | IN_PROGRESS (rework) | BLOCKED | CANCELLED
BLOCKED -> ASSIGNED (unblocked)
FAILED -> ASSIGNED (reassignment for retry)
INTERRUPTED -> ASSIGNED (reassignment on restart)
COMPLETED and CANCELLED are terminal states with no outgoing transitions. FAILED and INTERRUPTED are non-terminal (can be reassigned).
validate_transition
¶
Validate that a state transition is allowed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
TaskStatus
|
The current task status. |
required |
target
|
TaskStatus
|
The desired target status. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the transition from current to target
is not in :data: |
Source code in src/synthorg/core/task_transitions.py
Project¶
project
¶
Project domain model for task collection management.
Project
pydantic-model
¶
Bases: BaseModel
A collection of related tasks with a shared goal, team, and deadline.
Projects organize tasks into a coherent unit of work with budget tracking and team assignment. Per the Design Overview glossary and entity relationship tree.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
NotBlankStr
|
Unique project identifier (e.g. |
name |
NotBlankStr
|
Project display name. |
description |
str
|
Detailed project description. |
team |
tuple[NotBlankStr, ...]
|
Agent IDs assigned to this project. |
lead |
NotBlankStr | None
|
Agent ID of the project lead. |
task_ids |
tuple[NotBlankStr, ...]
|
IDs of tasks belonging to this project. |
deadline |
str | None
|
Optional deadline (ISO 8601 string or |
budget |
float
|
Total budget in base currency (configurable, defaults to EUR). |
status |
ProjectStatus
|
Current project status. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(NotBlankStr) -
name(NotBlankStr) -
description(str) -
team(tuple[NotBlankStr, ...]) -
lead(NotBlankStr | None) -
task_ids(tuple[NotBlankStr, ...]) -
deadline(str | None) -
budget(float) -
status(ProjectStatus)
Validators:
-
_validate_deadline_format -
_validate_collections
Approval¶
approval
¶
Human approval item domain model.
Represents an action that requires human approval before proceeding. Used by the approval queue API and referenced by engine and security subsystems.
ApprovalItem
pydantic-model
¶
Bases: BaseModel
A single item in the human approval queue.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
NotBlankStr
|
Unique approval identifier. |
action_type |
NotBlankStr
|
What kind of action requires approval. |
title |
NotBlankStr
|
Short summary of the approval request. |
description |
NotBlankStr
|
Detailed explanation. |
requested_by |
NotBlankStr
|
Agent or system that requested approval. |
risk_level |
ApprovalRiskLevel
|
Assessed risk level. |
status |
ApprovalStatus
|
Current approval status. |
created_at |
AwareDatetime
|
When the item was created. |
expires_at |
AwareDatetime | None
|
Optional expiration time for auto-expiry. |
decided_at |
AwareDatetime | None
|
When the decision was made (set on approve/reject). |
decided_by |
NotBlankStr | None
|
Who made the decision (set on approve/reject). |
decision_reason |
NotBlankStr | None
|
Reason for the decision (required on reject). |
task_id |
NotBlankStr | None
|
Optional associated task identifier. |
metadata |
dict[str, str]
|
Additional key-value metadata. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(NotBlankStr) -
action_type(NotBlankStr) -
title(NotBlankStr) -
description(NotBlankStr) -
requested_by(NotBlankStr) -
risk_level(ApprovalRiskLevel) -
status(ApprovalStatus) -
created_at(AwareDatetime) -
expires_at(AwareDatetime | None) -
decided_at(AwareDatetime | None) -
decided_by(NotBlankStr | None) -
decision_reason(NotBlankStr | None) -
task_id(NotBlankStr | None) -
metadata(dict[str, str])
Validators:
-
_validate_decision_fields -
_validate_expiry
Artifact¶
artifact
¶
Artifact domain models for task outputs and expected deliverables.
ExpectedArtifact
pydantic-model
¶
Bases: BaseModel
An artifact expected to be produced by a task.
Used within task definitions to declare what outputs are expected.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
ArtifactType
|
The type of artifact expected. |
path |
NotBlankStr
|
File or directory path where the artifact should be produced. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
Artifact
pydantic-model
¶
Bases: BaseModel
A concrete artifact produced by an agent during task execution.
Artifacts track the actual work output, linking it back to the originating task and the agent who produced it.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
NotBlankStr
|
Unique artifact identifier (e.g. |
type |
ArtifactType
|
The type of artifact. |
path |
NotBlankStr
|
File or directory path of the artifact. |
task_id |
NotBlankStr
|
ID of the task that produced this artifact. |
created_by |
NotBlankStr
|
Agent ID of the creator. |
description |
str
|
Human-readable description of the artifact. |
content_type |
str
|
MIME content type (empty when no content stored). |
size_bytes |
int
|
Content size in bytes (zero when no content stored). |
project_id |
NotBlankStr | None
|
ID of the project this artifact belongs to. |
created_at |
AwareDatetime | None
|
Timestamp when the artifact was created. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
id(NotBlankStr) -
type(ArtifactType) -
path(NotBlankStr) -
task_id(NotBlankStr) -
created_by(NotBlankStr) -
description(str) -
project_id(NotBlankStr | None) -
content_type(str) -
size_bytes(int) -
created_at(AwareDatetime | None)
Personality¶
personality
¶
Personality compatibility scoring.
Computes pairwise and team-level compatibility scores from
:class:~synthorg.core.agent.PersonalityConfig profiles.
compute_compatibility
¶
Compute pairwise compatibility score between two personality profiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
PersonalityConfig
|
First personality profile. |
required |
b
|
PersonalityConfig
|
Second personality profile. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Score between 0.0 (incompatible) and 1.0 (highly compatible). |
Source code in src/synthorg/core/personality.py
compute_team_compatibility
¶
Compute average pairwise compatibility for a team.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
members
|
tuple[PersonalityConfig, ...]
|
Tuple of personality profiles for team members. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Average pairwise score (1.0 for teams with fewer than 2 members). |
Source code in src/synthorg/core/personality.py
Resilience Config¶
resilience_config
¶
Resilience configuration models (retry + rate limiting).
Defined in core/ to avoid circular imports between config.schema
and providers.resilience. Both modules import from here.
RetryConfig
pydantic-model
¶
Bases: BaseModel
Configuration for automatic retry of transient provider errors.
Attributes:
| Name | Type | Description |
|---|---|---|
max_retries |
int
|
Maximum number of retry attempts (0 disables retries). |
base_delay |
float
|
Initial delay in seconds before the first retry. |
max_delay |
float
|
Upper bound on computed delay in seconds. |
exponential_base |
float
|
Multiplier for exponential backoff. |
jitter |
bool
|
Whether to add random jitter to delay. |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
max_retries(int) -
base_delay(float) -
max_delay(float) -
exponential_base(float) -
jitter(bool)
Validators:
-
_validate_delay_ordering
RateLimiterConfig
pydantic-model
¶
Bases: BaseModel
Configuration for client-side rate limiting.
Attributes:
| Name | Type | Description |
|---|---|---|
max_requests_per_minute |
int
|
Maximum requests per minute (0 means unlimited). |
max_concurrent |
int
|
Maximum concurrent in-flight requests (0 means unlimited). |
Config:
frozen:Trueallow_inf_nan:False
Fields:
-
max_requests_per_minute(int) -
max_concurrent(int)