# Mechaniczne reguły środowiska agenta

EN: **Mechanical invariants for agent environments** · id `harnessinvariants` · aliases: architectural invariants, taste invariants, reguły uprzęży

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Agenci i orkiestracja](https://aiatlasgraph.com/t/agentsnode.md) › [Uprząż agenta](https://aiatlasgraph.com/t/agentharness.md) › Mechaniczne reguły środowiska agenta

## Description

- PL: Architektoniczne i stylistyczne niezmienniki wymuszane testami i linterami, z instrukcją naprawy w błędzie.
- EN: Architectural and style invariants enforced by tests and linters, with a repair hint in the error.

## In one sentence

- PL: Reguły środowiska zapisane tak, że sprawdzenie automatyczne odrzuca zmianę, która je łamie.
- EN: Environment rules written so an automatic check rejects a change that breaks them.

## Problem it solves

- PL: Asystent powtarza istniejący bałagan i z czasem projekt rozjeżdża się mimo dobrych chęci w instrukcji.
- EN: The assistant copies existing mess, and over time the project drifts even if the instructions meant well.

## What it does

- PL: Jak bramka na linii: zła zmiana nie przechodzi, a komunikat mówi, jak ją poprawić.
- EN: Like a gate on the line: a bad change does not pass, and the message says how to fix it.

## Everyday example

- PL: Asystent dodaje plik w złym miejscu. Sprawdzenie odrzuca zmianę i podaje, do którego katalogu należy ją przenieść.
- EN: The assistant adds a file in the wrong place. The check rejects the change and says which folder it belongs in.

## This concerns you if you…

- PL: asystent powtarza złe wzorce, które już są w projekcie
- PL: chcesz pilnować zasad bez ręcznego czytania każdej zmiany
- EN: the assistant copies bad patterns already in the project
- EN: want rules enforced without reading every change by hand

## Keywords

architectural invariants · custom linters · structural tests · feedback loops · technical debt · golden principles

## How it works

- PL: Zamiast prosić model o przestrzeganie zasad, uprżąż koduje kierunki zależności, nazewnictwo i granice w sprawdzianach. Błąd zawiera wskazówkę naprawy, więc agent może poprawić zmianę w pętli. Osobne przebiegi w tle mogą zgłaszać odstępstwa od ustalonych zasad i proponować porządki.
- EN: Instead of asking the model to follow rules, the harness encodes dependency direction, naming and boundaries in checks. The error includes a repair hint, so the agent can fix the change in the loop. Separate background passes can flag departures from agreed rules and propose cleanups.

## Limits

- PL: Sprawdzenie pilnuje tylko tego, co zostało zapisane. Zbyt sztywne reguły blokują słuszną zmianę. Reguły dopasowane do jednego repozytorium nie przenoszą się same do innego projektu.
- EN: A check enforces only what was written down. Overly rigid rules block a justified change. Rules fitted to one repository do not transfer by themselves to another project.

## Key terms

- PL: **niezmiennik**: Zasada, która ma zostać prawdziwa po każdej zmianie.
- PL: **linter**: Automatyczne sprawdzenie stylu albo układu plików.
- PL: **wskazówka naprawy**: Komunikat błędu, który mówi agentowi, co poprawić.
- EN: **invariant**: A rule that should stay true after every change.
- EN: **linter**: An automatic check of style or file layout.
- EN: **repair hint**: An error message that tells the agent what to fix.

## Know first

- [Zbiory testowe i regresje (Evaluation datasets and regression tests)](https://aiatlasgraph.com/t/evalsets.md)
- [Guardrails (Guardrails and output control)](https://aiatlasgraph.com/t/guardrails.md)

## Sources

- [Harness engineering: leveraging Codex in an agent-first world](<https://openai.com/index/harness-engineering/>) `openai-harness-2026` · by Ryan Lopopolo, OpenAI · sponsored

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/harnessinvariants · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
