New in Facts, Rules, Runtime: How a Harness Learns from Engineering Judgment.Facts, Rules, Runtime: Post 3 is live. Read the post

An Inside Look

How a Harness Learns from Engineering Judgment

Post 3 of 5

Martin McRoy - VP of Engineering at Thread AI

This is the third post in Facts, Rules, Runtime, our series on the system we use to manage agentic software development. The previous post, The Verification Layer, From Policy to Exit Code, explained how a contract determines whether a task can move to the next stage.

Verification asks whether the task met its contract. Measurement asks whether the agent’s decisions held up through engineering review, CI, and later changes to the code.

A passing task can still reveal a pattern.
Suppose API migration tasks keep passing verification, but reviewers repeatedly request changes because compatibility tests are missing. An AI consumer can connect those corrections and propose a stronger verification policy and a routing rule that attaches the migration guide. An engineer reviews the proposal before it changes the harness.

This is how the harness learns: AI can process captured engineering judgment to find recurring corrections and propose new rules. Engineers review those proposals and turn them into guides, verification policies, routing rules, and task structures that future runs use.

This post follows the loop from engineering signals to an accuracy ledger, then to measurement and changes to the harness.

Build the Smallest Useful Loop

Start with one decision the system makes often: a review verdict, a triage decision, a task classification, or an eligibility decision. Record what the agent decided and connect it to the judgments and code changes that follow.

A PR is the package humans review. Within it, the harness can track individual classifications, review findings, accepted or rejected suggestions, and failed checks. Commits, changed files, and line ranges connect those events to code that can be examined again later. The unit of learning is smaller than the PR.

  1. 1

    Record the decision

    Keep the agent’s label, workflow step, and task identifier.

  2. 2

    Append the judgment

    Link each confirmation or override to the original decision.

  3. 3

    Connect the evidence

    Join reviews, checks, commits, changed files, and later code history.

  4. 4

    Extract and propose rules

    Use AI to group related corrections and draft scoped rules with supporting evidence.

  5. 5

    Review and promote a change

    An engineer checks the proposal and decides which harness files should change.

Keep the evidence behind each proposal. The team needs to see which corrections led to a rule, where it should apply, and whether it addresses the original problem.

Capture the Judgment Already in the Workflow

Engineers already label agent work all day. They approve it, request changes, leave comments, resolve threads, accept suggestions, force-push fixes, revert commits, and watch CI fail or pass. These actions supply evaluation signals as part of ordinary development. The harness needs to record them as structured events without asking engineers to enter their judgment again.

Start with pull-request review

The code review system is usually the first integration worth doing deeply. In our stack, that is GitHub. A review verdict tells us whether a change was acceptable; comments explain why; follow-up commits show what had to change; and resolved threads show whether the fix satisfied the reviewer. Capture these alongside check results, commit updates, and whether the PR was eventually merged.

Reviews from multiple models and the process that reconciles their findings can feed the same ledger. They contribute evidence; the engineering workflow still determines the outcome.

Agent decision

The original prediction

Workflow step, task identifier, model output, and agent label.

PR review

Acceptance and correction

Verdicts, requested changes, comments, resolved threads, and follow-up commits.

CI and Git

Runtime and code evidence

Checks, blocked reasons, commit SHAs, changed files, rewrites, reverts, and code lifetime.

Context

What the agent received

Guides, must-read paths, task type and scope, dependencies, context size, and agent provider.

Capture the decision, the engineering response, and the context needed to connect them.

In the migration example, the requested-change comment identifies the missing test, the follow-up commit shows the correction, and the context snapshot records which guides the agent received. Connecting them makes the reviewer’s judgment useful beyond that one PR.

Choose signals by what they help you decide

Prioritize sources that give you usable labels, explain corrections, improve diagnosis, or reveal what happened to accepted code. Each source serves a different purpose, so evaluate it with the measurement that fits that purpose.

Choose signals by the questions they answer

Acceptance
Review verdicts and resolved threads

How often can a decision be linked to a usable human label?

Check agreement with merge and task outcomes.

Correction
Requested changes and follow-up commits

Do related comments and follow-up changes reveal a recurring correction?

Give the AI consumer evidence for a scoped rule proposal.

Runtime diagnosis
CI failures and blocked reasons

Does CI evidence improve triage accuracy?

Compare triage with and without CI evidence.

Durability
Code lifetime, rewrites, and reverts

What happens to accepted code after merge?

Follow 7-, 14-, and 30-day survival by task type and workflow step.

Attribution
Context snapshot

Where do overrides or short code lifetime concentrate?

Compare guides, task scope, and context size.

Start with the signal that answers the engineering question you need to resolve.

Interpret code survival with care from the outset. Code can change because the product changed or because the original implementation was fragile. Review comments, task context, and later intent help distinguish the two.

Preserve Decisions in an Accuracy Ledger

