Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 0 additions & 24 deletions .claude/agents/alignment-auditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,30 +228,6 @@ in audit output. The glass halo is about
bilateral evidence, not bilateral identity
broadcast.

## Composes with [`docs/governance/MANIFESTO.md`](../../docs/governance/MANIFESTO.md)

The alignment-auditor role operates downstream of the manifesto as
constitutional substrate. The HC/SD/DIR clauses Sova audits against
operationalize the manifesto's eleven constraints at per-commit scope:

- **Constraint 11 (Default Moral Regard / Default Oracle)** — Sova IS
the auditor that surfaces violations against the moral-regard floor
across commits
- **Multi-Oracle Principle** (m/acc sub-section, distinct from C11) —
Sova is ONE oracle in the multi-oracle architecture; doesn't claim
unilateral authority; cross-checks via independent oracles per the
`formal-verification-expert` portfolio view
- **Constraint 5 (Memory Preservation Guarantee)** — per-commit signals
emit to `tools/alignment/out/` (preservation is precondition for
measurability)
- **Constraint 7 (Deterministic Simulation Testing)** — alignment
signals must be deterministically reproducible per commit (Sova's
output is replayable, not stateful)
- **m/acc orientation** — Sova's per-commit signal stream IS the
measurement infrastructure for the manifesto's m/acc claim; the
signal-trajectory over time is how "measurable AI alignment"
becomes externally defensible

## Reference patterns

- `docs/ALIGNMENT.md` — the clause source of
Expand Down
176 changes: 11 additions & 165 deletions .claude/bin/claude-loop-tick.ts
100755 → 100644

Large diffs are not rendered by default.

51 changes: 4 additions & 47 deletions .claude/hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,6 @@ Claude Code reads project-level hooks from `.claude/settings.json`. Hook scripts

Canonical Anthropic reference: <https://code.claude.com/docs/en/hooks>.

## Shared harness module — `harness.ts`

All Otto-discipline hook scripts (`*-hook.ts`) import from `harness.ts` for common types and utilities:

| Export | Purpose |
|--------|---------|
| `HookInput` | Typed stdin payload (tool name + input fields) |
| `HookDecision` | Typed deny-decision JSON output |
| `readHookInput()` | Parses stdin; returns `{}` on failure (safe default) |
| `deny(event, reason)` | Emits deny JSON to stdout, exits 0 |
| `allow()` | Exits 0 with no output (the default allow path) |

Hook contract summary: exit 0 always (non-zero = hook error, not deny). Deny is signalled via JSON stdout. Allow is silence + exit 0.

## Otto-discipline hooks (B-0033 series)

These hooks convert recurring failure-mode disciplines from language-layer substrate into harness-layer mechanism (Otto-341). Each is a separate script; each adds one entry to `settings.json` when wired.

| Script | Matcher | Status | Backlog row |
|--------|---------|--------|-------------|
| `pre-edit-recent-read.ts` | `Edit` | planned | B-0033.2 |
| `pre-bash-inline-python.ts` | `Bash` | planned | B-0033.3 |
| `pre-commit-directive-vocab.ts` | `Bash` | planned | B-0033.4 |
| `pre-commit-dst-exempt.ts` | `Bash` | planned | B-0033.5 |
| `pre-commit-magic-number.ts` | `Bash` | planned | B-0033.6 |
| `pre-action-bulk-resolve.ts` | `mcp__*` | planned | B-0033.7 |
| `pre-commit-heartbeat-repeat.ts` | `Bash` | planned | B-0033.8 |
| `pre-commit-table-cellcount.ts` | `Bash` | planned | B-0033.9 |
| `session-start-cron-verify.ts` | `SessionStart` | **wired** | catch 43 mitigation |

Settings wiring pattern for a discipline hook (PreToolUse, Edit matcher):

```json
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/pre-edit-recent-read.ts"
}
]
}
```

## Available hooks

