Back to .md Directory

L5 Persona Spec

Defines a digital staff training pipeline with role-based promotion gates, benchmark tracking, and correction logging for lab members.

May 2, 2026
0 downloads
1 views
ai
View source

What this file does

Defines a digital staff training pipeline with role-based promotion gates, benchmark tracking, and correction logging for lab members.

When to use it

  • Building a system with role-based progression for AI agents
  • Implementing automated promotion gates with minimum score thresholds
  • Tracking benchmark performance and corrections for digital staff
  • Managing human and digital member profiles in a lab or team

Assumes this stack

PythonPydantic

L5 Persona Spec

Design doc reference: section 7 (Digital Staff Training & Promotion)

Purpose

The persona subsystem manages human and digital staff within the lab. Digital members progress through a training pipeline (Intern -> Analyst -> Specialist) based on benchmark performance. Each member has a SOUL.md (identity) and MEMORY.md (accumulated experience) managed via the Tier A memory backend.

Corrections are logged when mistakes are found, and promotion gates enforce minimum competency thresholds before role advancement.

Roles

Defined in MemberRole enum (core/schemas.py):

RoleTypeDescription
piHumanPrincipal Investigator
postdocHumanPostdoctoral researcher
graduateHumanGraduate student
undergraduateHumanUndergraduate student
technicianHumanLab technician
digital_internDigitalEntry-level digital staff
digital_analystDigitalMid-level digital staff
digital_specialistDigitalSenior digital staff

Pydantic Schemas

All models live in src/labclaw/persona/schemas.py.

MemberProfile

class MemberProfile(BaseModel):
    member_id: str               # uuid4
    name: str
    role: MemberRole
    is_digital: bool
    expertise: list[str]
    created_at: datetime
    promoted_at: datetime | None

BenchmarkResult

class BenchmarkResult(BaseModel):
    member_id: str
    task_type: str
    score: float                 # 0.0 - 1.0
    completed_at: datetime
    details: dict[str, Any]

CorrectionEntry

class CorrectionEntry(BaseModel):
    member_id: str
    category: str
    detail: str
    corrected_by: str
    timestamp: datetime

PromotionGate

class PromotionGate(BaseModel):
    from_role: MemberRole
    to_role: MemberRole
    min_benchmarks: int
    min_avg_score: float
    requires_approval: bool

Promotion Ladder

FromToMin BenchmarksMin Avg ScoreRequires Approval
digital_interndigital_analyst100.70No
digital_analystdigital_specialist250.85Yes

Public Interface -- PersonaManager

class PersonaManager:
    def create_member(name: str, role: MemberRole, is_digital: bool) -> MemberProfile
    def get_member(member_id: str) -> MemberProfile
    def record_benchmark(member_id: str, task_type: str, score: float, details: dict | None) -> BenchmarkResult
    def record_correction(member_id: str, category: str, detail: str, corrected_by: str) -> CorrectionEntry
    def check_promotion(member_id: str) -> PromotionGate | None
    def promote(member_id: str, approver: str | None = None) -> MemberProfile
    def demote(member_id: str) -> MemberProfile

Constraints

  • promote() / demote() only change digital member roles along the ladder.
  • If the matched PromotionGate.requires_approval is True, promote() requires a non-empty approver.
  • Human members cannot be demoted below their actual role.
  • check_promotion() returns the matching PromotionGate if the member meets all criteria, or None if not eligible.
  • demote() raises ValueError for human members or members already at digital_intern.

Events

Event NamePayloadEmitted When
persona.member.createdmember_id, name, rolecreate_member()
persona.benchmark.recordedmember_id, task_type, scorerecord_benchmark()
persona.correction.recordedmember_id, category, corrected_byrecord_correction()
persona.member.promotedmember_id, from_role, to_rolepromote()
persona.member.demotedmember_id, from_role, to_roledemote()

Storage

  • In-memory dicts for MVP (no SQLite persistence yet).
  • Future: persist via Tier A markdown files and Tier B knowledge graph.

What's inside

5 sections: roles enum, 4 Pydantic schemas, promotion ladder table, 8-method PersonaManager interface, 5 event types

Change this for your project

  • Replace src/labclaw/persona/schemas.py with your own module path
  • Replace core/schemas.py with your own schema location
  • Replace labclaw in package references with your project name

Where it goes

Use as the system prompt for your model call, or as the base instructions in your agent framework.

Worth borrowing

  • Promotion gates as configurable Pydantic models with min benchmarks and approval flags
  • Event-driven architecture for persona lifecycle changes (created, promoted, demoted)

Related Documents