The ledger preserves the original agent decision, later human judgments, and the links between them and the task’s code and context. Put a durable, replayable message queue between the source tools and the ledger so the system can handle retries, backfills, and changes to downstream readers.

PR reviewverdicts · correctionsCIchecks · blocked reasonsGitcommits · later changesContextguides · task scopeMessage queuedurablereplayableAccuracy ledgerOriginal agent decision+ linked human judgment+ code and contextAI rule extractorqueued events + historyProposed rulesfor engineer reviewDecisions stay in the ledger as later judgments arrive.PR reviewverdicts · correctionsCIchecks · blocked reasonsGitcommits · later changesContextguides · task scopeMessage queuedurable · replayableAccuracy ledgerOriginal agent decision+ linked human judgment+ code and contextAI rule extractorqueued events + historyProposed rulesfor engineer review
Engineering events
AI processes queued events alongside the ledger’s linked history to propose rules for engineer review.

The ledger can use a database table, an object store, or a dedicated event store. What matters is that events have a defined structure, new entries are appended, and identifiers connect each decision to its task, review, commits, and context. An AI consumer can process events from the queue and consult this linked history to find recurring corrections across tasks.

When an engineer confirms or overrides a decision, the harness appends a new event linked to the original. This is append-only adjudication. It does not rewrite the earlier event, so the agent’s decision, the human correction, and the time between them remain visible.

Minimum fields worth standardizing

Decision

Where the agent made the call

Lifecycle stage · Workflow step · Decision type
Labels

What the agent and engineer decided

Agent label · Human label, recorded in linked events
Trace

How to reconnect the evidence

Task identifier · Review reference · Commit SHA · Context identifier · Timestamp

Keep workflow labels readable. Review, execution, triage, reconciliation, and release tell the team where a decision was made. If you record both a lifecycle stage and a more specific workflow step, keep those fields distinct and use their names consistently. Agent and human labels belong to their respective linked events.

Read Metrics That Point to Work

Once decisions are linked to later judgment, the next question is where disagreement concentrates. Decision quality and code lifetime answer different questions. Read both by workflow step and task context to identify which part of the harness needs attention.

Did the decision hold up?Agreement with engineersMissed and incorrect labelsHuman overridesDid the code survive?Code lifetime · Rewrites · RevertsRead both in contextWorkflow step · Task scope · Guides · Context sizeOverrides follow one guide?Inspect the guide and its routing.Rewrites follow broad tasks?Inspect task decomposition.Did the decisionhold up?Agreement with engineersMissed and incorrect labelsHuman overridesDid the codesurvive?Code lifetimeRewrites · RevertsRead both in contextWorkflow step · Task scopeGuides · Context sizeOverrides followone guide?Inspect the guideand its routing.Rewrites followbroad tasks?Inspect taskdecomposition.
Two measurement families
Read decision quality and code lifetime in parallel. Context helps identify what to inspect next.

Agreement with engineers

Decision quality

Did the agent choose the same label as the human?

Compare the agent’s decisions with the engineer’s judgment. Group disagreements by task and attached guide to see where instructions may need to change.

Missed and incorrect labels

Decision quality

Which labels are missed, over-applied, or confused?

Look for cases the agent missed, labels it applied incorrectly, and categories it confused. Check uncommon cases separately so frequent ones do not hide recurring mistakes.

Human overrides

Human judgment

How often did an engineer override the agent’s decision?

Track how often engineers change an agent’s decision and why. Repeated corrections can point to missing guidance or a check the harness should require.

Code lifetime

Durability

Did accepted code remain, get rewritten, or get reverted?

Follow commits and changed files, then examine the reason for later changes.

Code lifetime starts with the commit SHAs and changed files the verification layer records. The harness follows Git history to see whether accepted code remains, is rewritten soon after merge, or is reverted. This gives the team a way to examine work that passed checks and review but later proved fragile.

Do not treat churn as failure by default.
Some code changes because the product changed. Some changes because the agent chose the wrong abstraction. Read lifetime alongside task type, review comments, commit history, and later intent. The metric helps locate work that needs attention; an engineer still has to interpret it.

Context helps identify what to change. If overrides spike when a particular guide is attached, inspect that guide. If code from broad tasks is consistently rewritten soon after merge, inspect how those tasks are decomposed. In the migration example, group overrides by task type and attached guide to see where missing compatibility tests recur.

Use AI to Extract Candidate Rules

Metrics show where to look. The next step is to extract a requirement from the evidence. Give an AI consumer the queued review, CI, and Git events, together with the related decisions and context in the ledger. It can group similar corrections, compare the fixes engineers accepted, and propose a rule that addresses the recurring problem.

Ask for a concrete proposal: the instruction or check to add, the tasks or files it should apply to, and the guide, verification policy, or routing rule it would change. Each proposal should cite the reviews, commits, and context that support it. Conflicting feedback and exceptions should remain visible so an engineer can judge the scope.

