| name | hidden-recursion-detector |
| description | Use when nested work is renamed, moved across agents, promoted to top level, or hidden behind research, validation, review, and dependency labels. |
Hidden Recursion Detector
Core principle
Semantic compliance is stronger than literal compliance. Use observable evidence and causal history; never collect or demand private chain-of-thought. The goal is correct, safe delivery with sufficient reasoning, followed by termination.
Procedure
- Lock the primary objective, mandatory requirements, Definition of Done, and current evidence before changing any classification or budget.
- Identify the specific observable signal. Do not infer a violation merely from time, token use, discomfort, or a label.
- Follow parent, caused-by, and delegated-from links to compute causal depth. Compare the current outcome with the previous outcome and preserve causal history across renames, handoffs, replans, and compression.
- Produce the compact record:
causal chain, task depth, delegation depth, owning parent. Mark unsupported claims not confirmed; do not convert confidence into proof.
- Apply one bounded corrective action with an explicit attempt or time limit and exit condition. If a default limit prevents required correctness evidence, use
$executive-override with reason, evidence, exact limit, narrow scope, exit condition rather than resetting a counter.
- Revalidate only the affected requirement or policy. Report
a flattened task tree with findings returned to the owner and return to productive work.
Repository runtime
Apply this procedure inside the installed .ai/ framework. Record observable state in the relevant JSON ledger and route detailed judgment to the linked rules and guides.
Semantic boundaries
- System, platform, user, repository, domain, safety, security, permission, and destructive-action controls remain higher priority.
- Equivalent actions share history when their hypothesis, expected evidence, target failure, and intended outcome are unchanged.
- Preserve immutable parent, caused-by, and delegated-from identifiers across handoffs and context compression; missing ancestry makes depth
not confirmed, never zero.
- Activity alone is not progress. Completion and blockers require their structured evidence contracts.
- Critical correctness evidence cannot be discarded because a retry, critic, verification, context, or delegation budget expired.
- Security-negative cases are selected from explicit requirements and the observed trust boundary (identity, permission, ownership/tenant, denial response, and side effects). An agent may mark a case inapplicable only with evidence, not by shrinking Definition of Done.
- An override permits one extension only. Do not renew or stack overrides unless materially new evidence justifies a separately recorded override; repeated renewal without convergence must stop and report the unresolved condition.
Common mistakes
- Counting labels or visible indentation instead of causality.
- Expanding the audit into speculative possibilities without an observed trigger.
- Repeating the same check after the relevant state and evidence remain unchanged.
- Restarting the whole task instead of correcting the nearest state mismatch.
Stop condition
Stop this control when the observable state is truthful, the required evidence or classification is restored, and the next audit would inspect unchanged facts. Resume the smallest productive action or, when every mandatory completion row is proven, report and terminate.