CAT-RD10: the deprecated mesh-catalog module reads none of the indexer's state; it registers builds without manifests, said once (ruling U4)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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<void> | undefined;
|
||||
let askAgain = false;
|
||||
|
||||
const manifestOf = async (digest: string | undefined): Promise<unknown> => {
|
||||
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<unknown> => {
|
||||
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<void> => {
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
"mesh-delivery-builder.builder_builds_since"
|
||||
],
|
||||
"reads": [
|
||||
"mesh-delivery-builder.builds",
|
||||
"mesh-delivery-indexer.manifests"
|
||||
"mesh-delivery-builder.builds"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user