LengoAI

G-0003 · Reduce failed payments caused by gateway timeouts by 20%

closed  cycle 2  · flag goal_0003_c2_timeout_retry_budget · issue #4 · MR !5

Rollout at 100% of users1%10%50%100%

## Goal Reduce failed payments caused by gateway timeouts by 20%. ## Why it matters Customers whose payment times out at the gateway see "payment could not be completed, please retry" and often give up. Support-ticket themes in Lengo's memory point to timeouts as the main cause of failed payments. (All data in this project is synthetic.) ## How we will measure it | | | |---|---| | Goal metric | failure_rate | | Direction | decrease | | Target | 20% | | Guardrails that must not get worse | defaults from lengo.yml: http_5xx_rate, p95_latency_ms | ## Autonomy Preset from lengo.yml (Hands-off). ## Constraints No changes to the ledger, no new dependencies. --- _LengoAI picks this up because of the `lengo` label. Live smoke test, Run 1 profile (third take)._

Goal metric: failure rate

proven
failure_rate: change with the flag on (always-valid interval)-500+0.00+500pts10%50%100%goalexpand at 1% (minute 133)expand at 10% (minute 139)expand at 50% (minute 1445)proven at 100% (minute 1451)minutes since rollout start (1451)
always-valid interval estimate goal

With the flag on: -2.62 pts versus off (always-valid interval -2.95 pts to -2.29 pts), a relative change of -25.9%. Control rate 10.12%; 177569 events with the flag on, 229454 off. Method: msprt.

Guardrails

must not get worse
http_5xx_rate: change with the flag on (always-valid interval)-10-5.0+0.00+5.0+10pts10%50%100%kill lineexpand at 1% (minute 133)expand at 10% (minute 139)expand at 50% (minute 1445)proven at 100% (minute 1451)minutes since rollout start (1451)
always-valid interval estimate kill line (tolerance)
http 5xx rate: ok within limits
p95 latency ms: ok treatment p95 within tolerance

Latest decision

#2752 at 100% · · tick

What happened

