railyard/docs/plans/FIXALL-2026-10-06.md
caelum0x e26f114357 docs: fix-all round 3 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 20:03:29 +03:00

129 lines
10 KiB
Markdown

# Railyard fix-all (2026-10-06)
Branch `railyard-fixall-2026-10-06`, cut from `main` at `0738f71`.
This is code and tests only: nothing was deployed, pushed or bought, and no production system was touched.
## Sources
- Memory notes:
- railyard-apps-audit 09-03
- rago-parity-checklist 09-03
- menivor-railyard-donefully-audit
- menivor-railyard-live 10-06
- owner decisions 09-29
- core vision 09-29
- `docs/parity/recount-2026-10-05.txt` (infra I1-I44, analytics A1-A26, lim.run L1-L12) and `docs/analytics/LIMRUN-GAPS.md`.
- The Scribase parity matrix, rows 65 (analytics), 66 (flags) and 69 (consent). Their suites are `32-analytics`, `34-flags` and `37-consent`, part of the PY suites 30-37.
- Test runs on this branch:
- every Node suite;
- every Rust workspace touched;
- all live-Postgres suites, against a scratch local cluster (Postgres 17, never a hosted database).
- Read-only audits of rago, mint, ledgerline, game-economy, agent-runtime, toolgate, rithub and relay. Each gap below cites a file.
## Tags
- **code**: fixable in this repo without credentials or a deploy.
- **deploy**: needs a deployed stack or the CI runner to prove.
- **owner**: needs an owner decision, a credential or an account.
## Ranked gaps and status
User impact comes first: money correctness, then what a paying Scribase add-on customer hits, then breadth.
| # | Gap | Evidence | Tag | Status |
|---|---|---|---|---|
| 1 | Rago billed a charge with charge filters over **all** of the subscription's events at the default price. Pricing groups were summed into one line, and prorated sum/unique-count charges were billed in full. | `rago-jobs/src/scheduler.rs` `load_charges`, `rago-billing/src/lib.rs` | code | FIXED `d938e55` |
| 2 | Rago fixed charges were stored but never billed. | no reference in rago-billing or rago-jobs | code | FIXED `7cfa615` (REST API `386ff23`) |
| 3 | Rago REST ingest ignored the billable metric `expression`, so expression metrics billed 0. | `rago-api/src/emit.rs` | code | FIXED `d938e55` |
| 4 | Ledgerline: two instances could drive one saga, causing lost updates and a second attempt with fresh Mint keys while an older driver was still running. | `ledgerline/src/outbox.rs` | code | FIXED `2332a95` |
| 5 | game-economy: a stuck single-owner reservation blocked the player forever. The Postgres adapter had 0 tests. | `game-economy-store-postgres/src/lib.rs` | code | FIXED `f3917aa` |
| 6 | agent-runtime: queued captures were lost on a crash. | `agent-core/src/reconcile.rs` | code | FIXED `627e499` |
| 7 | Rago draft refresh only re-summed fees, so late events in a grace period were never billed. | `rago-api/src/subs.rs`, clock `invoices.rs` | code | FIXED `8d84175`. RegenerateInvoice fee adjustments: FIXED `2e41740` (round 2) |
| 8 | Rago webhooks were missing on several REST and GraphQL paths. | `handlers.rs`, `crud.rs`, `mutation.rs`, `subs.rs` | code | FIXED `485dc9a` |
| 9 | The product analytics destinations suite passed only on 2026-10-05 (its clock was a fixed date). | `test/qy/destinations.test.ts` | code | FIXED `af36f7a` |
| 10 | The product analytics SDK tests failed or skipped on a fresh checkout. | `pnpm-workspace.yaml` | code | FIXED `af36f7a`, `41653ae` |
| 11 | `pnpm test` runs a1 only. | `apps/product-analytics/package.json` | code | FIXED: `test:all` |
| 12 | CI ran 3 of the 13 Rust apps, had no database and ran no Node suite. vend's `--locked` build was broken (stale lockfile). | `.github/workflows/ci.yml` | code + deploy | FIXED `1c742a7`, `16937f9`. First run on the Mac runner: deploy |
| 13 | Mint ignored Stripe Connect `account.application.deauthorized`. | `mint-payments/src/seller/stripe.rs` | code | FIXED `0d79b50` |
| 14 | Rago REST routes missing compared with Lago. | `rago-api/src/lib.rs` | code | PARTLY FIXED: plan fixed charges and charge reads (`386ff23`), receipt show and customer payment requests/methods (`61c704f`). Round 2 closed the rest: metadata, customer wallets by code + alerts, payment methods, wallet transactions, plan/subscription charges, filters, fixed charges and entitlements, lifetime usage, instant-fee estimates, enriched events, API and security logs, activity log show, usage analytics, gRPC token, webhook public key with RS256 JWT signing, document requests, flat quote versions, v1 events batch (`5d4666f`, `70af9a6`, `77b12f1`) |
| 15 | Relay had no guardrails or PII redaction (I19). | `gateway/src/router.rs` | code | FIXED `b340956` |
| 16 | Rago had only one global rate limit for every tenant (I28, per-org ingest limit). | `rago-api/src/observability.rs` | code | FIXED `c6b6b27`. The load test is a deploy item |
| 17 | Product analytics had no warehouse destinations (A22). | `src/exports` | code | FIXED `0e611a1` (ClickHouse, BigQuery); Snowflake `aa25b53` (round 2) |
| 18 | Product analytics CDP destinations had no transforms (A23). | `src/exports` | code | FIXED `41653ae` |
| 19 | The Mint live suites could not re-run on the same database. | `mint-store-postgres/tests` | code | FIXED `199e0f2` |
| 20 | Relay semantic cache (I18). | `tensorzero-core/src/db/cache.rs` | code (L) | FIXED `a0ca357` (round 2): `relay-semantic-cache`, local or Relay-route embeddings, memory or pgvector store, TTL, org/workspace isolation; mounted in the gateway behind `RELAY_SEMANTIC_CACHE` |
| 21 | Mint direct App Store Server Notifications v2 / Play RTDN (I31). | `mint-payments/src/iap/` | code (L) + owner | PARTLY FIXED `1075b4b` (round 3): App Store direct (ASSN v2 + Server API, pinned-root JWS). Google Play RTDN open; both need real keys to prove live |
| 22 | Toolgate never charges cache hits (`cache_micros` unused). | `switchyard-core/src/price.rs` | code (S) | FIXED `a6f3271` (round 2): hits pay `cache_micros` (caps, hold+capture, Rago event). Catalog prices stay 0 until the owner sets them |
| 23 | Toolgate `POST /v1/credentials/oauth/{provider}/connect`. | README Deviations | code (M) | FIXED `427979d` (round 3): PKCE connect, sealed tokens, refresh before calls; no shipped provider has an `oauth` block yet |
| 24 | Rithub CI runner, packages, LFS, wiki. | `rithub-server/src/ci.rs` | code (L) | FIXED: workflow runner, Git LFS, live-Postgres harness (`41913df`, round 2); npm/generic/OCI package registry and git-backed wiki (`789b6b6`, round 3) |
| 25 | Native iOS/Android/Flutter analytics wrappers (A4); embeddable replay (L8). | recount | code (M) | FIXED `fba4dba` (round 2): Swift and Kotlin SDKs (`packages/analytics-swift`, `packages/analytics-kotlin`). Flutter/Dart SDK `8cd0695` (round 3). Embeddable replay open |
| 26 | lim.run L1, L3, L4, L5, L7, L10. | LIMRUN-GAPS.md | Scribase lane / owner | OPEN: they belong to the Scribase repo |
| 27 | Rago Cashfree, Flutterwave and Moneyhash providers; SSO IdP; LLM assistant. | `admin_mutations3.rs:94`, `sso.rs` | owner | OPEN: sandbox accounts and keys |
| 28 | Rago Kafka/ClickHouse path; 6 clock jobs on Redis or a ClickHouse MV. | `events-processor` | deploy | OPEN |
| 29 | Mint Stripe Connect is off until OD-9 and 3 secrets. | `mint-server/src/main.rs:131` | owner | OPEN |
| 30 | Relay OTel export (I20). | `tensorzero-core/src/config/mod.rs:634` | deploy | OPEN: config block plus `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` |
| 31 | PY compat suites 30-37 never ran against a stack, so matrix rows 63, 65, 66, 69 and 70 are PARTIAL live. The Railyard side of each was checked: the bridge contract, the flags read endpoint (`targeting.on`, `?id=&props=`, 15 s cache), the collector, `/capture/` and the first-event proof all match what the suites assert. | Scribase `tests/compat/suite/3[0-7]-*` | deploy + owner | OPEN |
| 32 | Custom domain proof (I6), restore drill RTO (I40), image scan (I41), origin rate limit (I44, infra-box). | recount | deploy / owner | OPEN |
## Results
20 commits on the branch, this document included.
Tests, all green (live-database suites included):
| Area | Passed | Failed | Notes |
|---|---|---|---|
| rago, pg-tests | 576 | 0 | 20 new |
| mint | 368 | 0 | live suites 11, twice in a row |
| ledgerline | 42 | 0 | |
| game-economy | 104 | 0 | |
| agent-runtime | 68 | 0 | |
| relay owned crates incl. guardrails | 240 | 0 | `cargo check -p gateway` clean |
| vend / abacus / turnstile / toolgate / context-passport | 136 / 95 / 92 / 114 / 58 | 0 | |
| product analytics a1+a2+a3+qy | 206 | 0 | 4 skipped: no cached Chromium on this machine |
| console | 158 | 0 | |
| insights-edge | 34 | 0 | |
| packages | 71 | 0 | |
| bridge contract | 6 | 0 | |
## Round 2 results
Closed: the remaining Rago REST routes (with RS256 JWT webhook signing),
toolgate cache-hit charging, the Relay semantic cache, Rithub workflow
runner + Git LFS + live-Postgres harness, native Swift and Kotlin analytics
SDKs, RegenerateInvoice fee adjustments and the Snowflake destination.
| Area | Passed | Failed | Notes |
|---|---|---|---|
| rago, pg-tests | 606 | 0 | |
| mint, live suites included | 379 | 0 | 1M-transfer gate skipped |
| ledgerline / game-economy / agent-runtime | 42 / 104 / 68 | 0 | |
| vend / abacus / turnstile / toolgate / context-passport | 136 / 95 / 92 / 116 / 58 | 0 | |
| relay owned crates | 254 | 0 | pgvector live test included; `cargo check -p gateway` clean |
| rithub | 46 | 0 | live-Postgres harness |
| product analytics a1+a2+a3+qy | 216 | 0 | 0 skipped: the 4 Chromium tests ran (playwright chromium 1243 installed) |
| console / insights-edge | 158 / 34 | 0 | |
| packages | 71 | 0 | |
| bridge contract | 3 | 0 | |
| Swift SDK / Kotlin SDK | 6 / 9 | 0 | |
## Round 3 results
Closed: the Rithub package registry (npm, generic, OCI) and git-backed wiki,
and the Flutter/Dart analytics SDK. Before the owner's scope cut, two item-3
fixes were already finished and tested and are included: toolgate OAuth
connect and Mint App Store direct deposits. Embeddable replay was not started.
| Area | Passed | Failed |
|---|---|---|
| rago, pg-tests | 606 | 0 |
| mint, live suites | 385 | 0 |
| rithub (live harness) | 54 | 0 |
| relay owned crates | 254 | 0 |
| toolgate / vend / abacus / turnstile / context-passport | 120 / 136 / 95 / 92 / 58 | 0 |
| ledgerline / game-economy / agent-runtime | 42 / 104 / 68 | 0 |
| product analytics (browser tests included) | 216 | 0 |
| console / insights-edge / packages / contract | 158 / 34 / 71 / 3 | 0 |
| Swift / Kotlin / Flutter SDKs | 6 / 9 / 8 | 0 |