Constitutional guardrails (CONSTITUTION.md) for agent supervisor
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
Start with the affected crates listed in the issue: terraphim_agent_supervisor, terraphim_types, and terraphim_agent, then inspect the existing rust-embed and zipsign usage. Define the constitution resource, structured validation and signing boundaries, and integration tests for rejected violations. Done means the documented rules are embedded, validated before execution, logged on rejection, and covered by tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Create an immutable set of architectural principles (CONSTITUTION.md) that terraphim agents cannot violate, even when given explicit instructions to do so. Enforced by terraphim_agent_supervisor as a pre-execution validation step.
Motivation
Inspired by Ouroboros BIBLE.md pattern. The agent system crates are incomplete partly because there is no specification of what agents MUST NOT do. A constitution constrains the design space, making it easier to complete the agent layer because boundaries are clear.
Proposed Principles
- Privacy-first: No data leaves the device unless explicitly configured by the user
- Deterministic-first: Prefer Aho-Corasick automata over LLM when deterministic matching suffices
- Type-safe: No
unwrap()in library crates; all errors propagated viaResult - Compile-time checked: Prefer compile-time guarantees over runtime reflection
- Local-first: Offline operation is the default; network is optional
- Auditable: Every agent decision must be traceable to an input and a rule
- Reversible: Agent actions should be reversible where possible; destructive actions require confirmation
Implementation Plan
- Create
CONSTITUTION.mdat repo root with the principles above (editable by maintainers, versioned in git) - Embed as a compile-time resource via
rust-embed(already used interraphim_agentanddesktop) - Add
ConstitutionValidatortoterraphim_agent_supervisor:- Pre-execution hook: check proposed agent action against constitution rules
- Rules encoded as structured checks (not LLM interpretation)
- Violation = action rejected with reason, logged as event
- Cryptographically sign the constitution using existing
zipsigninfrastructure fromterraphim_update - Add integration tests: attempt constitutional violations, verify rejection
Affected Crates
terraphim_agent_supervisor(primary -- add validation)terraphim_types(addConstitutionRuletype)terraphim_agent(embed constitution resource)
Estimated Effort
~2 hours
Part of
Epic #595
- Langage dominant
- Rust
- Étoiles
- 65
- Forks
- 5
- Merge moyen
- 1 h
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de terraphim/terraphim-ai
-
terraphim_rlm: require a per-sub-result verification plan (recheck / control / independent route)Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
terraphim/terraphim-ai#969 · 1 commentaire ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
terraphim/terraphim-ai#968 · 1 commentaire ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
terraphim/terraphim-ai#967 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
terraphim/terraphim-ai#966 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
terraphim/terraphim-ai#965 · 2 commentaires ·
Toutes les issues de terraphim/terraphim-ai
Issues similaires
-
ai_p2
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
ClickHouse/ClickHouse#125522 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedPeut-être pris @Mrun25 l’a pris aujourd’hui. Ouvertebug llm translation
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
BerriAI/litellm#46095 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug effort:low flow:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
jaroslawherod/micold-ai-ide#788 ·
Les mainteneurs répondent en général sous 1 jour
-
Docs: refresh target-app-parity and file-format-parity against mainPeut-être pris @vangel76 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
storytold/photocraft#4417 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
bevyengine/dlss_wgpu#37 ·