-.  -
 


   ,   .    -  .   CTO,   :   review, ownership   ,      .         . 12 , , , .





- 

  -



 



  , 2026



ISBN 978-5-0071-4411-7

     Ridero







  .   .

    CTO,   rewrite



  

 20232024        -.    velocity,  ,    .  618    : ,      , ,   ,      , rewrites,   ,    .



      .    :     ,      .      ,    .    -  .



        ,    .



    

   ,        .  ,  ,  .    .       35   ,    (,     ).



       .  :



. ,    ,  .



Review. 500     , , .



Ownership. -  , , .



 .     ,    .



.  outage  CTO,   .



     .      .        ,      .      .      .



 

- 20072008  :



    .



 23     (teaser rate).



  .



   .



.



 -   :



  -

Origination      

Teaser rate   23   , 

Securitization CDO Merge   main

Rating agencies AAA- Velocity, LOC,  

Reset   , , 

Foreclosure   Outage, rewrite,  

    .  ,  .   reset.  foreclosure.



     ,   .   ,          .



   

CTO, VP Engineering, Head of Development  ,        .



Tech lead, staff/principal engineer,   ,      review.



DevOps/SRE  ,     .



Security engineers  ,      .



Senior-  ,   -   review-.



   ,  ,      .



   ,   ,    .    ,   ,    .   ,        ,    .



   

    :



 I. :  -   .    ,   ,    .    : , , , , .



 II.  :      . ׸ ,  review, ownership-,  , production-,  .     .



 III.  .   ,    .   .   .   . Review  .   .   provenance.



 IV.     . AI-aware review, ,  (ADR/RFC, debt review, postmortem), on-call,  ,  ,   ,   .



 V.   . TCO -,    ,   /enterprise//regulated,    90/180/365 ,     PR,   .



   : , , , , .



   

  CTO  VP Engineering     I   V.  I  ,  V     .



  tech lead     .  II  III  .  IV     .



  SRE  security     10, 17, 22.     .



       6, 7, 8.    , review  ownership.



        1, 11, 27.     .



       .     :    ,    .



    

   .      Ȼ.   ,     .



  .   .   ,    :       .



 .   ,          .      .



  .        (DORA, SBOM, ADR, RFC, mutation testing).   , .     ,   .



 

-    .    ,    .    ,   ,   ,      ,    .



     -  .    : outage, rewrite,    .



   ,  : review, ownership,  ,   .    ,    .



  

   :



   .



   .



      .



     .



    .



   .



  trenches  ,   .



   ,   .



     .



  510 .



    .



   5 .



      .    CTO   :     ,  .



 

     ,    ,    .           .          .



   :



      ;



 owner-   PR;



    velocity,   defect escape rate;



      ;



 review  -;



    .



.




 I. :  -   





 1.  ,  


   .  .    .

       





    ,     .         -  .  =  +  + .      ,         .



 

        ?



         ?



     -?



  ,    ?



      ?



1.1.   ,   

      .     .  ,   main, : , , ,  , ,  .       .       .



   .    ,    .     .    .



   .    50100      .    1500        . ?   .     .  on-call-    .



  ,   .   .   .     ,    ,      .     :     ,     ,       -.



    ,   .  ,    .         .



1.2.   :     on-call-

  ,      .



 : .



3:47 .  . On-call   . 800 .     .      .  .  .   ,  . On-call    calculate_discount ()   ,    .     ,   .



  .    .



 : .



  .   .   . On-call   : - ,    ? .  ,   .    ,       .



     ,  .      ,      4 .



 : .



   :   .   .   .        ,       side effects.   ,    .



  . ,    ,    .     .



 =  +  + .        .  ,     .



       .    .   .   ,      .      .    .      .



1.3.  :    

 :     . ĸ.       60  ,   .    Own.     .



   .  .



      

 (Write) , , , merge  

Review , , ,  ,  

 (Own) , , , ,  , on-call,    324 

   Write. Review    :  500  ,  100. Own   ,        ,   .



text

Total Cost of Code = Write + Review + Own

Own :



   (debug time);



   (incident time ? cost of downtime);



    ;



 rewrites;



     .



  ():



1000   .



Write: 2 .



Review: 4 .



Own ( 12 ): 2060   , , .



: 2666 .



 : 1000 ,    : Write 20 , Review 4 , Own 1030 . : 3454 .



    ,     .     .    .  .    .    .



1.4.   ,    

     .      , ownership   .   .    .



   .



.    ,   .    .   .      ,      ,   .     .   .



Ownership. -  , , .   .     3:47.    .    ,   .



 .     .   ,      .      ,         B.    B   ,    .



  .  outage  CTO,   .     ,   API-.     ,   .



     .          ,      .      .      .



     .         .      .   .



