mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-23 03:05:20 +03:00
docs: this repo is public, so say what things are, not who decided them
Comments and served API descriptions here had grown references that only make sense to someone with our internal notes: relative paths that escape this tree, filenames and titles of documents nobody outside can open, quoted prose from them, and the name of a component that has no public surface — once in an OpenAPI description, which is published output rather than source. None of it was load-bearing. Every case restates as what the code actually requires, and every rewrite came out shorter: "in the words the host agent reports" for a component name, "republished as addresses are discovered" for a quoted phrase, "a size tier sets vCPU, RAM and the output geometry" for a sentence that had been carrying a path. Internal reasoning is now cited exactly one way, ref(d-NNNN) in a source comment, with the rule that the sentence must still stand if the marker is deleted. CLAUDE.md leads with it, because the previous version of this mistake was made by people who knew the repo was public and it still took ten occurrences to notice, so "be careful" is not a mechanism. Commit messages get the stricter rule and carry no references at all: a comment can be fixed by the next commit and a published message cannot be fixed at all. Git hooks now enforce both halves. The check caught a real one while being written: the CLAUDE.md table spelled out the paths it was prohibiting, which discloses them to exactly the reader it protects against. 138 tests, 0 fail.
This commit is contained in:
@@ -119,7 +119,7 @@ export namespace Team {
|
||||
* only thing that mints a team at signup — so the first one is the personal
|
||||
* one and any later ones were made deliberately. This is a convention, not a
|
||||
* column: adding an `isPersonal` flag would let the two disagree, and there
|
||||
* is nothing yet that needs them to.
|
||||
* is nothing yet that needs them to. ref(d-0048)
|
||||
*/
|
||||
export const personalFor = fn(Info.shape.ownerId, async (ownerId) => {
|
||||
return Database.use(async (tx) => {
|
||||
@@ -136,11 +136,10 @@ export namespace Team {
|
||||
/**
|
||||
* The personal team, made if it is not there.
|
||||
*
|
||||
* Every user has needed one since [0048](../../../../.nestri/decisions/0048-email-is-the-root-identity-and-a-box-is-a-row.md)
|
||||
* made `machine.teamId` notNull, so signup calls this and so does anything
|
||||
* that needs somewhere to put a host. Idempotent, because it runs on every
|
||||
* login rather than only on the first one — a user created before 0048 has
|
||||
* no team and gets one the next time they appear.
|
||||
* Every user has needed one since `machine.teamId` became notNull, so signup
|
||||
* calls this and so does anything that needs somewhere to put a host.
|
||||
* Idempotent, because it runs on every login rather than only on the first
|
||||
* one — an older user with no team gets one the next time they appear.
|
||||
*/
|
||||
export const ensurePersonal = fn(z.object({ displayName: z.string() }), async (input) => {
|
||||
const existing = await personalFor(Actor.userID);
|
||||
|
||||
@@ -54,8 +54,8 @@ describe('Team.ensurePersonal', () => {
|
||||
});
|
||||
|
||||
test('a user who predates the personal team gets one on next login', async () => {
|
||||
// The legacy row the 0007 migration and this call between them repair: a
|
||||
// user created by Steam sign-in before `ensurePersonal` was ever wired up.
|
||||
// The legacy row the migration and this call between them repair: a user
|
||||
// created by Steam sign-in before `ensurePersonal` was ever wired up.
|
||||
const userId = Identifier.ascending('user');
|
||||
createdUserIds.push(userId);
|
||||
await sql`insert into "user" (id, name, email) values (${userId}, ${'legacy'}, ${`legacy-${userId}@example.test`})`;
|
||||
|
||||
Reference in New Issue
Block a user