pact
CLAUDE.md0 starsChanged 7 months agoApache-2.0View on GitHub
This repository is PACT — the Terrene Foundation's reference implementation of PACT (Principled Architecture for Constrained Trust), the fourth standard in the Quartet alongside CARE, EATP, and CO. It implements the D/T/R accountability grammar, recursive operating envelope delegation, knowledge clearance framework, and verification gradient for running organizations with AI agents under governed autonomy. PACT is Foundation-owned, Apache 2.0 licensed, and irrevocably open. Since the standards, SDKs, and reference model are all open, anyone can build commercial implementations on top —…
- Reads credentials
In this repository37 other files it gives its agents.
- .claude/rules/agents.mdAGENTS.md
- .claude/guides/claude-code/CLAUDE.mdCLAUDE.md
- core-sdkSkill
- dataflowSkill
- nexusSkill
- kaizenSkill
- kailash-mcpSkill
- cheatsheetsSkill
- development-guidesSkill
- nodes-referenceSkill
- workflow-patternsSkill
- deployment-gitSkill
- frontend-integrationSkill
- testing-strategiesSkill
- architecture-decisionsSkill
- code-templatesSkill
- enterprise-infrastructureSkill
- validation-patternsSkill
- gold-standardsSkill
- security-patternsSkill
- flutter-patternsSkill
- interactive-widgetsSkill
- enterprise-ai-uxSkill
- conversation-uxSkill
- uiux-design-principlesSkill
- value-auditSkill
- ai-interaction-patternsSkill
- eatp-referenceSkill
- coc-referenceSkill
- 29-pactSkill
- claude-code-patternsSkill
- error-troubleshootingSkill
- kailash-mlSkill
- kailash-alignSkill
- co-referenceSkill
- managementSkill
- projectSkill
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
The boundary test: If you ripped out all domain vocabulary from a vertical's code and replaced it with different domain terms, the pact …
- Distinctive: line 35
Never write code from scratch before checking whether the Kailash frameworks already handle it.
- Very specific: line 37
Instead of direct SQL/SQLAlchemy/Django ORM → check with dataflow-specialist
- Distinctive: line 38
Instead of FastAPI/custom API gateway → check with nexus-specialist
- Distinctive: line 39
Instead of custom MCP server/client → check with mcp-specialist
- Distinctive: line 40
Instead of custom agentic platform → check with kaizen-specialist
- Very specific: line 44
All API keys and model names MUST come from .env.
- Distinctive: line 50
When you discover a missing feature, endpoint, or record — implement or create it.
- Very specific: line 56
Every implementation decision must align with the CARE, PACT, EATP, and CO specifications.
- Very specific: line 128
Session continuity: Run /wrapup before ending a session to write .session-notes.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PACT
This repository is PACT — the Terrene Foundation's reference implementation of PACT (Principled Architecture for Constrained Trust), the fourth standard in the Quartet alongside CARE, EATP, and CO. It implements the D/T/R accountability grammar, recursive operating envelope delegation, knowledge clearance framework, and verification gradient for running organizations with AI agents under governed autonomy.
PACT is Foundation-owned, Apache 2.0 licensed, and irrevocably open. Since the standards, SDKs, and reference model are all open, anyone can build commercial implementations on top — the Foundation has no structural relationship with any commercial entity.
What This Is
A framework and reference implementation of PACT (Principled Architecture for Constrained Trust). PACT publishes the domain-agnostic governance framework — D/T/R grammar validation, operating envelope composition, knowledge clearance, verification gradient — plus a simple example vertical (e.g., a university or open-source project) that proves the system works without requiring domain expertise. Built on the Kailash Python SDK (Kaizen agent framework, DataFlow persistence, Nexus API layer, EATP SDK trust layer).
The boundary test: If you ripped out all domain vocabulary from a vertical's code and replaced it with different domain terms, the pact library code wouldn't change at all. Only the configuration and domain layer would change.
What it is NOT: A generic agent orchestrator competing with LangChain/CrewAI. It is governed orchestration — an opinionated framework for running organizations with AI agents under PACT architectural governance.
Framework vs Verticals
| Layer | Repository | Purpose |
| Framework | pact (this repo) | Domain-agnostic PACT library + example vertical |
| Financial vertical | astra | Production-grade MAS-regulated financial services |
| HRIS vertical | arbor | Production-grade Singapore SME HR governance |
Verticals import pact and define their domain's D/T/R structure, envelope constraints, and clearance mappings as PACT configuration. The framework knows nothing about finance, healthcare, or any other domain.
Absolute Directives
These override ALL other instructions. They govern behavior before any rule file is consulted.
0. Foundation Independence — No Commercial Coupling
PACT is a Terrene Foundation project. It is fully independent. There is NO relationship between PACT and any commercial product, proprietary codebase, or commercial entity. Do not reference, compare with, or design against any proprietary product. Do not use language like "open-source version of X." PACT IS the product — not a derivative of anything. See rules/independence.md for full policy.
1. Framework-First
Never write code from scratch before checking whether the Kailash frameworks already handle it.
- Instead of direct SQL/SQLAlchemy/Django ORM → check with dataflow-specialist
- Instead of FastAPI/custom API gateway → check with nexus-specialist
- Instead of custom MCP server/client → check with mcp-specialist
- Instead of custom agentic platform → check with kaizen-specialist
2. .env Is the Single Source of Truth
All API keys and model names MUST come from .env. Never hardcode model strings like "gpt-4" or "claude-3-opus". Root conftest.py auto-loads .env for pytest.
See rules/env-models.md for full details.
3. Implement, Don't Document
When you discover a missing feature, endpoint, or record — implement or create it. Do not note it as a gap and move on. The only acceptable skip is explicit user instruction.
See rules/zero-tolerance.md for details.
4. Standards Alignment
Every implementation decision must align with the CARE, PACT, EATP, and CO specifications. When in doubt, consult the relevant standards expert agent. This repo is the reference implementation of the Quartet — it must embody them correctly.
5. Recommended Reviews
- Code review (intermediate-reviewer) after file changes — see
rules/agents.mdRule 1 - Security review (security-reviewer) before commits — strongly encouraged — see
rules/agents.mdRule 2 - Real infrastructure in integration/E2E tests is recommended — see
rules/testing.md
Architecture Overview
Three-Layer Stack
| Layer | Package | What | Version |
| L3 | pact-platform (this repo) | Org builder, approval UX, work management, dashboard, deployment | 0.3.0 |
| L2 | kaizen-agents | GovernedSupervisor, progressive disclosure, autonomous execution | 0.1.0 |
| L1 | kailash-pact | GovernanceEngine, D/T/R grammar, envelopes, clearance, gradient | 0.3.0 |
| L1 | kailash[trust] | EATP SDK, trust chains, signing, postures, enforcement | 2.0.0+ |
| L1 | kailash-dataflow | Auto-generated CRUD nodes (11 per model) | 1.2.0 |
| L0 | kailash | Core SDK, workflow runtime, 140+ nodes | 2.0.0+ |
Platform Components (v0.3.0)
| Component | Location | What |
| DataFlow Models (11) | pact_platform/models/ | AgenticObjective, Request, WorkSession, Artifact, Decision, ReviewDecision, Finding, Pool, PoolMembership, Run, ExecutionMetric |
| API Routers (13) | pact_platform/use/api/routers/ | objectives, requests, sessions, decisions, pools, reviews, metrics, org, clearance, ksp, envelopes, access, emergency-bypass |
| Services (5) | pact_platform/use/services/ | RequestRouter, ApprovalQueue, CompletionWorkflow, CostTracking, NotificationDispatch |
| Engine (6) | pact_platform/engine/ | SupervisorOrchestrator, ApprovalBridge, EventBridge, EmergencyBypass, PlatformSettings, AutoSeed |
| Integrations (6) | pact_platform/integrations/ | NotificationAdapter, Slack/Discord/Teams webhooks, LLMProviderManager |
| CLI (10 commands) | pact_platform/cli.py | quickstart, org, role, clearance, bridge, envelope, agent, audit, validate, status |
| Web Dashboard (4 new) | apps/web/app/ | objectives, requests, pools, org-builder pages |
| Mobile Screens (3 new) | apps/mobile/lib/features/ | objectives, requests, pools screens |
| Existing Frontend | apps/web/, apps/mobile/ | approvals, agents, bridges, trust-chains, envelopes, cost, audit, shadow, verification |
Import Patterns
# Governance (from kailash-pact — L1)
from pact.governance import GovernanceEngine, GovernanceVerdict
from pact.governance import compile_org, load_org_yaml
# Config types (from this repo — L3)
from pact_platform.build.config.schema import OrgDefinition, AgentConfig, ConstraintEnvelopeConfig
# Work management models (from this repo — L3)
from pact_platform.models import db, validate_finite
# Engine wiring (from this repo — L3)
from pact_platform.engine import SupervisorOrchestrator, EmergencyBypass
# Trust layer (kailash[trust] — L1)
from kailash.trust import TrustOperations, generate_keypair
from kailash.trust.chain import VerificationLevel, VerificationResultWorkspace Commands
| Command | Phase | Purpose |
/start | — | New user orientation; explains the workflow |
/analyze | 01 | Research and validate the project idea |
/todos | 02 | Create project roadmap; stops for your approval |
/implement | 03 | Build one task at a time; repeat |
/redteam | 04 | Test from adversarial angles |
/codify | 05 | Capture knowledge for future sessions |
/deploy | — | Get the project live (standalone) |
/ws | — | Check project status anytime |
/wrapup | — | Save progress before ending a session |
Workspace detection: Hooks automatically detect the active workspace and inject context.
Session continuity: Run /wrapup before ending a session to write .session-notes. The next session reads these notes automatically.
Rules Index
| Concern | Rule File | Scope |
| Foundation independence | rules/independence.md | Global — overrides all |
| Plain-language communication | rules/communication.md | Global |
| Agent orchestration & reviews | rules/agents.md | Global |
| E2E god-mode testing | rules/e2e-god-mode.md | tests/e2e/**, **/*e2e*, **/*playwright* |
| API keys & model names | rules/env-models.md | **/*.py, **/*.ts, **/*.js, .env* |
| Deployment operations | rules/deployment.md | Global |
| Git commits, branches, PRs | rules/git.md | Global |
| No stubs or placeholders | rules/zero-tolerance.md | Global |
| Kailash SDK execution patterns | rules/patterns.md | **/*.py, **/*.ts, **/*.js |
| Security (secrets, injection) | rules/security.md | Global |
| 3-tier testing strategy | rules/testing.md | tests/**, **/*test*, **/*spec*, conftest.py |
| Terrene naming & terminology | rules/terrene-naming.md | Global |
| Documentation & version accuracy | rules/documentation.md | README.md, docs/**, CHANGELOG.md |
| Auto-generated workflow instincts | rules/learned-instincts.md | Global |
Agents
Agents are organized by function. See .claude/agents/ for the full set.
| Category | Key Agents |
| Analysis | analyst (failure analysis + requirements) |
| Frameworks | dataflow-specialist, nexus-specialist, kaizen-specialist, mcp-specialist, pact-specialist |
| Quality | reviewer, security-reviewer, gold-standards-validator, testing-specialist |
| Implementation | tdd-implementer, pattern-expert, build-fix |
| Frontend | react-specialist, flutter-specialist, uiux-designer |
| Release | release-specialist, todo-manager, gh-manager |
| Project | pact-dashboard-specialist, pact-trust-specialist |
Standards reference: use co-reference skill (covers CARE, EATP, CO, COC specs).
Skills
SDK skills in .claude/skills/01-* through 17-*. Standards in co-reference/, 26-eatp-reference/, 29-pact/. Project skills in project/.
Critical Execution Rules
# ALWAYS: runtime.execute(workflow.build())
runtime = LocalRuntime()
results, run_id = runtime.execute(workflow.build())
# Async: await runtime.execute_workflow_async(workflow.build(), inputs={})
# Express CRUD: db.express_sync.create("Model", {...}) # 23x faster than workflows
# PactEngine: result = await pact_engine.submit(objective, role, context)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

