Article: Agentic Fitness Functions: Extending Evolutionary Architecture Beyond Deterministic Rules
Hemant Kumar Mahato, ลukasz Sieczkowski, Vijayasenthilkumar Kuppusamy ยท rss ยท 2026-08-17 source โ Reader ๐ฅ๏ธ
Agent Governance (Internal)Agent SecurityAgentic Fitness FunctionsArchitecture Decision RecordsEvalsEvolutionary Architecture & Fitness FunctionsGuardrailsHuman-in-the-Loop
Deterministic fitness functions should remain the primary architectural governance mechanism, but calibrated, evidence-scoped, escalation-capable AI 'agentic fitness functions' should be added as an advisory judgment layer for architectural concerns that are evidence-bound but not reducible to a rule โ boundary fidelity, semantic contract drift, stale ADR assumptions โ so that architectural judgment itself becomes observable, auditable, and, where patterns repeat, convertible back into deterministic guardrails.
practical ยท mixed โ Primarily practical/prescriptive (argues for a specific governance pattern teams should adopt), built expositorily (definitions, anatomy, a reference implementation) and argumentatively (defends the deterministic/agentic split against the objection that AI judgment is unreliable), with three worked examples functioning as narrative illustration.
Structure
| Part | Role |
|---|---|
| From Deterministic Rules to Architectural Judgment (opening framing) | context |
| The Ceiling of Deterministic Fitness Functions | evidence establishing the problem โ deterministic checks can prove structural facts but not architectural intent |
| Agentic Fitness Functions: Calibrated Judgment, Not Oracles (definition + design principle) | conceptual core โ defines the new mechanism and its subordinate relationship to deterministic gates |
| Production-Ready Agentic Fitness Function: Anatomy and ADK Reference Implementation (four-part anatomy, minimal structured verdict example) | concrete specification โ makes the abstract definition implementable and auditable |
| Calibration and Controls (calibration sets, disagreement-as-signal, bias table, injection controls) | risk mitigation โ answers the objection that AI judgment is unreliable or gameable |
| Three Examples (Boundary-Fidelity Reviewer, Semantic Contract Evaluator, ADR Drift Monitor) | narrative/case illustration โ shows the pattern applied to concrete architectural concerns |
| Practical Guidelines (8 numbered rules) | conclusion translated into action |
| Toward Governed Architectural Judgment (closing) | conclusion / restatement |
Key terms
- agentic fitness function Agentic Fitness Functions
An architecture-governance check whose evaluator is a calibrated AI agent, whose criteria are an analytic rubric, and whose output is a structured verdict with evidence, confidence, and rationale โ subordinate to and never a replacement for deterministic fitness functions. - evidence contract Agentic Fitness Functions
The deliberately limited, named set of artifacts (PR diff, changed API spec, relevant ADRs, ownership metadata, service catalog entry, deterministic-check output, trace window) the agentic judge is allowed to inspect for a given verdict. - boundary fidelity
Whether a change preserves the intended ownership boundary of a business capability โ semantic coupling, hidden coordination paths, shared-state abstractions, leaked knowledge across bounded contexts โ even when it violates no explicit dependency rule. - structured verdict Agentic Fitness Functions
A machine-readable judgment output (score, confidence, violated_criteria, evidence references, recommended_action) as opposed to a conversational essay โ required so the result can be stored, trended, and audited like any other governance signal. - rubric
A versioned, named-criteria scoring instrument applied by the agentic judge, treated and reviewed like code (pull-request review, version numbers, re-run against the calibration set on any change).
Propositions
- explicitDeterministic fitness functions should remain the primary enforcement mechanism for measurable architectural invariants โ dependency direction, contract shape, latency budgets, security posture, policy checks.conf: highsupportsAgents don't know what good looks like. And that's exactly the problem. ยท p5 โ Both independently converge on 'deterministic guardrails around nondeterministic judgment are not optional' โ this article turns that imperative into a concrete anatomy.supportsArchitecture as Code to Teach Humans and Agents About Architecture ยท p3 โ Agrees that agents/AI judges can only be trusted to converge on acceptable outcomes when deterministic constraints bound the space first.
- explicitAgentic fitness functions add value specifically where architectural risk is evidence-bound but judgment-heavy โ boundary fidelity, semantic contract drift, workflow coupling, stale ADR assumptions โ not where a rule or threshold already suffices.conf: highextendsComprehension at AI Speed: Building a Context Store for Evolutionary Architecture ยท p8 โ Context-store piece pushes conformance checking onto CI-blocking deterministic fitness-function sensors to free reviewer capacity; this article extends the fitness-function concept itself to add a calibrated, non-blocking judgment layer for concerns those deterministic sensors structurally cannot reach.
- explicitdevelopedAn agentic fitness function should begin as an advisory signal and become more influential only after calibration against prior human decisions demonstrates acceptable precision, recall, and variance.conf: highrefines โHow Figma Uses AI Agents for Security ยท p10 โ Refines the general 'calibrate for acceptable precision, recall, and variance before increasing influence' principle by specifying that order matters: optimize precision before recall, because a team's historical bug data can only ever measure recall.
- explicitestablishedLow confidence, judge disagreement, high blast radius, or ambiguous architectural trade-offs should always escalate to a human reviewer rather than being resolved automatically.conf: highextendsAgents don't know what good looks like. And that's exactly the problem. ยท p3 โ The earlier piece names capability verification (operational/architectural qualities at scale) as beyond current agents; this article's calibration-plus-escalation design is a concrete attempt at exactly that gap, using low confidence/disagreement as the trigger to fall back to human judgment.supports โHuman Oversight Is Not a Human in the Loop ยท p11 โ Both converge on escalation-by-boundary rather than escalation-by-default; the fitness-functions piece gives concrete triggers (low confidence, judge disagreement, high blast radius) that match Bataller's abstract categories (insufficient evidence, irreversibility, value conflict).supports โMeta's Recipe for Building Agents as "Organizational Second Brains" ยท p5 โ Same escalation principle: ambiguous or low-confidence cases are routed to a human reviewer rather than resolved automatically.
- explicitA production-ready agentic fitness function separates deterministic gates from agentic advisory signals, scopes evidence to the change rather than the whole codebase, applies a versioned rubric, and returns a structured (not conversational) verdict.conf: high
- explicitWhen agentic findings recur and the team agrees they represent real violations, they should be promoted into a named rubric criterion or a deterministic rule โ the intended long-term trajectory is convergence toward more deterministic governance, not permanent reliance on judgment.conf: high
- explicitThe judge model evaluating a change should be isolated from the agent that produced the code being judged, to control for self-enhancement bias (a model favoring patterns similar to what it generates).conf: high
- explicitDisagreement between judges or high variance across repeated runs on the same evidence is itself a signal of a real, unresolved architectural trade-off โ not noise that should be averaged away.conf: high
- explicitcorroboratedA dependency rule or schema validator can prove structural conformance (an import exists, a schema still parses) but cannot determine intentionality, semantic meaning, or ownership erosion โ rule-conformance and architectural health are treated as genuinely different properties.conf: highsupportsThree more static code analysis sensors ยท p15 โ Both conclude that computational/structural sensors alone are insufficient and that semantic interpretation by an LLM is required for architecture-level judgment โ reached independently in different domains (cross-file modularity vs. boundary fidelity).supports โThe Interfaces Are Arriving ยท p9 โ Same structural limit surfacing in a different domain: a schema or dependency-rule validator can prove structural conformance (a schema still parses; an import exists) but not semantic meaning or intent โ here applied to MCP tool schemas, there to architectural fitness functions.
- explicitArchitectural drift most commonly happens through individually reasonable changes that each pass every written rule while collectively moving the implementation away from the intent the team believed it had protected โ not through obvious rule violations.conf: high
- explicitManual architectural review does not scale down to the granularity of every pull request, contract change, workflow trace, or AI-generated patch โ this capacity gap is the underlying justification for the agentic layer.conf: high
- implicitA calibration set of roughly 20 to 50 prior changes, already classified by the architecture community as acceptable/risky/unacceptable, is treated as sufficient to establish a rubric's reliability before it is trusted in production.conf: medium
- implicitTreating repository/PR content strictly as evidence for the judge to inspect, and never as instructions the judge should follow, is presented as adequate to prevent prompt injection into architectural verdicts.conf: medium
Arguments
Agentic fitness functions are a defensible, disciplined extension of evolutionary architecture rather than an abandonment of the rigor deterministic fitness functions established. strength: medium
Explicit premises:
- Deterministic fitness functions have a hard ceiling โ they only protect what reduces to a rule, threshold, schema, or executable experiment.
- Manual review is the historical fallback above that ceiling, but does not scale to modern change volume (every PR, every contract diff, every agent-generated patch).
- A calibrated AI agent, given a scoped evidence pack and a versioned rubric, can return a structured, auditable verdict (score, confidence, rationale, evidence) rather than an unaccountable opinion.
- The pattern keeps deterministic gates as gates and treats agentic checks strictly as advisory signals subject to human escalation.
Implicit premises:
- A probabilistic AI verdict, properly scoped and calibrated, counts as legitimate governance evidence rather than merely a heuristic hint that a human could ignore without cost.
- Organizations can reliably build and sustain the calibration sets, rubric-review process, and audit trail the pattern depends on โ i.e., adopting this pattern does not simply relocate the same finite-reviewer-capacity bottleneck from code review onto rubric/calibration maintenance.
Inferences:
- If rubric and calibration-set maintenance is itself a scarce, senior-reviewer-bound activity, the 'advisory signal via agent' pattern may not relieve the review bottleneck so much as move it upstream to a smaller number of higher-stakes reviews โ a possibility the article never quantifies or addresses.
The known failure modes of LLM-as-judge systems (position, verbosity, self-enhancement bias, non-determinism, prompt injection, rubric drift) can be controlled without compromising the pattern's usefulness for architecture governance. strength: medium
Explicit premises:
- A named failure-mode-to-control table maps each bias to a specific mitigation (dual-ordering evaluation, evidence-only scoring, separate judge model, repeated-run variance treated as low confidence, treating repo content as evidence not instruction, versioned/reviewed rubrics).
- Confidence and evidence references are made explicit parts of every verdict rather than hidden.
Implicit premises:
- The failure-mode taxonomy imported from general LLM-as-judge evaluation literature transfers cleanly to architecture-governance judging without domain-specific failure modes of its own.
Inferences:
- Because fitness-function verdicts gate real production changes on a recurring basis (unlike a one-off eval run), even a purely 'advisory' false positive has an ongoing organizational cost โ reviewer fatigue and alert fatigue โ that the article's controls address for correctness but never discusses for volume or throughput.
Narratives
- Three worked examples โ a Boundary-Fidelity Reviewer that reasons about ADRs, ownership metadata, and package graphs; a Semantic Contract Evaluator that assesses whether a backward-compatible schema diff still preserves domain meaning; an ADR Drift Monitor that periodically checks whether an ADR's original assumptions (e.g., 'traffic is low enough for synchronous communication') still hold against current operational metrics.
โ Shows, rather than argues abstractly, what 'evidence-bound but judgment-heavy' architectural concerns look like in practice and how the anatomy (intent, evidence contract, judge, structured verdict) resolves each without blocking deployment. - A minimal structured-verdict JSON example: a 'checkout-boundary-fidelity' check scoring 0.68 with 0.74 confidence, flagging that a PaymentSession DTO leaking into a public OrderEvent violates semantic coupling per ADR-014, with a recommended action to move it behind a checkout-owned adapter.
โ Grounds the abstract 'anatomy' in a concrete, plausible artifact, implicitly supporting the claim that agentic verdicts can be as structured and reviewable as any deterministic tool's output.
Questions addressed
- โ
Can architectural governance be extended beyond what deterministic rules can check, without abandoning the rigor evolutionary architecture built around deterministic fitness functions?
Yes, via a layered pattern: deterministic gates stay gates for objective invariants; a calibrated, evidence-scoped, versioned-rubric AI judge is added as an advisory signal for judgment-heavy concerns, with mandatory human escalation on low confidence or disagreement, and a promotion path back into deterministic rules once findings stabilize. - โ
How do you keep an AI architectural judge auditable, calibratable, and resistant to the known failure modes of LLM-as-judge systems (bias, prompt injection, non-determinism)?
Calibration against a labeled set of prior changes; versioned, code-reviewed rubrics; a named bias-to-control mapping; judge/generator model isolation; treating repository content strictly as evidence, never as instructions. - โญ What is the actual cost, at organizational scale, of maintaining calibration sets and rubric review across many fitness functions โ and does that reproduce the same finite-reviewer-capacity bottleneck the pattern is meant to relieve?
Gaps
- incompleteNo empirical evaluation of the pattern itself is reported โ no precision/recall/false-positive numbers from an actual calibration run, no production case study, only a reference implementation and a hypothetical worked example. The article's confidence that calibration 'demonstrates acceptable precision, recall, and variance' is asserted as a process, never shown as an outcome.
Read next: Look for a follow-up piece, or independent case study, reporting real calibration results (false-positive rate, override rate, time-to-escalation) for an agentic fitness function running against production PR traffic. - incompleteThe article never addresses who reviews and maintains the calibration set and rubric over time, across potentially many fitness functions (boundary fidelity, semantic contracts, ADR drift, and whatever else a team adds) โ this could reproduce, at the rubric-review layer, exactly the finite-senior-reviewer-capacity bottleneck the pattern is proposed to relieve at the code-review layer. This corpus already flags a structurally identical concern about spec-authoring capacity in extract-context-store-evolutionary-architecture#g1.
Read next: Look for treatments of AI-eval/rubric maintenance cost at scale โ how many rubrics one architecture team can realistically own and keep current. - illogicalThe article treats judge disagreement as valuable signal of a real architectural trade-off that should always escalate to a human, but also recommends promoting recurring agentic findings into deterministic rules once the team 'agrees they represent real violations.' No criterion is given for distinguishing a finding that has become stable enough to deterministic-ize from one where persistent disagreement is itself the correct, ongoing state โ the two prescriptions pull in opposite directions without a stated tiebreaker.
Read next: Look for a worked example or decision procedure for when to stop escalating a recurring disagreement and instead write a rule. - uninformedThe article's optimism about a calibrated agentic judge reliably assessing boundary fidelity from ADRs, ownership metadata, and package graphs doesn't engage a directly relevant finding already in this corpus: extract-fowler-bockeler-static-sensors-iii found that even a strong model (Claude Opus 4.7) interpreting raw coupling metrics produced 'lackluster, often wrong' findings when it could not distinguish intentional patterns (DI factories, shared frontend/backend schemas) from genuine coupling smells โ a near-identical judgment task to boundary-fidelity review.
Read next: extract-fowler-bockeler-static-sensors-iii (same corpus) โ read the specific failure modes an LLM shows when interpreting structural/coupling evidence without richer context.
Closes gaps elsewhere
- Architecture as Code to Teach Humans and Agents About Architecture ยท g4 โ The earlier essay left the tension between 'divergence is feedback, not failure' and 'constraints are inviolate for agents' unreconciled. This article resolves it by naming two distinct layers explicitly: deterministic gates stay inviolate, while agentic checks are advisory feedback signals that can escalate to humans and, once stable, get promoted into a new deterministic rule โ giving the reconciliation the earlier piece lacked.
Related documents
- Three more static code analysis sensors
- Comprehension at AI Speed: Building a Context Store for Evolutionary Architecture
- Your AI agent just blamed the network team. Now what?
- Inside Claude Code Auto Mode: Anthropic's Autonomous Coding System with Human Approval Gates
- Podcast: Securing AI Agents: Identity, Authorization, and the DPACT Framework
- Presentation: From AI Agent Demo to Production: Automated Testing and Evaluation
- Anthropic Details How It Contains Claude Across Web, Code, and Cowork
- AWS Launches Amazon GuardDuty Investigation Agent to Automate Threat Triage
- AWS Releases Loom, an Open-Source Reference Platform for Governing AI Agents at Enterprise Scale
- Presentation: Engineering AI for Creativity and Curiosity on Mobile