Skip to content

feat: differentiate template operational configs#742

Merged
Aureliolo merged 3 commits intomainfrom
feat/template-operational-configs
Mar 22, 2026
Merged

feat: differentiate template operational configs#742
Aureliolo merged 3 commits intomainfrom
feat/template-operational-configs

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

  • Differentiate autonomy.level, communication, and workflow across 7 builtin YAML templates so each archetype has a meaningful operational profile
  • Add parametrized regression test covering all 7 templates' operational configs
  • Update design spec docs: Company Types table gains Autonomy/Communication/Workflow columns, cross-references added to Operations and Communication pages, stale "Recommended for Full Company" label on Hybrid pattern removed
Template Autonomy Communication Workflow
solo_founder full event_driven kanban
startup semi hybrid agile_kanban
dev_shop semi hybrid agile_kanban
product_team semi meeting_based agile_kanban
agency supervised hierarchical kanban
research_lab full event_driven kanban
full_company supervised hierarchical agile_kanban

Test plan

  • Parametrized test TestBuiltinOperationalConfigs asserts all 7 templates' autonomy, communication, and workflow values
  • All 10,345 existing tests pass (93.68% coverage)
  • Pre-reviewed by 5 agents (docs-consistency, code-reviewer, test-quality, conventions-enforcer, issue-resolution-verifier) -- 5 docs findings addressed

Closes #717

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 22, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43b108c4-ce26-41d3-87de-d938a0c59e1e

📥 Commits

Reviewing files that changed from the base of the PR and between f1c7ab0 and 540ccee.

📒 Files selected for processing (9)
  • docs/design/communication.md
  • docs/design/operations.md
  • docs/design/organization.md
  • src/synthorg/templates/builtins/agency.yaml
  • src/synthorg/templates/builtins/full_company.yaml
  • src/synthorg/templates/builtins/product_team.yaml
  • src/synthorg/templates/builtins/research_lab.yaml
  • src/synthorg/templates/builtins/solo_founder.yaml
  • tests/unit/templates/test_loader.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Backend
  • GitHub Check: Build Web
  • GitHub Check: Build Sandbox
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (4)
docs/design/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

When approved deviations occur, update the relevant docs/design/ page to reflect the new reality.

Files:

  • docs/design/communication.md
  • docs/design/organization.md
  • docs/design/operations.md
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: No from __future__ import annotations—Python 3.14 has PEP 649 native lazy annotations.
Use except A, B: (no parentheses) per PEP 758 except syntax for Python 3.14.
Type hints are required on all public functions; use mypy strict mode.
Use Google-style docstrings required on public classes and functions, enforced by ruff D rules.
For dict/list fields in frozen Pydantic models, rely on frozen=True for field reassignment prevention and use copy.deepcopy() at system boundaries (tool execution, LLM provider serialization, inter-agent delegation, persistence serialization).
Never mix static config fields with mutable runtime fields in one model. Use frozen Pydantic models for config/identity and separate mutable-via-copy models for runtime state that evolves.
Use Pydantic v2 (BaseModel, model_validator, computed_field, ConfigDict). Use @computed_field for derived values instead of storing redundant fields. Use NotBlankStr for all identifier/name fields (including optional and tuple variants) instead of manual whitespace validators.

Files:

  • tests/unit/templates/test_loader.py
{**/*.py,cli/**/*.go}

📄 CodeRabbit inference engine (CLAUDE.md)

Line length is 88 characters (enforced by ruff).

Files:

  • tests/unit/templates/test_loader.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.py: Use test markers: @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.e2e, @pytest.mark.slow.
Test timeout is 30 seconds per test globally in pyproject.toml—do not add per-file pytest.mark.timeout(30) markers; only non-default overrides like timeout(60) are allowed.
Prefer @pytest.mark.parametrize for testing similar cases.
In tests, use test-provider, test-small-001, etc. instead of vendor-specific names.
Use Hypothesis for property-based testing in Python with @given and @settings decorators. Use profiles: ci (50 examples, default) and dev (1000 examples).
For timing-sensitive tests, mock time.monotonic() and asyncio.sleep() to make them deterministic instead of widening timing margins.
For tasks that must block indefinitely until cancelled (e.g., simulating slow providers), use asyncio.Event().wait() instead of asyncio.sleep(large_number)—it is cancellation-safe and carries no timing assumptions.