1.5.   velocity  

Velocity ,   .   ,    .         .      .     ,     .



  velocity:



  ;



 PR;



story points;



  merge.



   :



 ;



 ;



rework rate;



orphan code ratio;



   ;



 outage.



   :  , velocity ,     .     ,    .



        .   ,    .



:   

    .  1000   .  Write, Review, Own  6  12 .   ,  .



  cost of ownership  .     .    .



 :    main   owner-?  CODEOWNERS  git blame.  git blame    , owner  NULL   orphan code.



  :     ,   ?     .



 :  owner-   merge.   -.



      .   ?   ?    ?          .





   

Cost per line (write)    / LOC  

Cost per line (own)    / LOC  

Rework rate   /    ,   

Defect escape rate    /    review

Orphan code ratio   owner- /    

 - ():



text

Subprime Rate = (Own  Write) / Write ? 100%

 Own  Write    .  Own  5   Write  foreclosure   .



  trenches

 .  .



, 12 , B2B SaaS, : Python + React + PostgreSQL.  -  .     3   .  , velocity   180%.



   4 :  .



 ,  2:47 , on-call    .    . 800 .  ,  ,  .    .  4      ,    .  5  .



 $4080 . ()         .



    :     .    :  ,  ,   .   2 .



 : velocity   60%,   6  ( 12), CTO ,  .  rewrite  $200400 . ().     $150200 . ().    $250500 .



   :    ,   ownership,   .



 

    , review .



 ,   5 ?



  velocity   2 .



  ,   ,   .



,  .



    .



  .





   :



 -  owner-.



 velocity   .



     .



   .



  review  -.



     .



,      .





?   Write, Review, Own  1000  .

?   cost of ownership.

?   orphan code.

?  PR  owner-.

?  ,      .

? Velocity   .

? Review -  .

?      .

?       .

?    .

 

     .    .    ,          .



 

DORA State of DevOps Report      .



Accelerate (Forsgren, Humble, Kim)   ,      .



Working Effectively with Legacy Code (Michael Feathers)      .



Google SRE Book,   postmortem       .



The Mythical Man-Month (Fred Brooks)       .




 2.  -  


   .    .         ,  .

     -





     ,    : origination ? securitization ? leverage ? rating ? foreclosure.       .            . Foreclosure  .    .



 

   origination, securitization  foreclosure?



 rating agencies () ?



   ,   ?



  -   ,   foreclosure?



         ,   ?



2.1. Origination:       

 2007    :  ,     ,  .  .  .  .  .



  origination  .     , :       .   800 .  :  . .   :   ?  ?  owner?   ?     .



   ,   .   ,     .      .    ,  review,  .          .



 .    ,  .    .  ,    .    .  .  ,  ,   ,  .



Origination        .   ,    .    reset.



2.2. Securitization: merge-  CDO

        .     CDO (collateralized debt obligations)  .       CDO.       .



  securitization  .   10 PR  .     5 . .    main  3000   .            main.   .



  PR      .       ,  - .   .  :    10 PR  8 ,   48   PR.  , ,  , .



     . , 18:40.    PR  . 600 .  .   .  .   LGTM   .       PR.      .   .



Securitization     .    .   ,    . Merge-      .        CDO.



  ,   .   ,   .   ,   15 .    securitization.



2.3. Leverage:    

  ,    .     .   leverage.



        ,   . ,   .      ,  .



     .       :    ,  ,  .     .      .            .



 ,   -:



     

       

  ,   

  ,    

  owner-   

   ,      

    .   ,            .



   ?          .  ,        ,     .



2.4. Rating agencies: velocity, LOC,  

CTO   . Velocity  .   .    velocity.    .     .   rating agencies.



 2008     AAA  CDO,     . ?       .    .



       . Velocity, LOC, story points,  .   .    .



  velocity:



  ;



 PR ;



 story points .



   :



    ;



    6 ;



    ;



   rewrite;



  .



   :  , velocity ,  AAA.    reset.



     velocity,   cost of ownership     rating agencies.        ,         rating agencies.      ,          rating agencies.



2.5. Foreclosure: outage, rewrite,  

 .  on-call   .   .  .  rewrite.   .    .  .



    , 21:14.    . On-call  . 800 .     .      .  .  . On-call   : - ,    ? .



      .   CTO  Slack  : - ,    ? .   CTO .



   : .   ,  ,    .  .  .   ,    ,   .



  ,     , .    .   .       .



Foreclosure   .   .     .    .      ?.     ?.     .



