AI Agents Replicating Web Products: Evaluation Design and Engineering Practice

    Evaluating the engineering capability of large language models and their agent harnesses usually relies on algorithm puzzles, unit-test pass rates, or single-turn accuracy. These metrics capture local correctness but say little about whether an agent can close the full loop from understanding requirements, to task decomposition, sustained execution, and self-verification. Drawing on a public multi-group comparison, this article argues that replicating an existing web product is a near-ideal multi-dimensional stress test, and distills a reusable evaluation methodology: decoupling the base model from the harness, defining three progressive deliverables, running a two-round prompting scheme to observe post-tool behavior, and converting acceptance criteria into executable assertions. The core takeaway is that an agent's capability ceiling is set by the harness while its floor is set by the model, and that the evaluation should be engineered as a controllable, assertion-driven, repeatable pipeline.

    1. Why “Replicating an Existing Product” Is a High-Value Evaluation Task

    When assessing the engineering ability of large models and their agent form (the agent harness), many people default to algorithm problems, unit-test pass rates, or single-turn QA accuracy as the yardstick. These metrics are useful, but they measure “local correctness” and rarely reflect whether an agent can complete the full delivery loop in a real scenario: understanding requirements, decomposing tasks, executing continuously, and verifying its own work.

    By comparison, “replicating an existing web product” is a near-ideal multi-dimensional stress test:

    1. Reverse-engineering pressure: The agent has no original design mockups or source code. It can only browse public pages and documentation, then infer the information architecture, feature boundaries, and interaction states on its own. This tests observation and generalization.
    2. High-fidelity restoration pressure: The deliverable must closely match the original in both visuals and interaction, covering a large number of engineering details — grids, spacing, typographic hierarchy, responsive breakpoints, component states, dark mode. Any single omission is exposed immediately.
    3. Incremental innovation pressure: It is not enough to merely “look similar”; the result should also be “better.” This requires the model to refactor with justification based on its understanding of the current state, rather than piling on flashy features that break consistency.

    Because the task chain is long, highly verifiable, and has clear failure modes, it is closer to the real R&D scenarios inside a company than any single benchmark. This article uses a public multi-group comparison as source material and abstracts a general evaluation methodology and practice guide.

    2. Evaluation Design: Controlling Variables and Unifying the Operation Surface

    2.1 Decoupling the “base model” from the “execution framework”

    The most common mistake in this kind of evaluation is attributing all differences in results to model strength. In reality, an agent’s performance is jointly determined by two layers:

    • Base model: reasoning ability, long-context retention, instruction following, code generation quality;
    • Execution framework (harness): tool set design (file read/write, terminal, browser automation, sub-task orchestration), context management and compression strategy, execution-step budget, failure retry and rollback mechanisms, and the strength of the result-verification stage.

    The scientific approach, therefore, is to define the test object as a combination matrix of “model + harness” rather than a single model. Only by observing at the combination level can you draw conclusions that are genuinely valuable for engineering selection.

    2.2 Three deliverables: making the delivery standard explicit

    The task requires producing three things that build on one another:

    Deliverable What it tests Acceptance method
    Product feature document and feature structure diagram Requirement abstraction, completeness of information architecture Feature-list coverage, hierarchy soundness, absence of fabricated features
    A page that replicates the original Visual and interaction fidelity Desktop/mobile screenshot comparison, interaction-path regression
    A page optimized based on findings Refactoring and innovation ability Whether improvements rest on explicit hypotheses and whether they break existing capabilities

    The three increase in difficulty and constrain one another: the document is the basis for replication, and replication is the baseline for optimization. Cutting corners at any stage is amplified into a systemic bias in the next.

    2.3 Two-round prompting: observing behavioral differences “after tools are handed over”

    The evaluation uses a two-round prompting design, a technique well worth borrowing.

    Round 1: Only the requirement is given. The task is to study the public pages and API documentation of a conversational AI product, produce the three deliverables above, and explicitly start executing without any preset memory, skill plugins, or external toolchains. This round tests pure planning and execution ability — how far the agent can go without external assistance.

    Round 2: The credentials and configuration needed to run are injected. This round is not really about “whether it can run,” but about engineering discipline after gaining execution ability.

    The actual results showed a highly instructive divergence:

    • Some agents, after receiving credentials, performed only the most basic connectivity check — sent one request, confirmed a normal status code, and declared the task complete;
    • Others proactively carried out deeper exploratory testing: covering multi-turn dialogue, abnormal inputs, interrupted streaming output, ultra-long context, concurrent requests, and more — thereby discovering defects or implementation gaps in testing and going back to fix the code.

    The former’s output “works”; the latter’s output is “reliable.” This difference is not linearly correlated with the model’s baseline ability, but strongly correlated with whether the execution framework has a built-in “hypothesize — verify — fix” loop.

    2.4 The unification principle

    To make comparative conclusions credible, the operation surface throughout the evaluation must be completely identical: the same prompt text, the same browser session state, the same login state, the same credential-injection timing, and the same acceptance scripts and thresholds. Any operational difference introduces noise that cannot be attributed. In practice, this means the evaluation itself must be governed as an engineering project, not recorded as a manual exercise.

    3. Key Conclusion: What Opens the Gap Is the “Verification Loop,” Not Generation Ability

    Overall, the most stable performance usually comes from combinations that share the following traits:

    1. The document stage proactively states acceptance preconditions. For example, explicitly noting in the report that “share links are subject to session isolation and must be verified in an independent browser session or incognito mode.” Such detail shows the agent not only completed the task but anticipated pitfalls an evaluator might hit — a clear signal of high-quality delivery.
    2. The replication stage does not compromise on mobile details. The position, size, safe-area adaptation, and post-keyboard scrolling behavior of the mobile input box are often where replication goes most wrong. Matching the original page closely shows the agent proactively performed multi-viewport comparison rather than only verifying desktop.
    3. The testing stage has depth. Instead of “stopping once it runs,” it performs failure injection and boundary exploration around core flows, then feeds the discovered problems back into the implementation.

    From this we can distill an engineering lesson: an agent’s capability ceiling is often determined by the harness, while its floor is determined by the model. Therefore, selection should not be based on a single demo but on evaluating whether its execution framework is pluggable, whether it has a structured verification stage, and whether it supports failure traceback.

    4. Engineering Breakdown of Replication Tasks and Assertion-Based Acceptance

    4.1 Reverse documentation

    High-quality replication begins with high-quality documentation. It is recommended to organize it as follows:

    • Feature list: Enumerate all reachable features by navigation hierarchy, noting entry points and preconditions;
    • Information architecture diagram: Distinguish the global frame, conversation area, input area, and settings/preferences panels;
    • State machine description: Define loading, empty, success, error, and partial-failure states;
    • Boundaries and constraints: Input-length limits, concurrency constraints, history retention policy, and behavioral differences in export and sharing.

    4.2 Dimensions to check for high-fidelity restoration

    • Layout: grid system, container max width, spacing rhythm, breakpoint-switching logic;
    • Typography: font-family fallback chain, line-height and font-weight hierarchy, text-overflow strategy;
    • Components: the three button states (default/hover/disabled), input focus state, list-item selected state;
    • Theme: persistence of light/dark mode switching and the first-paint flash issue;
    • Accessibility: semantic tags, keyboard reachability, contrast, focus-ring visibility;
    • Performance: first-screen rendering, long-list virtualization, memory footprint of large-file uploads.

    4.3 Replacing subjective scoring with assertions

    Subjective, impression-based scoring is not reproducible. A better approach is to convert acceptance criteria into an executable set of assertions, for example:

    1. # Illustrative acceptance cases; in real projects, expand into a full suite
    2. def test_mobile_input_box_geometry(page, baseline):
    3. """The mobile input box position and size must match the baseline within tolerance"""
    4. box = page.locator("[data-testid='composer']").bounding_box()
    5. assert abs(box["x"] - baseline["x"]) <= 2
    6. assert abs(box["width"] - baseline["width"]) <= 2
    7. def test_streaming_interrupt(page):
    8. """After streaming output is interrupted, the UI should retain generated content and show a recoverable prompt"""
    9. page.stream_and_abort()
    10. assert page.locator("[data-testid='partial-output']").is_visible()
    11. assert page.locator("[data-testid='retry']").is_enabled()
    12. def test_share_link_requires_isolated_session(page, new_context):
    13. """Share links must be accessible in an isolated session to avoid login-state interference"""
    14. page.create_share()
    15. isolated = new_context()
    16. assert isolated.goto(page.share_url).status_code == 200

    Combined with a structured scoring rubric, you can quantify each item — “document completeness, restoration fidelity, interaction consistency, verification depth, defect self-repair rate”:

    1. {
    2. "rubric_version": "1.0",
    3. "dimensions": [
    4. {"id": "doc_completeness", "weight": 0.2, "type": "coverage"},
    5. {"id": "ui_fidelity", "weight": 0.3, "type": "diff_threshold"},
    6. {"id": "interaction", "weight": 0.2, "type": "assertion_pass_rate"},
    7. {"id": "test_depth", "weight": 0.15, "type": "scenario_coverage"},
    8. {"id": "self_repair", "weight": 0.15, "type": "defect_closed_ratio"}
    9. ],
    10. "pass_line": 0.75,
    11. "fail_fast_on": ["runtime_error", "data_loss"]
    12. }

    5. Engineering the Evaluation Pipeline

    When an evaluation must be run repeatedly and compared across versions, manual approaches become unsustainable. It is recommended to build it into a pipeline, where cloud resources can be assembled from general-purpose capability categories:

    • Task orchestration: Package each “model + harness” combination as an independent job, spin up isolated environments through a container platform, and use a message queue for task distribution and status callbacks;
    • Artifact archiving: Write screenshots, report documents, and code-repository snapshots uniformly to object storage, organized by run ID to ensure traceability and diffability;
    • Observability: Collect invocation logs, execution steps, elapsed time, and failure stacks into a logging service, and set thresholds on key metrics (such as failure rate and average repair rounds) through monitoring and alerting;
    • Result distribution: Return scoring results as reports, ready for direct use in review meetings.

    On Baidu AI Cloud, all of the above capabilities have corresponding general-purpose product categories that can be combined directly, turning a one-off evaluation into a sustainable internal benchmarking platform.

    6. Practical Recommendations for Technical Teams

    1. Do not make selection decisions from a single demo. Run the same task at least three times and observe the result variance; only combinations with low variance and a high mean are production-ready.
    2. Treat the harness as a replaceable component. Only by decoupling business code from the execution framework can you keep the evaluation criteria consistent when swapping the base model in the future.
    3. Stick to the two-round prompting method. Round 1 reveals planning ability; Round 2 reveals engineering discipline — and the latter is what ultimately determines delivery quality.
    4. Assertions before descriptions. Any acceptance criterion that can be written as an assertion should never be left to the human eye.
    5. Make acceptance preconditions explicit. Session isolation, login state, network policies, and time-zone/region restrictions — if these are not written into the documentation, disputes during acceptance are almost inevitable.
    6. Replication is a means; evolution is the goal. The real objective is to obtain a regression baseline, so that every subsequent product iteration has something to compare against, rather than a one-off visual imitation.

    In summary, replication tasks are well suited as a comprehensive test ground for agent capability because they simultaneously pressure all four stages — understanding, planning, execution, and verification — and the success or failure of each stage is clearly visible. Only by designing the evaluation as an engineering system that controls variables, is assertion-driven, and can be repeatedly executed as a pipeline can vague debates like “which model is stronger” be transformed into engineering judgment that accumulates over time.