Skip to content

API Reference parrot.sdd.scripts.brief_meta

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.sdd.scripts.brief_meta

View source

Brief frontmatter model and worktree/index planning for /sdd-brief (FEAT-698).

Briefs never go through FlowMeta: it ships in the wikitoolkit wheel and its hotfix => main validator cannot represent a dev-based ledger brief. This module therefore builds WorktreePlan directly and owns the brief's identity.

Attribute BRIEFS_DIR

Type: str

Attribute BRIEF_BASE_BRANCHES

Type: frozenset[str]

Attribute BRIEF_ID_PREFIX

Type: str

Class BriefMeta

Frontmatter of sdd/briefs/<slug>.brief.md.

Fields:

Field Type Default Description
kind Literal['brief']
slug str
key str
base_branch str
source BriefSource
jira_issue_key str | None None
ledger_issue str | None None
created str

Attributes:

Attribute Type Description
feature_id str Index identity: BRIEF-<KEY>.
brief_path str Repo-relative path of the brief document.
index_path str Repo-relative path of the per-brief index.
tasks_dir str Repo-relative directory holding the materialized task files.

Class BriefSource

Where a brief came from.

Fields:

Field Type Default Description
type SourceType
ref str
url str | None None

Alias SddConfig

Re-exported from parrot.sdd.config.SddConfig.

Attribute SourceType

Alias WorktreePlan

Re-exported from parrot.sdd.scripts.sdd_meta.WorktreePlan.

Function brief_base_branches

Return the branches a brief may base on: the configured hotfix, base and (if set) staging branches.

brief_base_branches(config: SddConfig) -> frozenset[str]

Parameter Type Default Description
config SddConfig

Returns: frozenset[str]

Function brief_task_id

Local, unreserved task id HOTFIX-<KEY>-<n> (n >= 1).

brief_task_id(meta: BriefMeta, n: int) -> str

Parameter Type Default Description
meta BriefMeta
n int

Returns: str

Function brief_worktree_plan

Build a brief worktree plan using its base branch and safe identity fields.

Re-checks the BriefMeta invariants for callers that never build one — notably ensure_worktree --brief-key, which plans straight from raw CLI strings. config=None loads the current repository's sdd/config.json. The ledger => dev rule stays on BriefMeta alone: the source type is not derivable from these arguments.

brief_worktree_plan(*, slug: str, key: str, base_branch: str, config: SddConfig | None = None) -> WorktreePlan

Parameter Type Default Description
slug str
key str
base_branch str
config SddConfig | None None

Returns: WorktreePlan

Raises:

  • ValueError — When slug/key are not safe ref components, or base_branch is not one of the configured long-lived branches.

Function emit_brief_frontmatter

Render meta as a ----delimited YAML block ending in a newline.

emit_brief_frontmatter(meta: BriefMeta) -> str

Parameter Type Default Description
meta BriefMeta

Returns: str

Alias load_sdd_config

Re-exported from parrot.sdd.config.load_sdd_config.

Attribute logger

Function main

CLI for installed flows: plan prints a worktree plan, write-index writes the brief index.

main(argv: Sequence[str] | None = None) -> int

Parameter Type Default Description
argv Sequence[str] | None None

Returns: int

Function parse_brief

Parse a brief's leading YAML frontmatter.

parse_brief(doc_path: Path, *, config: SddConfig | None = None) -> BriefMeta

Parameter Type Default Description
doc_path Path
config SddConfig | None None

Returns: BriefMeta

Raises:

  • ValueError — When the file has no frontmatter block at byte 0.
  • pydantic.ValidationError — When the block does not validate as BriefMeta.

Function plan_brief_worktree

Plan the worktree for an already-validated brief.

plan_brief_worktree(meta: BriefMeta, *, config: SddConfig | None = None) -> WorktreePlan

Parameter Type Default Description
meta BriefMeta
config SddConfig | None None

Returns: WorktreePlan

Alias worktree_root_setting

Re-exported from parrot.sdd.config.worktree_root_setting.

Function write_brief_index

Write sdd/briefs/<slug>.index.json and return its path.

write_brief_index(meta: BriefMeta, tasks: list[dict[str, Any]], worktree_root: Path) -> Path

Parameter Type Default Description
meta BriefMeta Validated metadata which supplies the index header.
tasks list[dict[str, Any]] Partial task records containing id, slug, title, and file.
worktree_root Path Root directory in which the brief artifacts are written.

Returns: Path

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally