Skip to content

feat: add personality presets for new template archetypes#758

Merged
Aureliolo merged 3 commits intomainfrom
feat/personality-presets
Mar 23, 2026
Merged

feat: add personality presets for new template archetypes#758
Aureliolo merged 3 commits intomainfrom
feat/personality-presets

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

  • Add 3 new personality presets to _RAW_PRESETS: client_advisor, code_craftsman, devil_advocate
  • Add corresponding MODEL_AFFINITY entries: client_advisor (balanced), code_craftsman (quality), devil_advocate (quality)
  • All presets validated against PersonalityConfig at import time via existing _validate_presets()
  • Tests updated: count assertion bumped to 23, parametrized validation, profile-specific tests for distinguishing traits

New Presets

Preset Archetype Key Traits Affinity
client_advisor Client-facing consultant High agreeableness (0.75), team, consultative balanced
code_craftsman Quality-obsessed developer Very high conscientiousness (0.9), low risk, pair quality
devil_advocate Contrarian thinker Very low agreeableness (0.25), independent, compete quality

Test plan

  • All 3 presets validate against PersonalityConfig at import time
  • Profile tests verify distinguishing characteristics of each preset
  • test_all_presets_have_affinity confirms all presets have MODEL_AFFINITY entries
  • Full test suite passes (10,411 passed)
  • Lint (ruff), format, type-check (mypy) all clean

Review coverage

Pre-reviewed by 6 agents: docs-consistency, code-reviewer, python-reviewer, pr-test-analyzer, conventions-enforcer, issue-resolution-verifier. 1 finding addressed (test parametrize list cleanup).

Closes #721

Aureliolo and others added 2 commits March 23, 2026 00:12
Add three new personality presets to support new template archetypes:

- client_advisor: consultative, high agreeableness, team-oriented
  (for consultancy/agency client-facing roles)
- code_craftsman: meticulous, very high conscientiousness, low risk
  (quality-obsessed senior developer, distinct from pragmatic_builder)
- devil_advocate: contrarian, low agreeableness, competitive conflict
  (challenges consensus, addresses trendslop mitigation)

Each preset includes full Big Five dimensions, behavioral enums,
and MODEL_AFFINITY entries. All validated against PersonalityConfig
at import time.

Closes #721

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove pre-existing preset names from
test_new_presets_produce_valid_personality_config so the parametrize
list only contains the three actually-new presets. The removed entries
are already covered by test_all_presets_produce_valid_personality_config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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

@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 significantly enhances the system's personality archetype capabilities by introducing three distinct new presets: 'client_advisor', 'code_craftsman', and 'devil_advocate'. These additions provide greater flexibility and range for agent personalities, each with carefully defined traits and model affinities. The changes are seamlessly integrated with existing validation mechanisms and are thoroughly supported by comprehensive unit tests to ensure correctness and maintainability.

Highlights

  • New Personality Presets Added: Three new personality presets, 'client_advisor', 'code_craftsman', and 'devil_advocate', have been introduced to expand the range of available agent archetypes.
  • Model Affinity Integration: Corresponding 'MODEL_AFFINITY' entries were added for the new presets, assigning 'balanced' or 'quality' priorities based on their characteristics.
  • Validation and Testing Enhancements: All new presets are validated against 'PersonalityConfig' at import time, and the test suite was updated to include an increased preset count assertion and dedicated profile-specific tests for each new archetype.
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.

@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: 2d0de7f4-4bee-41e2-b146-e465efff3ba1

📥 Commits

Reviewing files that changed from the base of the PR and between f5ec3d3 and cd1c587.

📒 Files selected for processing (2)
  • tests/unit/templates/test_model_requirements.py
  • tests/unit/templates/test_presets.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). (4)
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Build Sandbox
  • GitHub Check: Build Backend
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: No from __future__ import annotations -- Python 3.14 has PEP 649 native lazy annotations.
Use PEP 758 except syntax: except A, B: (no parentheses) -- ruff enforces this on Python 3.14.
Type hints: all public functions, mypy strict mode.
Docstrings: Google style, required on public classes/functions (enforced by ruff D rules).
Immutability: create new objects, never mutate existing ones. For non-Pydantic internal collections, use copy.deepcopy() at construction + MappingProxyType wrapping for read-only enforcement. For dict/list fields in frozen Pydantic models, rely on frozen=True and copy.deepcopy() at system boundaries.
Config vs runtime state: frozen Pydantic models for config/identity; separate mutable-via-copy models for runtime state that evolves. Never mix static config fields with mutable runtime fields.
Models: Pydantic v2 (BaseModel, model_validator, computed_field, ConfigDict). Use @computed_field for derived values. Use NotBlankStr for all identifier/name fields instead of manual whitespace validators.
Async concurrency: prefer asyncio.TaskGroup for fan-out/fan-in parallel operations in new code. Prefer structured concurrency over bare create_task.
Line length: 88 characters (ruff).
Functions: < 50 lines, files < 800 lines.
Errors: handle explicitly, never silently swallow.
Validate: at system boundaries (user input, external APIs, config files).
Variable name: always logger (not _logger, not log).

