Repository navigation
test(worker): a visitor with no account leaves a note, on a worker with accounts (FRU-224) - #281
Conversation
There was a problem hiding this comment.
Score de confiance : 4/5 · ✅ Rien de bloquant · Peut être fusionnée: la PR ajoute des tests et de la documentation sur le parcours visiteur sans modifier le code de production; le seul point de vigilance est l'acceptation de notes sans session sur un site réservé aux membres, documentée et signalée comme question ouverte.
Niveau lite · anthropic/claude-haiku-5.5 · 0,002 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
There was a problem hiding this comment.
Score de confiance : 4/5 · ✅ Rien de bloquant · La PR peut être fusionnée : je n'ai relevé aucun défaut nouveau introduit par ce changement. Le point d'attention est un choix de produit déjà documenté (une note anonyme est gardée sur un site réservé aux membres), qui existait avant ce changement.
Niveau lite · anthropic/claude-haiku-5.5 · 0,003 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
|
@sakuga-review review heavy |
There was a problem hiding this comment.
Score de confiance : 5/5 · ✅ Rien de bloquant · La PR peut être fusionnée : elle n'ajoute que des tests et de la documentation, sans aucun changement du code du worker.
Niveau heavy · anthropic/claude-opus-5.5 · 0,109 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
|
Reply to the heavy review of 444684f (5/5), on what it could not read: |
There was a problem hiding this comment.
Score de confiance : 4/5 ·
Niveau lite · anthropic/claude-haiku-5.5 · 0,003 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
There was a problem hiding this comment.
Score de confiance : 4/5 ·
Niveau lite · anthropic/claude-haiku-5.5 · 0,004 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
|
Reply to the lite review of 90ce4a2 (4/5): a second PGlite world in one case, right. The control of test: |
There was a problem hiding this comment.
Score de confiance : 4/5 · ✅ Rien de bloquant · Mergeable en l'état : la PR ajoute des tests, de la documentation et une règle de visibilité sans modifier le code de production visible ; le point à surveiller est la note acceptée sur un site réservé aux membres, documentée comme choix délibéré.
Niveau lite · anthropic/claude-haiku-5.5 · 0,002 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
|
@sakuga-review review heavy What changed since the heavy review of 444684f (5/5): the branch took the new head of #277 (a merge of |
There was a problem hiding this comment.
Score de confiance : 4/5 · ✅ Rien de bloquant · Mergeable : la PR n'ajoute que des tests et de la documentation, sans changer le code du worker ; aucun défaut bloquant n'a été trouvé.
Niveau heavy · anthropic/claude-opus-5.5 · 0,105 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
…th accounts (FRU-224) Mathieu, 2026-10-13: an account is always possible for whoever administers, and is not needed to leave a note. The code did it already, and no test held the whole path on a worker whose sites come from the console: the ones that did ran on FRUITBACK_CLIENTS, which is going. - `visitor.test.ts`: a site made through the console, a note with no session, no token and no cookie, read again, refused from another origin; a site for members answers 401 to a read. - `e2e/visitor.spec.ts`: the same in a browser, where CORS stops a page of another origin. - Measured, and written in SECURITY.md: a site for members still takes a note that has no session. - The token signed by the site is not decided, and nothing here changes it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h no fallback (FRU-224) Raised in review: the assertion fell back to the origin of the page when the header was absent, and then compared the page with itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… same world (FRU-224) Raised in review: the case opened a second PGlite world, and a process holds one PGlite database at a time. The control reads a site of the same workspace that everyone reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8873aa7 to
6e1886a
Compare
There was a problem hiding this comment.
Score de confiance : 4/5 · ✅ Rien de bloquant · Le changement ne contient que des tests, de la documentation et des décisions déjà documentées ; il peut être fusionné, sous réserve de vérifier les fixtures et le code worker non présents dans la PR.
Niveau lite · anthropic/claude-haiku-5.5 · 0,003 $ · Le résumé, le diagramme et la liste des constats sont à la fin de la description de la PR.
Stack: #277 → this. The base is the branch of #277 (FRU-223): the E2E spec needs the workers of the suite to have accounts, which is what #277 gives them. For Mathieu, with #277: it states what is protected (
SECURITY.md), and it raises one question below. I do not merge it.Tests and documents only.
app.tsdoes not change.Scope
FRU-224 has two halves. This is the first: the guard on the path of a visitor with no account. The second half is not here, on purpose: the token signed by the site (a secret for each site of the console, or the end of that way of working) is a decision that is not taken. Nothing in this pull request adds, removes or prepares it;
docs/modes.mdsays what holds today.What it does
Mathieu, 2026-10-13: « on peut créer un compte quoiqu'il arrive aussi pour la partie admin, par contre pas forcément besoin de compte pour laisser des notes côté user ». The worker did it already. No test held the whole path on a worker whose sites come from the console: the tests that did ran on
FRUITBACK_CLIENTS, which is going (FRU-184).apps/worker/src/visitor.test.ts(7 cases, throughhandleRequest, on PostgreSQL (PGlite), better-auth on, the notes in the store of the database). An admin signs in and makes the site through the route of the console. A visitor then sends what the<script>of the site sends: the id of the site and theOriginof the page, with noAuthorizationand noCookie.e2e/visitor.spec.ts(3 specs, in Chromium, on the two workers of the suite). What a browser adds is CORS: a page of another origin gets no status and no body.SECURITY.md,docs/modes.md,docs/decisions/worker.md.One thing measured that the ticket says otherwise
A site for members takes a note that has no session. The ticket and FRU-184 say that such a site « asks for a paired session ». That is true of a read (
401,identity-required). A write with no token is a claim on every site (attributionFor), and is kept:201. Its sender cannot read it back; the members find it, in the worker or in the tracker of the site.That is what
maindoes, and has done since the visibility isread. I changed nothing: test:still takes a note sent with no session, which its sender cannot read backholds the behaviour with a warning that it is not a promise, andSECURITY.mdnow says it in plain words (« The visibility of a site decides who reads it, and not who writes on it »).Question for Mathieu: should a site read by
membersrefuse a note that comes with no session? Today a team has no setting for « notes from our members only ». It is one condition inattributionFor, and it would also close the team mode to a reviewer whose extension is not paired yet.Proof
everyonemade by the console, a note with noAuthorization, read with no tokenleaves a note and reads it again, with no session, no token and no cookie; in a browser:a visitor plants a pin and finds it again, and no request carried a credential(each request to/feedbackis read: noauthorization, nocookie)refuses a note and a read that name the site from the page of another site(two checks, both named:origin-not-allowedfor an origin that is no site,origin-not-allowed-for-clientfor the site of another workspace); in a browser:a page of another origin reads no note of the site, and plants none, with its control (the page of the site reads its note with the same request) and the answer of the worker read from outside the browser (403, no CORS header)reads no note: the worker asks for a session, and says so; in a browser:on a site that its members read, a visitor reads no note(the same page and the same site id on two workers:401and200)keeps the name the visitor typed, and never says the worker verified it(the visitor sendsverified: true)Originis removedresolveClient: 1 test ofvisitor.test.tsfailsclientOf(read: 'public'for every site): 2 tests failOn this machine:
visitor.test.ts7 pass; the three specs pass against the workers of #277; the whole worker suite, 1568 tests, 0 fail, 109 skipped (the ones that need a server);typecheck,oxlint,oxfmtclean.Not done, not verified
worker.md» (ticket): there is no decision to write.worker.mdsays that it is not taken.docs/modes.mdis not rewritten. It describes a worker ofFRUITBACK_CLIENTSas well as a worker with accounts, and what it becomes depends on point 3 and on FRU-225. I added a section that says what the visibility of a site is in the words of that page, and that the host's token does not exist on a worker with accounts.everyoneanybody who opens the page reads and writes notes?). That screen is being rebuilt from the new mock-up by other agents (FRU-243); I did not touch it. With the measure above, the sentence formembersshould not promise that only members write.visitor.test.ts.🤖 Generated with Claude Code
Sakuga Review · Score de confiance : 4/5
Le changement ne contient que des tests, de la documentation et des décisions déjà documentées ; il peut être fusionné, sous réserve de vérifier les fixtures et le code worker non présents dans la PR.
Résumé
La PR ajoute des tests qui vérifient qu'un visiteur sans compte peut laisser et relire une note sur un site visible par tous, que l'origine est contrôlée, et qu'un site réservé aux membres refuse la lecture sans session (401). Elle ajoute aussi un test e2e (CORS, absence de cookie et d'Authorization) et met à jour SECURITY.md, docs/decisions/worker.md et docs/modes.md. Le diff ne montre pas le code des routes ni d'attributionFor ; je n'ai donc pu vérifier les tests que par leur cohérence interne avec la documentation.
Non relu
Revues (8) · Dernier commit relu : test(worker): the control of the read of a site... · Niveau
lite·anthropic/claude-haiku-5.5· 0,003 $