進化型アーキテクチャにエージェント型フィットネス関数を追加
本文の状態
日本語全文を表示中
詳細モードで約26分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
InfoQ AI/ML
InfoQ のアーキテクトプログラム参加者が発表したこの論文は、従来の決定論的ルールに依存する進化型アーキテクチャを拡張し、判断が求められる領域で AI エージェントを活用したフィットネス関数を導入する実装戦略と長期的価値を詳述している。
AI深層分析を開く2026年8月17日 20:26
AI深層分析
キーポイント
決定論的ルールの限界と補完
依存関係やスコープなどの計測可能な不変条件には決定論的ルールが有効だが、意図的な協働か偶発的な結合かの判断など、証拠に依存するが判断を要する領域では従来のルールだけでは対応できない。
エージェント型フィットネス関数の役割
境界の忠実性やセマンティック契約の逸脱、ワークフロー結合、古くなった ADR 仮定など、判断が重く証拠に依存するリスクに対して AI エージェント型のフィットネス関数が付加価値を発揮する。
本番環境向けの実装戦略
決定論的ゲートとエージェントによる助言信号を分離し、変更範囲に証拠を限定し、バージョン管理されたルブリックを適用して構造化された判断結果を返す実装が推奨される。
人間へのエスカレーションと学習
低信頼度または影響範囲が大きい事象は人間へエスカレーションし、パターンが繰り返されることでアーキテクチャ判断を可視化・較正可能にし、将来的に決定論的ガードレールへ変換する長期的価値を持つ。
決定論的機能の限界とアーキテクチャドリフト
決定論的なルールやスキーマ検証だけでは、意図しない結合やドメイン概念の逸脱といった微妙なアーキテクチャドリフトを検出できない。個々の変更が規則を通過しても、チームの保護しようとした意図から徐々に実装がずれていく現象は頻繁に発生する。
重要な引用
Evolutionary architecture makes the next change safer by turning architectural intent into continuous feedback rather than relying on periodic reviews, tribal memory, or late-stage governance.
A dependency rule can show that a service interaction changed; it cannot always tell whether the change represents intentional collaboration or accidental coupling.
The long-term value of agentic fitness functions is making architectural judgment more observable, calibratable, auditable, and easier to convert into deterministic guardrails when patterns repeat.
A schema diff can prove that an API still parses; it cannot always judge whether the contract still expresses the right domain concept.
編集コメントを表示
編集コメント
この論文は、AI の判断能力をソフトウェアアーキテクチャのガバナンスに組み込む実用的なアプローチを示しており、従来の静的ルールベースの検証からの脱却を促す重要な示唆を含んでいる。InfoQ の認定プログラム参加者による成果として、現場の実装課題と理論的枠組みを結びつけた実践的な知見が凝縮されている。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
重要なポイント
- 進化型アーキテクチャでは、定期的なレビューや属人的な記憶、後工程のガバナンスに頼るのではなく、アーキテクチャ上の意図を継続的なフィードバックに変換することで、次の変更をより安全に行えるようになります。
- 決定論的(デターミニスティック)なフィットネス関数は、依存関係の方向性、契約形状、レイテンシ予算、セキュリティ体制、ポリシーチェックなど、測定可能な不変条件に対する主要な強制メカニズムとして維持されるべきです。
- アーキテクチャ上のリスクが証拠に基づいているものの判断を要するケース、例えば境界の忠実度、セマンティック・コントラクトの逸脱、ワークフロー間の結合、あるいは古くなった ADR(アーキテクチャ決定記録)の前提条件などにおいては、エージェント型フィットネス関数が真価を発揮します。
- 本番環境で運用可能な実装では、決定論的なゲートとエージェントによる助言信号を分離し、証拠は変更範囲に限定し、バージョン管理された評価基準を適用し、構造化された判断結果を返す必要があります。また、信頼度が低い場合や影響範囲が大きいケースについては、人間へのエスカレーションを行います。
- エージェント型フィットネス関数の長期的な価値は、アーキテクチャ上の判断をより「可視化可能」にすることにあります。これにより、判断の較正や監査が容易になり、パターンが繰り返された場合に決定論的なガードレールへ変換しやすくなります。
*この記事は、オンライン InfoQ 認定アーキテクトプログラム の参加者によって執筆されました。これは彼らの集大成であり、AI と現代ソフトウェアアーキテクチャの交差点におけるコホート全体の学習成果を反映したものです。*
決定論的ルールからアーキテクチャ判断へ
「進化型アーキテクチャ(Evolutionary Architecture)」の根底にあるのは、シンプルな前提です。アーキテクチャは固定的な到達点として扱うべきではなく、ビジネス要件や技術選定、運用環境、チーム編成の変化に応じて、安全に進化させていく意思決定の体系と捉えるべきだという考え方です。
このアプローチが機能するのは、チームが継続的に変更を加えられる場合に限られます。その結果、アーキテクチャの本質的な特性が見えないうちに劣化することなく、ビジネス自体も進化し続けることができます。
これを可能にするのが「フィットネス関数(Fitness Functions)」です。これはアーキテクチャの意図を実行可能なフィードバックに変換する仕組みです。依存関係ルールはパッケージ境界を守り、契約テストは統合互換性を保護します。レイテンシー予算はパフォーマンスを、セキュリティスキャンはポリシー準拠を守ります。
これらの決定論的なチェックが不可欠なのは、アーキテクチャガバナンスを断続的なイベントから継続的なプロセスへと転換させるからです。
しかし、すべてのアーキテクチャ上の懸念事項をルールや閾値、スキーマ、あるいは指標に還元できるわけではありません。依存関係ルールはサービス間の相互作用が変化したことを示すことはできても、その変化が意図的な協力の結果なのか、偶発的な結合によるものなのかを常に判断することはできません。
スキーマの差分解析は API が依然としてパース可能であることを証明できますが、契約が正しいドメイン概念を表現しているかどうかを常に評価できるわけではありません。トレースは新しいランタイムパスの出現を示しますが、そのパスがワークフローの所有権を迂回していないかを必ずしも特定できるわけではありません。
ここで アジェンティック・フィットネス関数 の真価が発揮されます。これにより、進化型アーキテクチャは、決定論的な自動化と手動のアーキテクチャレビューの間の領域へと拡張されます。
アーキテクチャ意思決定記録(ADR)、所有権メタデータ、サービス境界、評価基準、そして過去の事例に基づいて調整された AI エージェントは、限定的な証拠を評価し、スコア、信頼度、根拠、エスカレーションのガイダンスを含む構造化された判断を返すことができます。
アジェンティック・フィットネス関数は、決定論的なフィットネス関数やアーキテクトを代替するものではありません。それは、証拠に基づいてはいるが機械的に判定できない懸念事項に対して、統制された判断層を追加するものです。適切に使用すれば、進化型アーキテクチャは現代のデリバリーペースに追いつくことができます。すなわち、より小さな変更、迅速なフィードバック、AI 生成コード、そしてプルリクエストや契約差分、ワークフローのトレース、エージェントが呼び出すアクションの中に現れるようになったアーキテクチャ判断です。
決定論的フィットネス関数の限界
決定論的フィットネス関数は不可欠ですが、ルール、閾値、スキーマ、または実行可能な実験に還元できるものだけを保護します。これでは、単純な測定ラインを超える大規模なアーキテクチャのドリフト(逸脱)をカバーしきれないのが現状です。
依存ルールは、あるパッケージが別のパッケージをインポートしていることをチームに伝えることができます。しかし、そのインポートが意図的な共有カーネルの結合なのか、偶発的な近道なのか、それとも境界が空洞化され始めた最初の兆候なのかを、常に判断できるわけではありません。
スキーマ差分は、API が依然としてパース可能であることを示すことができます。しかし、新しいフィールドがセマンティックモデルを維持しているのか、ドメインイベントに UI の懸念が漏れ出しているのかを、常に評価できるわけではありません。
これらは特殊なエッジケースではありません。アーキテクチャが劣化する通常の過程です。個々の変更は合理的であり、書かれたすべてのルールを通過しますが、チームが守ろうとしていた意図から、実装が徐々にずれていくのです。
歴史的には、その答えは手動レビューでした。問題は、手動レビューがすべてのプルリクエスト、すべての契約変更、すべてのワークフローの追跡、そしてエージェント生成のパッチに至るまで、スケーラブルに適用できないことです。

