Model output and its constraints

What the large language model contributes to an assessment, the two-pass design that separates scoring from writing, and the rules in code that bound the model's scores and signals.

Some properties of a codebase cannot be counted: whether input is validated on every endpoint, whether errors leak internal details, how intricate the business domain is. Codeego uses a large language model to judge these properties. The model's role is limited in two ways. It works only in defined passes with defined outputs, and its numeric outputs are adjusted by rules in code that refer to the static evidence.

What the model does#

The model works in a loop with a small set of read-only tools: read a file, list a directory, search the code by pattern, and record a note. It cannot run the code or reach the network, and in the scoring pass the only file it may write is the structured result. The loop has a fixed turn budget; as the budget is used up the model is instructed to stop exploring and write its result.

The structured result contains:

  • a proposed score from 0 to 100 for each of the seven dimensions, chosen against a written rubric;
  • findings, grouped as critical issues, warnings, recommendations and strengths, with file references;
  • four complexity signals on a scale of 1 to 5: architectural complexity, domain complexity, integration complexity and security surface;
  • an inventory of infrastructure resources (compute services, databases, message queues, storage buckets, CDN endpoints, GPU workloads and other managed services);
  • a short executive summary, which may not mention hours, cost, duration or team size.

Two passes: scoring, then writing#

The scoring pass produces numbers and findings. Calibration then runs in code. Only after that does a separate report pass write the technical report, and it receives the final, calibrated values as its source of truth. The report pass explains the numbers; it has no means of changing them, and it is not given monetary figures. When the economic report is requested, a third pass writes its narrative, and code places the computed figures into the text at fixed markers.

This separation means the prose of a report cannot drift from the figures on the results page. The wording of a report may differ between runs; its numbers come from the same calibrated result.

Evidence ceilings and floors#

After the scoring pass, each proposed dimension score is compared with the static evidence. A ceiling lowers a score that the evidence does not support. A floor raises a score that the evidence shows to be too low. A score that already lies between its ceiling and floor is left unchanged. The rules apply to every assessment.

Examples of ceilings:

  • A codebase with no test files cannot score more than a low value for test coverage, whatever the model proposes. A low test-to-source ratio caps the score at an intermediate level.
  • Without a README, the documentation score is capped at a low value.
  • Without linter configuration, the code quality score cannot reach the upper bands. A high average cyclomatic complexity lowers the cap further.
  • A large number of security scanner findings caps the security score.
  • Without CI configuration, the observability and operations score is capped.

Examples of floors:

  • A high test-to-source ratio guarantees a minimum test coverage score.
  • A low average cyclomatic complexity guarantees a minimum code quality score.
  • No security scanner findings, or very few, guarantee a minimum security score.
  • The presence of a README and of CI configuration each guarantee a modest minimum for documentation and for observability respectively.

Ceilings and floors use only measurements that are reliable from static evidence. Error handling and dependencies have no static bound and rest on the rubric alone. The overall score is recomputed from the calibrated dimension scores; see The production readiness score.

Measured evidenceStatic metrics computed by tools
Model judgementProposed score per dimension, against a rubric
CalibrationCeilings and floors derived from the evidence
Dimension scoresSeven values from 0 to 100
Overall scoreMean of the dimensions, weighted if frameworks apply

Bounded complexity signals#

The four complexity signals feed the investment estimate, so they are bounded in the same way. For each signal, code derives a permitted range from the static metrics, and the model's value is clamped into that range. For example, a small single-language codebase cannot be rated as a distributed system, and a large polyglot codebase with Kubernetes manifests cannot be rated as a single script. Domain complexity is bounded by size and average complexity, integration complexity by the dependency count and infrastructure signals, and security surface by infrastructure exposure and size.

Within its permitted range the model's judgement stands. The ranges are narrow, so a change of opinion between runs moves the signal by at most a small step.

The model never computes money#

Hours, cost ranges, maintenance cost and the prices of recommendations are computed in code. The investment estimate combines the size measured per language, per-language productivity data, the static factors, the bounded signals and the team scenario. Maintenance cost is computed from the infrastructure inventory by a fixed schedule. Recommendations are priced from their sizing, the technology facts and the scenario. If the model writes hours or amounts into its output, they are replaced. The inputs and the direction of their effects are described in The investment estimate and Maintenance and cloud cost.