Preprint · Software Engineering Methodology · 2026

Verification-Gated Human–AI Co-Development A reproducible methodology for high-assurance software, with a cost–benefit analysis of a 74-file, six-language engine built in hours

cs.SE Human–AI Collaboration Empirical Software Engineering Case Study Cost Modeling

Abstract

Large language models can generate code, yet senior practitioners remain rightly skeptical that AI assistance produces trustworthy systems at scale: generation is fast, but verification, architectural coherence, and provenance are where real engineering cost accrues. We report a methodology — Verification-Gated Co-Development (VGC) — in which a single senior architect directs an AI executor through a disciplined loop whose defining property is that no generated artifact is accepted until an independent, machine-checkable oracle confirms it. We formalize six reusable collaboration primitives that emerged in practice, including a cross-representation parity oracle that pins a hand-written C implementation byte-for-byte against a reference JavaScript implementation (6,590 automated checks), exact-anchor patching that makes AI edits auditable and reversible, and guarded-irreversibility for operations with real-world side effects.

As a case study we build CHAKRA, an offline, dependency-free astronomical and calendrical engine: 74 files and ~8,150 lines across a JavaScript core, a parity-verified C99 twin, five additional language bindings, five interactive web instruments, a 120-assertion test suite, and a reproducible DOI-minting pipeline. The system was delivered across seven working sessions spanning days of elapsed time but a small fraction of the human effort a conventional team would require. We estimate the direct AI inference cost at US$143–412 (central US$251) and the total collaboration cost, including human time, at ≈US$6,000, against a conventional baseline the author independently estimated at 4–6 person-years (≈US$1.2–1.8M loaded) — a cost reduction of ~99.5% and an effort compression of ~200–300×. We present the methodology, the case study, the cost model with sensitivity bounds, and an honest treatment of threats to validity, and argue that the transferable contribution is not the artifact but the gate.

Keywords — human–AI collaboration; verification-gated generation; parity oracle; software cost estimation; agentic development; provenance; reproducibility; empirical software engineering

1 Introduction

The question is no longer whether an AI system can write code. It is whether a small human–AI dyad can produce software that a senior reviewer would stake their name on — coherent in architecture, verified in behavior, honest about its limits, and traceable in provenance — and whether doing so changes the economics of software enough to matter.

Contemporary discourse conflates two very different claims. The first, now uncontroversial, is that language models raise the throughput of code production. The second, which this paper addresses, is whether that throughput can be converted into assurance without surrendering the properties senior engineers care about: that the system does what it claims, that a change in one place does not silently break another, that a second implementation agrees with the first, and that no irreversible action is taken on unverified inputs. Throughput without assurance is a liability, not a productivity gain; the interesting engineering question is the conversion between them.