図 1. 決定論的なフィットネス関数は、アーキテクチャの意図を実行可能なガードレールに変換します。一方、エージェント型のフィットネス関数は、このモデルを境界の意図やセマンティックドリフト、その他の判断を要するアーキテクチャ上の懸念へと拡張します。出典:著者作成。
エージェント型フィットネス関数:予言者ではなく、調整された判断
エージェント型フィットネス関数とは、評価主体が調整済みの AI エージェントであり、判断基準が分析用ルブリックとして明文化され、出力が証拠・信頼度・根拠を伴った構造化された判定となるアーキテクチャガバナンスのチェックです。これは神託(オラクル)ではなく、決定論的なチェックを代替するものでもありません。かつては手作業に頼っていたアーキテクチャ判断を、継続的に実行可能なほど反復可能にし、監査可能なほど透明化するための手段です。
この区別が重要な理由があります。コンパイラ、リンター、スキーマバリデータ、SLO チェックなどは、明確な違反を検知した際に引き続きデプロイをブロックすべきです。一方、エージェント型フィットネス関数は通常、まずは警告信号として機能します。それがより影響力を持つようになるのは、過去の人間の判断との照合を通じて、許容される精度・再現率・ばらつきが確認された後です。それでもなお、信頼度が低い場合や、判定者の間で意見が割れる場合、影響範囲(ブラスト半径)が大きい場合、あるいはアーキテクチャのトレードオフが曖昧な場合は、必ず人間のレビュー担当者にエスカレーションする必要があります。
設計原則はシンプルです。客観的な不変条件には決定論的なゲートを使い、証拠に基づく解釈にはエージェント型判定者を使います。エージェントに渡すのは、エンタープライズ全体ではなく、小さな証拠パックに限ります。評価対象は「一般的な良いアーキテクチャ」ではなく、特定の懸念事項(ネームド・コンサーン)に限定します。出力は会話形式のエッセイではなく、機械可読な結果として返すべきです。また、ルブリック自体もコードと同様にバージョン管理され、定期的に見直されるべきものです。

