Repository navigation
feat: index varandinha pointers on the seeder - #724
Merged
Merged
Conversation
The engagement index keeps pointers to the garden, garden-state and garden-help blocks: the newest flag and state per owner, and the helps addressed to an owner with their date and pot, capped per writer and owner pair, per writer and per owner. With the seeder's clock, a writer whose rows can no longer be listed gives its place to a new one, and a refused help that could still be listed marks the balcony incomplete. garden() lists helps only from writers who follow the owner, one per writer per Brasilia day, at most 4 per pot, rows dated ahead of the clock last, and answers nothing for a balcony that is off. gardenStreet() pages the owner's visible follow targets whose balcony is on, and its cursor is always a visible key. The seeder answers GET /index/garden/<owner> and /rua[/<key>], adds garden to the profile index, and reports complete false while the follow index is incomplete for the owner. Protocol section 5 and 7 describe the index and the routes.
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ê
Segundo PR da Varandinha (fase 1), sobre
feat/varandinha-records. O semeador passa a indexar os registrosgarden,garden-stateegarden-helpe responde duas rotas novas:GET /index/garden/<dono>: os ponteiros da varanda (últimogardenegarden-state), as regas de quem segue o dono dentro da janela de 72 h, uma por vizinho por dia de Brasília, no máximo 4 por vaso e 24 no total, e as regas que o próprio dono deu. Varanda desligada ou nunca aberta não responde regas.GET /index/garden/<dono>/rua[/<chave>](Varandas da rua): as varandas abertas de quem o dono segue, 20 por página, sem nunca citar uma chave que o índice de seguidos esconde./index/profile/<autor>ganhagarden(seq ounull).O índice guarda só chaves, seqs, a data e o vaso de cada rega. O nó lê e confere cada bloco. Tetos por par, por escritor e por dono, com o relógio do semeador para liberar lugares de linhas que não podem mais ser listadas; uma rega recusada que ainda poderia ser listada deixa a resposta com
complete: false. A resposta também dizcomplete: falseenquanto o índice de seguidos do dono está incompleto.Limitações conhecidas (baixas, deixadas para depois):
complete: false, mas regas novas ficam de fora enquanto a janela delas durar. Exige 512 contas admitidas.nextpode vir preenchido quando só restam chaves escondidas depois dele, o que indica que o dono segue ao menos uma conta que o índice de seguidos omite (sem dizer qual).giventraz as 24 regas próprias mais novas; com mais de 24 na janela (o nó honesto chega no máximo a 20), o bônus de regas dadas pode mudar. Só afeta a própria varanda, que já é declarada pela pessoa.Issue
Sem issue (parte da fase 1 da Varandinha).
Como verificar
npm test -w packages/core -- test/garden-index.test.js test/profile-extra-index.test.js test/engagement.test.jsnpm test -w apps/cli -- test/seeder-index.test.js test/seed-ws.test.jsdocs/verification/feat-varandinha-index.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