fix: make join review read only

This commit is contained in:
User
2026-07-14 15:06:16 +02:00
parent c7474f3852
commit 27af6733c8
11 changed files with 378 additions and 22 deletions
+23
View File
@@ -177,6 +177,28 @@ function buildSchemaLinkingRequest({ id, phase, title, tables }) {
};
}
// Build a blocking, read-only join review. The reviewer can accept the complete
// proposal or use Other to request a textual correction; individual joins are
// deliberately not selectable because omitting one could create a Cartesian product.
function buildJoinReviewRequest({ id, phase, title, options }) {
requireString(title, "title", "join-review");
const opts = requireArray(options, "options", "join-review");
if (opts.length === 0) {
throw new Error("builders: join-review requires at least one option");
}
return {
type: "ui_request",
id,
phase,
schema_version: SCHEMA_VERSION,
widget: "join-review",
title,
options: [...opts],
confirm_label: "Continue",
reserved: RESERVED,
};
}
// Attach a child-widget spec to an option (linkage, §4.2). Returns the option.
function withChildLinkage(option, widgetSpec) {
option.opens = widgetSpec;
@@ -190,6 +212,7 @@ module.exports = {
buildInfoRequest,
buildFreetextRequest,
buildSchemaLinkingRequest,
buildJoinReviewRequest,
withChildLinkage,
SCHEMA_VERSION,
RESERVED,