**English** | [Русский](/ru/docs/senar)

# What is SENAR?

<!-- doc-map: reader=user; zone=getting-started -->

SENAR (Supervised Engineering & Normative AI Regulation) is an open engineering standard that defines how AI agents should work on software projects. Think of it as a building code for AI-assisted development — a set of rules that make the agent's work predictable, verifiable, and safe.

**Full specification:** [senar.tech](https://senar.tech) | [GitHub](https://github.com/Kibertum/SENAR)

TAUSIK (**T**ask **A**gent **U**nified **S**upervision, **I**nspection & **K**nowledge) is the reference implementation of SENAR. Every rule described below is enforced by TAUSIK automatically — you don't need to read the spec to use the framework.

---

## The Problem SENAR Solves

AI coding agents are powerful but unreliable. Without structure, they:

- Start writing code without defining what "done" means
- Claim tasks are complete without testing
- Forget everything between sessions
- Try the same failed approach three times in a row

AGENTS.md and .cursorrules are recommendations — the agent can ignore them. SENAR provides **enforcement**: hard blocks that physically prevent the agent from skipping steps.

## Core Concepts

### Quality Gates

Two checkpoints that every task must pass:

**QG-0 — Context Gate (before starting work):**
- The task must have a clearly defined goal
- Acceptance criteria must be written down — what counts as "done"
- At least one negative scenario is required (what happens on error, invalid input, etc.)
- Security-sensitive tasks (auth, payments, PII) get an additional warning if security criteria are missing

**QG-2 — Implementation Gate (before closing a task):**
- Every acceptance criterion must have documented evidence (test output, verification steps)
- All plan steps must be completed
- Automated checks must pass (tests, linters — depending on your stack)

These gates are **hard blocks** — the agent literally cannot proceed without meeting the requirements. No `--force` flag, no bypass.

> **Why QG-0 and QG-2, not QG-1?** The numbering follows the SENAR specification: QG-0 runs at task start (before any work), QG-2 runs at task completion (after all work). QG-1 is reserved in the spec for a mid-work checkpoint but is not yet implemented.

### Session Management

Working sessions have structure:

- **Session start** — load context from previous work (what was done, what's blocked, what failed)
- **Context pressure** — session time, calls since the last checkpoint and a quiet journal are printed as advice with a measured basis; they never block a task start (1.10).
- **Checkpoints** — periodic context snapshots so nothing is lost if the session crashes
- **Session end** — save a handoff: what was accomplished, what's unfinished, what decisions were made

### Dead End Tracking

When the agent tries an approach and it fails — it records the dead end: what was tried and why it didn't work. Next session, when a similar task comes up, the agent sees the failed approach and avoids repeating it.

### Metrics

Six metrics are tracked automatically, with no manual input:

| Metric | What It Measures |
|--------|------------------|
| **Throughput** | Tasks completed per session |
| **FPSR** (First-Pass Success Rate) | % of tasks solved on the first attempt |
| **DER** (Defect Escape Rate) | % of tasks where a defect was found later |
| **Lead Time** | Average time from task creation to completion |
| **Dead End Rate** | Share of dead ends relative to total tasks |
| **Cost per Task** | Average time by complexity level |

These metrics help answer: is the agent working efficiently, or spending time on retries and dead ends?

## What You'll Notice in Practice

When using TAUSIK, SENAR manifests as:

1. **The agent always asks "what counts as done?"** before writing code — that's QG-0
2. **The agent can't close a task by just saying "done"** — it must show evidence for each criterion — that's QG-2
3. **Starting a new session loads previous context** — you don't explain the project from scratch
4. **Failed approaches are remembered** — the agent won't try the same broken solution twice
5. **Long sessions get a warning** — after 3 hours the agent suggests taking a checkpoint

## SENAR Rules at a Glance

| Rule | What It Says | How TAUSIK Enforces It |
|------|-------------|------------------------|
| Rule 1 | No code without a task | Hook blocks file edits without an active task |
| Rule 2 | Define scope boundaries | `scope_write_gate`/`bash_write_gate` block writes outside `scope_paths`; QG-0 hard-blocks a medium/complex start with no scope |
| Rule 3 | Verify against criteria | QG-0 + QG-2 combined enforcement |
| Rule 4 | External adversarial review | `risk_l3_trigger` blocks an under-evidenced closure until an L3 review is recorded; reviewer is the separate-model `tausik-external-reviewer` subagent |
| Rule 5 | Verification checklist | Hard gate for substantial/deep tiers whose AC cite no existing test; escalating warning below |
| Rule 6 | Plan rollback | `rollback_plan` field: QG-0 blocks a medium/complex start without a rollback plan; `task done` warns |
| Rule 7 | Find root cause for defects | Warning if defect task has no root cause in notes |
| Rule 8 | Capture knowledge | Warning at task close if no decisions/patterns recorded |
| Rule 9.2 | Session duration | Signal: advice above `session_max_minutes`, no refusal (1.10) |
| Rule 9.3 | Periodic checkpoints | Signal: calls since the last handoff are derived from the ledger, advice above `checkpoint_calls` |
| Rule 9.4 | Document dead ends | Dedicated tool + reminders in skills |
| Rule 9.5 | Periodic audit | Auto-check at session start |

> **A note on Rules 4–6.** As of **v1.5** these are enforced: **Rule 4** (external adversarial review — a separate-model, read-only subagent gates under-evidenced closures), **Rule 5** (verification checklist — a hard gate for substantial/deep planning tiers, advisory below), and **Rule 6** (rollback planning — QG-0 blocks new medium/complex tasks without a documented rollback plan). See the [SENAR Compliance Matrix](https://github.com/Kibertum/tausik-core/blob/v1.11.0/docs/en/senar-compliance-matrix.md) for the full enforcement table.

**Full compliance matrix:** [SENAR Compliance Matrix](https://github.com/Kibertum/tausik-core/blob/v1.11.0/docs/en/senar-compliance-matrix.md)

---

## What's Next

- **[Quick Start](/docs/quickstart)** — set up TAUSIK in 10-15 minutes
- **[Workflow](/docs/workflow)** — how a typical work day looks
- **[SENAR Compliance Matrix](https://github.com/Kibertum/tausik-core/blob/v1.11.0/docs/en/senar-compliance-matrix.md)** — detailed implementation status for every rule
