gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb554cd5fb554cd5flogmreb554cd5f/missions/W45-pr-page.md

5.1 KB

  1. # W45 — the PR page shows comments, threads and a re-request button (gitoria#45, 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/45
  3. W45, PORTS = 8720–8729, branch w45-pr-page from main 0a46bf7 (LIVE code = 34143d2 + docs; has #40 lib/pullsync.hl, #41 lib/apps.hl, #43 lib/events.hl raiseEvent, #44 lib/reviews.hl incl. currentVerdict, #46 lib/statuses.hl). #47 (rate limits, status read route, statuses on the pull object) is built in parallel by another worker: do not touch lib/statuses.hl's JSON shape, the API routes' limits or docs/apps-api.md.
  4. ## Scope (contract docs/apps-api.md v1.3 §4 events table, §5 shapes)
  5. 1. A PR page per PR: `/pulls/:n` and `/:orepo/pulls/:n` (a page component, the same way components/pulls.hl does it; keyed by repo id + PR number, never a list position). The /pulls list links each PR's title to its page (today it links to the commit). The page shows: title, number, state, source → target, author, the linked tickets (as on the list), the statuses on the current head (badges as on the list) and, per app, its current verdict (currentVerdict).
  6. 2. On that page: the apps' reviews (verdict, head, body) and threads (path:line, outdated/resolved marks, comments), and the PR's conversation (comments oldest first). All bodies are Markdown shown ESCAPED (no raw HTML; use lib/markdown.hl if it escapes, check it).
  7. 3. People (signed in AND owner or member of the repo, i.e. who may push; NOT HIS, my reading, keep it in one helper so it can change) can: write a conversation comment, reply in a thread, resolve/reopen a thread, and click "Review again" (per connected app). Others see the page read-only. Bodies ≤ 65,536 chars. Comments get seq like #44's (same counter, author {type user, id, name}).
  8. 4. Events (§4): `review_requested`/requested (Review again; to that app only), `pull_comment`/created (a person's conversation comment; to every connected app), `review_comment`/created (a person's reply in an app's thread; to THAT app only), `review_thread`/resolved|unresolved (to the thread's app only). raiseEvent has extra.exceptApp today; add an "only this app" option the same way. sender = the person.
  9. 5. Settings: hide the "Apps" heading (and its section) for non-owners (today a non-owner sees an empty "Apps" heading).
  10. 6. Tests: tests/pr-page.mjs in GATES: page 200 by number, 404 for an unknown number, escaping (a body with <script> shows as text), a member comments/replies/resolves/re-requests and the right app (only that one) gets the right event, a non-member gets no form and a forged POST is refused. Browser checks at 390 and 1280 (tests/browser.mjs shape).
  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/W45/ (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

  • 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
  • 4d779b3bAdd create-api gatemre
  • 88563122Add POST /api/repos for user tokensmre
  • b00860e3Create repositories with member checks in createRepoInmre