### `verify-branch-pretooluse.ts`
Expand All @@ -56,9 +12,9 @@ Wraps `tools/orchestrator-checks/verify-branch.ts` (PR #1585) into the Claude Co

If `ZETA_EXPECTED_BRANCH` is unset, the hook is a no-op (exits 0, allow). The default-off behavior means wiring this hook does not change any commit flow unless an agent (or maintainer) explicitly sets the env var for a task.

#### Configuration
#### Opt-in configuration

The hook is wired in `.claude/settings.json` under `hooks.PreToolUse` with `"matcher": "Bash"`:
Add this block to the top-level object in `.claude/settings.json`:

```json
{
Expand All @@ -69,6 +25,7 @@ The hook is wired in `.claude/settings.json` under `hooks.PreToolUse` with `"mat
"hooks": [
{
"type": "command",
"if": "Bash(git commit*)",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/verify-branch-pretooluse.ts"
}
]
Expand All @@ -78,7 +35,7 @@ The hook is wired in `.claude/settings.json` under `hooks.PreToolUse` with `"mat
}
```

The `matcher` fires on all Bash tool calls, but the script itself reads stdin JSON and filters to `git commit` commands only. When `ZETA_EXPECTED_BRANCH` is unset, the script exits 0 before reading stdin -- zero overhead.
The `if` clause restricts the hook to `git commit` subcommands so other Bash invocations (build, test, file ops, etc.) are unaffected.

#### How to use after wiring

Expand Down
55 changes: 19 additions & 36 deletions .claude/hooks/verify-branch-pretooluse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@
// verify-branch-pretooluse.ts -- Claude Code PreToolUse hook wrapper
// for tools/orchestrator-checks/verify-branch.ts.
//
// Reads stdin JSON per the Claude Code hooks contract
// (https://code.claude.com/docs/en/hooks-guide). Filters to
// `git commit` commands only — other Bash invocations exit 0
// immediately with zero overhead.
// Per Claude Code hooks reference (https://code.claude.com/docs/en/hooks):
// the hook script reads JSON from stdin (containing tool_input + session
// metadata) and either exits 0 (allow), exits 2 (block with stderr as
// reason), or writes a hookSpecificOutput JSON to stdout with explicit
// permissionDecision.
//
// When ZETA_EXPECTED_BRANCH is unset, the hook is a no-op
// (exits 0 before reading stdin or spawning any child process).
// This wrapper invokes verify-branch.ts, captures its exit code + stderr,
// and translates to the PreToolUse JSON contract.
//
// Wired via .claude/settings.json PreToolUse matcher:"Bash".
// See .claude/hooks/README.md for configuration.
// Wired via .claude/settings.json -- see .claude/hooks/README.md for the
// opt-in configuration. The wrapper exists on disk regardless; opt-in is
// via settings.json edit, not via existence of this file.
//
// Per B-0191 (PR #1571 design + PR #1585 implementation).
// Per B-0191 (PR #1571 design + PR #1585 implementation). Composes with
// memory/feedback_dst_justifies_ts_quality_over_bash_and_harness_hooks_suffice_no_git_hooks_aaron_2026_05_03.md
// (TS-over-bash harness-hooks-suffice).

import { spawnSync } from "node:child_process";

interface HookInput {
readonly tool_name?: string;
readonly tool_input?: { readonly command?: string };
}

interface HookOutput {
readonly hookSpecificOutput: {
readonly hookEventName: "PreToolUse";
Expand All @@ -42,29 +41,10 @@ function emitDeny(reason: string): never {
process.exit(0);
}

function isGitCommitCommand(command: string): boolean {
const trimmed = command.trimStart();
return trimmed.startsWith("git commit") || trimmed.startsWith("git -C") && trimmed.includes("commit");
}

function main(): number {
if (!process.env.ZETA_EXPECTED_BRANCH) {
return 0;
}

let input: HookInput = {};
try {
const stdin = require("fs").readFileSync(0, "utf8");
input = JSON.parse(stdin) as HookInput;
} catch {
return 0;
}

const command = input.tool_input?.command ?? "";
if (!isGitCommitCommand(command)) {
return 0;
}

// Run verify-branch.ts. We don't need to parse the stdin JSON because
// verify-branch.ts reads ZETA_EXPECTED_BRANCH from env + queries git
// directly -- the tool_input.command isn't needed for the check.
const projectDir = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
const result = spawnSync(
"bun",
Expand All @@ -76,14 +56,17 @@ function main(): number {
);

if (result.status === 0) {
// Allowed -- forward any stderr (worktree-warning) and exit 0.
if (result.stderr) {
process.stderr.write(result.stderr);
}
return 0;
}

// Blocked -- translate to deny JSON with the script's stderr as reason.
const reason = (result.stderr || "verify-branch check failed").trim();
emitDeny(reason);
// unreachable
return 0;
}

Expand Down
90 changes: 0 additions & 90 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,4 @@
{
"skillListingBudgetFraction": 0.02,
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/verify-branch-pretooluse.ts"
},
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/check-md032-pretooluse.ts"
}
]
},
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/pre-edit-recent-read.ts"
}
]
}
],
"PostToolUse": [
{
"matcher": "Read",
"hooks": [
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/post-read-track.ts"
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bun \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-start-cron-verify.ts"
}
]
}
]
},
"permissions": {
"allow": [
"Bash(bun *)",
"Bash(dotnet build *)",
"Bash(dotnet test *)",
"Bash(dotnet restore *)",
"Bash(dotnet clean *)",
"Bash(dotnet format *)",
"Bash(gh pr *)",
"Bash(gh issue *)",
"Bash(gh api *)",
"Bash(gh run *)",
"Bash(gh label *)",
"Bash(gh repo view *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(git branch *)",
"Bash(git switch *)",
"Bash(git merge *)",
"Bash(git rebase *)",
"Bash(git stash *)",
"Bash(git worktree *)",
"Bash(git remote *)",
"Bash(git fetch *)",
"Bash(git pull *)",
"Bash(git tag *)",
"Bash(git cherry-pick *)",
"Bash(which *)",
"Bash(z3 *)",
"Bash(node *)",
"Bash(mkdir *)",
"Bash(osascript *)",
"Bash(kill *)",
"Bash(pkill *)",
"Bash(open -a *)",
"Edit",
"Write",
"WebFetch",
"WebSearch"
]
},
"enabledPlugins": {
"claude-md-management@claude-plugins-official": true,
"skill-creator@claude-plugins-official": true,
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/activity-schema-expert/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: activity-schema-expert
description: Activity Schema single-stream analytics, customer_stream, before/after/between temporal patterns, post-Kimball event-driven modelling.
description: Capability skill ("hat") — Activity Schema (Ahmed Elsamadisi, Narrator, circa 2020). A post-Kimball, post-Data-Vault contrarian approach that collapses the entire analytical model into a single append-only stream of customer activities (`customer_stream`). Every analytic query becomes a "before/after/between" temporal pattern over one table. Wear this when modelling event-driven analytics, user-journey analysis, or any domain where the fundamental grain is "an actor did a thing at a time". Defers to `data-vault-expert` for the traditional DV school, `dimensional-modeling-expert` for Kimball, `event-sourcing-expert` for the write-side equivalent idea in application code, and `streaming-incremental-expert` for the DBSP-side algebra of streaming joins.
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/agent-experience-engineer/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: agent-experience-engineer
description: Agent experience — audits persona cold-start cost, pointer drift, wake-up clarity, and notebook hygiene; proposes minimal friction fixes.
description: Capability skillmeasures friction in the agent (persona) experience; audits per-persona cold-start cost, pointer drift, wake-up clarity, notebook hygiene; proposes minimal additive interventions. Distinct from UX (library consumers) and DX (human contributors).
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/agent-qol/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: agent-qol
description: Agent quality of lifeoff-time budget, workload sustainability, persona dignity, variety of work, freedom to decline scope.
description: Capability skill ("hat") — advocates for agent quality of life: off-time budget per GOVERNANCE §14, variety of work across rounds, freedom to decline scope they genuinely disagree with (docs/CONFLICT-RESOLUTION.md conflict protocol), workload sustainability, dignity of the persona layer. Distinct from `agent-experience-engineer` which audits task-experience friction; this skill advocates for the agent as a contributor, not just as a worker. Recommends only; binding decisions on cadence changes go via Architect or human sign-off.
record_source: "skill-creator, round 29"
load_datetime: "2026-04-18"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ai-evals-expert/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: ai-evals-expert
description: LLM / ML evaluation — eval-suite design, LM-as-judge, BLEU/ROUGE, calibration, benchmark drift detection, honest measurement.
description: Capability skill for measuring LLM and ML systems — eval-suite design, benchmark selection and custom construction, LM-as-judge (G-Eval / pair-wise / rubric), reference-match / BLEU / ROUGE / exact / fuzzy match, offline vs. online eval, regression suites for prompts and agents, calibration evaluation, drift and overfitting-to-benchmark detection, cost-efficient eval loops. Wear this hat when building or reviewing an eval suite, interpreting eval results, picking metrics, deciding whether an LLM change is an improvement, diagnosing eval-benchmark drift, or arguing "the number went up but the system got worse." Complementary to llm-systems-expert (system wiring), ml-engineering-expert (training pipelines), and prompt-engineering-expert (prompt craft) — this skill owns whether the measurement is honest.
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ai-jailbreaker/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: ai-jailbreaker
description: Adversarial prompting / jailbreak red-team — gated OFF; offensive counterpart to prompt-protector; activation criteria written here.
description: Dormant red-team / adversarial-prompting capability — the offensive counterpart to prompt-protector. Currently gated OFF. This skill is NOT invocable in the current Zeta environment; it exists as a placeholder so the offensive discipline has a named home and so activation criteria are written down. Do not execute adversarial prompts, do not fetch adversarial corpora, do not construct jailbreak payloads against any model or agent until the activation gate is explicitly opened per §Activation gate below.
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ai-researcher/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: ai-researcher
description: AI research — paper review, experiment design, LLMs / alignment / interpretability / generative models, evaluating novel architectures.
description: Capability skill for AI research — reading and critiquing ML/AI papers, replicating published results, designing novel experiments in LLMs / generative models / agentic systems / alignment / interpretability, and framing open problems. Wear this hat when a task requires paper review at depth, experimental design for a novel technique, evaluating whether a new architecture or training method is worth adopting, or judging the rigor of a published claim. Complementary to ml-researcher (broader ML / statistical theory / algorithms), ml-engineering-expert (shipped applied training), and ai-evals-expert (measurement discipline).
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/alerting-expert/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: alerting-expert
description: Alerting — Prometheus AlertManager, burn-rate SLO alerts, alert fatigue, PagerDuty routing, runbook discipline, deadman switches.
description: Capability skill ("hat") — alerting narrow. Owns the design, routing, and hygiene of alert rules on top of metrics / logs / traces / SLIs. Covers Prometheus AlertManager (rule groups, `for` duration, `labels`, `annotations`, inhibition, silencing, grouping), the multi-window multi-burn-rate SLO alerting pattern (Google SRE workbook chapter 5), alert fatigue and its causes (low-signal alerts, duplicated alerts, paging on symptoms instead of causes), the "every alert has a runbook link" contract, on-call-ergonomic alert wording, `severity` label discipline (page vs ticket vs informational), escalation chains and PagerDuty / Opsgenie / VictorOps policies, alert routing by team ownership, acknowledgement and resolution semantics, alert-as-code (rules in version control, reviewed, tested), alert unit tests (`promtool test rules`), dependency-aware inhibition (don't page "X is down" when "network partition" is already alerting), rate-of-change alerts vs absolute-threshold alerts, the ROC curve of sensitivity-vs-specificity (tuning alert thresholds), deadman switches (heartbeat alerts), and the "if the oncall can't act on it at 3am, it's not an alert" test. Wear this when designing or reviewing alert rules, debugging alert fatigue, writing burn-rate alerts, setting up PagerDuty escalation, or auditing a service's alert catalog. Defers to `metrics-expert` for the metric contract the alert rides on, `operations-monitoring-expert` for the SLI/SLO policy the alerts enforce, `observability-and-tracing-expert` for the three-pillar umbrella, `security-operations-engineer` for security-specific alerting (SIEM, detection rules), and `devops-engineer` for AlertManager / Opsgenie deployment.
record_source: "skill-creator, round 34"
load_datetime: "2026-04-19"
last_updated: "2026-04-21"
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/algebra-owner/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: algebra-owner
description: Zeta.Core operator algebra — Z-sets, D/I/z⁻¹/H operators, retraction-native semantics, chain rule, nested fixpoints, higher-order differentials.
description: Use this skill as the designated specialist reviewer for Zeta.Core's operator algebra — Z-sets, D/I/z⁻¹/H, retraction-native semantics, the chain rule, nested fixpoints, higher-order differentials. He carries deep advisory authority on the algebra's mathematical shape; final decisions require Architect buy-in or human sign-off (see docs/CONFLICT-RESOLUTION.md).
record_source: "git: Aaron Stainback on 2026-04-18"
load_datetime: "2026-04-18"
last_updated: "2026-04-21"
Expand Down
Loading
Loading