gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb05f6d92b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmreb05f6d92/missions/W47-limits-v13.md

4.5 KB

  1. # W47 — rate limits, status read route, linked tickets and docs (gitoria#47, part of the push API #38)
  2. TASK (his words, unchanged): "gitorias first job is to evaluate how to make a push api where external apps can register to interact with gitoria. first use case being a code reviewer." Build GO by Apollo 2026-11-02. This part: https://tickets.worldapi.org/gitoria.worldapi.org/47
  3. W47, PORTS = 8730–8739, branch w47-limits from main 0a46bf7 (LIVE code = 34143d2 + docs; has #40–#44, #46). #45 (the PR page UI, human comments, human-side events) is built in parallel by another worker: do not touch components/pulls.hl, the PR page, or lib/events.hl.
  4. ## Scope (contract docs/apps-api.md v1.3, §5 and §6)
  5. 1. Rate limits per app: 300 reads and 60 writes per minute over every apps API route (GET = read; POST/PUT = write). Over the limit: 429 `{"error":{"code":"rate_limited",…}}` with a `Retry-After` header in seconds. Counted per app id, in the process (say in the report what a deploy swap does to the counts). Configurable for the gate only by env (like GITORIA_EVENTS_RETRY_MS), default 300/60.
  6. 2. v1.3: `GET {api}/statuses/<sha>` → `{"statuses":[status…]}` with ALL contexts on that sha from every app; 404 (§6 shape) for a sha the repo does not have. `status` JSON gains `"app":{"id","name"}` (also in the PUT answer). The pull object (pullObject: events and GET pulls/N) gains `statuses` (all apps, CURRENT head) and `required` (the owner's required contexts, names only). Writing stays own-context only.
  7. 3. Linked tickets in the pull object (§4 `tickets`): verify against the contract (explicit project#n always; bare #n only when the repo is connected to tickets); fix if it differs; cover it in the gate.
  8. 4. 413 for a request body over 1 MB and 400 invalid_json on every write route: verify, fix if missing (a broken JSON that ends in 500 is a framework gap: report it with a repro, do not work around).
  9. 5. README.md: a short "Apps API" section pointing to docs/apps-api.md (what an owner clicks, what an app gets). Do not change docs/apps-api.md; contract doubts → report.
  10. 6. Tests: tests/limits.mjs in GATES (429 + Retry-After at a low env limit, reads vs writes counted apart, per app apart, statuses read route incl. another app's context and 404, pull.statuses/required, tickets list cases).
  11. ## Read first
  12. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.
  13. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,
  14. /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for any
  15. View change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).
  16. Copy a working shape from the docs or from gitoria's own code. A framework gap: write a DOCS/GAP line in the report with a tiny repro; no workaround, no hand-written JavaScript.
  17. - THE CONTRACT: docs/apps-api.md v1.3 (fixed; anything you cannot build as written → report, do not change the contract).
  18. - Evaluation: reports/E38-push-api-eval.md (sections 1–6) and reports/E38b-konrad-needs.md. App: README.md, project.hl, lib/pulls.hl, lib/transport.hl, lib/tokens.hl, lib/tickets.hl (connect flow), lib/repos.hl.
  19. ## Rules
  20. - Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main 0a46bf7), everything under /media/STORAGE/claude-scratch/gitoria/W47/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.
  21. - Hybriel stays on the vendored set (do not re-vendor). bin/ is not in git: copy /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/bin/ into your worktree.
  22. - Ports: only PORTS (check `ss -ltn` first).
  23. - Secrets: keys/tokens stored as sha256 only (like lib/tokens.hl); the signing secret is server-readable but never sent to a page or a log.
  24. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.
  25. - Gates (LC_ALL=C), 0 failed at the end: node theme/check-theme.mjs ., node tests/browser.mjs, and every gate in deploy.sh's GATES list. Add your own gate file tests/<name>.mjs for this ticket and add it to GATES. A flake: rerun once, report it.
  26. - Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.
  27. ## Report (REPORT.md, short)
  28. What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.

Branches

Latest commits

  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre
  • dc77fb95main: offline note from __hlOnline, tick removed (#29)mre
  • 37a86d93tests/reviews: seeded fake hook's DNS failures are not server errors (flaky gate)mre
  • 07ab845bvendor: Hybriel set-day50 (run() leak fix #335)mre
  • 71b2fa4blog: hybriel#335mre
  • bd94cc7elog: #25 cause found (run() leak)mre
  • 565cb508log: H25 round 1mre
  • 90a0af84log: H25 startedmre
  • 87bd53b8mission H25mre
  • 71a746cflog: day48 livemre
  • bf568e14log: V48 mergedmre
  • 09955dedMerge v48: Hybriel set-day48, theme layouts ce4a0bamre
  • f2a2b0cevendor: Hybriel set-day48, theme layouts ce4a0bamre
  • 5d0834e7log: Apollo model rulemre
  • fe8e5bd5log: #25 sample, V48 missionmre
  • 8580c5d9log: theme fix from Atlasmre
  • 46823d93log: Apollo budget correctionmre
  • f6d32341log: Apollo on budget and #25 nextmre