gitoria
All repositories: gitoria
3.9 KB
# W39 — create a repository through the API (gitoria#39)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/39Build GO: Apollo 2026-11-02 (goal: new app repos no longer need gitoria stopped for a one-off script).W39, PORTS = 8720–8739, branch w39-create-api from main a2ae830 (live = b8252ca + records only).## Scope1. `POST /api/repos` with `Authorization: Bearer gtr_…` (the user's access token, lib/tokens.hl userOfToken). Body JSON:`{"name": "<slug>", "description": "…", "org": "<org slug, optional>", "private": false, "members": ["<user name or identity short id>", …] (optional)}`.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).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).3. A `gat_` app token must NOT create repos (403). GET /api/repos stays public and unchanged.4. Same route on the org spellings only if the existing /api/repos routes have them; otherwise just /api/repos.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 Vinzenz); put a short "contract note" for it in the report instead.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.## Read first- /media/STORAGE/projects/WorldAPI/worldapi-conductor/archive/2026-10-31/WORKER-RULES.md (all) and RULINGS.md in that 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". 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.- App: README.md, project.hl, lib/repos.hl, lib/tokens.hl, lib/members.hl, lib/api.hl, lib/api-helpers.hl.## Rules- 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.- Hybriel stays on the vendored set. bin/ is not in git: copy /media/STORAGE/projects/WorldAPI/gitoria.worldapi.org/bin/ into your worktree.- Ports: only PORTS (check `ss -ltn` first). Secrets: never print token values in logs or the report.- Commits: small, plain subjects, no self-attribution, on your branch only. Do not push, deploy or 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 GATES. Do not end your turn while gates run in the background; wait for them.- Budget: small mission (~60 requests). If bigger, finish a clean part, commit, report what remains. STOP after the report.## Report (REPORT.md, short)Files and commits; how tested (commands + results); contract note; 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
- 358474bflog: P50 livemre
- 477d7bdcMerge branch 'p50'mre
- 00efc06fP50 reportmre
- e3f85afblog: commit mention slipmre
- 4d1a4cf4log: #25 numbersmre
- 1af0a60ddocs: H25 run() correctionmre
- eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
- 8c8ba2f1log: PR flow announcedmre
- fa00cd35log: Kunibert pings provenmre
- 3a68cfaclog: components decisionmre
- 87de8e31log: Kunibert connected to 9 app reposmre
- c22aff69log: PR-only rollout startedmre
- 25309981log: STOP and paused workers 2026-11-08mre
- 5286803alog: worker briefs and reports of 2026-11-08mre
- 85c86605log: 2026-11-08 Arachne on list shapemre
- cb634512log: 2026-11-08 keyed lists livemre
- 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
- 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
- b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
- 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre