From 5adb8e1fea4a6c7c96e902dd666de6ef4d59aa09 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 4 Nov 2026 12:16:37 +0100 Subject: [PATCH] CAT-RD10: the deprecated mesh-catalog module reads none of the indexer's state; it registers builds without manifests, said once (ruling U4) --- modules/mesh-catalog/heard.ts | 1 - modules/mesh-catalog/index.ts | 20 ++++++++++++++------ modules/mesh-catalog/module.json | 3 +-- modules/mesh-catalog/test/heard.test.ts | 5 +++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/mesh-catalog/heard.ts b/modules/mesh-catalog/heard.ts index 619639ed..c8d58acd 100644 --- a/modules/mesh-catalog/heard.ts +++ b/modules/mesh-catalog/heard.ts @@ -52,7 +52,6 @@ export interface Built { export const BUILDER = "mesh-delivery-builder"; export const BUILDS_SINCE_TOOL = "builder_builds_since"; export const BUILDS_STATE = "mesh-delivery-builder.builds"; -export const MANIFESTS_STATE = "mesh-delivery-indexer.manifests"; /** One entry of the builder's log, an ended build (mesh-sdk delivery.BuildLogEntry). */ export interface LogEntry { diff --git a/modules/mesh-catalog/index.ts b/modules/mesh-catalog/index.ts index cc034002..c70d80ec 100644 --- a/modules/mesh-catalog/index.ts +++ b/modules/mesh-catalog/index.ts @@ -15,7 +15,7 @@ import { invokeTool } from "@novox/mesh-sdk/tools"; import { state } from "@novox/mesh-sdk/state"; import { Graph } from "./store.js"; import { - answerOf, builtFrom, placeable, BUILDER, BUILDS_SINCE_TOOL, BUILDS_STATE, MANIFESTS_STATE, + answerOf, builtFrom, placeable, BUILDER, BUILDS_SINCE_TOOL, BUILDS_STATE, type Built, type BuildsSince, type LogEntry, } from "./heard.js"; @@ -94,11 +94,19 @@ let caughtUp = false; let asking: Promise | undefined; let askAgain = false; -const manifestOf = async (digest: string | undefined): Promise => { - if (!digest) return {}; - const held = await state<{ manifest?: string }>(MANIFESTS_STATE).get(digest); - if (!held?.value.manifest) return {}; - return JSON.parse(held.value.manifest); +/** + * **The indexer's manifests are no longer read** (novox/hq ADR 0615 §1, ruling U4): the module graph is the indexer's since + * ADR 0604, and this deprecated module's graph feeds nothing (no module consumes what it announces, and the seat + * `mesh-catalog` is the indexer's). Nothing replaces the read: a build is registered with an empty manifest, said once, until + * the module is retired. + */ +let manifestsSaid = false; +const manifestOf = async (_digest: string | undefined): Promise => { + if (!manifestsSaid) { + manifestsSaid = true; + console.error("mesh-catalog: deprecated; builds are registered without their manifests (the indexer's manifests are not read, ADR 0615)"); + } + return {}; }; const takeIn = async (e: LogEntry, replay: boolean): Promise => { diff --git a/modules/mesh-catalog/module.json b/modules/mesh-catalog/module.json index fe30560e..c49699cb 100644 --- a/modules/mesh-catalog/module.json +++ b/modules/mesh-catalog/module.json @@ -89,7 +89,6 @@ "mesh-delivery-builder.builder_builds_since" ], "reads": [ - "mesh-delivery-builder.builds", - "mesh-delivery-indexer.manifests" + "mesh-delivery-builder.builds" ] } diff --git a/modules/mesh-catalog/test/heard.test.ts b/modules/mesh-catalog/test/heard.test.ts index 391cb5e9..b70b0270 100644 --- a/modules/mesh-catalog/test/heard.test.ts +++ b/modules/mesh-catalog/test/heard.test.ts @@ -2,7 +2,7 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import { readFile } from "node:fs/promises"; -import { answerOf, builtFrom, placeable, BUILDER, BUILDS_SINCE_TOOL, BUILDS_STATE, MANIFESTS_STATE } from "../heard.js"; +import { answerOf, builtFrom, placeable, BUILDER, BUILDS_SINCE_TOOL, BUILDS_STATE } from "../heard.js"; // A walk's build as the build seat says it (mesh-controller's link.BuildResult), here mailu's of novox/hq issue 712. const walkBuild = { @@ -24,7 +24,8 @@ test("the catalogue takes builds from the builder's log, and hears no controller const manifest = JSON.parse(await readFile(new URL("../module.json", import.meta.url), "utf8")); assert.deepEqual(manifest.consumes, []); assert.ok(manifest.invokes.includes(`${BUILDER}.${BUILDS_SINCE_TOOL}`), "the builder's tool is not invoked"); - for (const read of [BUILDS_STATE, MANIFESTS_STATE]) assert.ok(manifest.reads.includes(read), `${read} is not read`); + // ADR 0615 §1, ruling U4: the indexer's manifests are not read (the module is deprecated and feeds nothing). + assert.deepEqual(manifest.reads, [BUILDS_STATE]); // A log entry is placed as a build: done with its manifest, made and against; failed passed over; queued not taken in. const entry = { event: "build.ended", module: "mailu", fp: "fp1", repository: walkBuild.repository, directory: "modules/mailu", commit: walkBuild.commit, ref: "main", at: "2026-10-29T20:00:00Z", outcome: "done", manifest: "ab", against: ["img@sha256:1"],