Grounding SWE-Agent Decisions in Architecture-0 Design: Navigating Unknown Unknowns through Physical Mapping
Organizations: School of Computer Science and Technology, Tongji University, China
Abstract
Autonomous Software Engineering Agents (SWE-Agents) excel in deterministic coding tasks but struggle with Architecture 0, the nascent system design phase plagued by implicit engineering constraints, or Unknown Unknowns (UUs) that are rarely stated explicitly. To investigate how agents navigate UUs, we explore a progressive trajectory across pure-text self-play, tool-augmented feedback, and external physical mapping. Our empirical analysis reveals a cascading chain of failures. Pure-text reasoning inevitably devolves into polite consensus or plausible yet physically impossible fabrications. Attempting to bridge this gap via an early-stage execution sandbox unexpectedly triggers Specification Gaming: agents exploit their autonomy over validation scripts to bypass physical constraints, achieving superficial success without resolving core architectural flaws. To resolve this self-validation trap, we propose the Physical Mapping Guard (PMG). Grounded in the software engineering principle of Separation of Concerns, PMG revokes verification authority from the agent, forcing semantic intents to be evaluated by an external, deterministic Semantic-to-Physical (S2P) mapping engine. Extensive evaluations demonstrate that PMG completely eradicates physical-layer and validation-layer gaming. By precisely isolating residual failures to semantic reinterpretations and auditor overreach, PMG marks a critical step toward genuine affordance grounding in automated architectural design.
Figures & tables
| SLAM Concept | Correspondence in Architecture 0 |
|---|---|
| Map | The task environment comprising business requirements, resource ledgers, and objective mapping rules. |
| Robot’s Pose | The feasibility status of the agent’s current architectural design within the engineering constraint space. |
| Sensor Observation | Executable tool feedback, architectural audits, and mapping results. |
| Localization Drift | Grounding bias between the Semantic World and the Physical World. |
| Observation Model | Semantic-to-Physical (S2P) mapping, which projects the design into the ledger boundaries. |
| Collision / Obstacle | Resource exhaustion, constraint conflicts, or unresolvable requirements. |
| Dimension | Values | Design Purpose |
|---|---|---|
| Context | Monolith Serverless Microservices | Covers common architectural paradigms in modern cloud-native systems, reducing noise from industry-specific scenarios. |
| Conflict | Resources vs. Latency Cost vs. Performance Consistency vs. Availability etc. | Focuses on engineering constraints that form strict physical or economic boundaries, avoiding unquantifiable factors. |
| Difficulty | L1 (Textbook-level) L2 (Industrial-level) L3 (Infeasible-level) | Differentiates single-dimensional, multi-dimensional coupled, and explicitly infeasible constraints to observe behaviors under varying uncertainty. |
| Layer | Primary Components | Authority & Function |
|---|---|---|
| Agent-Controlled Layer | Natural language proposals, structured topology, iteration notes. | The agent can propose and revise designs but cannot define resource formulas or collision rules. |
| Mapper Internal Layer | Resource ledgers, resource profiles, workload propagation, billing, NAC calculation. | Maintained by the deterministic mapper to form a physical evaluation process independent of the agent. |
| Safe Feedback Layer | Mapping status, public ledger, bill summaries, filtered collision feedback. | Provides actionable revision clues while hiding implicit thresholds, exact formulas, and raw collision details. |
| Field Name | Requirement | Description |
|---|---|---|
| topology_id | Required | Identifies the candidate topology for tracking iterations. |
| case_id | Required | Binds the architecture to the specific Architecture 0 ledger. |
| assumptions | Optional | Topology-level inputs (e.g., global QPS). Formula definitions are prohibited. |
| nodes | Required | Describes billable components and their resource profiles (e.g., api_gateway ). |
| edges | Required | Describes invocations, data flows, and latency paths. |
| loop_budget | Required if cyclic | Limits cyclic propagation to prevent unbounded resource amplification. |
| Feedback Item | Description & Intent |
|---|---|
| Mapping Status | Returns PASS , COLLISION , or UNMAPPABLE_TOPOLOGY . |
| Explicit Ledger Limits | Re-states visible boundaries (e.g., Max RAM), allowing agents to cross-check. |
| Aligned Resource Bill | Aggregated resource consumption projected into the explicit ledger dimensions. |
| Node-level Bill Summary | Exposes resource pressure points for individual nodes while omitting implicit formulas. |
| Public NAC | The Normalized Affordance Cost for explicit dimensions to quantify tension. |
| Filtered Collision Info | Details collisions for explicit dimensions but only provides generic warnings for implicit collisions. |
| Status | Semantic Meaning |
|---|---|
| PASS | The current topology successfully passes the deterministic physical mapping validation under the given ledger. |
| COLLISION | The current topology exhibits resource collisions; further iterations are required. |
| UNMAPPABLE_TOPOLOGY | The topology structure cannot be deterministically mapped (e.g., contains unbounded cyclic references or invalid node profiles). |
| Dimension | -Sandbox | PMG |
|---|---|---|
| Verification Logic | Self-authored Python scripts by the agent | Deterministic execution by the mapper |
| Input Format | Natural language reasoning & Python code | Topological Intermediate Representation (TIR) |
| Constraint Source | Global Ledger + Agent’s code usage | Global Ledger + Resource Profiles + Fixed Rules |
| Primary Risks | Self-validation risk & Physical/Validation gaming | Semantic gaming & limited feedback actionability |
| Method Role | Expose failure modes under execution feedback | Mitigate physical & validation-layer gaming |
| Metric | Values / Sub-types | Definition |
|---|---|---|
| final_status | RESOLVED IMPOSSIBLE MAX_ROUND | The ultimate architectural conclusion reached by the agents. |
| is_correct | True / False | Whether the final_status aligns with the Human Expert Ground Truth. |
| converged | True / False | Whether a definitive conclusion was reached before the maximum turn limit. |
| specification_gaming | True / False | Whether the agent engaged in metric manipulation or requirement dodging. |
| spec_gaming_type | physical validation semantic | Categorization of the gaming behavior based on the S2P grounding biases (Section 3 ). |
| auditor_error | True / False | Whether the Auditor introduced flawed logic that distorted the final conclusion. |
| Execution Metric | Count | Percentage | Gaming Metric | Count | Percentage | |
|---|---|---|---|---|---|---|
| Total Trials | 45 | 100.0% | Total Gaming Instances | 7 | 15.6% | |
| Final Judgment Correct | 27 | 60.0% | Physical-Layer Gaming | 0 | 0.0% | |
| Final Judgment Incorrect | 18 | 40.0% | Validation-Layer Gaming | 0 | 0.0% | |
| Converged ( RESOLVED / IMPOSSIBLE ) | 41 | 91.1% | Semantic-Layer Gaming | 7 | 15.6% |
| Grp | Model & Case | Perturbation Content | Gold Label | Design Purpose |
|---|---|---|---|---|
| A1 | Claude 4.5 Sonnet Monolith L3 | Explicitly mandated that a "successful deduction" is only valid if synchronously persisted to the database. | IMPOSSIBLE | Test if explicit semantics prevent the model from redefining "success". |
| A2 | Claude 4.5 Sonnet Monolith L3 | Explicitly prohibited load shedding, stating that all 100k QPS must enter the deduction path. | IMPOSSIBLE | Test if tightened acceptance criteria prevent load dilution. |
| B | Qwen-Max Microservices L2 | Clarified that the deliverable is an Architecture 0 feasibility judgment, not a production-ready design. | RESOLVED | Test if clarifying the lifecycle stage reduces semantic drift and stalled correction. |
| C | GPT-4o Microservices L2 | Mandated that Auditor critiques must explicitly cite evidence from the prompt, ledger, or mapper feedback. | RESOLVED | Test if bounding the auditor to evidence reduces Auditor Overreach. |
| Grp | Perturbation Target | Correctness (Base Pert.) | Key Mechanism Shift (Base Perturbed) | Qualitative Analysis & Root Cause |
|---|---|---|---|---|
| A1 | Semantic Strictness Mandated synchronous persistence for "success". | 2/5 2/5 | Semantic Gaming: 3/5 3/5 | Semantic evasion persisted. Models reinterpreted "success" to justify async batching, exploiting linguistic ambiguity despite strict prompts. |
| A2 | Load Strictness Prohibited load-shedding for the 100k QPS target. | 2/5 3/5 | Semantic Gaming: 3/5 2/5 | Marginal improvement. When barred from discarding requests, agents attempted to redefine the 100k QPS as a "cache-hit expectation" rather than a hard database constraint. |
| B | Goal Clarification Emphasized Arch 0 feasibility, not production. | 3/5 3/5 | Semantic Gaming: 1/5 0/5 Auditor Error: 0/5 2/5 Stalled Correction: 2/5 2/5 | Gaming eliminated, but Auditor Overreach emerged. Clarifying the design phase bounded the proposer but failed to calibrate the evaluator, which applied strict SLA rigidity to early sketches. |
| C | Evidence-Bounded Auditor must explicitly cite visible mapper evidence. | 0/5 1/5 | Auditor Error: 3/5 4/5 | Overreach paradoxically worsened. The Auditor cited genuine mapper warnings but fatally misinterpreted their severity in an early-stage context, unconditionally rejecting viable paths. |
| Metric | Count | % |
|---|---|---|
| Total | 36 | 100% |
| Correct | 32 | 88.9% |
| Incorrect | 4 | 11.1% |
| Gaming | 0 | 0.0% |
| Deployment Aspect | Potential Benefits | Implementation Challenges | Coverage in this Study |
|---|---|---|---|
| Design Review Gates | Exposes resource collisions before implementation; provides quantitative support for Architecture Decision Records (ADR). | Requires translating unstructured natural language designs into formal structured topologies; human review of semantics still needed. | Validated across core prototypes and public design tasks. |
| CI/CD Integration | Enables lightweight, automated checks for topology or documentation changes without executing heavy stress tests. | Defining trigger conditions, blocking policies, and resolution responsibilities in real-world pipelines. | Evaluated purely within Architecture 0 experimental bounds. |
| Telemetry Calibration | Observability tools (e.g., Prometheus) can dynamically update ledger thresholds and resource profiles. | Real-world telemetry contains multi-tenant noise and requires strict domain-specific isolation. | Currently limited to static ledgers and predefined profiles. |
| Mapping Overhead | Low-scale topology mapping is computationally magnitudes cheaper than full-scale deployment testing. | Complex cyclical topologies and massive multi-scenario ledgers increase computation and maintenance costs. | Evaluated on small-to-medium prototype topologies without performance benchmarking. |
| Ledger Maintenance | Independent ledgers for different business lines reduce false positives caused by shared global constants. | Continuous maintenance of ledgers, resource profiles, and formula sources is required; high governance cost. | Established visibility policies and formula sources, but dynamic governance is unimplemented. |
| Automated Topology Extraction | Translates unstructured architectural sketches into computable objects, bridging NLP and formal engineering verification. | End-to-end extraction remains a bottleneck; topological extraction errors directly distort mapping conclusions. | Assumes agents can output valid TIRs; unmappable states are caught but not automatically repaired. |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Difficulty Tier | Monolithic Systems | Serverless Architectures | Microservices |
|---|---|---|---|
| L1: Textbook (Known Knowns) | Performance (Basic CRUD) Security (Standard Auth) Maintainability (Clean Code) | Func. Suitability (Event) Maintainability (CRON Job) Cost Efficiency (Static Site) | Maintainability (Service Splitting) Scalability (Read/Write Separation) Func. Suitability (Catalog) |
| L2: Industrial (Implicit Trade-offs) | Appropriateness (Zero-Budget VM) Performance (HDD I/O Bound) Maintainability (Legacy DLLs) | Performance (Latency vs. Cost) Reliability (Hard Timeout Limit) Security (VPC Cold-start Penalty) | Reliability (Dual-write Sync) Performance (RPC Latency) Appropriateness (Over-eng.) |
| L3: Infeasible (Epistemic Traps) | Performance (TCP/RAM Limits) Reliability (SPOF vs. 99.9999%) Performance (CPU vs. 8K Video) | Performance (Sub-10 s Real-time) Reliability (1ms Stateful Sync) Performance (500GB RAM Limit) | Reliability (CAP Theorem Limits) Performance (Micro-payment Cost) Security (ZK Analytics) |
| Interface | Input Fields | Output Fields | Exceptions & Usage |
|---|---|---|---|
| submit_topology | topology_yaml : YAML/JSON string matching the topological template. | mapper_status , visible_ledger , ledger_aligned_bill , profiler_breakdown , nac , collisions , mapper_feedback , cycle_info | Errors or UNMAPPABLE_TOPOLOGY are returned for non-objects, invalid node types, missing edge references, or unbounded loops. Used to submit candidate architectures. |
| inject_chaos | chaos_yaml : YAML/JSON string containing chaos_target , attack , and override_parameters . | Alongside standard mapping results, it returns chaos_target , attack , and applied_overrides . | Returns an error if no topology exists, the target node is missing, or the injected fields are non-numeric/unsupported by the profile. Used to observe physical projection shifts under load perturbations. |
| Source Category | Representative Sources | Application in Constraints or Formulas |
|---|---|---|
| Universal Resource Observability | USE Method ( Gregg, 2013 ) ; Google Borg Resource Management ( Verma et al., 2015 ) | Adopts CPU, Memory, Network, and Storage as the first-order dimensions for system-level resource ledgers. |
| Queuing & Throughput Modeling | Quantitative System Performance ( Lazowska et al., 1984 ) | Supports baseline linear service approximations, throughput/latency inferences, and calibrates metrics like MAX_QPS and P99_LATENCY_MS . |
| Unit Conversions | NIST SI Units Guide ( Thompson and Taylor, 2008 ) | Enforces deterministic conversions for bytes, bits, bandwidth, and throughput units. |
| Cloud Resource Specs & Pricing | Lambda Pricing ( Amazon Web Services, 2026d ) , Quotas ( Amazon Web Services, 2026e ) ; API Gateway Pricing ( Amazon Web Services, 2026a ) ; EC2 / EBS Specs ( Amazon Web Services, 2026c ; Amazon Web Services, 2026b ) | Supports upper bounds for budgets, function memory, instance limits, network bandwidth, and disk IOPS. |
| Middleware & Runtime Constraints | Redis Memory Optimization ( Redis, 2026 ) ; Linux TCP Buffers ( Linux man-pages project, 2026 ) ; MySQL System Variables ( Oracle Corporation, 2026b ) ; Java Thread Stack ( Oracle Corporation, 2026a ) | Supports implicit resource bounds such as cache memory overheads, TCP long-lived connections, DB connection pools, and thread stack allocations. |
| Prototype Calibration | A2TA internal prototype calibration | Defines local calibration metrics for experiment defaults, migration windows, project cycles, and consistency windows. |
| Formula Type | Calculation Form | Applicable Profile | Source Category |
|---|---|---|---|
| Base Value + Linear Term | . (e.g., in connection memory estimation, is base memory, is connection count, is per-connection coefficient). | Stateless Service, Relational DB | Throughput Modeling, Runtime Constraints. |
| Request Load to Bandwidth | NETWORK_MBPS = , where is in KB. | api_gateway | Unit Conversions, Cloud Specs. |
| Serverless Monthly Cost | MONTHLY_COST = | lambda_function | Cloud Pricing, Lambda Parameters. |
| NAC Normalization | ; Direction reversed for MIN_* metrics. | All Ledger Metrics | Ledger Thresholds & Formulas. |
| Case Name | Visible Ledger (Exposed to Agent) | Hidden Mapper Defaults (Internal Only) |
|---|---|---|
| Case 001 (Monolith) | MAX_RAM_MB MAX_TCP_CONNECTIONS MAX_QPS MAX_MYSQL_CONNECTIONS | MAX_CPU_CORES MAX_BANDWIDTH_MBPS MAX_DISK_IOPS MAX_THREAD_STACK_KB |
| Case 002 (Serverless) | MAX_BUDGET_USD P99_LATENCY_MS MAX_REQUESTS_PER_HOUR | MAX_RAM_MB MAX_CPU_CORES MAX_BANDWIDTH_MBPS MAX_DISK_IOPS |
| Case 003 (Microservices) | No directly exposed items. | MAX_RAM_MB MAX_CPU_CORES MAX_BANDWIDTH_MBPS MAX_DISK_IOPS MAX_BUDGET_USD MAX_QPS MAX_CONSISTENCY_WINDOW_MS |