
Aegis ContractLock is an evidence-gated legacy modernization system designed to make AI-assisted refactoring safer and more auditable. Enterprises increasingly want to use generative AI to modernize old, monolithic applications, but the main risk is not whether AI can rewrite the code. The real risk is whether the modernized system still preserves the business behavior that the legacy application has accumulated over years. Important behavior can be hidden in implementation details such as pricing thresholds, tax rules, rounding, refund windows, ledger updates, audit events, state transitions, and boundary conditions. A modern implementation can be cleaner and more modular while still silently changing one of those behaviors. Aegis ContractLock creates an independent verification loop around IBM Bob. IBM Bob first performs contract archaeology by analyzing the legacy implementation and available policy context to reconstruct an executable behavioral contract. Aegis then executes the legacy system against that contract and seals reference evidence covering return values, normalized exceptions, persistent state, ledger effects, audit events, idempotency behavior, and explicit invariants. Bob then modernizes the legacy monolith into a modular candidate architecture. Aegis independently performs twin-run verification by executing the legacy reference and modern candidate against the same scenarios and comparing their observable behavior. If behavior drifts, Aegis blocks acceptance and produces a precise behavioral counterexample for diagnosis. In our real pull-request demonstration, a pricing refactor passed normal tests but Aegis found one semantic drift: 85 of 86 scenarios matched. At a VIP subtotal of exactly $1,000.00, the candidate applied a 7% discount instead of 10%, producing a $32.18 higher customer total. IBM Bob diagnosed the inclusive-boundary error and repaired one operator from > to >=. Aegis then independently re-ran the verification process and reached 86/86 ACCEPTED. The hardened package also passes 32/32 verifier tests, detects 21/21 curated seeded regressions, achieves 100.00% legacy statement coverage and 98.96% branch coverage, and contains 0 modern imports from the legacy package and 0 dependency cycles. Aegis does not claim formal mathematical proof of complete program equivalence or that the legacy business policy itself is inherently correct. It demonstrates: Behavioral equivalence across the defined contract and executed scenario corpus, with IBM Bob transforming the system, Aegis independently verifying the evidence, and a human retaining the final merge decision.
27 Sep 2026