Skip to content

API Reference parrot.sdd.audit

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

parrot.sdd.audit

View source

Scan SDD markdown/hook assets for assumptions that break outside the ai-parrot monorepo (FEAT-633 S5).

Stdlib-only by contract: imported by parrot sdd install (TASK-4091) to warn about missing tooling.

Class AssumptionFinding

One line of an asset that encodes a non-portable assumption.

Parameter Type Default Description
path str
line int
kind str
snippet str

Fields:

Field Type Default Description
path str
line int
kind str
snippet str

Attribute BARE_PYTHON_RE

Attribute BRANCH_LITERAL_RE

Attribute CLAUDE_MD_RE

Attribute DEFAULT_GLOBS

Type: tuple[str, ...]

Attribute EXTERNAL_TOOLS

Type: tuple[str, ...]

Attribute EXTERNAL_TOOL_RE

Attribute HOST_COMMANDS

Type: tuple[str, ...]

Attribute JIRA_ORG_DEFAULT_RE

Attribute KINDS

Type: tuple[str, ...]

Attribute LEGACY_SDD_RUN_RE

Attribute MONOREPO_PATH_RE

Attribute NONEXISTENT_CLIS

Type: tuple[str, ...]

Attribute NONEXISTENT_CLI_RE

Attribute ORG_HOST_RE

Attribute PLACEHOLDER_ATLASSIAN_HOST

Attribute PLACEHOLDER_TICKET_PREFIX

Attribute POSIX_SHELL_RE

Attribute REPO_SCRIPT_RE

Attribute TICKET_KEY_ALLOW

Type: tuple[str, ...]

Attribute TICKET_KEY_RE

Attribute UNSHIPPED_COMMAND_RE

Attribute UV_RUN_RE

Attribute VENV_PATH_RE

Attribute WORKTREE_ARTIFACT_RE

Function helper_map

Map each path to the sorted unique scripts/sdd helper names it references (repo-script findings).

helper_map(findings: Sequence[AssumptionFinding]) -> dict[str, list[str]]

Parameter Type Default Description
findings Sequence[AssumptionFinding]

Returns: dict[str, list[str]]

Function main

CLI: scan PATHs (default: DEFAULT_GLOBS under --root) and write the report.

Exit codes: 0 ok; 1 a finding of a --fail-on kind exists (C11c CI gate); 2 nothing to scan. A PATH that is a directory is scanned recursively (every regular file, sorted).

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

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

Returns: int

Function missing_tools

Sorted unique external tools named by external-tool findings that shutil.which cannot find.

missing_tools(findings: Sequence[AssumptionFinding]) -> list[str]

Parameter Type Default Description
findings Sequence[AssumptionFinding]

Returns: list[str]

Function render_report

Markdown: summary counts per kind, Helper reference map, Rewrite list, findings per file, Missing tools.

render_report(findings: Sequence[AssumptionFinding], *, scanned: Sequence[str]) -> str

Parameter Type Default Description
findings Sequence[AssumptionFinding]
scanned Sequence[str]

Returns: str

Function scan_paths

Read each existing file as UTF-8 (errors="replace") and return all findings sorted by (path, line, kind).

scan_paths(paths: Iterable[Path]) -> list[AssumptionFinding]

Parameter Type Default Description
paths Iterable[Path]

Returns: list[AssumptionFinding]

Function scan_text

Scan text line by line; at most one finding per (line, kind); snippet = stripped line, max 160 chars.

scan_text(text: str, path: str) -> list[AssumptionFinding]

Parameter Type Default Description
text str
path str

Returns: list[AssumptionFinding]

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