Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Constitutional guardrails (CONSTITUTION.md) for agent supervisor

オープン
#596 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust
領域
ai, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

architecture enhancement multi-agent

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

  1. Privacy-first: No data leaves the device unless explicitly configured by the user
  2. Deterministic-first: Prefer Aho-Corasick automata over LLM when deterministic matching suffices
  3. Type-safe: No unwrap() in library crates; all errors propagated via Result
  4. Compile-time checked: Prefer compile-time guarantees over runtime reflection
  5. Local-first: Offline operation is the default; network is optional
  6. Auditable: Every agent decision must be traceable to an input and a rule
  7. Reversible: Agent actions should be reversible where possible; destructive actions require confirmation

Implementation Plan

  1. Create CONSTITUTION.md at repo root with the principles above (editable by maintainers, versioned in git)
  2. Embed as a compile-time resource via rust-embed (already used in terraphim_agent and desktop)
  3. Add ConstitutionValidator to terraphim_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
  4. Cryptographically sign the constitution using existing zipsign infrastructure from terraphim_update
  5. Add integration tests: attempt constitutional violations, verify rejection

Affected Crates

  • terraphim_agent_supervisor (primary -- add validation)
  • terraphim_types (add ConstitutionRule type)
  • terraphim_agent (embed constitution resource)

Estimated Effort

~2 hours

Part of

Epic #595

主要言語
Rust
スター
62
フォーク
5
平均マージ
2時間 27分
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

terraphim/terraphim-ai のほかの issue

terraphim/terraphim-ai の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。