Repository navigation
feat: add the garden methods to the browser node - #725
Merged
Merged
Conversation
The rpc contract gains garden.set, garden.state, garden.play and garden.help (rpc.md 5.156 to 5.159). None takes a date or free text: the node sets every date. The browser node reads the own balcony from the own diary, joins and leaves the game (leaving tombstones every own garden-state and garden-help first and writes the off flag last, so a leave cut short still reads as on), saves one play session as one garden-state through the shared rules, and writes a help only after its own checks: not self, own game on, the helper follows the owner, one help per balcony per Brasilia day, at most 5 a day. It then reads the owner's flag and state through the seeder pointers and one peek, and fails closed when anything is unverified. Nothing is retried. The core node answers the four methods with the same USAGE refusal as the other on-demand reads.
Main took docs/rpc.md 5.156 for dm.historyCopy, so the garden sections move to 5.157 to 5.160, with every reference (methods.js, the web session and member-ops, the e2e test and the verification file). The method pins and the writes-need-the-key list keep both sides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que muda e por quê
Terceiro PR da Varandinha (fase 1), sobre
feat/varandinha-index. Liga o jogo ao nó do navegador:@varanda/rpcganhagarden.set,garden.state,garden.playegarden.help(docs/rpc.md5.157 a 5.160). Nenhum recebe data nem texto livre: o nó escolhe cada data.garden-stateegarden-helppróprios e grava ogardendesligado por último, então uma saída interrompida continua ligada); grava uma sessão de jogo como um sógarden-state, com as regras delib/garden.js; e só grava uma rega depois das checagens: não é a própria varanda, o jogo de quem rega está ligado, a pessoa não está bloqueada, quem rega segue o dono, uma rega por varanda por dia de Brasília, no máximo 5 por dia. Depois confere ogardene ogarden-statedo dono pelos ponteiros do semeador e uma espiada, e recusa (semeador indisponível) quando algo não confere. Nada é reenviado.USAGEdas outras leituras sob demanda, sem escrever nada.Limitações conhecidas (baixas):
garden.playaceita a colheita com o limite mais generoso de regas recebidas (3 por vaso), porque as regas ficam no diário dos vizinhos. Sem cesta nem pontuação, uma colheita adiantada não ganha nada.garden.helprepete o padrão descrap.write: fechar a sessão durante a conferência no semeador (até 12 s) não cancela a escrita que vem depois.to(exige o serviço de conta). A checagem é a mesma descrap.write.Issue
Sem issue (parte da fase 1 da Varandinha).
Como verificar
npm test -w packages/rpc -- test/methods.test.jsnpm test -w packages/core -- test/engagement-session.test.jsnpm test -w packages/web-member -- test/garden.test.js test/garden-e2e.test.js(Node 20.19 ou mais novo)docs/verification/feat-varandinha-node.md.main; depois dela, rodou no topo da pilha (feat/varandinha-app), que contém este ramo. A CI do GitHub roda neste PR.Checklist
npm run lint,npm test(ounpm test -- --affected=origin/main) enpm run demopassamdocs/changelog/<branch>.mde verificação emdocs/verification/<branch>.md, se houver, sem editar o CHANGELOG.md nem acrescentar seção ao docs/verification.md (só verificação: sem tela, nada chega à pessoa usuária ainda)docs/rpc.md5.157 a 5.160)