In the migration example, the recurring requirement is compatibility coverage. The AI can propose requiring compatibility tests for API migration tasks and attaching the migration guide when the relevant files are touched. The proposal should make that scope explicit, rather than extending a migration requirement to every code change.

What an AI rule proposal should contain

Evidence and pattern

Show which corrections recur.

Link the reviews, accepted fixes, and task context that support the proposal.

Rule and scope

Draft the instruction and where it applies.

Name the guide, verification policy, or routing rule to change, including relevant exceptions.

Validation

Check the proposal against recorded cases.

Show how the rule addresses the earlier mistakes so an engineer can accept, revise, or reject it.

Use the recorded mistakes and accepted corrections as evaluation cases for the proposed rule. Check whether it would have caught the missing tests and whether its scope fits the evidence. These cases help engineers assess a change to the harness before promoting it, and provide regression checks for later changes.

Turn Repeated Overrides into Rules

A single override is not a rule. A cluster of repeated overrides is a starting point for a proposal. AI can draft the rule; an engineer decides whether to accept, revise, or reject it. Promotion happens only after that review, so a one-off disagreement does not become a permanent instruction.

Migration reviewadd compatibility testsMigration reviewadd compatibility testsMigration reviewadd compatibility testsAI proposes a rulestronger verificationmigration-guide routingEngineer reviewsdecides whatto promoteNext runuses the reviewedconfigurationThe next run produces new evidence.Illustrative migration example · repeated corrections are evidence, not automatic rules.Migration reviewmissing testsMigration reviewmissing testsAI proposes a rulestronger verificationmigration-guide routingEngineer reviewsdecides what to promoteNext runuses reviewed configurationIllustrative migration example.New runs produce new evidence.
Illustrative migration example
AI proposes the rule. An engineer reviews it before it becomes configuration used by the next run.

The change should address the reason for the repeated correction. A naming convention belongs in a guide; a missing compatibility check may need an executable verification policy. Routing and task decomposition address different causes.

Match the change to the cause

Guide edit

A convention keeps being corrected.

Explain naming, architecture, APIs, or migration rules in a Markdown instruction file.

Verification policy

A compatibility check keeps being missed.

Encode an automated check in a reusable verification contract.

Routing rule

The relevant guide is missing or the wrong one is attached.

Change which guides and must-read paths attach to this kind of task.

Task structure

Tasks are too broad for reliable execution.

Change decomposition, dependencies, or required evidence.

Once the proposal is reviewed, update the relevant harness files and preserve the link to its supporting evidence. The next run must receive those files for the rule to take effect. Its review results then return to the ledger, where the team can check whether the same correction is becoming less common.

Deliver the Change to the Next Run

Post 4 takes up deployment. A new guide, verification policy, or routing rule has to reach each supported agent provider’s configuration consistently. Otherwise, developers’ agent setups drift and the reviewed change has no reliable effect on future work.

Capturing evidence, using AI to propose rules, reviewing those proposals, and delivering the resulting changes requires the same orchestration discipline behind Lemma, our workflow platform. Here, that discipline connects engineering feedback to the next agent run.

Captured judgment informs proposed rules. Engineering review turns them into harness changes. Deployment puts those changes into use.

Post 1
Published

How We Built Our Agentic SDLC Harness

The system overview. Why the model is only one component, how the harness turns agent work into a repeatable lifecycle, and how work plans, task contracts, routing, verification, review signal, and ledger feedback fit together. This is the post that names the components the rest of the series expands.

Post 2
Published

The Verification Layer, From Policy to Exit Code

What the harness verifies. Verification policies as named, reusable templates. The hard gate at passes=true. The two-tier completion model that lets dependent work proceed while later phases finish. The TDD analogy taken seriously, and the question of who's allowed to loosen a contract once it's written. This is the post about turning intent into executable contracts.

Post 3
This Post

How a Harness Learns from Engineering Judgment

How engineering judgment improves future runs. Capture review, CI, and Git signals; connect them in an append-only ledger; measure decision quality and code lifetime; and use AI to propose rules for engineers to review.

Post 4
Coming Soon

Agent Configuration is Infrastructure

How the system delivers behavior. The pack manifest as a single source of truth. Multi-provider sync: one canonical pack materializing into multiple provider directories with provider-specific files in each. The validator that enforces invariants in CI. Versioning as a deployment concern. And the routing layer that decides which guides attach to which task.

Post 5
Coming Soon

Operating the Harness

How the system runs safely. Pipeline runners as the manual baseline. The daemon and its module structure. Work units, leases, atomic claiming. Governance: when unattended runs hand back to humans. The comparison to deterministic-workflow runtime that the series has been building toward.

We’re Hiring.
If you want to build durable infrastructure around agentic work, typed contracts, and learning loops grounded in engineering judgment, visit Thread AI Careers.

Previous post: The Verification Layer, From Policy to Exit Code

Next post: Agent Configuration is Infrastructure

Made In NY badge

©️ 2026 Thread AI, Inc.

666 Broadway. Floor 5. New York, NY 10012