gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/missions/W39-create-api.md

3.9 KB

  1. # W39 — create a repository through the API (gitoria#39)
  2. TASK (words as relayed by Apollo, unchanged): "Also open a gitoria ticket: creating a repo is not in the API yet." Ticket: https://tickets.worldapi.org/gitoria.worldapi.org/39
  3. Build GO: Apollo 2026-11-02 (goal: new app repos no longer need gitoria stopped for a one-off script).
  4. W39, PORTS = 8720–8739, branch w39-create-api from main a2ae830 (live = b8252ca + records only).
  5. ## Scope
  6. 1. `POST /api/repos` with `Authorization: Bearer gtr_…` (the user's access token, lib/tokens.hl userOfToken). Body JSON:
  7. `{"name": "<slug>", "description": "…", "org": "<org slug, optional>", "private": false, "members": ["<user name or identity short id>", …] (optional)}`.
  8. Owner = the token's user. Use the SAME code path as the web form (lib/repos.hl createRepoIn, incl. git init and the live list update) — no second copy of the rules. Org: only where createRepoIn already allows the user. Members: lib/members.hl addMember on refOfRepo(slug); an unknown member → 422 and NOTHING created (check all members before creating).
  9. 2. Answers: 201 + the repo JSON exactly as `GET /api/repos/:slug` gives it (plus `clone` https + ssh URLs if the GET has them; do not invent new fields beyond that, list any you add in the report). Errors in the apps API §6 shape (`{"error":{"code","message"}}`, see docs/apps-api.md §6 and the existing helper): 401 no/unknown token, 403 org not allowed, 409 slug taken, 422 bad name / unknown member / user without display name, 400 invalid_json, 413 over 1 MB (use the existing jsonOfRequest).
  10. 3. A `gat_` app token must NOT create repos (403). GET /api/repos stays public and unchanged.
  11. 4. Same route on the org spellings only if the existing /api/repos routes have them; otherwise just /api/repos.
  12. 5. README.md: replace "Creating is not in the API yet" with a short paragraph (curl example with a placeholder token). Do NOT edit docs/apps-api.md (that contract belongs to the external reviewer); put a short "contract note" for it in the report instead.
  13. 6. Gate tests/create-api.mjs in deploy.sh GATES: creates via API, then the repo appears in GET /api/repos, a push with the owner's gtr_ works and a member's ssh/https rules match the web-created case (reuse what tests/browser.mjs or others do), and every error case above. Own temp storage only.
  14. ## Read first
  15. - /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in that folder.
  16. - /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". Copy a working shape from gitoria's own code (lib/api.hl, lib/app-auth.hl, lib/reviews.hl write routes). A framework gap: DOCS/GAP line with a tiny repro, no workaround, no hand-written JavaScript.
  17. - App: README.md, project.hl, lib/repos.hl, lib/tokens.hl, lib/members.hl, lib/api.hl, lib/api-helpers.hl.
  18. ## Rules
  19. - Git worktree of /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org under /media/STORAGE/claude-scratch/gitoria/W39/ (REPORT.md there). Never touch live (byrodin), his repos or live data.
  20. - Hybriel stays on the vendored set. bin/ is not in git: copy /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/bin/ into your worktree.
  21. - Ports: only PORTS (check `ss -ltn` first). Secrets: never print token values in logs or the report.
  22. - Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, deploy or write to tickets.
  23. - Gates (LC_ALL=C), 0 failed at the end: node theme/check-theme.mjs ., node tests/browser.mjs, and every gate in deploy.sh GATES. Do not end your turn while gates run in the background; wait for them.
  24. - Budget: small mission (~60 requests). If bigger, finish a clean part, commit, report what remains. STOP after the report.
  25. ## Report (REPORT.md, short)
  26. Files and commits; how tested (commands + results); contract note; 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