gitoria
All repositories: gitoria
7.5 KB
# Report 002 (w082): gitoria code order, no behaviour change**Where:** commits on main in loreana:/media/STORAGE/projects/gitoria.worldapi.org:- `110c279`: file moves (1/4)- `090a20c`: topics, map and thin wrappers (2/4)- `cc7bf7b`: `let` (3/4)- the docs + tests commit (4/4), which also holds this report and the mission briefNot pushed, not deployed. No `.env` read. Only ports 8750–8759 were used. Every server and sshd container was stopped by its PID or name; nothing of mine is still running.## Counts (before → after; `python3 tests/letcount.py .`)| | before (fdfb4b1) | after ||---|---|---|| `.hl` files in the root | 14 | **1** (project.hl) || project.hl lines | 251 | **126** (index comment, PWA config, routes, audience, server) || `let` total | 530 | 213 || `let` never reassigned | **296** | **0** |The 213 `let`s left are all needed:- 125 are reassigned;- 88 are re-bound in a loop body. Hybriel refuses a plain declaration there on its 2nd pass (tickets lesson).## LayoutThe full file map is in README "Files". Imports only go one way: util / git-helpers / markdown ← users ← repos-helpers ← git ← repos ← tickets-helpers ← homepage / code / pulls / releases ← tickets ← tokens / sshkeys ← transport ← api-helpers ← api ← project.hl.- **`lib/git.hl`** was 732 lines covering five topics. It is now split:- `git.hl`: the git calls, branches, `initRepo`, `isEmptyNow`, `tmpDir` (moved here from transport.hl);- `homepage.hl`, `code.hl`, `pulls.hl`, `releases.hl`: one per topic;- `git-helpers.hl`: path, name and id checks, tab fields, sizes, and the `|||PR` / `|||RL` subject parsers.- **`lib/repos.hl`**: the table and every write to it.- `mayPush` is new here. It is the single "only the owner pushes" rule; before, transport.hl and sshgate.hl each had their own copy.- `repos-helpers.hl`: slug rules, the row a page shows, `withChange`, `pageTitle`, the Markdown view.- **`lib/users.hl`**: users and ident.- `userOfLoginCode` is the one exchange + `ensureUser` step. Before, the login route and the selector face each had their own copy.- `tagOf` moved here out of project.hl.- **`lib/tickets.hl`** gained `finishConnect`, the logic of `/settings/connected` (taken out of project.hl).- `tickets-helpers.hl`: the tickets URL, the answer shapes, `#12` references.- **`lib/transport.hl`** holds `gitTransport` and `callGit`.- `transport-helpers.hl`: the Basic password, plain answers, `Git-Protocol`, pkt-line.- **`lib/sshkeys.hl`** gained `keyLine`, the authorized_keys line (taken out of sshgate.hl).- **`lib/api.hl`**: every function route, as thin wrappers:- `/api/repos…`;- `/login/callback`;- `/settings/connect…`;- `/__git/keys` and `/__git/access` (this was sshgate.hl).- **`lib/api-helpers.hl`**: JSON / Markdown / text answers, `goTo`, `sshGuard`, `repoOfRequest`, `safeNext`.- **`lib/util.hl`**:- was localtime.hl;- also holds env, `storageDir`, the addresses (`publicUrl`, `slugOfHost`, `domainFor`), lists, text checks;- `newestFirst` replaces three copies of the same insertion sort.- **Faces made thin:**- "Make main" → `code.hl makeMain`;- the Merge answer → `pulls.hl pullsView`;- the selector login → `userOfLoginCode`.- The session writes stay in the faces, because a face's `session` parameter is the framework's own.- **Removed:**- `jsoncheck.hl` was imported nowhere;- `git.hl parseView` was called nowhere.- **Moved:** `styles.hl` → `components/styles.hl`. `tools/migrate-short-ids.hl` now imports from `lib/`.## Tests| test | result ||---|---|| gate `tests/browser.mjs` (8750–8759) | **200 passed, 0 failed** before and after each step || `tests/push.mjs` | **46/0** before and after each step || `tests/ssh.mjs` | **44/0** before and after each step || live-data reads + writes | identical, except **1 intended difference** (below) |The gate commands are in README "Test". The browser gate runs with `GITORIA_GATE_TICKETS_DIR` set to a `git archive HEAD` copy of tickets. The reason: the tickets working tree is currently being changed by another worker, and with it the gate crashed at the start ("tickets name failed").**Live-data comparison** (new `tests/realdata-baseline.mjs` and `tests/realdata-compare.py`; how to run: README "Test" → "Same output"):- **Data:** a copy of Byrodin's `storage/mpackdb` + `storage/git`, taken 2026-10-03. Each run gets a fresh copy.- **Reads** (678), signed in as az5b2 through a session file:- every page of all 13 repos, signed in and out: `/` including the 3 MB tracker README, code, files, folders, branches, commits, pulls, releases, tickets, settings;- unknown addresses;- the 20 browser modules;- `/api/repos…` as JSON and as Markdown;- every refs advertisement, v0 and v2;- the refusals;- the login, connect and `/__git` routes.- **Writes** (80):- faces: create, token, ssh key, Make main, Merge, open ticket, disconnect, remove, login, logout;- over HTTPS: clone, then push with a token (also refused without one or with a bad one);- over SSH, through the real sshd container: clone tracker, push a branch to email, refused after the key is removed;- the pages that follow each write.- **Tickets:** the connected repo's tickets are a snapshot, served on port 8759, so nothing reaches live tickets. The live tickets API changed its links during this run, which is why a snapshot is needed.- **Masks:** two runs of the OLD code compare clean (758/758).- **Browser modules:** they differ only in the tables of imported statics and in source positions. The script checks the component code and the kind of every imported name it uses. Step 3 also changes `var` → `const`.**The 1 difference (intended, a fix that came with the cleanup):**- **What changed:** a failed `/login/callback` in a browser that already has a session now shows its reason on `/login/failed`. For example: "login is not set up …".- **Before:** it always showed "the login did not finish — try again".- **Cause:** the old `failed(req, why)` was a second call. It got a COPY of `req` and so a copy of the session, and its write was lost.- **Fix:** project.hl now hands `&req` and `&server.sessions` to the session-writing routes, the same fix as in tickets mission 010.- **To undo it:** pass `req` by value to `loginFailed` in lib/api.hl.**Other checks:**- `tools/migrate-short-ids.hl` loads and refuses exactly as before (no storage, no key, ident down).- `tests/short-id-switch.mjs` was **not run**: it is historical and uses fixed ports 8724/8725, which are outside my range.## Found (in STATUS "Lessons")1. **A session-writing route needs `&req` and `&server.sessions`.** gitoria lost the login-failure reason through a by-value `req`.2. **The browser module carries the statics of every file a component imports.** Moving a static changes the module's tables and the `?v=` hashes, but not the page. Compare the component code instead.3. **The tickets working tree can be mid-change.** Gate against a `git archive HEAD` copy.4. **A crashed gate leaves its servers running.** Check `ss -ltnp | grep :875` and kill by PID.## Not done / open- **Not deployed** (that is the architect's job). Use the normal `deploy.sh`. There is no data change.- deploy.sh's rsync does not delete, so the old root `.hl` files stay on Byrodin. They are unused and can be removed by hand.- **Scratch** (gitignored) in `.scratch/w082/`:- `old/` (the old tree, code only);- `tickets-head/` (code only);- `gates.sh` (the three gates on 8750–8759);- `unlet.py`.- **Deleted after the run:** the live-data copy and every baseline output (they hold live data).
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
- c50d17efKeep function-route not-found style in shared stylesheetmre
- e42d78d3Preserve ticket state CSS and document function-route style gapmre
- c6b7154eWIP gitoria#26: move styles into nested component blocksmre
- 77a2c31cgitoria#31: plain declarations instead of needless let in lib/ and tools/ (103 let removed, 137 kept because reassigned); no other changemre
- 4b98ab62gitoria: an ident access key (idt_) works as the git password; read key clones only, bad key 401, ident down 503 (ident#27); gate tests/ident-access-gitoria.mjs in deploy.shmre
- 1185f686gitoria#36: a failed return from tickets shows a note on the settings page and leaves one log line per outcome; no code is exchangedmre
- 5d2c385agitoria: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 71+5 failing → 76 passed; deploy.sh runs tests/private.mjs toomre
- 241ef3f9deploy.sh: rebuild the sshd image before up -d (GO34c)mre
- 821cdbb1gitoria#34b: styles, create-repo tool, docs, push/ssh gates sign in through the selector, shots scriptmre
- a81abdc9gitoria#34: org page via function route, member-reachable orgs, selects, reportmre
- 17f031f0gitoria#34: private repos, organizations, members, move tool, gatemre
- 71b69343gitoria#23: the sidebar's Repositories link was a 404 after any in-page navigation (static menu re-evaluated publicUrl in the browser); the menu is an instance property now; gate taps it after a tab, folder, filemre
- 90b4f728gitoria#25: restore the homepage cache and the parsed-blocks cache (they store data under immutable keys, no HTML); the page key, the framework readme key and the textHash key stay removedmre
- a487248cgitoria#25: remove every cache that hid the page build (page key, Markdown render key, homepage cache, parsed-blocks cache) and the gate that only tested themmre
- 12f2f4fegitoria: re-vendor Hybriel set-day27b, a startup fault in on Error exits 1mre
- c21c084egitoria: write the standby service out in full so the boot gate can read the main servicemre
- e307d69agitoria: say what is per process during the hand-overmre
- f0cbe6a6gitoria: standby service on port 45014 and a deploy that hands over through it without a gapmre
- 727cd083gitoria#25: README: vendor notes for Hybriel c1b1010f and the page cachemre
- 61b72dedgitoria#25: re-vendor Hybriel master c1b1010f (W149 page cache), key the repo Readme page by slug and main commit, extend the readme-cache gatemre