We report a methodology developed and stress-tested over seven working sessions in which one author — a systems architect with two decades of hypervisor, ML-accelerator, and SDN experience — directed an AI executor (Anthropic's Claude, operating with code-execution and tool-use) to build a non-trivial system end to end. The methodology's organizing principle is a gate: a machine-checkable oracle that every generated artifact must pass before it is accepted into the working tree. The gate is what converts fast generation into trustworthy delivery, and it is the paper's central transferable claim.

1.1 Contributions

  1. A named methodology (VGC) and six reusable collaboration primitives (§3), each stated precisely enough to be adopted by other practitioner–AI dyads and each grounded in an artifact from the case study.
  2. A cross-representation parity oracle (§3.1) that we argue is the load-bearing innovation: an independent second implementation, in a different language with different failure modes, checked byte-for-byte against the reference — turning "the AI probably got it right" into "6,590 assertions say it did."
  3. A worked case study (§4) with full quantitative characterization: 74 files, six language targets, a 120-assertion suite, and a reproducible research-artifact (DOI) pipeline.
  4. A transparent cost model and cost–benefit analysis (§5) with sensitivity bounds, comparing measured collaboration cost against an independently-derived conventional baseline.
  5. An honest threats-to-validity analysis (§6), including the ways a single case study and a self-reported baseline can mislead, and the conditions under which the method does not apply.
Framing for the skeptical reader
This paper does not claim AI "replaces" senior engineers. It claims the opposite: the method's leverage comes from senior judgment — knowing what oracle would falsify a mistake, and refusing to proceed without it. The AI supplies breadth and speed; the human supplies the gate. Remove the gate and the approach reduces to the very "confident, unverified generation" the paper argues against.

3 The VGC Methodology

Verification-Gated Co-Development is a loop, not a pipeline. Each turn of the loop moves an artifact from intent (a human-stated goal) to execution (AI-generated change) to gate (mechanical verification) and either accepts the change or returns it, with the failing oracle output, for repair. The human never writes the change and the AI never approves it; acceptance is the oracle's alone.

The loop's cadence is captured in the collaboration ledger below — the paper's recurring device. The left track is what the human specified; the right track is what the AI did and, critically, what oracle confirmed it. Every accepted change in the case study has such a pair.

Human intent (the navigator)
AI execution + gate (the driver)
"The C port must be provably the same as the JS engine — I don't trust a second implementation I can't check."
Generated vectors.h from the JS reference; wrote test_chakra.c to diff every field. Gate: parity: 6590 passed, 0 failed. Accepted only on green.
"Fix the Dīpāvalī date. And don't break the month rule while doing it."
Located the exact \u-escaped source line; patched the pradoṣa rule; re-ran the suite. Gate: node suite green + festival strings byte-identical 2026–27.
"Start minting the DOI." (an irreversible, public action)
Refused to mint from the assistant environment; delivered a dry-run-by-default script requiring an explicit --live flag and a typed confirmation on the human's own machine.

Figure 1 · The collaboration ledger. Every accepted change pairs a human intent with an AI execution and its gate. The discipline is that the right column is never empty of an oracle.

3.1 The six collaboration primitives

The following primitives emerged repeatedly and, we argue, transfer beyond this project. Each is stated as a reusable pattern with the problem it solves.

Primitive P1

Cross-Representation Parity Oracle Core innovation

When correctness is hard to specify but easy to compare, build a second implementation in a language with different failure modes and check it field-by-field against the reference. Here a hand-written C99 engine is pinned to a JavaScript reference by machine-generated vectors: 6,590 assertions, including UTF-8 festival strings checked to the byte. The oracle is decisive precisely because a floating-point or index error in the port would have to coincidentally match the same error in the reference — vanishingly unlikely.

This inverts N-version programming: the redundant version is not for runtime resilience but is the development-time acceptance test that lets a human trust AI-generated numerics without re-deriving them.

Primitive P2

Exact-Anchor Patching Auditability

AI edits are applied only via changes that match an exact, unique byte string in the target file (a heredoc-delivered patch keyed to a verbatim anchor), never by regeneration of whole files. If the anchor is not found exactly once, the patch aborts rather than guessing. This makes every AI edit reviewable as a diff, reversible, and immune to the silent drift that whole-file regeneration invites — and it surfaces encoding subtleties (e.g. \u-escaped source) as hard failures instead of corrupted output.

Primitive P3

Guarded Irreversibility Safety

Operations with real-world side effects — publishing a DOI, pushing to a shared branch, deleting records — default to a dry-run that validates everything and touches nothing, and require an explicit escalation flag plus a typed human confirmation to execute for real. The AI is structurally prevented from taking the irreversible step autonomously. This primitive was motivated by a genuine prior incident (an erroneously minted duplicate record) and encodes the lesson as a mechanical constraint rather than a hope.

Primitive P4

Source-of-Truth Reconciliation Coherence

When human and AI states can diverge (the human edits or releases out of band), the canonical store is named once and the AI re-adopts it and diffs to zero before any new work — verifying agreement rather than assuming it. In the case study, each session began by pulling the published repository and confirming byte-identity with the working tree, catching drift before it compounded.

Primitive P5

Read-Before-Write Grounding Anti-hallucination

Before modifying or "rebuilding" any component, the AI is required to read the actual existing implementation and verify what is already present, rather than reconstruct from assumption. This directly counters the dominant LLM failure mode — confidently reinventing something that already exists, subtly differently. Several times the correct action was to discover a capability was already implemented and passing, and to stop.

Primitive P6

Honest Deferral to a Tracked Backlog Scope integrity

Work that cannot be completed and verified within the current effort is not faked, stubbed, or silently dropped; it is written as a precise, self-contained issue in a tracked backlog (49 such issues here) that a future human or AI can execute. This preserves the honesty of the "done" claim — everything reported as complete is verified; everything unverified is visibly deferred.

4 Case Study: CHAKRA

To exercise the methodology on something a senior reviewer would recognize as non-trivial, we built CHAKRA — an offline, dependency-free astronomical and calendrical observatory that computes ten calendar traditions, planetary positions, the Hindu pañcāṅga, eclipses, and classical jyotiṣa structures from live orbital mechanics rather than lookup tables.

CHAKRA is deliberately in a domain where correctness is checkable but unforgiving: an astronomical routine is either right to arc-minutes or it is wrong, and calendar arithmetic across Gregorian, Hijrī (with distinct Sunni/Shia tabular sets), Hebrew, Solar Hijrī, Nanakshahi, and others admits no hand-waving. This is precisely the setting where the parity oracle (P1) earns its keep.

Table 1 · Delivered artifact, quantitative characterization
ComponentDetailLines
JavaScript reference coreephemeris, calendars, pañcāṅga, eclipses, jyotiṣa2,151
C99 parity twinbyte-verified against the reference (6,590 checks)1,248
Web instruments (×5)landing, observatory, mathematics, tour, test console2,775
Language bindings (×6)Python, Rust, Go, C#, Node, GW-BASIC/QB641,292
Test suite120 assertions, auto-discovered311
Documentation & governancearchitecture, contracts, 49-issue backlog773
Total substantive74 files8,150

Two verification surfaces ran continuously as gates: a 120-assertion JavaScript suite and the 6,590-check C-parity harness, the latter regenerated from the reference on every change so the two implementations could never silently diverge. A representative gate signature, reproduced verbatim from a build session:

node test/run.js → ✓ ALL SUITES PASSED (120 assertions) make -C lib test → parity: 6590 passed, 0 failed

The DOI pipeline (P3) illustrates guarded irreversibility concretely. The minting script defaults to a Zenodo sandbox dry-run that builds the artifact, validates metadata against the publisher's schema, and records a SHA-256 — with zero network calls — and mints a permanent public identifier only under an explicit --live flag with a typed confirmation. When the human attempted a live mint, a real schema-validation error surfaced (embargo_date required by a conditional the metadata had not satisfied); the gate caught it before anything was published, and the fix was verified against the actual shipped schema rather than assumed.

HUMAN INTENT state a goal AI EXECUTION generate change GATE oracle? ACCEPT into tree pass fail → return with the oracle's output, repair, retry The gate is the invariant Acceptance belongs to the oracle, not to either party.
Figure 2 · The VGC loop. The human states intent; the AI executes; a machine-checkable oracle decides. Failure returns the artifact with the failing output for repair. The loop's fixed point is a change that no oracle can falsify.

5 Cost Model & Cost–Benefit Analysis

We now quantify what the collaboration cost and what it displaced. We state every assumption; readers who prefer different assumptions can recompute from the sensitivity table.

5.1 Direct inference (API) cost

The work spanned seven agentic sessions. In tool-using agentic workflows each assistant turn re-ingests the running context (system instructions, tool definitions, and accumulated history), so token consumption is dominated by input re-reads rather than output. We estimate per-turn input at ≈70,000 tokens (a stable base context plus growing, partly-compacted history) and per-turn output at ≈3,500 tokens, over an estimated 385 tool-turns (7 sessions × ≈55 turns). This yields ≈27.0M input and ≈1.35M output tokens, ≈28.3M total.

We price against a current frontier (Opus-class) public list — US$15 / M input, US$75 / M output — and model prompt caching, which is decisive because the base context repeats every turn and reads at ≈US$1.50 / M when cached. With a 70% cache-hit assumption the central estimate is:

Table 2 · Direct inference cost, central estimate
ComponentTokensRate /MCost
Input — cached reads (70%)18.9M$1.50$28.30
Input — uncached (30%)8.1M$15.00$121.28
Output1.35M$75.00$101.06
Total direct inference28.3M—$250.63

Because the two largest uncertainties are the turn count and the cache-hit rate, we report a sensitivity band rather than a point estimate:

Table 3 · API cost sensitivity (7 sessions; USD)
Turns / sessioncache 50%cache 70%cache 85%
40 (conservative)$235$182$143
55 (central)$323$251$196
70 (heavy)$412$319$250
Direct inference cost — result
US$143–412, central US$251. Even the pessimistic upper bound is a rounding error against the human baseline below. Note this is an estimate, not a metered figure (see §6): the sessions were compacted, so true token flow is bounded but not exactly known.

5.2 The conventional baseline

The author, a senior architect, independently estimated the conventional cost of an equivalent deliverable — a verified multi-language astronomical engine with six bindings, five instruments, a parity-checked C core, a test suite, and a reproducible release pipeline — at 4–6 person-years with a high-cost team. At a fully-loaded senior rate of US$300,000 / person-year (salary, benefits, overhead, for staff/principal-level specialists including the domain astronomy and the systems work), this is US$1.2M–1.8M.

This estimate is a counterfactual and is the single most contestable input; §6 treats it as such. We note only that the deliverable's breadth — correctness in an unforgiving numeric domain, across six language ecosystems, with cross-implementation parity — makes a multi-person-year figure unsurprising to practitioners who have shipped comparable systems.

5.3 Cost–benefit analysis

Human time actually expended in the collaboration was small — the human directed, reviewed, ran terminal commands, and tested, but did not write the implementation — and was further bounded by severe platform rate-limiting during the sessions (on the order of minutes of model access per multi-hour window). We estimate ≈40 active human hours at the same loaded rate (≈US$144/hour), i.e. ≈US$5,800, giving a total collaboration cost of ≈US$6,000 including inference.

Table 4 · Cost–benefit summary
QuantityLowHigh
Conventional baseline (4–6 PY @ $300k)$1,200,000$1,800,000
Collaboration cost (inference + human time)$5,950$6,180
Net saving$1,194,000$1,794,000
Cost reduction99.50%99.66%
Cost ratio (baseline ÷ collaboration)≈199×≈290×
Two orders of magnitude, then some collaboration ≈ $6,000 baseline (4–6 PY) $1.2M – $1.8M The bars are drawn to linear scale. The collaboration bar is 3.5 px wide; the baseline is ~200–290× longer. At log scale the gap is ≈2.3 decades.
Figure 3 · Cost comparison, linear scale. Effort compression is of comparable magnitude: a 4–6 person-year (≈8,300–12,500 person-hour) baseline against ≈40 human hours is a ≈200–300× reduction in human effort; cost per substantive line falls from ≈US$150–220 to ≈US$0.74.

Two framings guard against the charge of a cherry-picked baseline. First, even taking the pessimistic upper-bound inference cost (US$412) and the low baseline (US$1.2M), the collaboration is still ≈194× cheaper. Second, a purely commercial replication estimate — an optimistic two person-years at a blended US$150/hour contractor rate, US$624,000 — remains more than three orders of magnitude above the ≈US$251 of inference that actually produced the artifact.

6 Threats to Validity

A result this large invites — and deserves — scrutiny. We enumerate the threats candidly; several materially qualify the numbers.

Construct & internal validity

External validity — where the method does not apply

The honest headline
The transferable contribution is the gate, not the multiplier. We are confident in "a verification-gated dyad can build high-assurance, checkable software at a small fraction of conventional cost." We are appropriately unconfident that any particular project will see 200×; that number is one data point, generously bounded, openly qualified.

7 Discussion, Venues & Conclusion

We have described Verification-Gated Co-Development — a methodology in which a senior human directs an AI executor through a loop whose acceptance criterion is always a machine-checkable oracle — and six reusable primitives that make it work, chief among them a cross-representation parity oracle that converts "the AI probably got it right" into thousands of passing assertions. A full-scale case study delivered a 74-file, six-language, parity-verified engine for an estimated ≈US$251 of inference and ≈40 human hours, against a conventional baseline of 4–6 person-years — with the caveats of §6 held firmly in view.

7.1 Suggested publication venues

The paper spans software-engineering methodology, human–AI collaboration, and empirical cost analysis; the natural venues, roughly in order of fit:

For any of these, the strongest revision would add a second, deliberately different case study (ideally in a domain with a harder oracle) to convert the existence proof into a defensible generalization, and — where possible — metered token counts to replace the estimated inference cost.

7.2 Conclusion

The economics of software may be shifting, but not for the reason the hype suggests. It is not that AI writes code; it is that a disciplined human–AI loop, gated on verification, can deliver checkable systems with an assurance a senior reviewer will accept, at a cost that changes what a single practitioner can attempt. The artifact will age; the gate is the idea worth keeping.

R References

  1. The costs and benefits of pair programming. Cockburn, A. & Williams, L. In Extreme Programming Examined, Addison-Wesley, 2000. (Empirical driver/navigator division of labor.)
  2. Test-Driven Development: By Example. Beck, K. Addison-Wesley, 2002. (Write the check before trusting the code.)
  3. QuickCheck: a lightweight tool for random testing of Haskell programs. Claessen, K. & Hughes, J. ICFP, 2000. (Property-based testing; specifying behavior as checkable properties.)
  4. An experiment in software reliability: the N-version programming approach. Avižienis, A. & Chen, L. IEEE Trans. Reliability, 1978/1985. (Independent implementations fail differently — here repurposed as a development-time oracle.)
  5. Evaluating large language models trained on code. Chen, M. et al. (Codex), 2021. (Capability and the plausible-but-wrong failure mode of unaided generation.)
  6. SWE-bench: Can language models resolve real-world GitHub issues? Jimenez, C. et al., 2023/2024. (Agentic software engineering; the gap between generation and verified resolution.)
  7. Emerging practices in agentic and tool-using LLM software development. (Representative of the 2024–2026 practitioner literature motivating mechanical acceptance gates.)