gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit03b5bb0803b5bb08W39 report to reports/, drop scratch repro, mission + logmre03b5bb08/missions/W40-pr-number.md

4.3 KB

  1. # W40 — gitoria: a pull request gets a stable number and a fetchable head ref (gitoria#40, 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/40
  3. W40 = W40, PORTS = 8720–8729, branch w40-pr-number.
  4. ## Scope
  5. 1. A stored PR record per repo (mpackdb table, keyed by the repo's id, never the slug: repos can be renamed): number N (1, 2, … per repo, never reused), source branch, the |||PR commit sha, target, state open|closed|merged, head, created/updated, author (the gitoria user who pushed it when known). Existing PRs get numbers on first sight in commit-time order.
  6. 2. syncPulls(repo) that compares git with the records and returns a list of CHANGES {number, action: opened|reopened|synchronize|closed|merged, before, after, forced, mergeCommit}. Call it after a successful git-receive-pack (transport.hl, where notifyPush runs) and after the Merge button. Rules: contract §4 table (closed = branch deleted or the |||PR commit gone from it; merged = the PR is in its target; synchronize = the source branch tip moved; forced = old tip not an ancestor of new). For now just log the changes in a test-visible way; gitoria#43 turns them into events. It must not slow a push noticeably and must never fail a push.
  7. 3. refs/pull/N/head kept pointing at the PR head (update-ref with old value), created before syncPulls returns its change. Users must not be able to push refs/pull/* (check receive-pack refuses it, e.g. receive.hideRefs or a check; prove it). They must not appear as branches anywhere in the UI.
  8. 4. A pullObject(repo, N) that builds the contract §4 "pull" JSON (number, title, body, draft=false, state, author, source, target, head, ref, baseRef, base, mergeBase, tickets per contract §4, url, created, updated). No API route yet (gitoria#42/#44 add the token routes).
  9. 5. /pulls shows "#N" for each PR; the existing Merge button keeps working (mergePullNow may keep finding by sha, or by number — your call, explain).
  10. ## Read first
  11. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in the same folder.
  12. - /media/STORAGE/projects/hybriel/docs/HL-PRIMER.md, /media/STORAGE/projects/hybriel/docs/CODE-ORDER.md,
  13. /media/STORAGE/projects/hybriel/COMPONENTS.md "hl:web — a function route and its request", "§11 — Routing", "§9 — Data", and for any
  14. View change "§1", "§4 — Styles", "§12 — Composition" (List/Conditional rendering). Plugin READMEs you use (mpackdb, crypto, fetch, proc, time).
  15. 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.
  16. - THE CONTRACT: docs/apps-api.md v1 (fixed; anything you cannot build as written → report, do not change the contract).
  17. - 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.
  18. ## Rules
  19. - Work in a git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org (base main 06d622d), everything under /media/STORAGE/claude-scratch/gitoria/W40/ (REPORT.md there). Never touch live (byrodin), his repos or live data; test data only in your own temp storage.
  20. - Hybriel stays on the vendored set (do not re-vendor).
  21. - Ports: only PORTS (check `ss -ltn` first).
  22. - 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.
  23. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, do not deploy, do not write to tickets.
  24. - 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.
  25. - Budget: ~60 requests / 150k context. If the work is bigger, finish a clean part, commit, and report what remains. STOP after the report.
  26. ## Report (REPORT.md, short)
  27. What was built (files, commits), how you tested (commands + results), contract points covered and not, DOCS/GAP lines, open risks.

Branches

Latest commits

  • 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
  • 0a38f236Report repository creation API blockermre
  • b5f72187Record malformed JSON blocker for repository creationmre
  • a2ae8302logmre
  • 6947cd58logmre
  • 2175e48clogmre
  • 40eb3ca1gitoria#38: review package, logmre
  • 06a5a50egitoria#38: deploy b8252ca, logmre
  • b8252ca0gitoria#46: W46b report, logmre
  • 50093aafgitoria#46: statuses keyed by app + context (merge w46b-keyed)mre
  • dd0267edgitoria#46: fix a label in the keyed gatemre
  • b1dcb580gitoria#46: statuses keyed by app + context, required = app + context, old rows still readmre
  • 2287363egitoria#47: W47 report, logmre