Files:

  • tests/unit/templates/test_loader.py
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-16T06:24:56.341Z
Learning: Applies to docs/design/**/*.md : Design specification pages in `docs/design/` must be consulted before implementing features (7 pages: index, agents, organization, communication, engine, memory, operations)
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T08:28:32.845Z
Learning: Applies to src/synthorg/templates/**/*.py : Templates: pre-built company templates, personality presets, and builder.
📚 Learning: 2026-03-22T16:44:15.487Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-22T16:44:15.487Z
Learning: Applies to docs/design/*.md : When approved deviations occur, update the relevant `docs/design/` page to reflect the new reality.

Applied to files:

  • docs/design/communication.md
  • docs/design/organization.md
📚 Learning: 2026-03-16T06:24:56.341Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-16T06:24:56.341Z
Learning: Applies to docs/design/**/*.md : Design specification pages in `docs/design/` must be consulted before implementing features (7 pages: index, agents, organization, communication, engine, memory, operations)

Applied to files:

  • docs/design/communication.md
  • docs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to docs/design/*.md : Design spec pages: 7 pages in `docs/design/` — index, agents, organization, communication, engine, memory, operations

Applied to files:

  • docs/design/communication.md
  • docs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/communication/**/*.py : Communication package (communication/): message bus, dispatcher, messenger, channels, delegation, loop prevention, conflict resolution; meeting/ subpackage for meeting protocol (round-robin, position papers, structured phases), scheduler (frequency, participant resolver), orchestrator

Applied to files:

  • docs/design/communication.md
📚 Learning: 2026-03-20T08:28:32.845Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T08:28:32.845Z
Learning: Applies to src/synthorg/templates/**/*.py : Templates: pre-built company templates, personality presets, and builder.

Applied to files:

  • src/synthorg/templates/builtins/full_company.yaml
  • src/synthorg/templates/builtins/solo_founder.yaml
  • docs/design/organization.md
📚 Learning: 2026-03-17T06:30:14.180Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-17T06:30:14.180Z
Learning: Applies to src/synthorg/budget/**/*.py : Budget tracking includes pre-flight/in-flight checks, auto-downgrade, billing periods, cost tiers, quota/subscription. CFO includes anomaly detection, efficiency analysis, downgrade recommendations.

Applied to files:

  • src/synthorg/templates/builtins/full_company.yaml
📚 Learning: 2026-03-22T16:44:15.487Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-22T16:44:15.487Z
Learning: Applies to tests/**/*.py : Prefer `pytest.mark.parametrize` for testing similar cases.

Applied to files:

  • tests/unit/templates/test_loader.py
📚 Learning: 2026-03-15T18:28:13.207Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T18:28:13.207Z
Learning: Applies to tests/**/*.py : Parametrize: Prefer pytest.mark.parametrize for testing similar cases.

Applied to files:

  • tests/unit/templates/test_loader.py
📚 Learning: 2026-03-22T16:44:15.487Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-22T16:44:15.487Z
Learning: Applies to tests/**/*.py : In tests, use `test-provider`, `test-small-001`, etc. instead of vendor-specific names.

Applied to files:

  • tests/unit/templates/test_loader.py
📚 Learning: 2026-03-15T18:28:13.207Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T18:28:13.207Z
Learning: Applies to tests/**/*.py : Test markers: pytest.mark.unit, pytest.mark.integration, pytest.mark.e2e, pytest.mark.slow. Coverage: 80% minimum (enforced in CI).

Applied to files:

  • tests/unit/templates/test_loader.py
