toga-ai 1.0.717 → 1.0.718

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ project: API
6
6
  client: shared
7
7
  type: architecture
8
8
  status: active
9
- updated: 2026-08-28
9
+ updated: 2026-09-01
10
10
  owners: [jcardinal, bala, mhammontree, dfranks]
11
11
  files:
12
12
  - api2/Controller/Index.php
@@ -315,6 +315,52 @@ worker2 EB health monitor now applies a **persistence-delay gate** (a non-5xx `D
315
315
  must persist ≥ `nonFivexxPersistMinutes`, default 5, before it pages), which suppresses these flaps.
316
316
  See [worker2 EB health monitor](../worker2/features/elastic-beanstalk-health-monitor.md).
317
317
 
318
+ **A sixth cause — a 4xx BURST flips the env to `Degraded`/`Severe` while the ALB stays fully
319
+ healthy, because EB Enhanced Health counts application/ELB 4xx toward environment health.**
320
+ Distinct from every cause above: it is not a deploy (cause #4), not worker starvation (cause #3),
321
+ and not idle flappiness (cause #5) — it is EB reacting to *client* 4xx responses that are working
322
+ as designed. EB Enhanced Health's `ConfigDocument` (namespace
323
+ `aws:elasticbeanstalk:healthreporting:system`) ships with two rules **Enabled by default**:
324
+ `Rules.Environment.Application.ApplicationRequests4xx` and `Rules.Environment.ELB.ELBRequests4xx`.
325
+ So a short burst of client 4xx (e.g. a client polling with an expired bearer token) flips the env
326
+ to `Degraded`/`Severe` even though the ALB never marked a target unhealthy. Verified live (AWS CLI
327
+ `describe-events`/`describe-configuration-settings` + CloudWatch + prod `Logs.Api`, acct
328
+ `654654170868`):
329
+ - `api-production-1` (us-east-1) flip 2026-09-01 01:39–01:44 UTC, no cause cited ("TargetGroups
330
+ reduced health state"), **not** during a deploy. Throughout: `HealthyHostCount=2`,
331
+ `UnHealthyHostCount=0`, **0** target 5xx, **0** ELB 5xx, **0** connection errors — the ALB never
332
+ deregistered a target.
333
+ - Trigger burst ~5 min earlier at 01:34 UTC: `RequestCount` 738/min, ~560 of them 4xx (~77%),
334
+ `TargetResponseTime` max 5.2 s. Prod `Logs.Api` for the window: **398 × HTTP 401 on
335
+ `GET /v2/users/me`** from `sourceIp 34.232.23.158` (the Compass/Veyer feed) on `api1.togahub.com`,
336
+ split across both instances (`i-0fa76fc1365cdf583`, `i-068e89c284eb26133`) — a client polling with
337
+ an expired/invalid bearer token.
338
+ - `api-production-3` (eu-west-1) 2026-09-01 01:06 UTC stated it plainly: "Environment health
339
+ transitioned Ok→Severe: 80.7% of requests erroring with HTTP 4xx" — same root cause.
340
+ - Other causes ruled out: `/health` confirmed served as a **static Apache file** (response carries
341
+ `Last-Modified`/`ETag`/`Accept-Ranges`, body `OK`, `Content-Length 3`, no PHP) → cause #3 not in
342
+ play; `DeploymentPolicy=Rolling`, `BatchSize=1` Fixed confirmed → cause #4 not in play. This is
343
+ why the prior four fixes (culminating in Rolling/batch-1, which only addressed cause #4) never
344
+ stopped these flips — they are unrelated to deploys.
345
+
346
+ **Rule:** an EB "% 4xx" flag, or a no-cause "TargetGroup reduced health" flip, where
347
+ `HealthyHostCount` never drops and target/ELB **5xx = 0**, is EB Enhanced Health reacting to a 4xx
348
+ burst — **not** a backend failure. Check the ALB 4xx metric and `Logs.Api` for a client 4xx flood
349
+ before chasing app bugs.
350
+
351
+ **Fix shipped 2026-09-01 (config-only, all three prod envs).** Both 4xx rules were **disabled** on
352
+ `api-production-1/2/3` by updating the `ConfigDocument` option (namespace
353
+ `aws:elasticbeanstalk:healthreporting:system`) via `aws elasticbeanstalk update-environment
354
+ --option-settings`, setting `ApplicationRequests4xx.Enabled=false` and
355
+ `ELBRequests4xx.Enabled=false` while preserving every other rule and the `CloudWatchMetrics` block
356
+ (**5xx and latency rules stay ON, so real backend failures still page**). It is a config-only update
357
+ (~1–2 min "Updating", no instance replacement) and is **reversible** by flipping the flags back to
358
+ `true`. Verified after apply: all three Ready/Green/Ok with both 4xx rules `Enabled=false`. This is
359
+ the **server-side complement** to the worker2 monitor's non-5xx persistence-delay gate
360
+ (`nonFivexxPersistMinutes`, cause #5) — one de-sensitizes the alert, this stops EB from generating
361
+ the flip at all. (The dev ran the three `update-environment` commands; the harness auto-mode
362
+ classifier correctly blocks the assistant from mutating prod infra or self-granting that permission.)
363
+
318
364
  **Triage aid — break an EB "% requests failing with HTTP 5xx" flag into ELB 502/503/504 to find
319
365
  the cause:** **503** = no healthy backend (a deploy with no capacity); **504** = target timeout
320
366
  (worker saturation); **502** = connection dropped mid-response (an `AllAtOnce` deploy killing
@@ -400,6 +446,20 @@ they are the known sharp edges. Do not re-discover these from scratch.
400
446
  single-caller branches in `V2.php` as unverified until exercised directly.
401
447
 
402
448
  ## Change history
449
+ - 2026-09-01 — Recorded a **sixth EB-`Degraded` cause — a client 4xx BURST**: EB Enhanced Health
450
+ counts application/ELB 4xx toward env health via two default-Enabled `ConfigDocument` rules
451
+ (`ApplicationRequests4xx`, `ELBRequests4xx`, namespace
452
+ `aws:elasticbeanstalk:healthreporting:system`), so a short 4xx spike flips the env to
453
+ `Degraded`/`Severe` while the ALB stays fully healthy (`HealthyHostCount`=2, 0 target/ELB 5xx).
454
+ Verified on `api-production-1` (2026-09-01 01:39 UTC flip, not a deploy) from a 01:34 UTC burst of
455
+ 398×HTTP 401 on `GET /v2/users/me` from the Compass/Veyer feed (`34.232.23.158`) polling with an
456
+ expired token; `api-production-3` stated it as "80.7% of requests erroring with HTTP 4xx". Ruled
457
+ out causes #3 (static-file `/health` confirmed) and #4 (Rolling/batch-1 confirmed) — which is why
458
+ the prior deploy-focused fixes never stopped it. Triage rule: no-cause/%-4xx flip + steady
459
+ `HealthyHostCount` + 0 5xx = a 4xx burst, check the ALB 4xx metric and `Logs.Api` first. Fixed
460
+ config-only on all three prod envs — disabled both 4xx rules via `update-environment
461
+ --option-settings` (5xx/latency rules kept ON), reversible; the server-side complement to the
462
+ worker2 monitor's non-5xx persistence-delay gate. (jcardinal)
403
463
  - 2026-08-29 — Recorded a **fifth EB-`Degraded` cause**: a brief self-healing "no-cause reduced
404
464
  health" flip on a low-traffic *idle* 2-instance env (e.g. `api-production-3`, eu-west-1) is EB
405
465
  Enhanced Health flappiness (a single missed ALB `/health` check), distinct from the busy-env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.717",
3
+ "version": "1.0.718",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",