55 events
  1. flow · core
    lengo-plan-build started (plan, attempt 1)
    session completed
  2. handoff · ai-lengo-plan-build-gitlab-ai-hackathon
    strategist → builder: done accepted, citations 100% valid
    Plan a flag-guarded single gateway-timeout retry with back-off, jitter and an idempotency key to cut failure_rate by 20% while avoiding the 5xx retry storm seen in M-0002.
  3. state · core
    proposed → planned
    Strategist plan validated
  4. handoff · ai-lengo-plan-build-gitlab-ai-hackathon
    builder → gatekeeper: done accepted, citations 100% valid
    Flag-guarded single gateway-timeout retry with exponential back-off, jitter and idempotency key, wired in release.py with tests for flag on and off.
  5. state · core
    planned → built
    Builder opened !3
  6. flow · core
    lengo-gate started (gate, attempt 1)
    session completed
  7. handoff · ai-lengo-gate-gitlab-ai-hackathon
    gatekeeper → launcher: pass accepted, citations 100% valid
    MR !3 passes: pipeline green, policy-check passed, flag-guarded single back-off retry with idempotency key, tests cover both flag states, only allowed paths changed, within size limits, no secrets or real data. No critical findings. SAST (9, none critical) and the unfixable high-severity base-image CVEs are not introduced by this MR. Image digest not available to me (registry 403, empty package log); SBOM is on the container_scanning_pesalite job.
  8. state · core
    built → gate_passed
    Gatekeeper verdict: pass
  9. state · core
    gate_passed → staged
    deployed to staging (deployment 1640160828)
  10. flag · core
    flag on at 1% (applied)
    allow: all checks passed
  11. state · core
    staged → rollout_1
    flag goal_0003_timeout_retry on for 1% of users
  12. flow · core
    lengo-launch started (launch, attempt 1)
    session completed
  13. handoff · ai-lengo-launch-gitlab-ai-hackathon
    launcher → analyst: done accepted, citations 100% valid
    Release notes for G-0003 (MR !3, flag goal_0003_timeout_retry, currently at 1%): a single back-off retry with an idempotency key for gateway timeouts, rollout steps 1/10/50/100 each gated by a statistics decision and minimum dwell, guardrails on http_5xx_rate and p95_latency_ms, and automatic switch-off by Core.
  14. flag · core
    flag at 10% (applied)
    allow: all checks passed
  15. state · core
    rollout_1 → rollout_10
    flag expanded to 10%
  16. flow · core
    lengo-analyze started (analyze_17, attempt 1)
    session completed
  17. flag · core
    flag off (applied) time to kill 620 ms
    guardrail p95_latency_ms: more than 5% of treatment requests exceed 1756 ms ((1+0.2) x control p95); lower bound 0.054
  18. state · core
    rollout_10 → killed
    guardrail p95_latency_ms: more than 5% of treatment requests exceed 1756 ms ((1+0.2) x control p95); lower bound 0.054
  19. flow · core
    lengo-incident started (incident, attempt 1)
    session completed
  20. handoff · ai-lengo-analyze-gitlab-ai-hackathon
    analyst → core: done accepted, citations 100% valid
    Core expanded the flag from 1% to 10%: guardrails clean, failure_rate down 3.5% relative but the interval (-5.73 to +5.02 points) includes zero so nothing is proven yet, p95 latency is the guardrail to watch, and the sample ratio check shows no mismatch.
  21. handoff · ai-lengo-incident-gitlab-ai-hackathon
    commander → scribe: done accepted, citations 100% valid
    Core's fast path killed goal_0003_timeout_retry in 620 ms on a p95_latency_ms breach (more than 5% of treatment requests above 1756 ms, lower bound 0.054); 5xx was not the trigger. Hypothesis: the single back-off retry plus a second 1,500 ms timeout puts retried payments around 3.2 s, matching treatment p95 of 3,242 ms. This is not a repeat of M-0002 (5xx retry storm). No fix MR was opened because no small, safe fix is clear; the flag stays off and a new goal cycle is needed.
  22. flow · core
    lengo-scribe started (scribe, attempt 1)
    session completed
  23. handoff · ai-lengo-scribe-gitlab-ai-hackathon
    scribe → core: done accepted, citations 100% valid
    Goal killed on the p95_latency_ms guardrail, not 5xx; failure_rate was -3.5% relative at 1% and unproven. Recommend reopen with a plan that bounds total retry latency.
  24. state · core
    killed → reported
    Scribe posted the outcome report
  25. state · core
    reported → reopened
    allow: all checks passed
  26. flow · core
    lengo-plan-build started (plan, attempt 1)
    session completed
  27. handoff · ai-lengo-plan-build-gitlab-ai-hackathon
    strategist → builder: done accepted, citations 100% valid
    Plan a flag-guarded single idempotent back-off retry with a total per-payment time budget, to cut failure_rate by 20% without repeating the M-0002 5xx storm or the M-0006 p95 latency breach.
  28. state · core
    reopened → planned
    Strategist plan validated
  29. handoff · ai-lengo-plan-build-gitlab-ai-hackathon
    builder → gatekeeper: done accepted, citations 100% valid
    Flag-guarded single idempotent back-off retry with a 1,600 ms per-payment budget (first attempt cut at 600 ms), wired in release.py as the capped_budget policy, with tests for flag on and off and for the budget cap.
  30. state · core
    planned → built
    Builder opened !5
  31. flow · core
    lengo-gate started (gate, attempt 1)
    session completed
  32. handoff · ai-lengo-gate-gitlab-ai-hackathon
    gatekeeper → launcher: pass accepted, citations 100% valid
    MR !5 passes: pipeline green, policy-check passed, flag-guarded single back-off retry with idempotency key and a 1,600 ms budget, tests cover both flag states, only allowed paths changed, within size limits, no secrets or real data. No critical findings. The 9 SAST findings are all in files this MR does not touch. Image digest not available to me (registry 403, empty package log); SBOM is on the container_scanning_pesalite job.
  33. state · core
    built → gate_passed
    Gatekeeper verdict: pass
  34. state · core
    gate_passed → staged
    deployed to staging (deployment 1640232423)
  35. flag · core
    flag on at 1% (applied)
    allow: all checks passed
  36. state · core
    staged → rollout_1
    flag goal_0003_c2_timeout_retry_budget on for 1% of users
  37. flow · core
    lengo-launch started (launch, attempt 1)
    session completed
  38. handoff · ai-lengo-launch-gitlab-ai-hackathon
    launcher → analyst: done accepted, citations 100% valid
    Release notes for G-0003: MR !5 (gate pass) adds a budgeted single idempotent back-off retry behind goal_0003_c2_timeout_retry_budget, live for 1% of users, growing 1/10/50/100% with a statistics decision and minimum dwell per step, protected by http_5xx_rate and p95_latency_ms guardrails with automatic switch-off by Core.
  39. flag · core
    flag at 10% (applied)
    allow: all checks passed
  40. state · core
    rollout_1 → rollout_10
    flag expanded to 10%
  41. flow · core
    lengo-analyze started (analyze_345, attempt 1)
    session completed
  42. handoff · ai-lengo-analyze-gitlab-ai-hackathon
    analyst → core: done accepted, citations 100% valid
    Core expanded from 1% to 10%. failure_rate is 12.0% lower relative to control, but the interval (-0.0594 to +0.0350) includes zero, so it is not proven. http_5xx_rate and p95_latency_ms are within limits and the sample ratio check shows no mismatch.
  43. flag · core
    flag at 50% (applied)
    allow: all checks passed
  44. state · core
    rollout_10 → rollout_50
    flag expanded to 50%
  45. flow · core
    lengo-analyze started (analyze_357, attempt 1)
    session completed
  46. handoff · ai-lengo-analyze-gitlab-ai-hackathon
    analyst → core: done accepted, citations 100% valid
    Core expanded from 10% to 50%. failure_rate is 19.4% lower relative to control (estimate -0.0199, interval -0.0397 to -0.0001, p-value 0.048), so the interval excludes zero, just short of the 20% target. http_5xx_rate and p95_latency_ms are within limits and the sample ratio check shows no mismatch.
  47. flag · core
    flag at 100% (applied)
    allow: all checks passed
  48. state · core
    rollout_50 → rollout_100
    flag expanded to 100%
  49. flow · core
    lengo-analyze started (analyze_2740, attempt 1)
    session completed
  50. handoff · ai-lengo-analyze-gitlab-ai-hackathon
    analyst → core: done accepted, citations 100% valid
    Core expanded from 50% to 100%. failure_rate is 25.9% lower relative to control (estimate -0.0262, interval -0.0295 to -0.0229, p-value 1.3e-151), so the interval excludes zero and the 20% target is exceeded. http_5xx_rate and p95_latency_ms are within limits and the sample ratio check shows no mismatch.
  51. state · core
    rollout_100 → proven
    goal proven and guardrails clean at 100%
  52. flow · core
    lengo-scribe started (scribe, attempt 1)
    session completed
  53. handoff · ai-lengo-scribe-gitlab-ai-hackathon
    scribe → core: done accepted, citations 100% valid
    Goal proven at 100%: failure_rate down 25.9% relative, both guardrails clean. Recommend close.
  54. state · core
    proven → reported
    Scribe posted the outcome report
  55. state · core
    reported → closed
    allow: all checks passed

