Skip to content
Myr

Merge docs/w14-adrs into main

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by oscabriel · committed by oscabriel · parents 140db4f, 3a30c9a · Browse files · 3 files+66 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+66 added−1 removed

  • other:+66 added−1 removed

3 files+66 added−1 removed

added:docs/adr/0032-a-project-is-named-by-its-owner-and-the-forty-keep-their-keys.md+28 added
1---2status: accepted3---45# A project is named by its owner, and the forty keep their keys67A project's name was one lowercase word, `datekit`, and that word was its address on the web (`/datekit`), at the gateway (`datekit.git`), in every contract's `project` field, and inside the platform: the Durable Object's id, the Artifacts repo's name, the code cache's key and every projection row. One flat namespace cannot hold two people's `notes`, says nothing about who a project belongs to, and gives an imported repo an address that hides where it came from.89A project's name is now `<owner>/<name>`. An **owner** is a person's handle, lowercased (`oscabriel/datekit`), or a **source namespace**, the host and account a repo was imported from, from a fixed list of hosts (`github.com/pallets/click`, `codeberg.org/dnkl/fuzzel`). A name is a person or a source namespace, never both: handles hold no dot and hosts always do. Organisations will be a second kind of owner in the same place. The web serves a project at `/<owner>/<name>`, the gateway at `<platform>/<owner>/<name>.git` (a claim fork at `…/<name>--<ask>--<handle>.git`), the CLI's `--project` takes the full name, and every contract's `project` field carries it. `ProjectName` keeps its identifier and means the full name; `Owner` and `ShortName` are its parts; one parser in `packages/protocol/src/ids.ts` reads it and lowercases on the way in, and `packages/protocol/test/project-name.test.ts` holds it.1011Inside the platform a project keeps a flat **key**: the Durable Object's id, the repo's name, the code cache's key and the projection columns. The key is a pure function of the name: the name with `/` replaced by `_` (`oscabriel_foo`, `github.com_pallets_click`), which no handle, host, account or short name contains, so it reverses. The forty projects made before this decision keep the keys they have (`datekit`, `click`): `packages/protocol/src/legacy.ts` lists each with its name, `keyOf` and `nameOfKey` consult it first, and `ProjectName`'s decode accepts a bare legacy key and gives its name. So a stored event, a projection row, a Durable Object's own id, an old clone's remote, `--project datekit` and MCP's `project: "datekit"` all read as `oscabriel/datekit`, and nothing stored is migrated. The web answers `/<legacy>` and every address under it with a 301 to the full name; the gateway serves `<legacy>.git` and its forks as aliases, with no redirect, since git follows one only on its first request. The table is a cartridge: re-key the forty and delete it.1213Owning a namespace gives one right: to make projects in it. `initProject` refuses `NotYourNamespace` when the name's owner is neither the caller's handle nor the source namespace of the import's URL. Nothing else moves: deciders stay per path from the config folder, an import's importer stays its fallback decider, and `setEnv`, policy edits and custody are as they were. A namespace is not a policy right.1415## Considered Options1617- **Rename the Durable Objects and repos to the new keys.** A clean store, but a Durable Object cannot be renamed and an Artifacts repo cannot be moved: each of the forty would be copied, with its events and its storage, on two stages, days before the demo is recorded. The alias costs a table of forty lines.18- **A registry table (D1, or one Durable Object per owner) mapping each name to a key.** It would also serve uniqueness and a person's project list, but it is a second source of truth, consulted on every call, for a mapping that is pure for every project but forty. Uniqueness is the key's: two names never share one.19- **Keep flat names and add the owner as a field.** No address changes, but `/notes` still belongs to whoever took it first, and the user asked for `/owner/repo`.20- **Every import under the importer's handle** (Gitea's model). Honest about who brought it, but the address then hides the source, two people's imports of one repo get two addresses, and the host-path address (ADR 0033) would need a lookup by source. The source namespace is the address and the provenance at once; a person may still import under their own handle.21- **Give the owner policy rights** (decide everywhere, set env). Simpler to explain, but the platform's rights are per path in the config folder on `main`, where every reader can see them; a namespace right would be a second, invisible kind.2223## Consequences2425- `ProjectName`'s grammar widens; the short name allows `.` and `_` with single separators (`commander.js`), so an import keeps its own name. The first segment may not be a word the web serves its own pages at, and sign-up refuses those words as handles.26- `repoKind`, fork names, layer repos and the well-known skill's URL carry the key, so the forty's URLs there are unchanged.27- A projection row whose key decodes to no name (a torn-down throwaway) is skipped by the lists.28- The demo's recorded addresses and commands stay true through the alias.
added:docs/adr/0033-a-repo-is-imported-from-the-web-and-its-host-path-offers-the-import.md+25 added
modified:GLOSSARY.md+13 added-1 removed
79 unmodified lines
80The commit the platform itself last landed on main; the only commit a project's rules are read from.81_Avoid_: HEAD, tip of main8283**Import**:84A project adopted from a public repo: a read-only copy, not run by its maintainers, whose first `main` is the source branch's tip. The source, its address and branch, stays on the project's record and is shown as where it was imported from.84A project adopted from a public repo: a read-only copy, not run by its maintainers, whose first `main` is the source branch's tip. The source, its address and branch, stays on the project's record and is shown as where it was imported from; by default the project is named at its source namespace.85_Avoid_: mirror, fork (of the source), sync8687**Outcome**:88Where an offered answer stands: Checking, Landed, WaitingOnParent, AwaitingFinish, AwaitingDecision or Refused; only Refused carries refusals, and waiting is not a refusal.
109 unmodified lines
198_Avoid_: dummy value, mock secret199200## Platform201202**Project name**:203A project's full name, `<owner>/<name>`: an owner, then the short name the owner chose. It is the project's address on every surface.204_Avoid_: slug, repo name, full name, path205206**Owner**:207The namespace a project is named in: a person's handle, or a source namespace. Owning a namespace is the right to make projects in it and nothing more; deciding stays with the config folder.208_Avoid_: org, account, maintainer, admin209210**Source namespace**:211An owner that is the host and account a repo was imported from, such as `github.com/pallets`, so an import's address says where it came from.212_Avoid_: upstream, origin, mirror213214**Config folder**:215The .myr/ folder on main holding the project's process as TypeScript: project.ts, kinds, asks, visibility.ts, the vouch file.216_Avoid_: settings, workflow files217
18 unmodified lines