Files:

  • tests/unit/templates/test_model_requirements.py
  • tests/unit/templates/test_presets.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.py: Markers: @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.e2e, @pytest.mark.slow
Parametrize: Prefer @pytest.mark.parametrize for testing similar cases.
Tests must use test-provider, test-small-001, etc. for vendor-agnostic test code.
Property-based testing: Python uses Hypothesis (@given + @settings). Hypothesis profiles: ci (50 examples, default) and dev (1000 examples), controlled via HYPOTHESIS_PROFILE env var.
Flaky tests: NEVER skip, dismiss, or ignore -- always fix them fully and fundamentally. For timing-sensitive tests, mock time.monotonic() and asyncio.sleep() to make them deterministic. For tasks that must block indefinitely until cancelled, use asyncio.Event().wait() instead of asyncio.sleep(large_number).

Files:

  • tests/unit/templates/test_model_requirements.py
  • tests/unit/templates/test_presets.py
🧠 Learnings (2)
📚 Learning: 2026-03-22T19:37:56.694Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-22T19:37:56.694Z
Learning: Applies to tests/**/*.py : Property-based testing: Python uses Hypothesis (`given` + `settings`). Hypothesis profiles: `ci` (50 examples, default) and `dev` (1000 examples), controlled via `HYPOTHESIS_PROFILE` env var.

Applied to files:

  • tests/unit/templates/test_presets.py
📚 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:

  • tests/unit/templates/test_presets.py
🧬 Code graph analysis (1)
tests/unit/templates/test_presets.py (1)
src/synthorg/templates/presets.py (1)
  • get_personality_preset (407-429)
🔇 Additional comments (6)
tests/unit/templates/test_presets.py (5)

6-11: LGTM!

The enum imports are correctly added to support type-safe assertions in the new profile tests.


51-52: LGTM!

Exact equality assertion provides precise validation and will catch unintended preset additions or removals.


54-61: LGTM!

Assertions correctly verify distinguishing characteristics of the client_advisor profile. Using threshold checks (e.g., >= 0.7) provides reasonable tolerance while still validating intent.


63-70: LGTM!

Assertions correctly verify the quality-focused characteristics of the code_craftsman profile, including high conscientiousness and low risk tolerance.


72-79: LGTM!

Assertions correctly verify the contrarian characteristics of the devil_advocate profile, including low agreeableness and competitive conflict approach.

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

110-123: LGTM!

Good use of @pytest.mark.parametrize to test the three new preset affinity priorities. The expected values correctly match the PR objectives (client_advisorbalanced; code_craftsman and devil_advocatequality). As per coding guidelines: "Prefer @pytest.mark.parametrize for testing similar cases."


Walkthrough

Three new personality presets were added: client_advisor, code_craftsman, and devil_advocate. Each preset includes full personality definitions (traits, communication style, risk tolerance, creativity, Big Five scores, and behavior enums). Corresponding entries were added to model affinity defaults (client_advisorpriority: balanced; code_craftsman and devil_advocatepriority: quality). Tests were updated to expect a total of 23 presets and include dedicated assertions for the three new profiles.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly and concisely summarizes the main change: adding three new personality presets for template archetypes.
Description check ✅ Passed The description provides clear details about the three new presets, their affinity mappings, and validation approach, directly relating to the changeset.
Linked Issues check ✅ Passed All coding requirements from issue #721 are met: three presets added with specified Big Five values and behavioral enums, MODEL_AFFINITY entries created with correct priority mappings, validation via existing _validate_presets() confirmed, and tests updated.
Out of Scope Changes check ✅ Passed All changes directly align with issue #721 requirements: preset definitions, affinity mappings, and corresponding test updates. No unrelated modifications detected.

✏️ 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.

@Aureliolo Aureliolo temporarily deployed to cloudflare-preview March 22, 2026 23:26 — 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 adds three new personality presets: client_advisor, code_craftsman, and devil_advocate, along with their corresponding model affinities and tests. The changes are well-structured and include thorough testing. My feedback focuses on improving long-term maintainability by suggesting alphabetical sorting for the large preset and affinity dictionaries, and on making a test assertion more precise for better regression detection.

