gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/missions/W41-apps-connect.md

4.5 KB

  1. # W41 — gitoria: repo owners can connect an app to a repo (gitoria#41, 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/41
  3. W41 = W41, PORTS = 8730–8739, branch w41-apps-connect.
  4. ## Scope (contract docs/apps-api.md §0, §1)
  5. 1. lib/apps.hl: apps table keyed by the repo's id (not slug): {id, repo, name, hookUrl, keyHash (sha256 of gak_+40 hex), secret (64 hex, server-only), createdBy, created, lastDelivery, lastStatus}. One row per (repo, app name); a re-connect replaces key and secret. appOfKey(key) like userOfToken. Remove (row gone, key dead) and rotate secret.
  6. 2. Connect flow A exactly as contract §1: GET <repo address>/settings/apps/connect?app&hook&return&state (and the /:orepo form for org repos) → sign-in → owner check (ownsRepo) → a confirm page → redirect return?code&state; code one-time, 5 min. POST /api/apps/exchange {code} → the JSON of §1 step 3. Reuse the shapes of lib/tickets.hl connectStart/connectBack where they fit.
  7. 3. Manual way B: Settings → Apps → Add (name + receiver URL) → key and secret shown ONCE.
  8. 4. URL allow-list (Apollo 2026-11-02, corrected): hook and return are allowed when (a) https:// with host worldapi.org or a subdomain, or (b) the URL starts with one of the configured HyperConductor bases EXACTLY as written, plain http and internal IP:port included (env var, e.g. GITORIA_APP_HOSTS, same values as tickets' TICKETS_PUSH_ALLOWED: http://100.77.141.84:8100, http://127.0.0.1:45010, http://100.109.3.10:8100; documented in README; default empty). Anything else 400 invalid_url (JSON error shape of contract §6). No redirects. Check the prefix with a path boundary (base + '/'), so http://100.77.141.84:8100.evil does not pass.
  9. 5. Settings → Apps section (owner only): list apps (name, receiver host, created, last delivery status), Remove, Rotate secret (new secret shown once), Add. Follow the existing Settings view's form and style (WORKER-RULES STYLE FORMAT).
  10. 6. Leave a clearly named hook point where gitoria#43 will send the ping after connect (no sending now).
  11. Not in scope: tokens gat_ (#42), events (#43).
  12. ## Read first
  13. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.
  14. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,
  15. /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for any
  16. View change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).
  17. 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.
  18. - THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).
  19. - Evaluation: reports/E38-push-api-eval.md (sections 1–6) and reports/E38b-reference-needs.md. App: README.md, project.hl, lib/pulls.hl, lib/transport.hl, lib/tokens.hl, lib/tickets.hl (connect flow), lib/repos.hl.
  20. ## Rules
  21. - Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main 06d622d), everything under /media/STORAGE/claude-scratch/gitoria/W41/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.
  22. - Hybriel stays on the vendored set (do not re-vendor).
  23. - Ports: only PORTS (check `ss -ltn` first).
  24. - 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.
  25. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.
  26. - 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.
  27. - Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.
  28. ## Report (REPORT.md, short)
  29. What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.

Branches

Latest commits

  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre