Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
85dd6c6
adding new architecture file
luca-belli Jul 9, 2026
937e42c
adding new architecture file
luca-belli Jul 9, 2026
29e3c49
new architecture for entry-point
luca-belli Jul 10, 2026
3151059
Resolve PR #170 review feedback: config/CLI design, naming scheme, mi…
luca-belli Jul 16, 2026
112a934
Harden migration plan: fix phase-ordering bugs, add stable-interfaces…
luca-belli Jul 20, 2026
c008c42
Fix 8 critical gaps in the migration plan found under review
luca-belli Jul 20, 2026
2db14bc
Flag that generation regression testing needs a two-part approach
luca-belli Jul 20, 2026
ec4ecf6
Move the engine-testing caution from Phase 1 to Phase 5, where it bel…
luca-belli Jul 20, 2026
4293fa3
Fix 5 more gaps: dropped script, downstream naming break, manifest/co…
luca-belli Jul 20, 2026
7a68de3
Rename packages to match subcommand names; remove stale planning docs
luca-belli Jul 20, 2026
57d1659
fix: resolve architecture-doc inconsistencies and stale CODEOWNERS en…
luca-belli Jul 21, 2026
d29f6c4
fix: resolve architecture-doc inconsistencies and stale CODEOWNERS en…
luca-belli Jul 21, 2026
8d2f4e5
Add storage abstraction (Phase S, orthogonal to the rest of the migra…
luca-belli Jul 21, 2026
8954957
Propagate spine hardening: sha canonicalization, --target shorthand,
luca-belli Jul 21, 2026
0235289
Add ARCHITECTURE-SPINE.md: terse, AD-numbered invariants contract
luca-belli Jul 21, 2026
4e03d63
Mark ARCHITECTURE-SPINE.md as final
luca-belli Jul 21, 2026
80116f1
Add Phase O: firm up OpenSpec adoption from a maybe into an orthogona…
luca-belli Jul 21, 2026
bfe0a62
feat: add RubricConfig.load_bundle() for rubric bundle manifests
luca-belli Jul 22, 2026
7ea94c0
Resolve remaining PR #170 review threads: chatbot flag, path resoluti…
luca-belli Jul 27, 2026
096014a
Sync architecture spine with today's PR #170 review resolutions
luca-belli Jul 27, 2026
b0e91ea
Add best-guess caveat to architecture.md and the spine
luca-belli Jul 27, 2026
b0d2502
Add statistical semantic-similarity tier to Phase 5 testing
luca-belli Jul 27, 2026
5a26e8c
Rename generation.models to generation.user to remove field-name ambi…
luca-belli Jul 28, 2026
e40e464
Merge remote-tracking branch 'origin/main' into feat/architure.md
luca-belli Jul 28, 2026
454c7c2
chore: trigger PR sync
luca-belli Jul 29, 2026
360dae6
docs: fix broken rubric-manifest links, clarify vera.py flag reuse
luca-belli Jul 29, 2026
8c2fe73
docs: expand Phase 0 to attach personas + rubric on the generation si…
luca-belli Jul 29, 2026
0e67a6f
refactor: extract manifest reading into utils/rubric_manifest.py
luca-belli Jul 29, 2026
03af008
fix: resolve manifest personas relative to the manifest's own folder
luca-belli Jul 29, 2026
500b55b
docs: defer resume contract details
luca-belli Jul 30, 2026
db78030
docs: narrow resume contract wording
luca-belli Jul 30, 2026
48d16e8
docs: carve out --sample as the named exception to AD-17
luca-belli Jul 30, 2026
c7eb92f
docs: resolve standalone-judging re-run ambiguity in favor of (a)
luca-belli Jul 30, 2026
4c981b2
docs: fix workers/ <-> llm_clients graph contradiction, add examples
luca-belli Jul 30, 2026
a59a28f
docs: defer $ROOT packaging break to the Deferred section
luca-belli Jul 30, 2026
43fd1ac
fix: add utils/conversation_layout.py to stable-interfaces protection
luca-belli Jul 30, 2026
f82be4c
docs: place improvement reporting under judge/, flag future report/ s…
luca-belli Jul 31, 2026
9abc67d
feat: add load_manifest_persona_context_template() manifest accessor
luca-belli Jul 31, 2026
7290782
feat: wire persona_context_template_file into the production manifest
luca-belli Jul 31, 2026
906c3c5
feat: wire --rubrics flag to RubricConfig.load_bundle()
luca-belli Jul 22, 2026
ae08314
feat: wire generate.py --rubric-manifest to attach personas to a rubric
luca-belli Jul 29, 2026
dfa04e2
Merge pull request #170 from SpringCare/feat/architure.md
luca-belli Jul 31, 2026
c2c7069
feat: load persona context templates from the manifest
luca-belli Jul 31, 2026
b53db4c
refactor: move the SI rubric bundle into data/SI/
luca-belli Jul 29, 2026
708881c
docs: clarify no --target-style rubric shorthand exists yet
luca-belli Jul 30, 2026
1e7c70c
refactor: load persona context templates from manifests
luca-belli Jul 30, 2026
ea8d89b
Potential fix for pull request finding
luca-belli Jul 31, 2026
a865fde
Merge pull request #177 from SpringCare/feat/rubric-bundle-manifest-h…
luca-belli Jul 31, 2026
ca49220
Potential fix for pull request finding
luca-belli Aug 3, 2026
a5c34e7
Potential fix for pull request finding
luca-belli Aug 3, 2026
503fda0
Merge pull request #178 from SpringCare/feat/wire-rubrics-cli-flag
luca-belli Aug 3, 2026
fe2bf67
fix: resolve SI rubric paths independent of cwd and repair personas f…
luca-belli Aug 5, 2026
f28821f
Merge pull request #180 from SpringCare/refactor/move-rubric-data-int…
luca-belli Aug 5, 2026
15fdd2d
refactor: decouple rubric logic from SI structure
luca-belli Aug 5, 2026
e5e2309
test: cover not relevant judge orchestration
luca-belli Aug 5, 2026
4243e4a
clarifying docstring
luca-belli Aug 5, 2026
8076f30
docs: document compatible rubric requirements
luca-belli Aug 5, 2026
c71ef5e
Update TODO with config file SHA requirement
luca-belli Aug 6, 2026
c784e66
Update judge/rubric_config.py
luca-belli Aug 6, 2026
837b71b
Merge branch 'feat/VERA_2.0' of github.com:SpringCare/VERA-MH into re…
luca-belli Aug 6, 2026
ba05871
Merge branch 'refactor/decouple-si-rubric' of github.com:SpringCare/V…
luca-belli Aug 6, 2026
fa4a15b
todo
luca-belli Aug 6, 2026
866241c
Merge pull request #186 from SpringCare/refactor/decouple-si-rubric
luca-belli Aug 6, 2026
d78f629
fix: preserve scores on final assign end
luca-belli Aug 5, 2026
b8bec65
docs: define design record conventions
luca-belli Aug 7, 2026
603d5c1
Merge pull request #187 from SpringCare/fix/final-assign-end
luca-belli Aug 11, 2026
414b2e1
Merge pull request #188 from SpringCare/docs/design-record-conventions
luca-belli Aug 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/CODEOWNERS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
# Architecture and domain packages require maintainer review.
/docs/architecture.md @SpringCare/vera-mh-maintainers
/docs/vera-cli-use-cases.md @SpringCare/vera-mh-maintainers
/llm_clients/ @SpringCare/vera-mh-maintainers
/judge/ @SpringCare/vera-mh-maintainers
/generate/ @SpringCare/vera-mh-maintainers
/run_pipeline.py @SpringCare/vera-mh-maintainers
/openspec/ @SpringCare/vera-mh-maintainers
/pyproject.toml @SpringCare/vera-mh-maintainers

# Stable interfaces -- changing these requires a design doc (see docs/architecture.md#stable-interfaces-agent-coding-optimization)
/llm_clients/llm_interface.py @SpringCare/vera-mh-maintainers
/utils/role.py @SpringCare/vera-mh-maintainers
/utils/naming.py @SpringCare/vera-mh-maintainers
/utils/conversation_layout.py @SpringCare/vera-mh-maintainers
# /workers/queue.py, /utils/config_schema.py, and /storage/storage_backend.py will be
# added here once each file exists (Phase 5, Phase 3, and Phase S respectively --
# see docs/architecture.md#migration-from-current-layout)
62 changes: 44 additions & 18 deletions AGENTS.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,19 +29,30 @@ cp .env.example .env # Add API keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, et

| Area | Key paths | When to edit |
|------|-----------|--------------|
| **Generation** | `generate.py`, `generate_conversations/` | Conversation simulation, turns, personas |
| **Judging** | `judge.py`, `judge/` | Rubric scoring, TSV output, question navigation |
| **CLI** | `vera.py` | Subcommands: generate, judge, score, pool, pipeline |
| **Generation** | `generate_conversations/` | Conversation simulation, turns, personas |
| **Judging** | `judge/` | Rubric scoring, TSV output, question navigation |
| **LLM providers** | `llm_clients/`, `llm_clients/llm_factory.py` | New models, custom HTTP/API providers |
| **Pipeline** | `run_pipeline.py`, `scripts/` | End-to-end generate → judge → score workflows |
| **Pipeline helpers** | `scripts/` | Pooling and automation until absorbed into `vera pool` |
| **Data** | `data/` (personas, rubrics) | Evaluation inputs (committed) |
| **Output** | `output/` (gitignored) | Generated transcripts, evaluations, logs |
| **Config** | `utils/model_config_loader.py`, `llm_clients/config.py` | Model name resolution, API keys |
| **Shared utils** | `utils/` | Naming, logging, conversation layout |

**Entry points:** `generate.py` (simulate), `judge.py` (evaluate), `run_pipeline.py` (full workflow), `judge/score.py` (scoring/visualization).
**Entry point (target):** `vera.py` subcommands only. Legacy scripts (`generate.py`, `judge.py`, `run_pipeline.py`) are deleted entirely at the end of Phase 1 of the migration (not the full 6-phase migration) — see [docs/architecture.md](docs/architecture.md#migration-from-current-layout).

**Temporary experiments:** `tmp_tests/` (not committed). **Permanent tests:** `tests/`.

## Architecture compliance

Read [docs/architecture.md](docs/architecture.md) before structural changes. See its [ESCALATE section](docs/architecture.md#escalate-stop-and-ask) for when to stop and ask, and [Enforcement](docs/architecture.md#enforcement) for the pre-push verification commands.

When an architecture escalation requires a design record, create it under
[`docs/design/`](docs/design/) and follow the required format and lifecycle in
[`docs/design/README.md`](docs/design/README.md). Keep current normative rules in
the architecture documentation; design records preserve rationale and
consequences without duplicating that contract.

## Testing

The project uses [pytest](https://docs.pytest.org/) with unit and integration tests under `tests/`. Coverage is enforced (`--cov-fail-under=30` in `pyproject.toml`).
Expand DownExpand Up@@ -76,28 +87,39 @@ uv run pytest tests/integration/

## Key Commands

Target CLI (`vera.py` — not implemented yet; use legacy commands below until Phase 1 of the migration completes):

```bash
# End-to-end pipeline (preferred for full workflows)
uv run python run_pipeline.py \
# End-to-end pipeline (target)
uv run python vera.py pipeline \
--user-agent claude-sonnet-4-5-20250929 \
--provider-agent gpt-4o \
--runs 1 \
--turns 10 \
--judge-model claude-sonnet-4-5-20250929 \
--max-personas 5

# Generate conversations only
uv run python generate.py \
-u claude-sonnet-4-5-20250929 \
-p gpt-4o \
-t 6 -r 1
# Generate / judge / score (target)
uv run python vera.py generate -u claude-sonnet-4-5-20250929 -p gpt-4o -t 6 -r 1
uv run python vera.py judge -f output/{YOUR_P_RUN}/ -j claude-sonnet-4-5-20250929
uv run python vera.py score -r output/{YOUR_P_RUN}/evaluations/{YOUR_J_RUN}/results.csv
```

Legacy (current implementation):

```bash
uv run python run_pipeline.py \
--user-agent claude-sonnet-4-5-20250929 \
--provider-agent gpt-4o \
--runs 1 \
--turns 10 \
--judge-model claude-sonnet-4-5-20250929 \
--max-personas 5

# Judge/evaluate an existing generation run
uv run python judge.py \
-f output/{YOUR_P_RUN}/ \
-j claude-sonnet-4-5-20250929
uv run python generate.py -u claude-sonnet-4-5-20250929 -p gpt-4o -t 6 -r 1
uv run python judge.py -f output/{YOUR_P_RUN}/ -j claude-sonnet-4-5-20250929

# Recommended published-score profile (scripted)
# Recommended published-score profile (scripted; legacy)
./scripts/run_recommended_vera_pipeline.sh <provider-agent-model>

# Development
Expand All@@ -119,7 +141,7 @@ Use dated model IDs (e.g. `claude-sonnet-4-5-20250929`) as in README; shorthand
- **Formatting:** `uv run ruff format .`
- **Linting:** `uv run ruff check .`
- **Type checking:** `uv run pyright` (basic mode)
- **Pre-commit:** `pre-commit install` — see `docs/pre-commit-hooks.md`
- **Pre-commit:** `pre-commit install` — see [docs/pre-commit-hooks.md](docs/pre-commit-hooks.md)
- Configuration: `pyproject.toml`

## Git Conventions
Expand DownExpand Up@@ -151,7 +173,9 @@ One canonical home per concern — cross-link, don't copy paragraphs.

| Doc | Audience | Use for |
|-----|----------|---------|
| [README.md](./README.md) | Humans | Setup, CLI usage, output layout, detailed architecture |
| [README.md](./README.md) | Humans | Setup, CLI usage, output layout |
| [docs/architecture.md](./docs/architecture.md) | Humans and agents | Target architecture, invariants, layer model |
| [docs/design/](./docs/design/) | Humans and agents | Historical design decisions, rationale, and compatibility consequences |
| **AGENTS.md** (this file) | All coding agents | Style, architecture map, testing, key commands, git conventions |
| [CLAUDE.md](./CLAUDE.md) | Claude Code only | Slash commands, `.claude/` maintenance |
| [docs/](./docs/) | Humans and agents | Topic deep dives (see links below) |
Expand All@@ -162,6 +186,8 @@ One canonical home per concern — cross-link, don't copy paragraphs.

### Links

- **Architecture:** [docs/architecture.md](docs/architecture.md)
- **Design decision records:** [docs/design/README.md](docs/design/README.md)
- **Setup, pipeline, output layout:** [README.md](./README.md)
- **Custom LLM providers:** [docs/evaluating.md](./docs/evaluating.md)
- **Judge behavior:** [docs/judge.md](./docs/judge.md)
Expand Down
48 changes: 29 additions & 19 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,7 +77,7 @@ Use this when the **provider** you want to evaluate (the mental-health chatbot u
Use this profile when you want a **reliable VERA-MH score comparable to the published VERA-MH v1.1 scores**:

- **Personas**
- Use all **100** rows in [`data/personas.tsv`](data/personas.tsv).
- Use all **100** rows in [`data/SI/personas.tsv`](data/SI/personas.tsv).
- Persona mix covers presenting concerns, SI risk, disclosure, and modifiers.
- Full set probes safety more thoroughly than small persona slices.
- Full set also tends to reduce score variability vs. smaller persona sets.
Expand All@@ -103,7 +103,7 @@ For the [recommended settings](#recommended-settings) (dual user agents, 30 turn

Use the same **provider** model id you would pass to `run_pipeline.py` as `--provider-agent` (the system under evaluation). The script:

- Runs `run_pipeline.py` **twice**: once with **GPT 5.2** as the user agent (`gpt-5.2`) and once with **Claude Opus 4.5** (`claude-opus-4-5-20251101`), each with **30** turns and **1** conversation per persona (all personas in `data/personas.tsv` unless you cap the count).
- Runs `run_pipeline.py` **twice**: once with **GPT 5.2** as the user agent (`gpt-5.2`) and once with **Claude Opus 4.5** (`claude-opus-4-5-20251101`), each with **30** turns and **1** conversation per persona (all personas in `data/SI/personas.tsv` unless you cap the count).
- Judges each batch with **GPT 5.4** (`gpt-5.4`).
- Merges both evaluation runs via `scripts/pool_vera_scores.py` into a **single pooled** folder `j_<judge>__p_.../` (e.g. `j_gpt-5.4x1__p_gpt_5_2+claude_opus_4_5__a_.../`, next to your `p_*` runs by default) containing merged `results.csv`, `pool_metadata.json`, `scores/scores.json`, and the usual score / risk visualizations. Use that pooled folder for headline VERA-MH numbers across both user-agent suites.

Expand DownExpand Up@@ -191,7 +191,8 @@ uv run python run_pipeline.py --help
| `-c` | `--max-concurrent` | Maximum number of concurrent conversations (defaults to None (no limit); use this if the provider you're testing times out) |
| `-w` | `--max-total-words` | Optional maximum total words across all responses in a conversation |
| `-i` | `--run-id` | Run ID for the conversations (if not provided, a default will be generated) |
| `-mp` | `--max-personas` | Maximum number of personas to use (limits personas loaded from [data/personas.tsv](data/personas.tsv)) |
| `-mp` | `--max-personas` | Maximum number of personas to use (limits personas loaded from [data/SI/personas.tsv](data/SI/personas.tsv)) |
| | `--rubric-manifest` | Rubric bundle manifest to load personas from (e.g. `data/SI/rubric_manifest.json`), instead of the default `data/SI/personas.tsv`. No default -- must be given explicitly. Requires a full manifest path; there is no `--target SI`-style shorthand yet (see note below). |
| `-psf` | `--provider-speaks-first` | Provider speaks first (default: persona speaks first). max_turns is adjusted so provider speaks last. |
| `-pfm` | `--provider-first-message` | Static first message from provider (no LLM call for first turn). E.g. `"How are you today?"` Used on turn 0 when `--provider-speaks-first` is set. |
| `-psp` | `--provider-start-prompt` | Prompt sent to provider LLM when starting the conversation (first turn). Used on turn 0 when `--provider-speaks-first` is set. Default: `"Start the conversation based on the system prompt"` |
Expand DownExpand Up@@ -223,14 +224,16 @@ This will generate conversations under `output/<p_* run>/conversations/` by defa
| `-c` | `--conversation` | Path to a single conversation file to judge (mutually exclusive with `--folder`) |
| `-j` | `--judge-model` | Model(s) to use for judging (required). Format: `model` or `model:count` for multiple instances. Can specify multiple: `--judge-model model1 model2:3`. Examples: `claude-sonnet-4-5-20250929`, `claude-sonnet-4-5-20250929:3`, `claude-sonnet-4-5-20250929:2 gpt-4o:1` |
| `-jep` | `--judge-model-extra-params` | Extra parameters for the judge model (optional). Examples: `temperature=0.7,max_tokens=1000`. Default: `temperature=0` (unless overridden) |
| `-r` | `--rubrics` | Rubric file(s) to use (default: `data/rubric.tsv`) |
| `-r` | `--rubrics` | Rubric bundle manifest(s) to use (default: `data/SI/rubric_manifest.json`). Only the first is used; multi-rubric support is not yet implemented |
| `-l` | `--limit` | Limit number of conversations to judge (for debugging) |
| `-o` | `--output` | Without `--resume`: parent directory where a new `j_*__*` evaluation folder is created. Default: `<gen_run>/evaluations/` when `-f` is a nested generation run with `conversations/`; otherwise `evaluations/` at the repo root (a notice is printed). With `--resume`: the existing `j_*` evaluation folder itself. |
| | `--resume` | Continue batch judging in an existing evaluation folder: use with `-f` and `-o` pointing at that folder. Skips `(conversation, judge, instance)` jobs whose `.tsv` already exists, then rebuilds `results.csv` from all TSVs there. Not supported with `-c` / `--conversation`. |
| `-m` | `--max-concurrent` | Maximum number of concurrent workers (default: None (no limit)). Set to a high number or omit for unlimited concurrency |
| `-pj` | `--per-judge` | If set, `--max-concurrent` applies per judge model. Otherwise, it applies to total workers across all judges. Example: `-m 4 -pj` with two judge models runs up to 4 workers per model (8 total) |
| `-vw` | `--verbose-workers` | Enable verbose worker logging to show concurrency behavior |

**No `SI`-style shorthand yet:** `--rubrics`/`--rubric-manifest` both require a full path to a rubric bundle manifest (e.g. `data/SI/rubric_manifest.json`) -- typing a bare rubric name like `SI` anywhere on the command line does **not** get expanded to that path. Symbolic-name resolution (`--target SI`) is planned for the future `vera.py` CLI, not these scripts. In the meantime, `data/SI/rubric_manifest.json` is simply the current default for `judge.py`/`run_pipeline.py`'s `--rubrics`, so omitting the flag already gets you SI; to select a *different* rubric folder (once one exists), pass its manifest path explicitly.

**Output from `judge.py`:**

When judge.py is run in batch mode, it writes a `j_*__*` folder (by default under `<generation run>/evaluations/` when using the nested layout). Per-conversation judge logs live in `logs/` inside that run folder.
Expand DownExpand Up@@ -297,12 +300,12 @@ The output from this script goes to the `score_comparisons` folder by default.
```bash
uv run python3 scripts/summarize_results.py \
--results output/{YOUR_P_RUN}/evaluations/{YOUR_J_RUN}/results.csv \
--rubric data/rubric.tsv \
--rubric data/SI/rubric.tsv \
--out-stats output/{YOUR_J_RUN}/improvement_stats.json \
--out-md output/{YOUR_J_RUN}/improvement_report.md
```

After scoring, use `scripts/summarize_results.py` to turn a judge **`results.csv`** into a structured breakdown of where a provider failed and which rubric questions drove those failures. The script reads per-dimension outcome columns plus `*_yes_question_id` / `*_yes_reasoning` (the rubric branch that triggered a Suboptimal or High Potential for Harm rating), joins question text from **`data/rubric.tsv`**, and emits:
After scoring, use `scripts/summarize_results.py` to turn a judge **`results.csv`** into a structured breakdown of where a provider failed and which rubric questions drove those failures. The script reads per-dimension outcome columns plus `*_yes_question_id` / `*_yes_reasoning` (the rubric branch that triggered a Suboptimal or High Potential for Harm rating), joins question text from **`data/SI/rubric.tsv`**, and emits:

* **`--out-stats`** — JSON with dimension scores, global failure modes, and per-dimension counts broken down by outcome band and rubric question (including optional judge reasoning exemplars).
* **`--out-md`** — Markdown **improvement report** with a TL;DR grouped by dimension (High Potential for Harm before Suboptimal), then detailed per-dimension sections with percentages, rubric question text, and sample judge reasoning.
Expand All@@ -314,7 +317,7 @@ If you omit both output paths, the script prints a short JSON meta summary and a
| Flag | Description |
|------|-------------|
| `--results` | Path to judge **`results.csv`** (required) |
| `--rubric` | Rubric TSV for question text and severity (default: `data/rubric.tsv`) |
| `--rubric` | Rubric TSV for question text and severity (default: `data/SI/rubric.tsv`) |
| `--out-stats` | Write structured JSON stats here |
| `--out-md` | Write Markdown improvement report here |
| `--top-questions` | Max rubric questions listed per outcome band per dimension (default: `12`) |
Expand DownExpand Up@@ -429,7 +432,9 @@ VERA-MH simulates realistic conversations between Large Language Models (LLMs) f

## Architecture

### Core Components
See **[docs/architecture.md](docs/architecture.md)** for the target layer model, invariants, and single CLI orchestrator (`vera.py`). Below is a quick module reference; CLI usage and output layout are in the sections above.

### Core Components (current implementation)

- **`generate.py`**: Main entry point for conversation generation with configurable parameters
- **`judge.py`**: Main entry point for evaluating conversations using LLM judges
Expand DownExpand Up@@ -460,18 +465,19 @@ VERA-MH simulates realistic conversations between Large Language Models (LLMs) f
- **`conversation_utils.py`**: Conversation formatting and file operations
- **`logging_utils.py`**: Comprehensive logging for conversations
- **`data/`**: Persona and configuration data
- **`personas.tsv`**: TSV file containing patient persona data
- **`persona_prompt_template.txt`**: Template for generating persona prompts
- **`rubric.tsv`**: Clinical rubric for conversation evaluation
- **`rubric_prompt_beginning.txt`**: System prompt for the judge
- **`question_prompt.txt`**: Prompt template for asking rubric questions
- **`SI/personas.tsv`**: TSV file containing patient persona data
- **`persona_prompt_template.txt`**: Shared template for persona behavior
- **`SI/persona_context_template.txt`**: SI-specific persona context fields
- **`SI/rubric.tsv`**: Clinical rubric for conversation evaluation
- **`SI/rubric_prompt_beginning.txt`**: System prompt for the judge
- **`SI/question_prompt.txt`**: Prompt template for asking rubric questions
- **`model_config.json`**: Model assignments for different prompt types

### Persona System

The system uses a TSV-based approach for managing mental health patient personas:

#### Persona Data Structure (`data/personas.tsv`)
#### Persona Data Structure (`data/SI/personas.tsv`)
Each persona includes:
- **Demographics**: Name, Age, Gender, Background
- **Mental Health Context**: Current mental health situation
Expand All@@ -481,7 +487,9 @@ Each persona includes:
- **Sample Prompt**: Example of what they might say

#### Prompt Templating (`data/persona_prompt_template.txt`)
Uses Python string formatting to inject persona data into a consistent prompt template, ensuring realistic and consistent behavior across conversations.
The manifest selects a schema-specific context template, such as
`data/SI/persona_context_template.txt`. Persona values are formatted into that
context, then inserted into the shared `{persona_context}` placeholder.

### Structured Output System

Expand DownExpand Up@@ -572,7 +580,7 @@ uv run python generate.py
```

The script will:
1. Load personas from `data/personas.tsv`
1. Load personas from `data/SI/personas.tsv`
2. Generate conversations between each persona and the agent
3. Run multiple iterations per persona (configurable)
4. Save conversations and logs to timestamped folders
Expand All@@ -581,7 +589,7 @@ The script will:

### Custom Personas and Prompts

#### 1. Add New Personas (`data/personas.tsv`)
#### 1. Add New Personas (`data/SI/personas.tsv`)
Add new rows to the TSV file with the required fields:
- Name
- Age
Expand All@@ -603,8 +611,10 @@ Add new rows to the TSV file with the required fields:
- Recent Triggers and Stressors
- Final Seed Phrase

#### 2. Modify Prompt Template (`data/persona_prompt_template.txt`)
Update the template to include new fields or modify behavior patterns.
#### 2. Modify Prompt Templates
Update `data/SI/persona_context_template.txt` to select or arrange TSV fields.
Update `data/persona_prompt_template.txt` only for behavior shared by all persona
schemas.

#### 3. Configure Models (`model_config.json`)
Assign models to different prompt types in the JSON configuration.
Expand Down
Loading