Foreclosure    .  .    ,           ?.



2.6.  :  ,  ,  

     ,   .  ,   .  ,   .   .



     ,  .



 ,     outage.  ,  ,     .  ,  :         ,      .



    ,    .         .     ,        ?.     outage,  , .   CTO    ,  rewrite  .



,   ,    .  .   .    ,   -.   .



   ,  .   .   ,  .         .       .      foreclosure   .



:   

 - .  ,     ,  -?    ?      ?



 bus factor   .     ?    bus factor = 1.  .    foreclosure  .



,      cost of ownership.    .       6 .



  merge-.  PR   ?      ?   30   PR     securitization.



 :     ?        ownership.



  debt interest.   40%    ,    ?      .





   

Orphan code ratio   owner- /    

Bus factor .  ,    

Debt interest    /     

Merge latency   PR  merge  securitization

Review depth    / LOC  

 debt interest ():



text

Debt Interest = (   - /   ) ? 100%

 debt interest> 30%    ,  . > 50%  foreclosure .



  trenches

 .  .



-, 40 , fixed-price    . : Java + Spring + Oracle.      .   9 .   .



 ,    -.     ~70% .  .  .   .  .



     :    .         ,    .    . 500 000 .  .  .  owner-.



   DocumentApprovalService. java. 12 000 .   .   .  git log   : initial commit from AI assistant.   .  .



       .     side effects,    .   .  rewrite.    .     .



        2,5  ().  ?     .     .    ,    ,   .



 

    .



  .



  ,   .



  ?  .



  velocity , ,  .



  owner?   .



  .





   :



 PR    .



 velocity  .



  debt interest.



  bus factor   .



,   =  .



   owner-   .



 rewrite,  ,    .





?  -:  ,    ?

?  bus factor   .

?   debt interest.

?  merge latency:     ?

?  owner    .

? Orphan code ratio   .

?     foreclosure.

?  ,    .

? Merge-   review.

? Rewrite     .

 

Foreclosure  .      .



 

The Big Short (Michael Lewis)           .     .



Release It! (Michael Nygard)   production-   .



Team Topologies (Skelton, Pais)   ownership   .



DORA State of DevOps Report  ,    .



Working Effectively with Legacy Code (Michael Feathers)      .




 3.   : DOU, Reddit, HN


  500 .   .

    Reddit  review-





    .    .               ,   .        ,    .



 

   ,   ?



     ?



    ?



    ,   ?



       ?



3.1.        anecdotes

, 23:40.   Reddit.  AI assistants ruined my codebase. 400 .   same here.   skill issue.      ,  .



  .  .     ,   .        ,  .  .



    :



      

  Anecdote 

510       

10+          

 +       

 +  +   

    DOU, Reddit  HN     .  ,  -   .



3.2.  1: review-

, 17:20.    PR  . 700 .  .  .   .  .   LGTM   .       PR.     .



  .   32   PR.  .  .  . 32 .   :  PR 700 ,   .   .



   DOU   :     PR.   .     :    20 .   5,     .  :  ,   ,       .    .   .



  :    .  .  :    ? ,    .



3.3.  2:  

  :     PDF.   . : from pdf_magic_parser import PDFWizard.  . CI .   .   .



 Hacker News  ,   ,     ,      .   . API  .   .  :      .  :    API,  .    .



     .   .    ,   .         .



   ,  CI .  CI     .      .       ,    ,   .  CI .  .    ,  .



3.4.  3: ,    

, 10:15.   ,   . 1200 .   .   . git blame : AI assistant, initial commit.     .    .   ,   .



          Telegram.    ?  :   .  .     .        .



 Reddit   .    .   :    .  .    .  :    ,     .    .    :  .    , .   ,  .



      .    .        ,     ,    .    .   .     ,   .    ,    ,   .



3.5.  4:      

, 14:30.  .     .  . : .   .  .     .    .  .  .



    .  .    .    .  ,    .



 DOU     :      .  .  :   ,   ,    .    :    ,   .



      .  .    .   .      ,   .   ,   .  .   .



3.6.  5:    

, 16:00. CTO :  .      .  .     24/7.    .      .   :   .



 Reddit    ,   .  :   .  .   .    :  ,   .  ,  .   :     ,   .



      .  .   ,    .      .  ,   .    .



   :  ,  ,  ,  .     .    .    .    .



3.7.     ,   

      .  ,      .    .



     :  PR  300        review.   defect escape rate   40% ().   . Velocity   15%.   .



 , ,  owner :        -PR.    ,     .  -     .    review latency ,  rework rate     ().



 ,  enterprise,  AI Usage Policy:    ,   boilerplate.    ,   .      ,   -.



   :



  .   ?    ,   .



   .     .



   velocity.   defect escape rate.



   .   .



   .   .



  .  .   .    ,    .