図 2:アジェンティック・フィットネス関数は、決定論的ゲートの隣に位置します。これはスコープを限定した証拠パックを受け取り、構造化された判断を下し、信頼度が低い結果については黙って平均化して消去するのではなく、上級者へエスカレーションします。出典:著者作成。
本番環境対応型アジェンティック・フィットネス関数:構成要素と ADK リファレンス実装
本番環境で運用可能なアジェンティック・フィットネス関数は、自由な AI レビューとして扱うのではなく、実行可能なガバナンスコンポーネントとして捉える必要があります。その価値は明確な実行境界から生まれます。具体的には、特定のアーキテクチャ上の懸念事項を受け取り、限定的な証拠を評価し、名付けられたルブリック(評価基準)を適用した上で、保存・傾向分析・監査が可能な構造化された判断を出力します。
基本構成は 4 つの要素から成り立っています。第一に「フィットネス関数の意図」です。これはチームが守りたいアーキテクチャ上の懸念事項(例:境界の忠実度、セマンティック・コントラクトの整合性、ADR の逸脱など)を指します。第二に「証拠契約」です。審査官が検査対象として許容される限定的なアートのセット(PR の差分、変更された API 仕様、関連する ADR、所有権メタデータ、サービスカタログエントリー、決定論的チェックの出力結果、またはトレースウィンドウなど)を定義します。第三に「アジェンティック・ジャッジ」です。証拠に対して分析ルブリックを適用する調整済みの AI エージェントを指します。第四に「構造化された判断」です。スコア、信頼度、違反した基準、根拠、証拠への参照、推奨アクションを含む機械可読の結果です。
このパターンを具体化するため、ADK ベースの参考実装を作成しました。agentic-fitness-functions
この実装では、エージェント型フィットネス関数をパイプラインとしてモデル化しています。プルリクエストや契約差分といった変更イベントは、スコープを限定した証拠パックに変換されます。まず決定論的なチェックが実行され、依存関係のルール、スキーマ検証、ポリシーチェック、閾値ベースのゲートといった客観的制約の責任を負います。その後、ADK ベースのアーキテクチャ判断者が評価基準を用いて残りの判断を要する課題を評価し、構造化された結論を出力します。
重要な設計上の選択は、責務の分離にあります。このフレームワークがエージェントに決定論的なフィットネス関数を置き換えるよう求めているわけではありません。むしろ、エージェントをその隣に配置し、証拠に基づきつつも固定ルールに単純化できない課題を評価させるのです。例えば、依存関係のルールは新しいサービス間の相互作用を検出できますが、エージェント型判断者は、それが意図的な協力なのか、偶発的な結合なのか、それとも境界の忠実性に関するリスクなのかを評価できます。同様に、スキーマ差分で API が後方互換性を保っていることが示されても、エージェントはその契約がドメインの意味を依然として保持しているかどうかを判断できます。