📚 Learning: 2026-03-14T15:43:05.601Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-14T15:43:05.601Z
Learning: Applies to docs/** : Docs source in docs/ (Markdown, built with Zensical); design spec in docs/design/ (7 pages: index, agents, organization, communication, engine, memory, operations)

Applied to files:

  • docs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/**/*.py : Package structure: src/synthorg/ organized as: api/ (REST+WebSocket, Litestar), auth/ (auth subpackage), backup/ (scheduled/manual backups), budget/ (cost tracking, CFO), cli/ (superseded by Go CLI), communication/ (message bus, meetings), config/ (YAML loading), core/ (domain models, resilience config), engine/ (orchestration, task state, coordination, approval gates, stagnation detection, context budget, compaction), hr/ (hiring, performance, promotion), memory/ (pluggable backend, Mem0, retrieval, consolidation), persistence/ (operational data, SQLite, settings), observability/ (logging, correlation, sinks), providers/ (LLM abstraction, LiteLLM, auth types, presets, runtime CRUD), settings/ (runtime-editable, typed definitions, encryption, config bridge), security/ (SecOps, rule engine, output scanning, progressive trust, autonomy levels), templates/ (company templates, personalities), tools/ (registry, built-in tools, git, sandbox, code_runner, MCP...

Applied to files:

  • docs/design/organization.md
📚 Learning: 2026-03-17T22:08:13.456Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-17T22:08:13.456Z
Learning: Security: SecOps agent, rule engine (soft-allow/hard-deny, fail-closed), audit log, output scanner, output scan response policies (redact/withhold/log-only/autonomy-tiered), risk classifier, risk tier classifier, action type registry, ToolInvoker security integration, progressive trust (4 strategies: disabled/weighted/per-category/milestone), autonomy levels (presets, resolver, change strategy), timeout policies (park/resume).

Applied to files:

  • docs/design/operations.md
🧬 Code graph analysis (1)
tests/unit/templates/test_loader.py (1)
src/synthorg/templates/loader.py (1)
  • load_template (161-217)
🪛 LanguageTool
docs/design/communication.md

[style] ~89-~89: Consider using a different adjective to strengthen your wording.
Context: ...arch Lab, hierarchical for Agency and Full Company, meeting_based for Product Te...

(FULL_ENTIRE)

🔇 Additional comments (10)
src/synthorg/templates/builtins/product_team.yaml (1)

109-109: LGTM!

The communication: "meeting_based" change correctly aligns with Issue #717's specification for the Product Team archetype. The combination of semi autonomy, meeting_based communication, and agile_kanban workflow appropriately reflects a product-focused team's need for structured coordination through planning ceremonies and standups.

src/synthorg/templates/builtins/agency.yaml (1)

24-25: LGTM!

Both changes correctly align with Issue #717's specification for the Agency archetype:

  • autonomy.level: "supervised" — appropriate for client-facing work requiring approval chains
  • communication: "hierarchical" — fits the project-management-driven structure with clear delegation paths

Also applies to: 120-121

docs/design/operations.md (1)

845-848: LGTM!

The documentation addition accurately describes the archetype-driven autonomy defaults and appropriately cross-references the Company Types table for the complete mapping. The examples chosen (Solo Founder/Research Lab with full, Agency/Full Company with supervised) correctly represent the template configurations.

src/synthorg/templates/builtins/full_company.yaml (1)

32-33: LGTM!

Both changes correctly align with Issue #717's specification for the Full Company archetype:

  • autonomy.level: "supervised" — appropriate for enterprise simulation requiring structured oversight
  • communication: "hierarchical" — fits the full departmental hierarchy with C-suite through junior levels

Also applies to: 245-246

docs/design/communication.md (1)

88-92: LGTM!

The documentation accurately describes the archetype-driven communication pattern defaults. The example mappings correctly reflect the template configurations:

  • event_driven for Solo Founder and Research Lab
  • hierarchical for Agency and Full Company
  • meeting_based for Product Team

The cross-reference to the Company Types table provides the complete mapping including Startup and Dev Shop (which retain hybrid).

src/synthorg/templates/builtins/solo_founder.yaml (1)

24-25: LGTM!

Both changes correctly align with Issue #717's specification for the Solo Founder archetype:

  • autonomy.level: "full" — appropriate for minimal setup and quick prototypes where human intervention overhead should be minimized
  • communication: "event_driven" — fits the async, decoupled pattern suitable for solo/small teams

Also applies to: 49-50

src/synthorg/templates/builtins/research_lab.yaml (1)

24-25: LGTM!

Both changes correctly align with Issue #717's specification for the Research Lab archetype:

  • autonomy.level: "full" — appropriate for research teams that work independently with high autonomy
  • communication: "event_driven" — fits the async, topic-based collaboration pattern suitable for data-focused research work

Also applies to: 84-85

tests/unit/templates/test_loader.py (1)

346-395: LGTM!

Excellent test implementation that aligns with coding guidelines:

  1. Coverage guard (lines 366-369): The test_matrix_covers_all_builtins method ensures new builtin templates cannot be added without updating this test matrix — this addresses the concern from the previous review.

  2. Parametrized testing (lines 371-395): Uses @pytest.mark.parametrize as per guidelines, testing all 7 templates with their expected operational configs.

  3. Correct expected values: All entries in _EXPECTED_CONFIGS match Issue #717's specification exactly.

  4. Proper marker: Uses @pytest.mark.unit as required.

docs/design/organization.md (2)

12-21: Accurate and complete operational-profile table update.

This table now cleanly documents the differentiated autonomy, communication, and workflow defaults per built-in template and aligns with the stated template mapping.

Based on learnings: Design specification pages in docs/design/ must be consulted before implementing features (7 pages: index, agents, organization, communication, engine, memory, operations).


176-177: Good clarification for template-default semantics in the YAML example.

These inline comments improve reader guidance by explaining that values are template defaults and where to find the canonical mapping.

As per coding guidelines: “When approved deviations occur, update the relevant docs/design/ page to reflect the new reality.”


Walkthrough

Updated operational defaults across built-in templates and documentation. Five YAML templates (src/synthorg/templates/builtins/solo_founder.yaml, research_lab.yaml, agency.yaml, full_company.yaml, product_team.yaml) now specify distinct company.autonomy.level and communication values. Documentation files (docs/design/communication.md, docs/design/operations.md, docs/design/organization.md) were changed to document archetype-driven template defaults and expanded the Company Types table to include Autonomy, Communication, and Workflow. Added tests/unit/templates/test_loader.py to assert each builtin template’s autonomy, communication, and workflow values and template coverage.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 40.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: differentiating operational configs (autonomy, communication, workflow) across templates.
Description check ✅ Passed The description clearly explains the changes: template config differentiation, test coverage, and documentation updates, all directly related to the changeset.
Linked Issues check ✅ Passed All code changes align with #717 requirements: template YAML files updated with specified autonomy/communication/workflow mappings, regression test added, docs updated.
Out of Scope Changes check ✅ Passed All changes are within scope: YAML template configs, test additions, and documentation updates directly address #717 objectives with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the operational profiles of built-in company templates by assigning specific autonomy levels, communication patterns, and workflow types to each archetype. It ensures that each template accurately reflects a distinct organizational structure and behavior. The changes are supported by new regression tests and comprehensive updates to the design documentation, enhancing clarity and consistency across the system.

Highlights

  • Template Operational Profiles: Differentiated autonomy levels, communication patterns, and workflow types across seven built-in YAML templates to provide meaningful operational profiles for each archetype.
  • Regression Testing: Added a new parametrized regression test, TestBuiltinOperationalConfigs, to cover and assert the operational configurations of all seven templates.
  • Documentation Updates: Updated design specification documentation, including the Company Types table with new Autonomy, Communication, and Workflow columns, added cross-references to Operations and Communication pages, and removed a stale 'Recommended for Full Company' label.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Aureliolo Aureliolo temporarily deployed to cloudflare-preview March 22, 2026 17:43 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively differentiates the operational configurations for the built-in templates, providing more meaningful archetypes. The changes are well-supported by updates to the documentation and a new parametrized regression test to prevent future regressions. My main feedback is a suggestion to improve maintainability by reducing data duplication between the new test and the documentation, which will make future updates easier and less error-prone.

Comment on lines +358 to +366
[
("solo_founder", "full", "event_driven", "kanban"),
("startup", "semi", "hybrid", "agile_kanban"),
("dev_shop", "semi", "hybrid", "agile_kanban"),
("product_team", "semi", "meeting_based", "agile_kanban"),
("agency", "supervised", "hierarchical", "kanban"),
("research_lab", "full", "event_driven", "kanban"),
("full_company", "supervised", "hierarchical", "agile_kanban"),
],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These hardcoded test parameters in @pytest.mark.parametrize duplicate the information that is now also present in the documentation table in docs/design/organization.md. This creates a maintenance challenge, as any future changes to these operational profiles will need to be updated in the YAML template, this test, and the documentation, increasing the risk of them becoming out of sync.

To improve maintainability and establish a single source of truth, you could consider creating a shared data file (e.g., a JSON or YAML file) that holds these configurations. The test could then load its parameters from this file, and the documentation could potentially be updated using a script that reads from the same file. This would ensure consistency across the codebase with less manual effort.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/unit/templates/test_loader.py`:
- Around line 356-376: The parameter matrix defined with pytest.mark.parametrize
(the ("name", "autonomy_level", "communication", "workflow") decorator and its
explicit "name" list) must be guarded so new built-in templates cannot be
missed; add an assertion in the same test that compares the set of parametrized
"name" values against the canonical list returned by the production code that
exposes built-in templates (call the loader function that lists built-ins in
your codebase, e.g., the function that returns available builtin template names)
and fail with a clear message if they differ so the test will break when a new
builtin is added.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 966d23d9-bb84-4f9b-8dcb-6bae9c712609

📥 Commits

Reviewing files that changed from the base of the PR and between 3045df8 and f1c7ab0.

📒 Files selected for processing (9)
  • docs/design/communication.md
  • docs/design/operations.md
  • docs/design/organization.md
  • src/synthorg/templates/builtins/agency.yaml
  • src/synthorg/templates/builtins/full_company.yaml
  • src/synthorg/templates/builtins/product_team.yaml
  • src/synthorg/templates/builtins/research_lab.yaml
  • src/synthorg/templates/builtins/solo_founder.yaml
  • tests/unit/templates/test_loader.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Build Sandbox
  • GitHub Check: Build Web
  • GitHub Check: Build Backend
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (4)
docs/design/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

When approved deviations occur, update the relevant docs/design/ page to reflect the new reality.

Files:

  • docs/design/communication.md
  • docs/design/operations.md
  • docs/design/organization.md
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: No from __future__ import annotations—Python 3.14 has PEP 649 native lazy annotations.
Use except A, B: (no parentheses) per PEP 758 except syntax for Python 3.14.
Type hints are required on all public functions; use mypy strict mode.
Use Google-style docstrings required on public classes and functions, enforced by ruff D rules.
For dict/list fields in frozen Pydantic models, rely on frozen=True for field reassignment prevention and use copy.deepcopy() at system boundaries (tool execution, LLM provider serialization, inter-agent delegation, persistence serialization).
Never mix static config fields with mutable runtime fields in one model. Use frozen Pydantic models for config/identity and separate mutable-via-copy models for runtime state that evolves.
Use Pydantic v2 (BaseModel, model_validator, computed_field, ConfigDict). Use @computed_field for derived values instead of storing redundant fields. Use NotBlankStr for all identifier/name fields (including optional and tuple variants) instead of manual whitespace validators.

Files:

  • tests/unit/templates/test_loader.py
{**/*.py,cli/**/*.go}

📄 CodeRabbit inference engine (CLAUDE.md)

Line length is 88 characters (enforced by ruff).

Files:

  • tests/unit/templates/test_loader.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.py: Use test markers: @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.e2e, @pytest.mark.slow.
Test timeout is 30 seconds per test globally in pyproject.toml—do not add per-file pytest.mark.timeout(30) markers; only non-default overrides like timeout(60) are allowed.
Prefer @pytest.mark.parametrize for testing similar cases.
In tests, use test-provider, test-small-001, etc. instead of vendor-specific names.
Use Hypothesis for property-based testing in Python with @given and @settings decorators. Use profiles: ci (50 examples, default) and dev (1000 examples).
For timing-sensitive tests, mock time.monotonic() and asyncio.sleep() to make them deterministic instead of widening timing margins.
For tasks that must block indefinitely until cancelled (e.g., simulating slow providers), use asyncio.Event().wait() instead of asyncio.sleep(large_number)—it is cancellation-safe and carries no timing assumptions.

Files:

  • tests/unit/templates/test_loader.py
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-16T06:24:56.341Z
Learning: Applies to docs/design/**/*.md : Design specification pages in `docs/design/` must be consulted before implementing features (7 pages: index, agents, organization, communication, engine, memory, operations)
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to docs/design/*.md : Design spec pages: 7 pages in `docs/design/` — index, agents, organization, communication, engine, memory, operations
📚 Learning: 2026-03-22T16:44:15.487Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-22T16:44:15.487Z
Learning: Applies to docs/design/*.md : When approved deviations occur, update the relevant `docs/design/` page to reflect the new reality.

Applied to files:

  • docs/design/communication.md
📚 Learning: 2026-03-16T06:24:56.341Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-16T06:24:56.341Z
Learning: Applies to docs/design/**/*.md : Design specification pages in `docs/design/` must be consulted before implementing features (7 pages: index, agents, organization, communication, engine, memory, operations)

Applied to files:

  • docs/design/communication.md
  • docs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/communication/**/*.py : Communication package (communication/): message bus, dispatcher, messenger, channels, delegation, loop prevention, conflict resolution; meeting/ subpackage for meeting protocol (round-robin, position papers, structured phases), scheduler (frequency, participant resolver), orchestrator

Applied to files:

  • docs/design/communication.md
📚 Learning: 2026-03-20T08:28:32.845Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T08:28:32.845Z
Learning: Applies to src/synthorg/templates/**/*.py : Templates: pre-built company templates, personality presets, and builder.

Applied to files:

  • src/synthorg/templates/builtins/full_company.yaml
  • docs/design/organization.md
📚 Learning: 2026-03-17T06:30:14.180Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-17T06:30:14.180Z
Learning: Applies to src/synthorg/budget/**/*.py : Budget tracking includes pre-flight/in-flight checks, auto-downgrade, billing periods, cost tiers, quota/subscription. CFO includes anomaly detection, efficiency analysis, downgrade recommendations.

Applied to files:

  • src/synthorg/templates/builtins/full_company.yaml
📚 Learning: 2026-03-17T22:08:13.456Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-17T22:08:13.456Z
Learning: Security: SecOps agent, rule engine (soft-allow/hard-deny, fail-closed), audit log, output scanner, output scan response policies (redact/withhold/log-only/autonomy-tiered), risk classifier, risk tier classifier, action type registry, ToolInvoker security integration, progressive trust (4 strategies: disabled/weighted/per-category/milestone), autonomy levels (presets, resolver, change strategy), timeout policies (park/resume).

Applied to files:

  • docs/design/operations.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to docs/design/*.md : Design spec pages: 7 pages in `docs/design/` — index, agents, organization, communication, engine, memory, operations

Applied to files:

  • docs/design/organization.md
📚 Learning: 2026-03-14T15:43:05.601Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-14T15:43:05.601Z
Learning: Applies to docs/** : Docs source in docs/ (Markdown, built with Zensical); design spec in docs/design/ (7 pages: index, agents, organization, communication, engine, memory, operations)

Applied to files:

  • docs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/**/*.py : Package structure: src/synthorg/ organized as: api/ (REST+WebSocket, Litestar), auth/ (auth subpackage), backup/ (scheduled/manual backups), budget/ (cost tracking, CFO), cli/ (superseded by Go CLI), communication/ (message bus, meetings), config/ (YAML loading), core/ (domain models, resilience config), engine/ (orchestration, task state, coordination, approval gates, stagnation detection, context budget, compaction), hr/ (hiring, performance, promotion), memory/ (pluggable backend, Mem0, retrieval, consolidation), persistence/ (operational data, SQLite, settings), observability/ (logging, correlation, sinks), providers/ (LLM abstraction, LiteLLM, auth types, presets, runtime CRUD), settings/ (runtime-editable, typed definitions, encryption, config bridge), security/ (SecOps, rule engine, output scanning, progressive trust, autonomy levels), templates/ (company templates, personalities), tools/ (registry, built-in tools, git, sandbox, code_runner, MCP...

Applied to files:

  • docs/design/organization.md
🧬 Code graph analysis (1)
tests/unit/templates/test_loader.py (1)
src/synthorg/templates/loader.py (1)
  • load_template (161-217)
🪛 LanguageTool
docs/design/communication.md

[style] ~89-~89: Consider using a different adjective to strengthen your wording.
Context: ...arch Lab, hierarchical for Agency and Full Company, meeting_based for Product Te...

(FULL_ENTIRE)

🔇 Additional comments (10)
src/synthorg/templates/builtins/product_team.yaml (1)

108-109: Operational profile for Product Team is consistent.

communication: "meeting_based" paired with workflow: "agile_kanban" is aligned with the intended archetype mapping.

docs/design/operations.md (1)

845-847: Docs update cleanly captures autonomy-by-archetype behavior.

Good addition of concrete examples plus a pointer to the Company Types table for full defaults.

src/synthorg/templates/builtins/agency.yaml (1)

25-25: Agency template operational defaults look correct.

supervised autonomy and hierarchical communication are coherent and aligned with the PR mapping.

Also applies to: 121-121

src/synthorg/templates/builtins/solo_founder.yaml (1)

25-25: Solo Founder template change is aligned and consistent.

full autonomy with event_driven communication matches the intended lightweight, independent operation profile.

Also applies to: 50-50

src/synthorg/templates/builtins/research_lab.yaml (1)

25-25: Research Lab defaults are correctly specialized.

The switch to full autonomy and event_driven communication is coherent for the archetype.

Also applies to: 85-85

src/synthorg/templates/builtins/full_company.yaml (1)

33-33: Full Company operational profile update is appropriate.

supervised autonomy plus hierarchical communication aligns well with full-hierarchy enterprise behavior.

Also applies to: 246-246

docs/design/communication.md (1)

88-91: Communication docs now reflect archetype-driven defaults clearly.

Good call adding concrete pattern examples and linking readers to the canonical Company Types table.

tests/unit/templates/test_loader.py (1)

351-388: Great regression coverage for operational config mapping.

This parametrized test directly protects the archetype defaults across autonomy, communication, and workflow.

docs/design/organization.md (2)

12-21: Company Types operational profile table update is correct.

The new columns and per-template defaults align with the intended differentiated operational configs and improve spec clarity.


176-177: Inline default-value annotations are helpful and accurate.

Good clarification that these are template defaults and that per-template values are defined in the Company Types table.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (15487a5) to head (540ccee).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #742   +/-   ##
=======================================
  Coverage   92.27%   92.27%           
=======================================
  Files         573      573           
  Lines       29655    29655           
  Branches     2870     2870           
=======================================
  Hits        27365    27365           
  Misses       1810     1810           
  Partials      480      480           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Aureliolo and others added 3 commits March 22, 2026 18:55
…tion, workflow)

Assign each builtin template an operational profile matching its
organizational archetype instead of using identical defaults everywhere.

Closes #717

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add Autonomy/Communication/Workflow columns to Company Types table,
add cross-references from Operations and Communication pages, fix
stale "Recommended for Full Company" label on Hybrid pattern.

Pre-reviewed by 5 agents, 5 findings addressed

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Addresses CodeRabbit feedback: test_matrix_covers_all_builtins() now
asserts the parametrized test names match BUILTIN_TEMPLATES, so adding
a new template without updating the config matrix fails immediately.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@Aureliolo Aureliolo force-pushed the feat/template-operational-configs branch from f1c7ab0 to 540ccee Compare March 22, 2026 18:04
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview March 22, 2026 18:05 — with GitHub Actions Inactive
@Aureliolo Aureliolo merged commit 9b48345 into main Mar 22, 2026
31 checks passed
@Aureliolo Aureliolo deleted the feat/template-operational-configs branch March 22, 2026 18:09
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview March 22, 2026 18:09 — with GitHub Actions Inactive
Aureliolo added a commit that referenced this pull request Mar 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.8](v0.4.7...v0.4.8)
(2026-03-22)


### Features

* add auto_cleanup config and improve update UX
([#741](#741))
([289638f](289638f))
* add reporting lines, escalation paths, and workflow handoffs to
templates ([#745](#745))
([c374cc9](c374cc9))
* differentiate template operational configs
([#742](#742))
([9b48345](9b48345))
* diversify personality preset assignments across templates
([#743](#743))
([15487a5](15487a5))
* improve template metadata -- skill taxonomy, descriptions, tags, and
display names ([#752](#752))
([f333f24](f333f24))


### Bug Fixes

* resolve log analysis findings (Ollama prefix, logging, init)
([#748](#748))
([8f871a4](8f871a4))
* use git tag for dev release container image tags
([#749](#749))
([f30d071](f30d071))
* use subordinate_id/supervisor_id in HierarchyResolver
([#751](#751))
([118235b](118235b))


### Performance

* add long-lived cache headers for content-hashed static assets
([#747](#747))
([4d350b5](4d350b5))
* use worksteal distribution for pytest-xdist
([#750](#750))
([b7dd7de](b7dd7de))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: differentiate template operational configs (autonomy, communication, workflow)

1 participant