CAT-RD2: gitea asks the indexer's modules once and follows its events (TypeScript follower), no reads; mesh-build-go's manifest text kept as it was

This commit is contained in:
2026-11-04 12:14:56 +01:00
parent d618cbb9ca
commit b00a826681
6 changed files with 289 additions and 28 deletions
+9 -5
View File
@@ -9,9 +9,9 @@
//
// **Which repositories: the indexer's word, read over the bus.** mesh-delivery-indexer keeps every registered module in its
// state `modules` (mesh-sdk go/delivery ModulesBucket), each value naming the repository it builds from. This module reads
// that state (its manifest's `reads`) with a watch: the watch hands the latest value of every key when it starts, and then
// every change, so a repository is granted at the module's start and when a module of it is first registered. Nothing
// polls. A repository of the organisation needs nothing: the organisation's team writes it (tools-account.ts). Every other
// that state through the indexer's read tool (its manifest's `invokes`) and then its views events (`consumes`; ADR 0615): the
// first view hands the latest value of every key when the module starts, and then every change, so a repository is granted
// at the module's start and when a module of it is first registered. Nothing polls and the state is not read. A repository of the organisation needs nothing: the organisation's team writes it (tools-account.ts). Every other
// repository of a user (the operator's dotfiles, say) is left as it is: read only.
//
// **Every grant is read back** from the forge (its permission for the account), and said on the bus as
@@ -31,8 +31,12 @@ import type { ForgeRepository } from "./client.js";
import type { BranchProtection } from "./protection.js";
import { CHECK_CONTEXT, CHECK_STATUS, REPO_CHECK_CONTEXT } from "./pulls.js";
/** The indexer's state this module reads: one key per registered module, its value naming the repository. */
export const INDEXER_MODULES = "mesh-delivery-indexer.modules";
/** The indexer, whose state `modules` this module follows: one key per registered module, its value naming the repository.
* It asks the indexer's read tool once and then hears its views events (ADR 0615), never reading the state. */
export const INDEXER_OWNER = "mesh-delivery-indexer";
export const INDEXER_MODULES_TOOL = `${INDEXER_OWNER}.indexer_read_modules`;
export const INDEXER_MODULES_EVENTS = `${INDEXER_OWNER}.views.modules`;
const INDEXER_MODULES = `${INDEXER_OWNER}.modules`;
/** The event said once an account writes a repository it could not write before. */
export const WRITABLE_EVENT = "repo.writable";