:   

    .     -?     ?      ?    .



  PR,     .  10  PR   .  :    ?         20%.    50%.  unexplained PR ratio.



 review latency.     PR?   30     review-.



 .  npm audit  pip check.   ,    ,   .  .



 git log  .    fix, hotfix, fix again, revert fix   patch-over-patch.  .



 post-layoff MTTR.      ?    ?    post-layoff MTTR. .





   

Review latency   PR  merge  securitization

Unexplainable PR ratio PR   /  PR  3

Hallucinated dependency rate   /    2

Patch-over-patch rate    /    4

Post-layoff MTTR MTTR   / MTTR   5

 unexplained PR ratio ():



text

Unexplainable PR Ratio = (PR   /  PR) ? 100%

> 20%   3   . > 50%     .



  trenches

 .  .



Enterprise, regulated, . 200 . : Java + Spring + Kafka + Oracle.  -   CTO.     .   velocity   60%.  .



     . -:          .



-  PaymentProcessor. java. 4000 .  .  .   .      :   ,  . -  .   :     .



   .



 : 30%     .      .    ,    .



  .   .   . :



     6 .



       PR.



  owner   .



 AI Usage Policy.



 -: $80120 . ().



 : 6   .



   :   ownership,   debt interest,  ,     .



  : ,  ,  .    .



 ?     .   .   . .



 

  .



   .



 Reddit  .



    .



   .  .



   ,  .



  .





   :



 ,     .



  .



    .



 review .



  review latency.



    .



    .



   ,   .





?     .

?  review latency.

?   PR  .

?    .

?     .

?    ( ).

?      .

?      .

?    .

?    ,    .

 

    ,   .    .     . .



 

DOU, Reddit r/programming, Hacker News     ,   .   ,  .               .



Accelerate (Forsgren, Humble, Kim)        .



The Field Guide to Understanding Human Error (Sidney Dekker)    ,   .



Google SRE Book       .



Thinking in Systems (Donella Meadows)    ,   .




 4.    


 ,    .   .    .

       





-      ,    : , , ,   .         .    :   ,   ,   .    .



 

     -?



   ?



   ?



    ?



        ?



4.1.  :   

, 11:20.     .     :    .  .   : ,     ,     ,   .



:   ,      .   . :     .  . :  ,    ,   .  . :   ,     .  . :       .  .



 .   ,    .   .          ,   .



      

  ,   , owner,    

 ,   , tech lead  

  ,  , - SRE, on-call  

 Ownership-,   CTO, VP Engineering   

   ,   Security,     

    .   .   MTTR.   orphan code ratio.    .  .  .  ,    .



4.2.  :    

, 15:40.   ,   . 800   Go.    .       ,    . git blame  AI assistant.



   ProcessPayment.    .   ,   .       ?     ,   ?     context. WithTimeout,     time.After?   .   .



   .  ,  .   .       .         .  senior-, 40    ,          : ?



  .     ,   .    ,    ,   .



    .     .    .  ,  -   .  :     ,        .



  ?   :    ,   ?     .    .               .   time to context.     ,   ,   5.



4.3.  :  , 

, 10:15.     .     .        .     .     - ,    .       .    .   .



  ,       .    .    .  . .     .



   :   (      ), dependency hell ( ,    ),   (   event-driven,    ),   (      ).



    duplication rate    .      ,    ,   200%    .  CI     (fitness functions)   5.



  :  .   ,    ,    .     .



4.4.  :  

, 2:47. .  . On-call  .  .   . 1200   Kotlin. .    .   ,   breakpoint.  ,   .  ,   .   ,     .



 Slack  200 .   5  .  195  .       .     .      .  alert-to-action ratio:  ,    .   10%      .



  ,   ,  .    .   .   .   runbook.     .    .



      ,     ,   ,   . MTTR .  .  incident recurrence rate       20%,   .  .



4.5.  : ownership-, 

, 9:00.     .     owner-.  .   .      .  . .



 .   -    . , ,   .   .  .  .      .



    ,    .  .   .   :     .   .   ,   .    .   .   . Ownership-     ,   .



    orphan code ratio     owner-.  20%   3.         5,   .     bus factor = 1.   .  .



4.6.   : , , supply chain

, 14:30. Security-  .       .      .      .  .  .   .      .  .



    ,   ,    .   ,       ,  ,   (   ), ,  ,    .



   .   .  .       , , .



    security findings per PR     PR.     SBOM    1.           5.



   :     .    staging     staging.  staging    .     .      .



