gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit477d7bdc477d7bdcMerge branch 'p50'mre477d7bdc/missions/W46b-status-keyed.md

4.6 KB

  1. # W46b — statuses keyed by app + context (gitoria#46 security fix, contract v1.4; 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/46
  3. W46b, PORTS = 8720–8739 (you are the only worker), branch w46b-keyed from main 9678a8f (= live 34143d2 + #45 PR page + #47 limits/v1.3, merged, not deployed yet).
  4. ## The bug
  5. lib/statuses.hl keeps one row per (sha, context): app B's PUT with context "kunibert" replaces app A's status, and because "required before merge" names only a context, any connected app can fake a required success. Vinzenz decided (contract docs/apps-api.md v1.4, read its §4 pull object, §5 Status, and the v1.4 changelog line): KEYED.
  6. ## Scope
  7. 1. statusRows: one row per (repo, sha, app id, context). A PUT replaces only the calling app's own row. GET {api}/statuses/<sha> and pull.statuses list all apps' rows (each with app {id,name}).
  8. 2. requiredRows: app id + context. Settings "Required before merge" (owner): pick a connected app (by its id, never by list position) + type a context; the list shows "App name · context"; Remove by row id. A required entry whose app was removed stays and shows as "(removed app) · context"; it is never met (Merge stays off) until the owner removes it.
  9. 3. mergePullNow: met = a row for THAT app + context with state success on the PR's current head. /pulls and the PR page badges stay as they are (they show app name + context already).
  10. 4. pull.required = [{"app":{"id","name"},"context"}] (name "(removed app)" if gone).
  11. 5. Live data: byrodin's statusreq.db is EMPTY; statuses.db has a few rows (one repo, kunibert-proof), every row already has appId. Old rows must keep working after deploy (if the unique key changes, a row written by the old code must still be read and be replaced correctly by the same app's next PUT — show this in the gate with a row written in the old shape). No one-off script on live.
  12. 6. Tests: extend tests/status.mjs (and tests/limits.mjs if its required shape changes): two apps, same context, both stored apart; B cannot change A's; required A+ctx is not met by B's success; removed app → never met; old-shape row read and replaced.
  13. ## Read first
  14. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.
  15. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,
  16. /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for any
  17. View change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).
  18. 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.
  19. - THE CONTRACT: docs/apps-api.md v1.3 (fixed; anything you cannot build as written → report, do not change the contract).
  20. - 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.
  21. ## Rules
  22. - Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main 9678a8f), everything under /media/STORAGE/claude-scratch/gitoria/W46b/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.
  23. - 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.
  24. - Ports: only PORTS (check `ss -ltn` first).
  25. - 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.
  26. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.
  27. - 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.
  28. - Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.
  29. ## Report (REPORT.md, short)
  30. What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.

Branches

Latest commits

  • 477d7bdcMerge branch 'p50'mre
  • 00efc06fP50 reportmre
  • e3f85afblog: commit mention slipmre
  • 4d1a4cf4log: #25 numbersmre
  • 1af0a60ddocs: H25 run() correctionmre
  • eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
  • 8c8ba2f1log: PR flow announcedmre
  • fa00cd35log: Kunibert pings provenmre
  • 3a68cfaclog: components decisionmre
  • 87de8e31log: Kunibert connected to 9 app reposmre
  • c22aff69log: PR-only rollout startedmre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • 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