Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions repos/constitution/.claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://anthropic.com/schemas/claude-code-marketplace.json",
"name": "systemfsoftware-marketplace",
"owner": {
"name": "systemfsoftware",
"url": "https://systemfsoftware.com"
},
"plugins": [
{
"name": "constitution",
"source": "./plugins/constitution",
"description": "Time-Traveling Stream Rules (TTSR) enforcing strict adherence to the Supreme Engineering Constitution (Articles I–V).",
"version": "0.1.0",
"author": {
"name": "systemfsoftware",
"url": "https://systemfsoftware.com"
},
"homepage": "https://github.com/systemfsoftware/constitution",
"repository": "https://github.com/systemfsoftware/constitution",
"license": "Apache-2.0",
"keywords": [
"constitution",
"ttsr",
"rules",
"omp",
"claude-code"
]
}
]
}
Empty file added repos/constitution/.gitignore
Empty file.
1 change: 1 addition & 0 deletions repos/constitution/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deno run --allow-read --allow-env --allow-run --allow-sys npm:@commitlint/cli@21 --edit $1
1 change: 1 addition & 0 deletions repos/constitution/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deno task test
30 changes: 30 additions & 0 deletions repos/constitution/.omp-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://anthropic.com/schemas/claude-code-marketplace.json",
"name": "systemfsoftware-marketplace",
"owner": {
"name": "systemfsoftware",
"url": "https://systemfsoftware.com"
},
"plugins": [
{
"name": "constitution",
"source": "./plugins/constitution",
"description": "Time-Traveling Stream Rules (TTSR) enforcing strict adherence to the Supreme Engineering Constitution (Articles I–V).",
"version": "0.1.0",
"author": {
"name": "systemfsoftware",
"url": "https://systemfsoftware.com"
},
"homepage": "https://github.com/systemfsoftware/constitution",
"repository": "https://github.com/systemfsoftware/constitution",
"license": "Apache-2.0",
"keywords": [
"constitution",
"ttsr",
"rules",
"omp",
"claude-code"
]
}
]
}
121 changes: 121 additions & 0 deletions repos/constitution/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# AGENTS.md — Constitution Repository

Single source of truth for the supreme design law of [System F Software](https://systemfsoftware.com). Consumer repos vendor via `git subtree` + symlink. This repo has no production code, no test suite, and no build step — it is two markdown documents plus their governance tooling (commit validation, agent harness): `CONSTITUTION.md`, resident in every agent's context, and `CONSTITUTION-ARTICLES.md`, retrieved on write or edit of a source file.

@CONSTITUTION.md

## Startup Workflow

Before making changes:

1. **Read this file** completely.
2. **Confirm the active task** with the user or the agent's task list.
3. **Review recent commits** with `git log --oneline -5`.
4. **Ensure current branch is not `main`** — feature branches only. If on main, create one.

## Working Rules

- **One task at a time.** Finish before starting the next.
- **Conventional commits required.** The commit-msg hook enforces `type(scope): description`. Run `git commit` through the hook — do not bypass with `--no-verify`.
- **Verification required.** Run the verification commands before claiming done.
- **Stay in scope.** Don't modify files unrelated to the task. Scope reduction requires explicit user approval.
- **Leave clean state.** The next session must run verification immediately.

## Amending the Constitution

### File Split

- **`CONSTITUTION.md` (Resident):** Conduct rules (Article V + Governance) loaded in every session.
- **`CONSTITUTION-ARTICLES.md` (Retrieved):** Domain, boundary, verification, and organization rules (Articles I–IV) loaded on write/edit of source code.

### Writing a Rule

Rules are fenced YAML blocks with: `id`, `title`, `gate`, `do`, `dont`, `harm`, `check` (and optional `example`, `scope`, `layers`).

### Minting an ID

ID format: `CONST-<family><n>`. Pick the next free number in the family (never renumber to close gaps).

| Letter | Family | Purpose |
|---|---|---|
| `G` | Governance | Invoking constitution or resolving priority |
| `E` | Enforcement | Gate design, execution, verification |
| `P` | Purity | Decision functions and side-effect isolation |
| `D` | Domain modelling | Domain types and constraints |
| `B` | Boundary | Core/shell boundaries, effects, adapters |
| `T` | Testing | Testing strategy, mutation, properties |
| `N` | Naming & structure | Module organization and naming |
| `W` | Work discipline | Task scope, bypass declarations, reviews |
| `S` | Subtraction | Code deletion and structural simplification |

### Changing a Rule

- Same obligation reworded / moved: **keep ID**.
- Obligation narrowed, widened, split, or deleted: **retire old ID forever** and mint new one.
## Surface Classes

| Surface | Files | Rule |
|---|---|---|
| **Locked** | `AGENTS.md`, `.husky/_/`, verification scripts | Read and propose changes; do not edit to make verification pass. |
| **Editable** | `deno.json`, `deno.lock`, `commitlint.config.cjs`, `.gitignore`, `.husky/` (hooks only, not `_/`) | Edit freely within the active task. |
| **Human-controlled** | `CONSTITUTION.md`, `CONSTITUTION-ARTICLES.md`, `README.md`, merging to `main`, pushing, destructive ops | Propose changes; ask the user before acting. |

## Definition of Done

A task is done only when ALL of the following are true:

- [ ] Target changes are applied.
- [ ] Verification commands ran and passed.
- [ ] Commit uses conventional format (`type(scope): description`).
- [ ] Evidence recorded via the runtime memory system and task list.
- [ ] No dirty files left in the working tree.

## Verification Commands

```bash
deno task test # both files: schema, coverage, ids, families, dangling citations
deno run --allow-read --allow-env --allow-run npm:@commitlint/cli@21 --from HEAD~1
```

After a commit that deletes, splits, merges, or re-scopes a rule — not after every edit — also run the reassignment check against the revision before it:

```bash
deno task test --against <rev>
```

### Anti-Bypass Rules

- Run the **full command**, not parts in isolation.
- Evidence must be from the **current run**, not a prior session.
- **Any failure blocks done.** Do not bypass with `--no-verify`.
- Do not suppress, skip, or disable checks to make verification pass.

### Hallucination Prevention

- **Read before edit:** before editing a file, read it in the current session. Do not edit from memory.
- **Verify before claim:** before saying "done," the verification command must have run and its output recorded.
- **Search before write:** before writing code that calls a library API, read the actual API surface. Do not generate from training memory.

## Multi-Agent Ownership

When multiple agents work in the same repo:

- Each agent owns a disjoint file/module set.
- An agent must claim a file before editing it.
- Agents may not recursively delegate to each other.
- The one-shot verification must pass before any agent claims done.

## End of Session

Before ending a session:

1. Record current state, blockers, and next steps via the runtime memory system and task list.
2. Commit with a conventional-format message once work is in a safe state.
3. Leave the repo clean — `git status` should show nothing unexpected.

## Escalation

- **Constitution conflict**: `CONSTITUTION.md` is already in context — reread it there, not from disk.
- **Unclear requirements**: Ask the user.
- **Verification failure**: Record via memory, flag for review, do not bypass.
- **Scope ambiguity**: Re-read this file and the Definition of Done.
1 change: 1 addition & 0 deletions repos/constitution/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Loading
Loading