4.7.     

   .  .    .



text

 

?

    ?    ?

?

 

?

,   ?   ?

?

 

?

, MTTR  ?  ,  ?

?

 

?

 owner- ?     ?

?

 

 .  :     . -     .  :     .   .     .  .   .  .  .  owner-    .  .



 .        ,        .    .     ,       .    .    .    .



   .          .     ,      .    foreclosure.



:   

    .     15.  .   .



    .   tech lead.   .   SRE.   CTO/VP.   security.



 debt register  .  .  .    .



   .    ?   .



  .   owner-,    .



     .     .        .





    

 Unexplainable PR ratio PR   /  PR  

 Time to context      

 Duplication rate   /    

 MTTR     

 Alert-to-action ratio    /     

 Orphan code ratio   owner- /   Ownership-

 Bus factor .  ,    

 Security findings per PR  / PR 

 Debt Score ():



text

Debt Score = (Cognitive + Architectural + Operational + Organizational + Security) / 5

> 3     . > 4  foreclosure .



  trenches

 .  .



 , 8 , mobile-  e-commerce. : Swift + Kotlin + Node. js + PostgreSQL + Redis.  -   .   velocity   70%.



   :   ,     .      .



     .  .     :   .       .  .      .     ,  .   .



: 4/5.       .

: 3/5.      .

: 4/5. MTTR   40   4 .

: 5/5.    owner-.

: 3/5.    staging  .



Debt Score = (4+3+4+5+3) /5 = 3.8.  .



 :



 owner   .   owner      .



 :  owner-   merge.



  review.   .



      .



 security-  CI.



   AI-aware review.



  :



: 3/5. : 2/5. : 2/5.



: 2/5. : 2/5.



Debt Score = 2.2.    .



  .   .   .            foreclosure.   .



 

    .



    .



    owner-.



MTTR ,   -  .



    .



     ,  .



   ,  .





   :



,   .



   .



  owner-.



   .



  MTTR.



    .



  ,    .



,   .





?     .

?      15.

?     .

?  debt register.

?    .

?  owner    .

?     .

?     .

?     .

?     .

 

  .  .       .



 

The DevOps Handbook (Kim, Debois, Willis, Humble)        .



Building Secure and Reliable Systems (Google)      :      .



Software Architecture: The Hard Parts (Ford, Richards, Sadalage, Dehghani)      trade-off.



The Phoenix Project (Kim, Behr, Spafford)       .



Thinking in Systems (Donella Meadows)   ,     .




 5. ,   


   .   .    .

  postmortem SaaS-





Velocity, LOC      rating agencies .   ,    foreclosure.           ,  .   ,   ,   ,   .         .



 

      ?



   ?



 DORA ,  ?



 cost of outage   ?



  ,    ?



5.1. -: LOC, PR count, story points

, 10:00.  .   . Velocity  . LOC  . PR count    .  .  .     .    rewrite.    CTO .   .   .        .



   ,   .   ,      : , , PR, story points.       ,  .



       

LOC       ?  

PR count  merge  review  PR ?  

Story points      ? 

Velocity            

 Ȼ      ? 

    :   ,   .   .    .   .     postmortem.     .



 .    ,   .    foreclosure. LOC      ,    . PR count      ,   . Velocity      ,    .



   .         ,          .  ,     .



5.2.  DORA ,  

DevOps-  .  : lead time, deployment frequency, MTTR, change failure rate.   .   : lead time , deployment frequency , MTTR  .   ,  ,       .



DORA .  DORA  ,   .  ,           .   ,   ,     ,    owner-.



     

Lead time       

Deployment frequency    

MTTR    

Change failure rate    

DORA .       .    ,    ,     .   . DORA   .



   DORA    ,   ,     rating agencies.   AAA.    reset.



5.3. AI-specific : ,  DORA  

      .      :   debt interest?  .     : ,     ,   .  .  .



       .



Review latency.



, 18:40.    PR  . 600 .  .   .  .   LGTM   .    ? .  review latency.       .   .      .  :    ? ,    .



Rework rate.



, 10:00.   ,     . .    .   .     40% ,  .  rework rate.  ,   , .    ,  review,  ,  rewrite.     .



Orphan code ratio.



    .    owner-.  .  . .  -    .    .  .  orphan code ratio.        bus factor = 1.   .  .



Debt interest.



  40%    ,    .    .   .  .  debt interest.   30%    ,  .   50%  foreclosure .



Unexplainable PR ratio.



  :    ?    .  20%.   50%.  unexplainable PR ratio.  ,   .



    ,   .   .   .    .    .



  : cost of incident.    ?   downtime,    ,  , ,  .  cost of incident   velocity     .