図 3:懸念事項がルールや閾値として明確に表現できる場合は、決定論的な適合度関数を使用してください。一方、境界を定めた証拠に対して一貫して適用可能な評価基準(ルブリック)が存在する場合は、エージェント型適合度関数を使用します。真の曖昧さに対するマニュアルも用意しておきましょう。
出典:著者作成
最小限の構造化された判断
{
"fitness_function": "checkout-boundary-fidelity",
"rubric_version": "2026.07.01",
"score": 0.68,
"confidence": 0.74,
"decision": "advisory_warn",
"violated_criteria": [ "semantic coupling"],
"evidence": ["ADR-014", "OrderEvent.diff", "PaymentSession DTO"],
"recommended_action": "Move PaymentSession behind a checkout-owned adapter or create an explicit shared-kernel ADR.",
"deterministic_rule_candidate": "Disallow public events from exporting internal payment-state DTOs."
}較正と制御
エージェント型適合度関数は、実際の適用に影響を与える前に較正が必要です。実用的な較正セットには、アーキテクチャコミュニティがすでに「許容可能」「リスクあり」「不可」と分類済みの過去の改修事例を 20〜50 件含めるのが目安です。
これらの事例に対して評価モデル(ジャッジ)を実行し、誤検知(偽陽性)、見落とし(偽陰性)、および結果のばらつきが把握できるまで評価基準を調整します。モデル、プロンプト、評価基準、ツールチェーン、あるいは証拠契約に変更があった際は、必ずセットを再実行してください。
不確実性を隠してはいけません。信頼度は判断の一部です。2 つの評価者間で意見が分かれた場合、繰り返し実行した結果に大きなばらつきがある場合、あるいは必要な証拠が不足している場合は、必ず人間による確認へエスカレーションしてください。意見の相違を平均化して消し去ることは危険です。なぜなら、意見の相違こそが、アーキテクチャ上のトレードオフが実際に存在するという重要なシグナルであることが多いからです。
また、報酬ハッキングやプロンプトインジェクションに対する制御も必要です。エージェントは、コードコメント、PR の説明、ログ、生成ファイル内に記載された指示を無視すべきですが、それらのアーティファクトが証拠として明示的にリストされている場合は例外とします。可能な限り、判定を行うモデル(judge model)はコードを生成したエージェントから隔離しておくべきです。評価基準の変更はプルリクエストレビューを経るものとし、判定データは監査、トレンド分析、再調整のために保持する必要があります。
| 失敗モード | アーキテクチャガバナンスにおける現れ方 | 制御策 |
|---|---|---|
| 位置バイアス | 判定者は最初に読み込んだ設計(古いアーキテクチャか新しい変更か)を好む。 | 高インパクトの変更については両方の順序で評価し、評決を比較する。 |
| 冗長性バイアス | コードの証拠よりも、より長い PR 説明や豊富なコメントの方が説得力があるように見える。 | 文章の長さではなく証拠に対してスコアリングし、基準を具体的に保つ。 |
| 自己増強バイアス | モデルは自身が生成したコードパターンに類似したコードパターンを好む。 | 別の判定者モデルを使用するか、独立した基準所有者を採用する。 |
| 非決定性 | 同じ証拠でも実行ごとにスコアが大幅に異なる。 | 複数回実行し、ばらつきをシグナルではなく低信頼度として扱う。 |
| プロンプトインジェクション | diff コメントが判定者に特定の基準を無視するよう指示する。 | リポジトリの内容は証拠として扱い、判定者の指示として決して扱わない。 |
| 基準のドリフト | 基準が徐々に変化し、ADR やガバナンスの意図を反映しなくなる。 | 基準にバージョン管理を行い、レビューを必須とし、時系列キャリブレーションチェックを実行する。 |
エージェント型フィットネス関数の 3 つの例
以下の事例は、エージェント AI が特に効果を発揮する場面を示しています。各事例では、可能な限り決定論的な制御平面を維持し、従来はシニアレビュアーが必要だった解釈層のみをエージェントに任せるというアプローチをとっています。
バウンダリー・フィデリティ・レビュアー
決定論的な依存関係ルールを用いれば、パッケージが禁止されたパッケージをインポートするといった明らかなバウンダリー違反を検出することは可能です。しかし、より難しい課題は、明示的な依存関係ルールに違反していないにもかかわらず、変更によってビジネス機能の所有権(オーナーシップ)が弱体化していないかを特定することです。
アーキテクチャの侵食(アーキテクチュラル・イロージョン)は、違法なインポートとして現れるのではなく、共有された抽象化の実装詳細の漏洩、ビジネスロジックの重複、あるいはサービス間の調整コストの増大といった形で現れることがほとんどです。
エージェント型の「バウンダリー・フィデリティ・レビュアー」は、プルリクエストを ADR(アーキテクチャ決定記録)、サービスの所有権メタデータ、パッケージグラフ、CODEOWNERS、そしてリポジトリ全体の文脈に対して評価します。これにより、アーキテクチャの意図について推論を行うことが可能になります。具体的には、セマンティックな結合、隠れた調整経路、共有状態の抽象化、およびアーキテクチャが明示的に許可していない境界領域をまたぐ知識の横断などを検出対象とします。
最終的な判断結果には、バウンダリー・フィデリティスコア、根拠となる参照情報、信頼度レベル、そして推奨アクションが含まれます。決定論的な依存関係解析を置き換えるのではなく、それを補完するものとして機能し、微妙な境界の侵食を早期に発見するとともに、人間の判断が最も価値を発揮できる領域へアーキテクチャ上の注目を向けさせる役割を果たします。
セマンティック・コントラクト・ evaluator
スキーマバリデーターは、API やイベントが構造的に互換性を保つことを保証しますが、互換性があるからといって、必ずしも優れたアーキテクチャ境界が守られているわけではありません。契約が後方互換性を維持している間も、内部識別子やインフラに関する懸念事項、UI 固有のフィールド、プロバイダーの実装詳細などが徐々に露出し、消費者をサービスに不必要に結合させてしまう可能性があります。
エージェント型のセマンティック・コントラクト・ evaluator(評価者)は、OpenAPI や AsyncAPI の差分、サンプルペイロード、消費者側の契約、ADR(アーキテクチャ決定記録)、そして API デザインガイダンスをレビューします。これにより、契約が依然として消費者中心であり、意味的にまとまっており、ドメイン言語で表現されているかを評価します。これは単なる構造ではなく、インターフェースの意味について推論を行います。
判断結果には、セマンティック・コヒーシンスコア(意味的凝集性スコア)、結合リスクの評価、根拠となる参照情報、信頼度レベル、そして推奨アクションが含まれます。決定論的なバリデーターは引き続きスキーマの互換性を強制しますが、エージェントは意味、抽象化、長期的な結合リスクに関するアーキテクチャ解釈を提供します。
ADR ドリフト監視器
アーキテクチャ上の意思決定が有効なのは、その背後にある前提条件が依然として成立している間だけです。ADR は、トラフィックが少ないため同期通信を正当化したり、一時的な共有データベースを受け入れたり、組織的または運用上の制約に基づいて特定のトレードオフを許容したりする場合があります。システムが進化するにつれて、実装が文書化された決定に準拠し続けているにもかかわらず、それらの前提条件は静かに無効になってしまうことがあります。
エージェント型 ADR ドリフト監視システムは、定期的に ADR(アーキテクチャ決定記録)の前提条件と、運用メトリクス、インシデント、コスト動向、依存関係グラフ、デプロイパターン、所有権の変更などを比較します。コード変更そのものを評価するのではなく、アーキテクチャ判断が現在の状況に依然として合致しているかを検証し、アーキテクチャのズレ(ドリフト)を示す証拠を特定します。
この判定結果では、元の前提条件、変化が生じた根拠、それによるアーキテクチャ上のリスク、信頼度のレベル、そして推奨される見直し手順が示されます。ビルドを失敗させるのではなく、もはや有効ではない可能性のある判断の再検討を、積極的にアーキテクトに促す仕組みです。
実践的なガイドライン
- ハードゲートは決定論的に保つこと。ルール、スキーマ、しきい値、ポリシー、または反復可能な実験として表現できる条件には、決定論的なチェックを使用してください。信頼性の高いゲートを確率的な判断に置き換えてはいけません。
- 最初は助言モードから始めること。新しいエージェント型フィットネス関数は、そのシグナルが安定しており有用で、行動を起こす価値があると検証されるまで、必ず助言モードで実行してください。
- 証拠の範囲を変更点に限定すること。エージェントには、PR の差分、変更された契約、ローカルの依存関係グラフ、関連する ADR、そしてコードベース全体ではなく小さなトレースウィンドウを提供してください。
- 分析用ルブリックを使用すること。判断は名前付きの基準に分解してください。単一のアーキテクチャ品質スコアでは行動に移せませんが、基準レベルでの判定なら実行可能です。
人間の判断を優先する仕組みを保つこと。信頼度が低い場合、審査員間の意見が対立する場合、影響範囲が大きい場合、あるいはトレードオフの判断が曖昧な場合は、迷わず人間によるレビューへエスカレーションしてください。
安定した知見を広めること。エージェントからの発見が繰り返し現れ、チームがそれが実際の違反であると合意した場合、それを名前付きのルブリック基準または決定論的なルールとして確立してください。
審査員をバージョン管理すること。プロンプト、ルブリック、キャリブレーションセット、モデルバージョン、ツール定義はすべて、厳格に管理されるアーティファクトとして扱ってください。
証拠の追跡を検証すること。証拠への参照、判断結果、信頼度、根拠、およびフォローアップアクションを保存し、後日チームが意思決定を再検討できるようにしてください。
統制された建築的判断へ向けて
進化型アーキテクチャは、システムの最終形態を予測するものではありません。重要なのは、次の意味のある変更を安全かつ観測可能にし、元に戻せるようにするとともに、組織が重視するアーキテクチャ特性に合致させることです。フィットネス関数がその中核となるメカニズムです。なぜなら、これによりガバナンスは断片的な意見から、継続的なフィードバックへと転換されるからです。
Agentic AI は、これまで手作業に頼っていた領域へとその仕組みを拡張します。限定された証拠を検証し、適切に調整された評価基準を適用することで、決定論的なルールでは完全に捉えきれない懸念事項——意味の drifting(ドリフト)、境界の忠実度、レジリエンス解釈、そして陳腐化したアーキテクチャ上の前提——について構造化された判断を下すことが可能です。これは、これらの判断がすでにアーキテクチャの実践現場に存在しているからこそ価値があります。エージェントはそれらを新たに発明するのではなく、観察可能になるほど反復可能なものとし、改善のために規律あるものにします。
安全なパターンは保守的です。決定論的なゲートはあくまでゲートとして維持し、Agentic チェックを適切に調整されたシグナルとして活用します。不確実性が高まった場合はエスカレーションし、評価基準はバージョン管理を行い、時間経過とともに再調整を行います。可能な限り、繰り返し発見された課題は決定論的なチェック項目へと昇格させます。このように用いることで、Agentic Fitness Functions は自動化されたソフトウェアガバナンスの実用的な拡張となります。つまり「判断をコード化する」アプローチですが、判断には依然として証拠、文脈、そして説明責任が必要であるという謙虚さを伴ったものです。
References
- Neal Ford, Rebecca Parsons, Patrick Kua, and Pramod Sadalage, Building Evolutionary Architectures: Automated Software Governance, 2nd ed. O'Reilly, 2022.
- Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software. Addison-Wesley, 2003.
- Matthew Skelton and Manuel Pais, Team Topologies: Organizing Business and Technology Teams for Fast Flow. IT Revolution Press, 2019.
- Sam Newman, Building Microservices, 2nd ed. O'Reilly, 2021.
Martin Fowler 氏の「消費者主導契約(Consumer-Driven Contracts)」や、進化型アーキテクチャ、アーキテクチャ決定記録に関する関連記事。
著者について
Hemant Kumar Mahato
Hemant Kumar Mahato氏は、Space Inventive のシニア AI ソリューションアーキテクト兼 UAE 地域責任者を務めています。規制の厳しい環境やリスクの高い現場において、企業の AI ストラテジーとアーキテクチャを主導しています。
AI、クラウド、プラットフォームエンジニアリング、組織設計の交差点で活動し、実験段階から、耐障害性がありスケーラブルかつガバナンス可能な本番システムへの移行を支援しています。彼の関心は、変化するビジネスニーズに合わせて進化しつつも、イノベーション、信頼性、運用卓越性、そして長期的な適応性をバランスよく取り入れたアーキテクチャを構築することにあります。
Łukasz Sieczkowski
Łukasz Sieczkowski氏は、グローバル物流ネットワーク(GLN)を開発する Descartes Systems Group のソフトウェアアーキテクトです。機械学習や大規模言語モデルに興味を持ち、サイクリングを愛好しています。
Vijayasenthilkumar Kuppusamy
Vijayasenthilkumar Kuppusamy氏は、クラウドプラットフォーム、ソフトウェアアーキテクチャ、分散システム、AI に焦点を当てたシニアソフトウェアエンジニアです。複雑なエンジニアリング課題の解決や、システム思考や科学・技術からのアイデアが、より優れたソフトウェアとエンジニアリングプラクティスをどのように形作るかを模索することに情熱を注いでいます。
原文を表示
要点
- Evolutionary architecture makes the next change safer by turning architectural intent into continuous feedback rather than relying on periodic reviews, tribal memory, or late-stage governance.
- Deterministic fitness functions should remain the primary enforcement mechanism for measurable invariants such as dependency direction, contract shape, latency budgets, security posture, and policy checks.
- Agentic fitness functions add value when architectural risk is evidence-bound but judgement-heavy, such as boundary fidelity, semantic contract drift, workflow coupling, and stale ADR assumptions.
- A production-ready implementation separates deterministic gates from agentic advisory signals, scopes evidence to the change, applies versioned rubrics, returns structured verdicts, and escalates low-confidence or high-blast-radius outcomes to humans.
- The long-term value of agentic fitness functions is making architectural judgment more observable, calibratable, auditable, and easier to convert into deterministic guardrails when patterns repeat.
*This article was written by participants of the online InfoQ Certified Architect Program. It represents the capstone of their work, reflecting the cohort's collective learnings on the intersection of AI and modern software architecture.*
From Deterministic Rules to Architectural Judgment
Evolutionary architecture is built on a simple premise: architecture should not be treated as a fixed target state, but as a system of decisions that can evolve safely as business needs, technology choices, operating conditions, and team structures change. The discipline works when teams can make change continuously; as a result, business evolves, without allowing the architecture’s important characteristics to erode invisibly.
Fitness functions are the mechanism that makes this possible. They turn architectural intent into executable feedback. A dependency rule can protect package boundaries. A contract test can protect integration compatibility. A latency budget can protect performance. A security scan can protect policy compliance. These deterministic checks are essential because they make architectural governance continuous rather than episodic.
But not every architectural concern can be reduced to a rule, threshold, schema, or metric. A dependency rule can show that a service interaction changed; it cannot always tell whether the change represents intentional collaboration or accidental coupling.
A schema diff can prove that an API still parses; it cannot always judge whether the contract still expresses the right domain concept. A trace can reveal a new runtime path; it cannot always determine whether that path bypasses workflow ownership.
This is where agentic fitness functions become useful. They extend evolutionary architecture into the space between deterministic automation and manual architectural review.
An AI agent, calibrated against architecture decision records, ownership metadata, service boundaries, rubrics, and historical examples, can evaluate bounded evidence and return a structured judgment with score, confidence, rationale, and escalation guidance.
Agentic fitness functions do not replace deterministic fitness functions or architects. They add a governed judgment layer for concerns that are evidence-bound but not mechanically decidable. Used carefully, they help evolutionary architecture keep pace with modern delivery: smaller changes, faster feedback, AI-generated code, and architectural decisions that now surface inside pull requests, contract diffs, workflow traces, and agent-invoked actions.
The Ceiling of Deterministic Fitness Functions
Deterministic fitness functions are indispensable, but they only protect what can be reduced to a rule, a threshold, a schema, or an executable experiment. That still leaves a large class of architectural drift above the line of simple measurement.
A dependency rule can tell a team that a package imported another package. It cannot always determine whether the import represents intentional shared-kernel coupling, an accidental shortcut, or the first sign that a boundary is being hollowed out. A schema diff can show that an API still parses. It cannot always judge whether the new field preserves the semantic model or leaks a UI concern into a domain event.
These are not exotic edge cases. They are the normal way architecture decays: through individually reasonable changes that pass every written rule while slowly moving the implementation away from the intent the team believed it had protected. Historically, the answer was manual review. The problem is that manual review does not scale down to every pull request, every contract change, every workflow trace, or every agent-generated patch.