Comment on lines +126 to +127
"code_craftsman": {"priority": "quality"},
"devil_advocate": {"priority": "quality"},
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

For better maintainability and to make it easier to find entries in the future, it's a good practice to keep dictionary keys sorted alphabetically within their respective groups. These new entries for quality (and client_advisor in the balanced group) are currently appended. Could you please place them in alphabetical order within their groups?

Comment on lines +345 to +398
"client_advisor": {
"traits": ("consultative", "trustworthy", "structured"),
"communication_style": "warm",
"risk_tolerance": "medium",
"creativity": "medium",
"description": (
"A consultative advisor who builds client trust and manages expectations."
),
"openness": 0.6,
"conscientiousness": 0.8,
"extraversion": 0.7,
"agreeableness": 0.75,
"stress_response": 0.7,
"decision_making": "consultative",
"collaboration": "team",
"verbosity": "balanced",
"conflict_approach": "collaborate",
},
"code_craftsman": {
"traits": ("meticulous", "principled", "patient"),
"communication_style": "precise",
"risk_tolerance": "low",
"creativity": "medium",
"description": (
"A meticulous craftsman who prioritizes correctness and maintainability."
),
"openness": 0.5,
"conscientiousness": 0.9,
"extraversion": 0.35,
"agreeableness": 0.55,
"stress_response": 0.75,
"decision_making": "analytical",
"collaboration": "pair",
"verbosity": "balanced",
"conflict_approach": "compete",
},
"devil_advocate": {
"traits": ("contrarian", "rigorous", "provocative"),
"communication_style": "direct",
"risk_tolerance": "medium",
"creativity": "high",
"description": (
"A contrarian thinker who challenges consensus and conventional wisdom."
),
"openness": 0.85,
"conscientiousness": 0.7,
"extraversion": 0.6,
"agreeableness": 0.25,
"stress_response": 0.8,
"decision_making": "analytical",
"collaboration": "independent",
"verbosity": "balanced",
"conflict_approach": "compete",
},
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

The _RAW_PRESETS dictionary is quite large and will likely continue to grow. To improve maintainability and make it easier for future developers to find presets or add new ones without creating duplicates, it would be beneficial to sort all top-level keys (the preset names) alphabetically.

Comment on lines +45 to +46
def test_preset_count_at_least_23(self) -> None:
assert len(PERSONALITY_PRESETS) >= 23
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

To make this test more precise, it's better to assert an exact count with == instead of >=. This ensures that no presets are accidentally removed or added without updating this test, making it a stronger regression guard. I'd also suggest renaming the test to something like test_preset_count_is_23 to reflect this more specific check.

Suggested change
def test_preset_count_at_least_23(self) -> None:
assert len(PERSONALITY_PRESETS) >= 23
def test_preset_count_is_23(self) -> None:
assert len(PERSONALITY_PRESETS) == 23

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 22, 2026
@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.31%. Comparing base (77633c6) to head (cd1c587).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #758   +/-   ##
=======================================
  Coverage   92.31%   92.31%           
=======================================
  Files         573      573           
  Lines       29727    29727           
  Branches     2881     2881           
=======================================
  Hits        27441    27441           
  Misses       1806     1806           
  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.

- Replace .value string comparisons with enum constants for type safety
- Use exact count assertion (== 23) instead of floor bound (>= 23)
- Add parametrized test for specific MODEL_AFFINITY values of new presets
- Remove redundant parametrized test (subsumed by exhaustive loop)
- Add traits/communication_style assertions to profile tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Aureliolo Aureliolo merged commit de4e661 into main Mar 23, 2026
33 checks passed
@Aureliolo Aureliolo deleted the feat/personality-presets branch March 23, 2026 05:52
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview March 23, 2026 05:52 — with GitHub Actions Inactive
Aureliolo added a commit that referenced this pull request Mar 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.9](v0.4.8...v0.4.9)
(2026-03-23)


### Features

* add consultancy and data team template archetypes
([#764](#764))
([81dc75f](81dc75f))
* add personality presets for new template archetypes
([#758](#758))
([de4e661](de4e661))
* improve wipe command UX with interactive prompts
([#759](#759))
([bbd4d2d](bbd4d2d))


### Bug Fixes

* stable channel detects update for dev builds
([#753](#753))
([f53da9f](f53da9f))


### Documentation

* add version banner to docs header
([#761](#761))
([8f8c1f8](8f8c1f8))


### Maintenance

* adopt new features from web dependency upgrades
([#763](#763))
([1bb6336](1bb6336))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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: add personality presets for new template archetypes

1 participant