5.4. Cost of outage   

On-call    3:14.  .   . MTTR  4 .    :  . 1200 . .  . Breakpoint  .   .  .  .    .    .  CTO :   ?   .   . Cost of outage   ,    .



Cost of outage   ,     :  , , review, , .     cost of outage       .



   :



  (   ,   );



  ( -   );



  (  );



 (   );



  (  ,  ).



 ():



text

Cost of Outage = Lost Revenue + Team Hours ? Hourly Rate + Churned Clients ? LTV + Reputation Damage

Reputation Damage    . Ÿ   .   :     ?   ?   ?        .



 SaaS-,   ,       $120180 . ().   $40 .   . $30 .   . $50100 .   . $10 .  .       $200 .    .



  . Velocity  . LOC  .  Ȼ  .   .  .



5.5.   ,   

   .    : velocity, LOC, PR count.   : review latency, rework rate, orphan code ratio, debt interest, cost of incident.   .     .     .   ,  .



,   ,    .



   . Velocity, LOC, PR count    .   .  .    .     .       ,    .        .



     .   review latency  ,   .   orphan code ratio  ,   .     . .  . .     ,    .



    .  review latency ,        ?    .  review latency> 30    merge.  orphan code ratio> 20%   owner-.  debt interest> 30%   .



   

Lead time DORA DevOps> 3 

Deployment frequency DORA DevOps <1  

MTTR DORA SRE> 1 

Change failure rate DORA SRE> 15%

Review latency AI-specific Tech lead> 30 

Rework rate AI-specific Tech lead> 30%

Orphan code ratio AI-specific > 20%

Debt interest AI-specific CTO> 30%

Cost of incident  CTO> $10 .

    .    .    .   .   .



:   

  vanity-   .  LOC.  debt interest. ,      .



 cost     6 . Lost revenue + team hours + churned clients + reputation.     .



 AI-specific   . Review latency, rework rate, orphan code ratio, debt interest.   DORA.   .



    .  .  .  . .



    .  review latency> 30    merge.  orphan code ratio> 20%   owner-.



 cost of incident   .   .   story points.  .





   

DORA Lead time     > 3 

DORA Deployment frequency    <1

DORA MTTR   > 1 

DORA Change failure rate  / > 15%

AI-specific Review latency   PR  merge> 30 

AI-specific Rework rate   / > 30%

AI-specific Orphan code ratio   owner- / > 20%

AI-specific Debt interest    / > 30%

AI-specific Unexplainable PR ratio PR   / > 20%

 Cost of incident Lost Revenue + Team Hours + Churned Clients + Reputation> $10 .

 cost of incident ():



text

Cost of Incident = Lost Revenue + (Team Hours ? Hourly Rate) + (Churned Clients ? LTV) + Reputation Damage

  trenches

 .  .



B2B SaaS, 25 ,    . : Go + React + PostgreSQL + Kubernetes.  -  .   velocity   200%.  .  . CTO  .



    .    4 .    .    .    .      .   on-call  .



  CTO   cost of incidents.   .



 : $45 . (  $20 .,   $15 .,   $10 .).

: $80 .

: $120 .



   : $245 . ().



    : $300 . (  ).



CTO   .   . Velocity  . Cost of incidents  $245 .   .   CEO.



 :



    .      .    ownership.



 AI-specific   . Review latency, rework rate, orphan code ratio, debt interest.



 owner    .



 :  owner-   merge.



 cost of incident     .



 :



Velocity   40%.    .



Cost of incidents: $0  .



Debt interest   45%  20% ().



   24/7.



CEO :   ? CTO : $245 . CEO .   . CTO   .   .



 

   .



  .



Velocity , ,  .



Cost of incident?   .



  DORA ,  - ?



 ,  .



  .





   :



 velocity  .



 cost of incident.



  AI-specific .



    .



  .



    .



,    =  .



   .





?     vanity-   .

?  cost     6 .

?  AI-specific   .

?     .

?     .

? Cost of incident    .

? DORA  ,  .

?     .

?  ,     .

?       .

 

        .    .   .



 

DORA State of DevOps Report  .    :     ?



Accelerate (Forsgren, Humble, Kim)      .



How to Measure Anything (Douglas Hubbard)    ,   .  cost of incident.



The DevOps Handbook (Kim, Debois, Willis, Humble)       .



Thinking in Systems (Donella Meadows)   ,     .




 II.  :      





 6. ׸    


 .  .

     





 -   .    .     .    . ,    ,  :    ,   . ׸     ,    :  ,  ,   .    ,      .



 

    ,    ?



        ?



      ?



  ,    ?



         ?



