Meta¶
Meta-orchestration subsystems: charter interviews, governance, and the conversational organisation interface. The charter subsystem (which produces a project charter from a deep interview) is documented below; other meta surfaces are internal wiring.
Charter Enums¶
enums
¶
Charter domain enumerations.
CharterStatus
¶
Bases: StrEnum
Lifecycle state of a project charter produced by a deep interview.
Attributes:
| Name | Type | Description |
|---|---|---|
DRAFTED |
The interview produced a charter draft; the user may review and edit it in place. The only non-terminal state. |
|
APPROVED |
The charter was approved and dispatched into the work pipeline spine as a real project run. Terminal. |
|
CANCELLED |
The charter was discarded before approval. Terminal. |
Charter Models¶
models
¶
Domain models for the deep CEO interview to project charter flow.
A vague one-line product idea is turned, through a structured
requirements-elicitation interview, into a single :class:ProjectCharter
artifact the user reviews, edits, and approves. On approval the charter
becomes the authoritative input that drives a real project run through
the work pipeline spine.
The interview reuses the Chief of Staff conversation substrate
(Conversation + ConversationTurn); these models cover only the
charter artifact, the structured interview decision, and the service
and controller boundary args.
BudgetEnvelope
pydantic-model
¶
Bases: BaseModel
The budget and time envelope elicited during the interview.
Attributes:
| Name | Type | Description |
|---|---|---|
amount |
float
|
Total budget ceiling for the project run, in
|
currency |
CurrencyCode
|
ISO 4217 code; must match the live |
deadline |
AwareDatetime | None
|
Optional hard deadline for the project. |
time_horizon |
NotBlankStr | None
|
Optional free-text horizon (e.g. "2 weeks") when an absolute deadline is not yet known. |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
amount(float) -
currency(CurrencyCode) -
deadline(AwareDatetime | None) -
time_horizon(NotBlankStr | None)
ScopeBoundaries
pydantic-model
¶
Bases: BaseModel
Explicit in-scope and out-of-scope statements for the project.
Attributes:
| Name | Type | Description |
|---|---|---|
in_scope |
tuple[NotBlankStr, ...]
|
Capabilities/outcomes the project commits to deliver. |
out_of_scope |
tuple[NotBlankStr, ...]
|
Capabilities/outcomes deliberately excluded. |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
in_scope(tuple[NotBlankStr, ...]) -
out_of_scope(tuple[NotBlankStr, ...])
CharterDraft
pydantic-model
¶
Bases: BaseModel
The structured charter the interview strategy emits.
Carries content + project binding + envelope only; lifecycle and
dispatch provenance are added by the service when it mints the
persisted :class:ProjectCharter.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
NotBlankStr
|
Short human-readable charter title. |
brief |
NotBlankStr
|
The elaborated goal statement / project brief. |
goals |
tuple[NotBlankStr, ...]
|
Concrete goals the project pursues. |
constraints |
tuple[NotBlankStr, ...]
|
Constraints the work must respect. |
success_criteria |
tuple[NotBlankStr, ...]
|
Measurable criteria for project success; become the task acceptance criteria on approval. |
scope |
ScopeBoundaries
|
Explicit in/out scope boundaries. |
envelope |
BudgetEnvelope
|
Budget and time envelope. |
project_id |
NotBlankStr | None
|
Existing project to file the run under (XOR). |
proposed_project_name |
NotBlankStr | None
|
Name of a new project to create (XOR). |
proposed_project_description |
str
|
Description for the new project. |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
title(NotBlankStr) -
brief(NotBlankStr) -
goals(tuple[NotBlankStr, ...]) -
constraints(tuple[NotBlankStr, ...]) -
success_criteria(tuple[NotBlankStr, ...]) -
scope(ScopeBoundaries) -
envelope(BudgetEnvelope) -
project_id(NotBlankStr | None) -
proposed_project_name(NotBlankStr | None) -
proposed_project_description(str)
Validators:
-
_validate_binding
InterviewDecision
pydantic-model
¶
Bases: BaseModel
Structured output of one interview model turn.
Exactly one branch is taken: either the interviewer asks a single
elicitation question, or it emits a complete charter draft. The
strategy self-asserts coverage (goals, constraints, success
criteria, scope, envelope all populated) by emitting draft
instead of next_question.
Attributes:
| Name | Type | Description |
|---|---|---|
needs_more |
bool
|
|
next_question |
NotBlankStr | None
|
The question to put to the user; required iff
|
draft |
CharterDraft | None
|
The completed charter draft; set iff not |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
needs_more(bool) -
next_question(NotBlankStr | None) -
draft(CharterDraft | None)
Validators:
-
_validate_exclusive_branch
ProjectCharter
pydantic-model
¶
Bases: BaseModel
The reviewable, approvable project charter artifact.
Persisted via CharterRepository. Created in DRAFTED when the
interview converges, edited in place during review, and transitioned
to APPROVED (dispatched to the spine) or CANCELLED.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
NotBlankStr
|
Unique charter identifier. |
conversation_id |
NotBlankStr
|
Originating interview conversation id. |
created_by |
NotBlankStr
|
User id that ran the interview. |
version |
int
|
Monotonic edit version (starts at 1). |
status |
CharterStatus
|
Lifecycle state. |
project_id |
/ proposed_project_name / proposed_project_description
|
Project binding (existing-vs-new XOR). |
created_at, |
updated_at
|
Row timestamps. |
approved_at, |
approved_by
|
Set iff |
forecast_id, |
(correlation_id, task_id)
|
Dispatch provenance set on
approval; |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
id(NotBlankStr) -
conversation_id(NotBlankStr) -
created_by(NotBlankStr) -
version(int) -
status(CharterStatus) -
title(NotBlankStr) -
brief(NotBlankStr) -
goals(tuple[NotBlankStr, ...]) -
constraints(tuple[NotBlankStr, ...]) -
success_criteria(tuple[NotBlankStr, ...]) -
scope(ScopeBoundaries) -
envelope(BudgetEnvelope) -
project_id(NotBlankStr | None) -
proposed_project_name(NotBlankStr | None) -
proposed_project_description(str) -
created_at(AwareDatetime) -
updated_at(AwareDatetime) -
approved_at(AwareDatetime | None) -
approved_by(NotBlankStr | None) -
forecast_id(UUID | None) -
correlation_id(NotBlankStr | None) -
task_id(NotBlankStr | None)
Validators:
-
_validate_binding -
_validate_approval_coupling
InterviewTurnArgs
pydantic-model
¶
Bases: BaseModel
Args for one :meth:CharterInterviewService.run_turn turn.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
NotBlankStr
|
The user's natural-language message this turn. |
created_by |
NotBlankStr
|
User id that owns the conversation. |
conversation_id |
NotBlankStr | None
|
Existing conversation to continue, or |
project |
NotBlankStr | None
|
Optional existing project id the run should target; used as a hint when the interview drafts the charter. |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
message(NotBlankStr) -
created_by(NotBlankStr) -
conversation_id(NotBlankStr | None) -
project(NotBlankStr | None)
CharterEditArgs
pydantic-model
¶
Bases: BaseModel
Args for an in-place charter edit during review.
Every field is optional; only provided fields are updated
(replace semantics, None skips). status is never editable
here -- approval and cancellation have dedicated transitions.
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
title(NotBlankStr | None) -
brief(NotBlankStr | None) -
goals(tuple[NotBlankStr, ...] | None) -
constraints(tuple[NotBlankStr, ...] | None) -
success_criteria(tuple[NotBlankStr, ...] | None) -
scope(ScopeBoundaries | None) -
envelope(BudgetEnvelope | None)
InterviewTurnResult
pydantic-model
¶
Bases: BaseModel
Outcome of one interview turn.
Exactly one branch: an elicitation question (conversation stays open) or a drafted charter (conversation moves to PROPOSED).
Attributes:
| Name | Type | Description |
|---|---|---|
conversation_id |
NotBlankStr
|
The conversation this turn belongs to. |
status |
Literal['needs_more', 'drafted']
|
|
next_question |
NotBlankStr | None
|
Set iff |
charter |
ProjectCharter | None
|
The drafted charter; set iff |
conversation_closed |
bool
|
|
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
conversation_id(NotBlankStr) -
status(Literal['needs_more', 'drafted']) -
next_question(NotBlankStr | None) -
charter(ProjectCharter | None) -
conversation_closed(bool)
Validators:
-
_validate_status_payload
CharterApprovalResult
pydantic-model
¶
Bases: BaseModel
Outcome of approving a charter and dispatching the project run.
Attributes:
| Name | Type | Description |
|---|---|---|
charter |
ProjectCharter
|
The approved charter (with dispatch provenance stamped). |
project_id |
NotBlankStr
|
The project the run was filed under. |
task_id |
NotBlankStr
|
The spine-created task id. |
is_success |
bool
|
Whether the pipeline run reported success. |
Config:
frozen:Trueallow_inf_nan:Falseextra:forbid
Fields:
-
charter(ProjectCharter) -
project_id(NotBlankStr) -
task_id(NotBlankStr) -
is_success(bool)
Charter Service¶
service
¶
Deep CEO interview to project charter orchestration service.
Drives a multi-turn requirements-elicitation interview over the Chief
of Staff conversation substrate (Conversation + ConversationTurn)
and produces a single reviewable :class:ProjectCharter per
conversation. Each turn either records an elicitation question or
persists / updates the charter draft. Nothing executes here: an
approved charter is dispatched into the work pipeline by
CharterDispatcher via the dedicated approve endpoint.
CharterInterviewService
¶
CharterInterviewService(
*, strategy, config, conversation_repo, turn_repo, charter_repo, clock=None
)
Bases: CharterCrudMixin
Multi-turn charter interview orchestrator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strategy
|
CharterInterviewStrategy
|
Pluggable interview strategy (one model turn). |
required |
config
|
CharterConfig
|
Charter-interview configuration. |
required |
conversation_repo
|
ConversationRepository
|
Conversation header store. |
required |
turn_repo
|
ConversationTurnRepository
|
Append-only conversation turn store. |
required |
charter_repo
|
CharterRepository
|
Project charter store. |
required |
clock
|
Clock | None
|
Injectable time source (defaults to |
None
|
Source code in src/synthorg/meta/charter/service.py
run_turn
async
¶
Run one interview turn (elicit a question or draft the charter).
Raises:
| Type | Description |
|---|---|
ConversationNotFoundError
|
|
ConversationClosedError
|
The conversation is terminal. |
CharterInterviewResponseInvalidError
|
The model output did not satisfy the structured contract. |
Returns:
| Type | Description |
|---|---|
InterviewTurnResult
|
|