Figure 1. Deterministic fitness functions turn architectural intent into executable guardrails; agentic fitness functions extend that model into boundary intent, semantic drift, and other judgment-heavy architectural concerns. Source: author-created.
Agentic Fitness Functions: Calibrated Judgment, Not Oracles
An agentic fitness function is an architecture governance check whose evaluator is a calibrated AI agent, whose criteria are expressed as an analytic rubric, and whose output is a structured verdict with evidence, confidence, and rationale. It is not an oracle. It is not a replacement for deterministic checks. It is a way to make some formerly manual architectural judgments repeatable enough to run continuously and transparent enough to audit.
The distinction matters. A compiler, linter, schema validator, or SLO check should continue to block deployment when it detects a clear violation. An agentic fitness function should usually begin as an advisory signal. It becomes more influential only after calibration against prior human decisions demonstrates acceptable precision, recall, and variance. Even then, low confidence, judge disagreement, high blast radius, or ambiguous architectural trade-offs should escalate to a human reviewer.
The design principle is simple: use deterministic gates for objective invariants and agentic judges for evidence-bound interpretation. The agent should be given a small evidence pack, not the whole enterprise. It should evaluate a named concern, not "good architecture" in general. It should return a machine-readable result, not a conversational essay. And the rubric itself should be versioned and reviewed like code.