6.1.     ,  

, 11:30.  PricingEngine    .  .   .   .     ?   :    .



     :     .   . 1400   TypeScript.   .      . git blame : AI assistant.     .    .   ,   .



  .  . .    .        .   ,           .    . Ÿ    .



 .    .    .   ,  ,   X.    :  X   .     .



  .  .   ,    ,   reduce,   map,     ,     .    ,   .    .   .



    .  :   .  :   .   .      .       .  ,    .



6.2.  :    

, 15:20.    NotificationService.      push.  :  sendNotification   options,     channel   email, sms, webhook.  push. .



   . Push-  ,    . ,  options    priority,   priority === high NotificationService  channel     ,  ,   .      . Ÿ     ,   .       .



  .      .   ,   .     ,  - .  priority  channel?    ?     ?  :   .  ,  ,   .



     .   ,     .        .   ,    .   ,  .



   .  .    .      .  ,  -  ,     .    .  .



6.3.      

, 10:15.  :  .       .     PaymentProcessor  :



typescript

//  

async function processPayment (payment: Payment): Promise <Result> {

//  

if (payment.currency === USD) {

// 

const amount = await convert(payment.amount);

//  

return {status: ok, amount};

}

//  

return {status: error, code: UNSUPPORTED_CURRENCY};

}

    .    .   USD?   EUR?   ,     ?   ,   ?  Result,   PaymentResult?



   .  ,   .     ,    .     .



   .   .   .   .   .   . ,     :    CI.



     .   .    .          .



 :



,   ,   .    convert,   USD-       .    ,   ,   .



ADR (Architecture Decision Records).    ,     .     . . . .



Owner,  .  . .   .



    .     .



6.4.   :   breakpoint

, 2:47.  .    RecommendationEngine. On-call  . 2000   Python. .    : logger.info (recommendation generated).  ,  ,  .



  breakpoint. .   .  .    breakpoint.   .    :   .  .  ,     ,   .



   .   ,  .    .    :    ,  ,  ,  .       .



      .  ,     .  ,   .  ,    .     .



   .          .   ,    .   runbook  ,    3 .   .     :    CI   3 .



     .   .    .



6.5.   

   ,   ? .   .    ,      .



.   .  ,       ,    .    ,    .   .  .    .  ,   .



.      : , , , .    .       X,    USD,  InvalidCurrency,    .     .   ,  ,  ,   .



  .     .   ,   .      :     .



ADR   .   ?   ?    if,     .        .



Owner.     .  . .     .    .        .   , .   ,  ,  ADR,    .



  .    .   . ,  rewrite. ,  foreclosure.    .



:   

   .  ,   .     ,   .   .     .



     . , , , .      .



    .      logger.info (done),    .       .



 :   ,      .    .  . ,    .      .



 ADR.     . . . .  .   .  ,     .



 owner  . .  .     .   .





   

Unexplainable PR ratio PR   /  PR  

Time to context       

ADR coverage   ADR /    

Log coverage    /     

Runbook coverage   runbook /     

 black box ratio ():



text

Black Box Ratio = (Unexplainable modules /  ) ? 100%

 :         .  .        ,    .



  trenches

 .  .



DevTools-, 30 ,    . : TypeScript + Node. js + Rust + ClickHouse.  -  .    60%   .



     :      .    LanguageDetector. 800   Rust. .   .   . git blame  AI assistant.



  .  :    ,   .  :     ,   .           200 .  ,   .



    .       ,         .     :  . ?   ,    .     .    ,  .



   .  ,  .  LanguageDetector  .     .  40   .   ADR:   ,    ,   edge cases.   .  owner.



    .     .         , , ADR. ,    . ,   .



 : 24 - ().  rewrite,     : 200+ -.    .



 

   .



 .



   ,   .



  .



     .



     .



 ,  .





   :



   .



 ,  ,   .



  ,  .



     .



  runbook.



   owner-.



,   =  .



 rewrite,   .





?      .

?     .

?     .

?  :   ,      .

?  ADR.

?  owner    .

?  runbook  ,    3 .

? Black Box Ratio   .

?       ,  .

?     ,  .

 

,  ,  ,    .     .   ,  .  ,  -  .



 

Working Effectively with Legacy Code (Michael Feathers)      .    .



Refactoring (Martin Fowler)    ,   .     .      .



Domain-Driven Design (Eric Evans)   ,   ,   .



Documenting Software Architectures (Clements et al.)   ADR   .



The Pragmatic Programmer (Hunt, Thomas)       .




 7.  review:   


   PR.   .   LGTM.

    DOU  review-





  500 ,   500 .         . Review latency , defect escape rate .    .  :    15 PR    8 ,   32   PR.  , ,  , . 32   700     .  .   ,    ,     .



 

 review     ?



  rubber-stamping    ?



      ?



  ,   ?



  risk-based review    ?



7.1. :  vs 

    .  :      .  30   600 .  .  . .



   PR. 600 .  . .    . . . .     .   .      : 12  .    14 PR  .   LGTM  .



  30 .   30 .     .   .   .



 .     100 .    .   :   ,   .     100         15 ,     1500 ,     4 .    4 .   8   .



 ?   ,       :  .   .   .    .  :  PR, ,  , .



  .  .           .   rubber-stamping.



7.2. Rubber-stamping:    review

   PR  . 700 .  .   .  .   LGTM   .       PR.     .



 rubber-stamping.   .   .



  rubber-stamping   :



Review latency  5   PR.  PR  500    3 ,   .



Review depth   1   100 .    ,  .



LGTM rate   90%.    PR  LGTM  ,   .



 ,  nit.        , ,   .



   .      PR     ,   .



Rubber-stamping   ,   .   ,    .  :    .  :    .     .   LGTM.    .   .



     .  :    ? ,    .    .    postmortem.  postmortem :   .  :   ,      32   700 .



7.3. :     

, 11:15.   PR. 400 . .    .  . . . .     :  .  .    .    :  .  .



   .    ,   .   . . :   .    .



     .   .   :        ,    .     .   .    .



  .    .   . , ,      .   :   ,   .     .        .



     .         :  .        :   ,   .    .



   :



  ,  .   .   .   .    .



    ,       .  . .     ?      ?



  .   .   reduce?   map?   try/catch,   throw?       .



   300   .  300     40% ().  PR  .



     .  .



7.4.  :    

    PR. 18 .    boilerplate.   .   -.  :    ,      .



   .



      

 , auth,  ,   2  3060 

 -, , API 1  1530 

 Boilerplate, , ,    1   05 

 PR     .   ,   .   ,   .     PR  . .



 PR   .    .  . .  PR  300     .



 PR  . , boilerplate, .  CI   .  CI    .      .



Risk-based review    .    .      .    30   boilerplate,    30   .    2   boilerplate,    28   .



 :



Review latency   PR  .  .  2   ,  5 .



Review latency   PR    . .



Defect escape rate  .     .



Review-  .        .



 :  PR  ,        ,   .   .   ,   ,   .



7.5. AI-aware review:      merge

  .    PR.  .      PR.    PR    .



  PR:



.  ,   ?     .



.    ?     ?    ?



.    ?     ?    ?



.     ?    edge cases?       ,   ?



 .    ?  ?   retry?   fallback?



  .       ?     ?



.       ?    ?   N+1 ?



      , PR  .   .  .



   merge    .        .    merge  ,   foreclosure.   .



AI-aware review    :  ,     .     .      . ,    .     .          .



:   

 review latency   .     PR  merge.   10   PR  300+      rubber-stamping.



  . , , .      .   .   .



    PR.  .   PR  .        .



 :   ,    .   .   ,   .      . .



 LGTM rate.   90% PR  LGTM     .      PR:  ,  .



  PR.  PR  300   .        ,   .





   

Review latency   PR  merge  

Review depth    / LOC  

LGTM rate LGTM   /  PR Rubber-stamping

Defect escape rate    /    

Rework rate   /    

Review capacity   /  PR  

 review capacity ():



text

Review Capacity = (    /  PR) ? 100%

 capacity <50%    .  <20%   .  <10%   .



  trenches

 .  .



-, 40 ,   . : Ruby on Rails + Go + PostgreSQL + Kafka.  -  .   velocity   150%.  .  .



   : review latency   8   PR.   45 .    PR. 600 . 8 .  :  .



  . LGTM rate  94%. Review depth  0.8   100 . Defect escape rate      .    ,    PR,   LGTM  .



  .  .   .   :   15 PR  .    .    .



 :



  . , , .



 PR   2 , 3060 ,  .



  1 , 1530 .



  ,  CI .



 :   ,    .



       PR.



  PR.   300    ,  .



  :



Review latency   PR: 2 .  : 0.



LGTM rate: 60% (   ,    ).



Review depth: 4   100  (   8).



Defect escape rate:   2,5  ().



Velocity:   20%.    .



CEO :  velocity ?  :      . CEO .   .




  .


   .

   ,     (https://www.litres.ru/book/andrei-ladygin-34096508/subpraim-krizis-koda-dolgosrochnaia-tsena-ii-assistentov-74590814/)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


