From 09d575834317243862d10535f735d1f99303b0cb Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 21 Nov 2026 21:04:16 +0100 Subject: [PATCH] nftables: ask converged through the node-engine seat's generated package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The holder's ask of the node-engine's converged takes the seat's name, the verb's name and the answer's form from the node-engine seat's TypeScript package, as the holder says its own event through its seat's package. Builds: design 33 control-verbs §10, §12; design 47 H H-A-316, H-A-321 --- modules/nftables/allowances.ts | 10 +++------- modules/nftables/package.json | 3 ++- modules/nftables/tools/index.ts | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/nftables/allowances.ts b/modules/nftables/allowances.ts index a8f40839a..f5d5269ed 100644 --- a/modules/nftables/allowances.ts +++ b/modules/nftables/allowances.ts @@ -8,6 +8,7 @@ // its own state, said and journalled, so no expired entry is kept or answered. import { isIP } from "node:net"; +import type { ConvergedAnswer } from "@novox/mesh-contracts-node-engine"; /** The state the allowances are kept in, as the seat's definition names it (§7). */ export const STATE = "allowances"; @@ -55,13 +56,8 @@ export interface Changed { at: string; } -/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316). */ -export interface Convergence { - state: "adopted" | "converged"; - since?: string; - /** The found firewall's kind, for an adopted node. */ - found?: string; -} +/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316, H-A-321). */ +export type Convergence = ConvergedAnswer; /** One act by hand, as the seat mesh-hand-acts' hand-act takes it (ADR 0565 §10): the SDK's views.HandAct. */ export interface HandAct { diff --git a/modules/nftables/package.json b/modules/nftables/package.json index 34139c83d..38cc540ba 100644 --- a/modules/nftables/package.json +++ b/modules/nftables/package.json @@ -10,7 +10,8 @@ }, "dependencies": { "@novox/mesh-sdk": "^0.1.1", - "@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0" + "@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0", + "@novox/mesh-contracts-node-engine": "^0.1.0" }, "devDependencies": { "@types/node": "^22.0.0", diff --git a/modules/nftables/tools/index.ts b/modules/nftables/tools/index.ts index 03b3ccdb0..5646e0017 100644 --- a/modules/nftables/tools/index.ts +++ b/modules/nftables/tools/index.ts @@ -8,6 +8,7 @@ import { broker } from "@novox/mesh-sdk/messaging"; import { config, seatPublish } from "@novox/mesh-sdk/runtime"; import { keeps, state } from "@novox/mesh-sdk/state"; import { allowancesChangedSubject } from "@novox/mesh-connectivity-contracts-node-packet-filter"; +import { seat as nodeEngine, verbs as nodeEngineVerbs } from "@novox/mesh-contracts-node-engine"; import { FirewallClient } from "../client.js"; import { Allowances, MOST, STATE, markLoaded, type Convergence, type Store, type Value } from "../allowances.js"; @@ -127,7 +128,7 @@ const store: Store = { }, }; const allowances = new Allowances(store, node, (body) => seatPublish(allowancesChangedSubject(node), body), { - converged: async () => (await broker().request(`seat:node-engine.converged@${node}`, {})), + converged: async () => (await broker().request(`seat:${nodeEngine}.${nodeEngineVerbs.converged}@${node}`, {})), handAct: async (act) => { await broker().request("seat:mesh-hand-acts.hand-act", act); }, most: async () => { const v = await config("allowances-max");