Figure 2. Agentic fitness functions sit beside deterministic gates. They consume a scoped evidence pack, produce structured verdicts, and escalate low-confidence outcomes instead of silently averaging them away. Source: author-created.
Production-Ready Agentic Fitness Function: Anatomy and ADK Reference Implementation
A production-ready agentic fitness function should be treated as an executable governance component, not as a free-form AI review. Its value comes from a clear execution boundary: it receives a specific architectural concern, evaluates bounded evidence, applies a named rubric, and emits a structured verdict that can be stored, trended, and audited.
The basic anatomy has four parts. First, there is a fitness-function intent: the architectural concern the team wants to protect, such as boundary fidelity, semantic contract integrity, or ADR drift. Second, there is an evidence contract: the limited set of artifacts the judge is allowed to inspect, such as the PR diff, changed API specification, relevant ADRs, ownership metadata, service catalog entry, deterministic-check output, or trace window. Third, there is an agentic judge: a calibrated AI agent that applies an analytic rubric to the evidence. Fourth, there is a structured verdict: a machine-readable result containing score, confidence, violated criteria, rationale, evidence references, and recommended action.
To make this pattern concrete, we created a small ADK-based reference implementation: agentic-fitness-functions.
The implementation models an agentic fitness function as a pipeline. A change event, such as a pull request or contract diff, is converted into a scoped evidence pack. Deterministic checks run first and remain responsible for objective constraints such as dependency rules, schema validation, policy checks, and threshold-based gates. The ADK-based architecture judge then evaluates the remaining judgment-heavy concerns using a rubric and produces a structured verdict.
The important design choice is separation of responsibility. The framework does not ask the agent to replace deterministic fitness functions. Instead, it places the agent beside them, where it can evaluate concerns that are evidence-bound but not easily reducible to a fixed rule. For example, a dependency rule may detect that a new service interaction exists; the agentic judge can assess whether that interaction is intentional collaboration, accidental coupling, or a boundary-fidelity risk. A schema diff may show that an API remains backward compatible; the agent can assess whether the contract still preserves domain meaning.

