Skip to content

feat(config): dormant profiles with model tiers, allow list, memory room and skills - #612

Merged
ajianaz merged 2 commits into
developfrom
feat/dormant-profiles
Nov 11, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/dormant-profiles

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds dormant profiles (#584): [profiles.<name>] tables in the user config, selected with a new global --profile <name> flag. A profile holds a persona file, an allow list, skills, a memory room, model tiers and secret grant names.

Why

Closes #584 (epic #583). The owner keeps several specialised agents but uses few at a time. A profile should cost nothing until it is used, and should carry everything a delegated or scheduled run needs. The design is docs/profiles-collaboration-secrets.md A5.1, A6 and A9.3, implemented through the existing config layer with no new mechanism.

Changes

  • config.rs: new ProfileConfig and ModelTiers (both deny_unknown_fields) and Config.profiles.
    • Profile names are validated as [a-z0-9_-], max 64 chars, no leading -.
    • memory_room must use the room charset.
    • models.default must be light, standard or heavy and must name a tier that is set.
    • grants must be environment-variable NAMES. A value-shaped entry is an error, and the error does not echo it.
    • The existing secret-like-key guard also applies inside profiles.
    • User layer only: layered drops a project config's [profiles] table. Startup warns about it and config check shows it as IGNORED, exactly like [tui].
  • profile.rs (new): Profile::resolve(cfg, name, base, home).
    • It reads only the selected profile's persona file (64 KiB cap, ~/ and user-config-relative paths) and starts nothing.
    • An unknown name is an error that lists the defined profiles.
    • Profile::granted(parent) returns the intersection of the parent grant and the profile grant, by name only.
  • config_apply.rs: new Source::Profile, a layer between the per-key flags and the env: per-key flag > profile > env > config > user config.
    • It covers system_prompt, allow and skill.
    • A non-empty profile allow list replaces the config allow list; the two are not merged. This is the same rule as a non-empty --allow over config, and it only narrows pre-authorization: the config's patterns do not apply while the profile is selected. The README Profiles section says so.
    • The profile's default-tier model replaces the provider triple's model, so it beats TOLE_MODEL.
    • New Settings::memory_room, and Settings::fill_with_profile so the server faces see the profile model and persona.
  • main.rs:
    • The global --profile is resolved once from the layered config.
    • The memory room is chosen as child mailbox (TOLE_MEMORY_NAMESPACE) > profile room > repo-<dir>, via the pure memory_room helper.
    • mission uses the persona as its base prompt.
  • session_host.rs: server faces use profile persona > TOLE_SYSTEM_PROMPT > config.
  • Docs:
    • README: keys table, a Profiles section, and the status line.
    • docs/threat-model.md: new Profiles section.
    • CHANGELOG entry and docs/epics.md status.

Not in this PR:

Testing

All run locally on head 435605f (merge of develop a38284b into the branch; no rebase, no force push):

  • cargo test --workspace passes: 1401 passed, 0 failed (78 suites).
  • cargo test -p tole-core --no-default-features passes: 474 passed, 0 failed.
  • cargo fmt --all -- --check passes.
  • cargo clippy --workspace --all-targets -- -D warnings passes.
  • cora review --no-llm --base origin/develop (cora v0.20.0): "No issues found". The LLM review is CI Cora Review.
  • End-to-end with the real binary (tests/profile_e2e.rs):
    • --profile coder run sends the persona as the system message and the profile model instead of TOLE_MODEL, against a recording mock provider.
    • An unknown profile fails before any request and lists the defined ones.
    • A trusted project config's [profiles] is ignored with a warning.

New tests:

  • config::tests::profiles_parse_strictly_and_only_the_user_layer_survives_layering
  • profile::tests::* (6 tests)
  • config_apply::tests::profile_layer_is_below_flags_and_above_env_and_config
  • config_apply::tests::fill_with_profile_carries_the_profile_model_and_persona
  • memory_room_tests::child_mailbox_beats_profile_room_beats_repo_default
  • the persona case in the mission prompt test
  • tests/profile_e2e.rs (3 tests)

Red/green: each behavior was broken on purpose, the named test was seen failing, the file was restored, and the test passed again.

Broken variant Test that failed
project layer supplies profiles profiles_parse_strictly…, profile_e2e::a_project_config_cannot_define_profiles
profile model does not beat the env model (settings) profile_layer_is_below…
profile model dropped from the server/run fill profile_e2e::a_profile_sets_the_persona_and_beats_the_env_model
profile persona ignored profile_layer_is_below…, profile_e2e::a_profile_sets_the_persona…
profile allow ignored profile_layer_is_below…
profile beats an explicit per-key flag profile_layer_is_below…
profile room beats the child mailbox child_mailbox_beats_profile_room_beats_repo_default
value-shaped grants accepted profiles_parse_strictly…
no intersection with the parent grant granted_secrets_are_the_intersection_with_the_parent
every persona read eagerly (not dormant) resolving_one_profile_reads_only_its_persona, profile_e2e::a_profile_sets_the_persona…
mission ignores the persona fresh_mission_prompt_names_the_review_flow…
models.default ignored resolving_one_profile_reads_only_its_persona
  • Manual smoke test against a real provider: not done here. The e2e test uses a local mock.
  • Known limit: the server-face persona path (the process-wide fill) has no dedicated test, because install_fill is a write-once process global. fill_with_profile itself is unit-tested.

Related Issues

Closes #584. Epic #583. Follows #595 (grants uses the same secret-name vocabulary).

Checklist

  • Branch name follows convention (feat/dormant-profiles)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR

…oom and skills

[profiles.<name>] tables in the user config, selected with the global
--profile flag. A profile is one settings layer between the per-key
flags and the environment; its default tier's model beats TOLE_MODEL,
its persona replaces the system prompt, and the memory loop uses its
room unless a child mailbox is set. Resolving a profile reads only its
persona file and starts nothing. Project configs cannot define profiles.

Closes #584.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 06a599a into develop Nov 11, 2026
23 of 24 checks passed
@ajianaz
ajianaz deleted the feat/dormant-profiles branch November 20, 2026 08:36
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(config): profiles with model tiers, allowlist, memory room and skills

2 participants