Universal Agent Law
Relevant source files
The following files were used as context for generating this wiki page:
The Universal Agent Law is the portable, agent-agnostic core of engineering conduct within the flext-target-ldap repository. It serves as an inviolable set of rules that binds any AI agent—including Claude, Codex, Gemini, Cursor, or GitHub Copilot—and human users to a strict standard of technical excellence and integrity. Its primary purpose is to ensure that all modifications to the LDAP target loading system remain consistent, maintainable, and free of technical debt.
This law applies to every project type and session within the FLEXT ecosystem. It establishes a zero-tolerance policy for workarounds, mandates fix-forward-only development to prevent work destruction in multi-agent environments, and requires objective evidence for every task completion. Sources: AGENTS.md:4-10, README.md:14-15
Core Directives and Execution Protocols
1. Technical Integrity and Debt Prevention
The law mandates a "Zero-Tolerance / Strict-Total" approach to code quality. Agents must always address the root cause of issues rather than implementing compatibility wrappers or stubs. Dead code must be removed in the same cycle as its replacement, and the system must "fail loud" if a single source of truth (SSOT) is missing. Sources: AGENTS.md:14-23
The diagram illustrates the mandatory path for resolving issues, contrasting it with forbidden workaround techniques. Sources: AGENTS.md:14-36
2. Multi-Agent Coordination and State Management
Because multiple agents may share a single working tree, the Law forbids destructive Git operations such as git reset --hard or git stash that might destroy another agent's in-flight work. Agents must "Fix-Forward-Only," accepting the current state and moving toward a solution. Sources: AGENTS.md:25-31
| Rule Category | Directive | Forbidden Actions |
|---|---|---|
| State Management | Fix-Forward-Only | git checkout --, git restore, git reset, git clean |
| Typing | Most-Restrictive | Any, bare object, unchecked casts |
| Documentation | Honesty & Evidence | Speculative results, assumed success |
| Coordination | Task Board | Overwriting committed work, silent reverts |
Sources: AGENTS.md:25-78
Engineering Principles (SSOT, SOLID, YAGNI)
The Universal Agent Law enforces standard engineering paradigms to maintain the architectural integrity of the LDAP target system. These principles are applied across all modules, including the FlextTargetLdapModels and FlextTargetLdapSink implementations. Sources: AGENTS.md:80-90, src/flext_target_ldap/models.py:27-35
- SSOT (Single Source of Truth): One authoritative source per fact. For instance, in the LDAP target, configuration and identity contracts must be referenced from canonical files rather than duplicated. Sources: AGENTS.md:81-83, README.md:31-33
- SOLID: Respects SRP (Single Responsibility Principle) and DIP (Dependency Inversion Principle). The system depends on abstractions (protocols/interfaces) and collaborator injection. Sources: AGENTS.md:84-85, src/flext_target_ldap/_models/sinks.py:32-45
- YAGNI (You Ain't Gonna Need It): No speculative parameters or dead branches. Code is built strictly for the current task. Sources: AGENTS.md:86-87
Implementation Example: Model Validation
The FlextTargetLdapModels class demonstrates these principles by enforcing strict business rules for LDAP entries, such as requiring top in object classes and validating DN formats. Sources: src/flext_target_ldap/models.py:112-140
# src/flext_target_ldap/models.py:112-120
@u.field_validator("object_classes")
@classmethod
def validate_object_classes(
cls,
v: MutableSequence[str],
) -> MutableSequence[str]:
"""Validate object classes contain 'top'."""
if "top" not in v:
v.append("top")
return v
Sources: src/flext_target_ldap/models.py:112-120
Blocked-Operation and Destructive Protocol
When a tool or command is blocked by security hooks or sandbox rules, agents must follow a specific protocol rather than attempting a bypass. Sources: AGENTS.md:58-69
- Stop: Do not retry variations or seek bypasses.
- Diagnose: Explain in one sentence what was blocked and why.
- Handoff: Provide the exact command or edit to the user.
- Wait: Do not proceed until user output is provided.
- Bypass Prohibition: Techniques like
bash -cwrapping,eval, orenvswaps are strictly forbidden.
Sources: AGENTS.md:58-69
Conclusion
The Universal Agent Law ensures that flext-target-ldap development is predictable, high-quality, and collaborative. By adhering to these strict core directives—from zero-tolerance for workarounds to fix-forward-only Git practices—the project maintains a zero-debt baseline while enabling multiple AI agents and human developers to operate safely within the same codebase. Sources: AGENTS.md:4-12, README.md:14-16