Figure 3. Use deterministic fitness functions when the concern can be expressed as a rule or threshold. Use agentic fitness functions when a calibrated rubric can be applied consistently to bounded evidence. Keep a true ambiguity manual. Source: author-created.
A Minimal Structured Verdict
{
"fitness_function": "checkout-boundary-fidelity",
"rubric_version": "2026.07.01",
"score": 0.68,
"confidence": 0.74,
"decision": "advisory_warn",
"violated_criteria": [ "semantic coupling"],
"evidence": ["ADR-014", "OrderEvent.diff", "PaymentSession DTO"],
"recommended_action": "Move PaymentSession behind a checkout-owned adapter or create an explicit shared-kernel ADR.",
"deterministic_rule_candidate": "Disallow public events from exporting internal payment-state DTOs."
}Calibration and Controls
Agentic fitness functions require calibration before they influence delivery. A practical calibration set includes 20 to 50 prior changes that the architecture community has already classified as acceptable, risky, or unacceptable. Run the judge against those examples and tune the rubric until false positives, false negatives, and variance are understood. Re-run the set whenever the model, prompt, rubric, tool chain, or evidence contract changes.
Do not hide uncertainty. Confidence is part of the verdict. Disagreement between two judges, large variance across repeated runs, or missing evidence should escalate to a person. Averaging away disagreement is dangerous because disagreement is often the signal that the architectural trade-off is real.
The system also needs controls against reward hacking and prompt injection. The agent should ignore instructions found in code comments, PR descriptions, logs, or generated files unless those artifacts are explicitly listed as evidence. The judge model should be isolated from the agent that produced the code where possible. Rubric changes should go through pull request review, and verdict data should be retained for audit, trend analysis, and recalibration.
| Failure mode | How it appears in architecture governance | Control |
|---|---|---|
| Position bias | The judge favors the first design it reads: old architecture or new change. | Evaluate both orderings for high-impact changes and compare verdicts. |
| Verbosity bias | A longer PR description or richer comments appear more convincing than the code evidence. | Score against evidence, not prose length; keep criteria specific. |
| Self-enhancement bias | A model favors code patterns similar to those it generated. | Use a separate judge model or independent rubric owner. |
| Non-determinism | The same evidence yields materially different scores across runs. | Repeat runs; treat variance as low confidence, not as signal. |
| Prompt injection | A diff comment instructs the judge to ignore a criterion. | Treat repository content as evidence, never as judge instructions. |
| Rubric drift | Criteria slowly change until they no longer reflect the ADR or governance intent. | Version rubrics, require review, and run a temporal calibration check. |
Three Examples of Agentic Fitness Functions
The following examples show where agentic AI is useful. Each example keeps a deterministic control plane wherever possible and uses the agent only for the interpretive layer that previously required a senior reviewer.
Boundary-Fidelity Reviewer
Deterministic dependency rules can detect obvious boundary violations, such as one package importing a forbidden package. The harder problem is identifying whether a change weakens the ownership of a business capability without breaking any explicit dependency rule. Architectural erosion often appears as shared abstractions, leaked implementation details, duplicated business logic, or increasing coordination between services rather than as illegal imports.
An agentic Boundary-Fidelity Reviewer evaluates the pull request against ADRs, service ownership metadata, package graphs, CODEOWNERS, and repository context to reason about architectural intent. It looks for semantic coupling, hidden coordination paths, shared state abstractions, and knowledge crossing bounded contexts that the architecture has not explicitly sanctioned.
The verdict includes a boundary-fidelity score, evidence references, confidence level, and a recommended action. Rather than replacing deterministic dependency analysis, it complements it by identifying subtle boundary erosion early and directing architectural attention where human judgment is most valuable.
Semantic Contract Evaluator
Schema validators ensure that APIs and events remain structurally compatible, but compatibility does not guarantee good architectural boundaries. A contract may remain backward compatible while gradually exposing internal identifiers, infrastructure concerns, UI-specific fields, or provider implementation details that unnecessarily couple consumers to the service.
An agentic Semantic Contract Evaluator reviews OpenAPI or AsyncAPI diffs, sample payloads, consumer contracts, ADRs, and API design guidance to assess whether the contract remains consumer-focused, semantically cohesive, and expressed in the domain language. It reasons about the meaning of the interface rather than only its structure.
The verdict includes a semantic cohesion score, coupling risk assessment, evidence references, confidence level, and a recommended action. Deterministic validators continue to enforce schema compatibility, while the agent provides architectural interpretation about meaning, abstraction, and long-term coupling risk.
ADR Drift Monitor
Architectural decisions remain valid only while the assumptions behind them continue to hold. An ADR may justify synchronous communication because traffic is low, accept a shared database as temporary, or tolerate a particular trade-off based on organizational or operational constraints. As systems evolve, those assumptions can quietly become invalid even though the implementation still conforms to the documented decision.
An agentic ADR Drift Monitor periodically compares ADR assumptions against operational metrics, incidents, cost trends, dependency graphs, deployment patterns, and ownership changes. Instead of evaluating code changes, it evaluates whether architectural decisions still match the current reality and identifies evidence of architectural drift.
The verdict identifies the original assumption, the evidence that has changed, the resulting architectural risk, confidence level, and a recommended review path. It does not fail builds; instead, it proactively prompts architects to revisit decisions whose original rationale may no longer be valid.
Practical Guidelines
- Keep hard gates deterministic. Use deterministic checks for conditions that can be expressed as rules, schemas, thresholds, policies, or repeatable experiments. Do not replace reliable gates with probabilistic judgment.
- Start advisory. Run every new agentic fitness function in advisory mode until calibration proves that its signal is stable, useful, and worth acting on.
- Scope evidence to the change. Provide the agent with the PR diff, touched contracts, local dependency graph, relevant ADRs, and a small trace window rather than an entire codebase.
- Use analytic rubrics. Break judgment into named criteria. A single architecture quality score is not actionable; a criterion-level verdict is.
- Preserve human escalation. Low confidence, judge disagreement, high blast radius, or ambiguous trade-offs should route to a human reviewer immediately.
- Promote stable findings. When agentic findings recur, and the team agrees they represent real violations, convert them into a named rubric criterion or a deterministic rule.
- Version the judge. Treat prompts, rubrics, calibration sets, model versions, and tool definitions as governed artifacts.
- Audit the evidence trail. Store the evidence references, verdict, confidence, rationale, and follow-up action so the team can review the decision later.
Toward Governed Architectural Judgment
Evolutionary architecture is not about predicting the final form of a system. It is about making the next meaningful change safe, observable, reversible, and aligned with the architectural characteristics the organization values. Fitness functions are the core mechanism because they turn governance from episodic opinion into continuous feedback.
Agentic AI extends that mechanism into a previously manual space. It can review bounded evidence, apply a calibrated rubric, and return a structured judgment about concerns that deterministic rules do not fully capture: semantic drift, boundary fidelity, resilience interpretation, and stale architectural assumptions. That is useful precisely because these judgments already exist in architecture practice. The agent does not invent them; it makes them repeatable enough to observe and disciplined enough to improve.
The safe pattern is conservative. Keep deterministic gates as gates. Use agentic checks as calibrated signals. Escalate uncertainty. Version the rubrics. Recalibrate over time. Promote repeated findings into deterministic checks when possible. Used this way, agentic fitness functions become a pragmatic extension of automated software governance: judgment as code, but with the humility that judgment still needs evidence, context, and accountability.
References
- Neal Ford, Rebecca Parsons, Patrick Kua, and Pramod Sadalage, Building Evolutionary Architectures: Automated Software Governance, 2nd ed. O'Reilly, 2022.
- Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software. Addison-Wesley, 2003.
- Matthew Skelton and Manuel Pais, Team Topologies: Organizing Business and Technology Teams for Fast Flow. IT Revolution Press, 2019.
- Sam Newman, Building Microservices, 2nd ed. O'Reilly, 2021.
- Martin Fowler, "Consumer-Driven Contracts" and related articles on evolutionary architecture and architecture decision records.
About the Authors
Hemant Kumar Mahato
Hemant Kumar Mahato is a Principal AI Solution Architect and Regional Head – UAE at Space Inventive, leading enterprise AI strategy and architecture across regulated and high-stakes environments. He works at the intersection of AI, cloud, platform engineering, and organizational design, helping enterprises move from experimentation to resilient, scalable, and governable production systems. His focus is on shaping architectures that evolve with changing business needs while balancing innovation, trust, operational excellence, and long-term adaptability.
Show moreShow less
Łukasz Sieczkowski
Łukasz Sieczkowski is Software Architect at Descartes Systems Group, the company behind the Global Logistics Network (GLN). Curious about machine learning and large language models. Passionate about cycling.
Show moreShow less
Vijayasenthilkumar Kuppusamy
Vijaysenthilkumar Kuppusamy is a Staff Software Engineer focused on cloud platforms, software architecture, distributed systems, and AI. He is passionate about solving complex engineering problems and exploring how systems thinking and ideas from science and technology can shape better software and engineering practices.
Show moreShow less
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み