gitoria
All repositories: gitoria
4.5 KB
# W41 — gitoria: repo owners can connect an app to a repo (gitoria#41, part of the push API #38)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/41W41 = W41, PORTS = 8730–8739, branch w41-apps-connect.## Scope (contract docs/apps-api.md §0, §1)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.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.3. Manual way B: Settings → Apps → Add (name + receiver URL) → key and secret shown ONCE.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.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).6. Leave a clearly named hook point where gitoria#43 will send the ping after connect (no sending now).Not in scope: tokens gat_ (#42), events (#43).## Read first- /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.- /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,/media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for anyView change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).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.- THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).- 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.## Rules- 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.- Hybriel stays on the vendored set (do not re-vendor).- Ports: only PORTS (check `ss -ltn` first).- 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.- Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.- 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.- Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.## Report (REPORT.md, short)What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- fd4fc028Exercise member status reads with a populated check statemre
- 536ca6f9Allow repository members to read pull workflow APIs with user tokensmre
- 705dd834W49 missionmre
- b554cd5flogmre
- f4c9440ddeploy.sh: tar --hard-dereference for the live data backupmre
- 1a687b15Merge branch 'w48-member-merge'mre
- 166c775fW48 report, logmre
- 1b4623f0Members merge pull requests: API route, button on /pulls and /pulls/N, one shared merge pathmre
- 1075c38cW48 mission, logmre
- 17bdd0d6V37/V39 missions, logmre
- 146de5f8Re-vendor gitoria to Hybriel set-day39 (51e921d7)mre
- e874e44dtests/status-keyed: app token lives 60 s so it outlives the gate's two restartsmre
- 270b8d61deploy.sh: DEPLOY_STOP_START=1 stops, waits for the old pid, then starts (mpackdb freeze, replaces the standby swap)mre
- 3f9235b8project.hl: drop the dummy /pulls/:n component route (hybriel#294 is fixed in day37)mre
- c90daf19Re-vendor gitoria to Hybriel set-day37 (f6b3d45b)mre
- 03b5bb08W39 report to reports/, drop scratch repro, mission + logmre
- 154d333fMerge w39-create-api: POST /api/repos with a user token (#39)mre
- 149dd512Rewrite W39 reportmre
- e5385075Expect 401 for POST /api/repos without a tokenmre
- 1a76055cDocument repository creation APImre