Memory the agents cited

71 / 71 supplied
IDCited bySource
M-0002 strategist Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate strategist M-0002 > failure_rate
RB-001#0 strategist RB-001: Payment gateway timeouts > Overview
AGENTS#4 strategist AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
M-0002 builder Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate builder M-0002 > failure_rate
RB-001#0 builder RB-001: Payment gateway timeouts > Overview
AGENTS#4 builder AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
AGENTS#4 gatekeeper AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
AGENTS#3 gatekeeper AGENTS.md: conventions for every agent working in this repository > 2. Repository map
CONV-feature-flags#3 gatekeeper Feature flag conventions > Guarding a change
RB-001#3 gatekeeper RB-001: Payment gateway timeouts > Step 3
M-0002 launcher Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate launcher M-0002 > failure_rate
M-0005 launcher Outcome M-0005: Lower gateway timeout from 3 s to 1.5 s to fail fast
M-0001 launcher Outcome M-0001: Reduce checkout abandonment on the payment form by 10%
AGENTS#4 launcher AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
CONV-feature-flags#3 launcher Feature flag conventions > Guarding a change
M-0002 analyst Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate analyst M-0002 > failure_rate
M-0001 analyst Outcome M-0001: Reduce checkout abandonment on the payment form by 10%
M-0004 analyst Outcome M-0004: Reduce support tickets about fees by showing the fee before confirming
M-0002 commander Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate commander M-0002 > failure_rate
RB-001#0 commander RB-001: Payment gateway timeouts > Overview
RB-001#1 commander RB-001: Payment gateway timeouts > Step 1
RB-002#0 commander RB-002: High rate of 5xx responses > Overview
M-0002 scribe Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0002#failure_rate scribe M-0002 > failure_rate
M-0005#p95_latency_ms scribe M-0005 > p95_latency_ms
M-0006 strategist Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#failure_rate strategist M-0006 > failure_rate
M-0006#p95_latency_ms strategist M-0006 > p95_latency_ms
M-0006#http_5xx_rate strategist M-0006 > http_5xx_rate
M-0002 strategist Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
RB-001#0 strategist RB-001: Payment gateway timeouts > Overview
M-0005 strategist Outcome M-0005: Lower gateway timeout from 3 s to 1.5 s to fail fast
AGENTS#4 strategist AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
M-0006 builder Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#p95_latency_ms builder M-0006 > p95_latency_ms
M-0002 builder Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
RB-001#0 builder RB-001: Payment gateway timeouts > Overview
AGENTS#4 builder AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
AGENTS#4 gatekeeper AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
AGENTS#3 gatekeeper AGENTS.md: conventions for every agent working in this repository > 2. Repository map
CONV-feature-flags#3 gatekeeper Feature flag conventions > Guarding a change
RB-001#3 gatekeeper RB-001: Payment gateway timeouts > Step 3
RB-001#0 gatekeeper RB-001: Payment gateway timeouts > Overview
M-0006 launcher Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0002 launcher Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0006#failure_rate launcher M-0006 > failure_rate
M-0006#p95_latency_ms launcher M-0006 > p95_latency_ms
M-0006#http_5xx_rate launcher M-0006 > http_5xx_rate
M-0005 launcher Outcome M-0005: Lower gateway timeout from 3 s to 1.5 s to fail fast
AGENTS#4 launcher AGENTS.md: conventions for every agent working in this repository > 3. Rules for every code change
M-0006 analyst Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#p95_latency_ms analyst M-0006 > p95_latency_ms
M-0002 analyst Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0001 analyst Outcome M-0001: Reduce checkout abandonment on the payment form by 10%
M-0006 analyst Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#p95_latency_ms analyst M-0006 > p95_latency_ms
M-0002 analyst Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0001 analyst Outcome M-0001: Reduce checkout abandonment on the payment form by 10%
M-0006 analyst Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#p95_latency_ms analyst M-0006 > p95_latency_ms
M-0002 analyst Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0001 analyst Outcome M-0001: Reduce checkout abandonment on the payment form by 10%
M-0006 scribe Outcome M-0006: Reduce failed payments caused by gateway timeouts by 20%
M-0006#p95_latency_ms scribe M-0006 > p95_latency_ms
M-0002 scribe Outcome M-0002: Reduce failed payments caused by gateway timeouts by 20%
M-0001 scribe Outcome M-0001: Reduce checkout abandonment on the payment form by 10%

