fix(gate): stop injecting the redundant Altro option on select gates

buildSelectRequest injected an `altroOption` ({id:"other", opens:freetext}) into the
select descriptor, but SelectWidget/MultiselectWidget never route option.opens — so it
rendered as an inert "Altro — specifica…" button next to the working reserved
"Other — specify" control (which now owns free-text since the reviewer-gate-ux fix).
Remove the injection, the now-unused altroOption()/ALTRO_LABEL, and the unused
allow_other flag from both builders (no frontend consumer). Free-text stays offered on
every gate via the reserved "Other" control. The ArtifactGateWidget opens/LinkageHost
linkage (reject-with-reason capability) is intentionally kept — it is a separate,
tested feature, not the injected duplicate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 19:10:01 +02:00
co-authored by Claude Opus 4.8
parent 25ab37d0fe
commit b043293baf
4 changed files with 14 additions and 31 deletions
@@ -33,20 +33,17 @@ test("select F1 matches golden shape", () => {
assert.equal(result.type, "ui_request");
assert.equal(result.schema_version, 1);
assert.deepEqual(result.reserved, g.reserved); // back/exit/other framework hatches
assert.deepEqual(
result.options.filter((o) => o.id !== "other"),
g.options.filter((o) => o.id !== "other"),
);
assert.deepEqual(result.options, g.options);
});
test("select always carries the Altro escape hatch with freetext linkage", () => {
test("select no longer injects an Altro option (free-text is the reserved 'Other' control)", () => {
const result = buildSelectRequest({
id: "u", phase: "F1", title: "x",
options: [{ id: "a", label: "A" }],
});
const other = result.options.find((o) => o.id === "other");
assert.ok(other, "Altro option must always be present");
assert.equal(other.opens.widget, "freetext");
assert.equal(result.options.find((o) => o.id === "other"), undefined, "no injected Altro option");
assert.ok(!("allow_other" in result), "the unused allow_other flag is gone");
assert.deepEqual(result.reserved, ["back", "exit", "other"], "Altro still offered via the reserved control");
});
test("select surfaces a recommended marker when given", () => {
@@ -70,6 +67,7 @@ test("multiselect F4 matches golden + carries content + allowEmpty", () => {
const g = golden("multiselect_F4.json");
assert.equal(result.widget, "multiselect");
assert.equal(result.allow_empty, false);
assert.ok(!("allow_other" in result), "the unused allow_other flag is gone");
assert.ok("content" in result);
assert.deepEqual(result.reserved, g.reserved);
});