Agents may cite only IDs Core supplied in the latest context note; anything else counts against citation validity.

Flag changes

WhenChangeStatusTime to kill
goal_0003_timeout_retry
create → 1%
applied —
goal_0003_timeout_retry
set percentage → 10%
applied —
goal_0003_timeout_retry
deactivate
applied 620 ms
goal_0003_c2_timeout_retry_budget
create → 1%
applied —
goal_0003_c2_timeout_retry_budget
set percentage → 10%
applied —
goal_0003_c2_timeout_retry_budget
set percentage → 50%
applied —
goal_0003_c2_timeout_retry_budget
set percentage → 100%
applied —

Audit trail

hash chain verified
#WhenActorActionSubject
105coregoal.transitionreported->closed
104ai-lengo-scribe-gitlab-ai-hackathonhandoff.acceptedscribe
103coreflow.startlengo-scribe
102coregoal.transitionrollout_100->proven
101ai-lengo-analyze-gitlab-ai-hackathonhandoff.acceptedanalyst
100coreflow.startlengo-analyze
99coregoal.transitionrollout_50->rollout_100
98coreflag.set_percentagegoal_0003_c2_timeout_retry_budget
91ai-lengo-analyze-gitlab-ai-hackathonhandoff.acceptedanalyst
90coreflow.startlengo-analyze
89coregoal.transitionrollout_10->rollout_50
88coreflag.set_percentagegoal_0003_c2_timeout_retry_budget
87ai-lengo-analyze-gitlab-ai-hackathonhandoff.acceptedanalyst
86coreflow.startlengo-analyze
85coregoal.transitionrollout_1->rollout_10
84coreflag.set_percentagegoal_0003_c2_timeout_retry_budget
83ai-lengo-launch-gitlab-ai-hackathonhandoff.acceptedlauncher
82coreflow.startlengo-launch
81coregoal.transitionstaged->rollout_1
80coreflag.creategoal_0003_c2_timeout_retry_budget
79coregoal.transitiongate_passed->staged
77coremr.merged!5
76ai-lengo-gate-gitlab-ai-hackathonhandoff.acceptedgatekeeper
75coreflow.startlengo-gate
74coregoal.transitionplanned->built
73ai-lengo-plan-build-gitlab-ai-hackathonhandoff.acceptedbuilder
72ai-lengo-plan-build-gitlab-ai-hackathonhandoff.acceptedstrategist
71coreflow.startlengo-plan-build
70coregoal.transitionreported->reopened
57ai-lengo-scribe-gitlab-ai-hackathonhandoff.acceptedscribe
55coreflow.startlengo-scribe
54ai-lengo-incident-gitlab-ai-hackathonhandoff.acceptedcommander
51ai-lengo-analyze-gitlab-ai-hackathonhandoff.acceptedanalyst
50coreflow.startlengo-incident
49coregoal.transitionrollout_10->killed
48coreflag.killgoal_0003_timeout_retry
47coredecision.kill10%
46coreflow.startlengo-analyze
45coregoal.transitionrollout_1->rollout_10
44coreflag.set_percentagegoal_0003_timeout_retry
43ai-lengo-launch-gitlab-ai-hackathonhandoff.acceptedlauncher
42coreflow.startlengo-launch
41coregoal.transitionstaged->rollout_1
40coreflag.creategoal_0003_timeout_retry
38coreflag.create.failedgoal_0003_timeout_retry
36corepolicy.denycreate
35corepolicy.denycreate
34coregoal.transitiongate_passed->staged
32coremr.merged!3
31ai-lengo-gate-gitlab-ai-hackathonhandoff.acceptedgatekeeper

Full audit log for G-0003 →