Drop Advanced › Other rules from the agent form, so an agent's gates are the fetch gate's four parts: a stored gate the parts cannot say is named in a note under the fetch gate and sent back unchanged on Save, and the card still says it in words

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 14:33:34 +02:00
1 parent 136047023e
commit 1913101061
7 files changed
+193 -125

No files matched your search

+8 -7
View File
@@ -1,5 +1,6 @@
// static/remote.js without a browser: the badge, the suggestions the agent's
// remote line offers, and how gates share out between Where and Other rules.
// remote line offers, and how gates share out between the fetch gate and the
// rest the form keeps as stored.
//
// node --test tests/js/*.test.mjs
@@ -89,14 +90,14 @@ test("any other require gate on country is the scope with its codes as chips", (
assert.deepEqual(rest, []);
});
test("a second require gate on country stays a row", () => {
test("a second require gate on country is kept as stored", () => {
const second = must("NO");
const { where, rest } = rh.distribute([europe, second]);
assert.equal(where.scope.kind, "europe");
assert.deepEqual(rest, [second]);
});
test("the titles to leave out are the exclude gate on title, and any other exclude is a row", () => {
test("the titles to leave out are the exclude gate on title, and any other exclude is kept as stored", () => {
const titles = { field: "title", values: ["account executive"], mode: "exclude" };
const level = { field: "seniority", values: ["junior"], mode: "exclude" };
const { where, rest } = rh.distribute([titles, level]);
@@ -104,7 +105,7 @@ test("the titles to leave out are the exclude gate on title, and any other exclu
assert.deepEqual(rest, [level]);
});
test("a gate with a mode the form does not know stays a row and takes no Where line", () => {
test("a gate with a mode the form does not know is kept as stored and takes no Where line", () => {
const prefer = { field: "remote", values: ["hybrid"], mode: "prefer" };
const { where, rest } = rh.distribute([prefer]);
assert.deepEqual(where.remote, { mode: "none", values: [] });
@@ -112,7 +113,7 @@ test("a gate with a mode the form does not know stays a row and takes no Where l
assert.deepEqual(rest, [prefer]);
});
test("a require gate on another field is a row and leaves the scope everywhere", () => {
test("a require gate on another field is kept as stored and leaves the scope everywhere", () => {
const level = { field: "seniority", values: ["senior"], mode: "require" };
const { where, rest } = rh.distribute([level]);
assert.equal(where.scope.kind, "everywhere");
@@ -129,7 +130,7 @@ test("remote, three modes: the plain gate is within the scope", () => {
assert.deepEqual(named.rest, []);
});
test("a remote_from gate wins over the plain one, which stays a row", () => {
test("a remote_from gate wins over the plain one, which is kept as stored", () => {
for (const gates of [[older, from("country:DK")], [from("country:DK"), older]]) {
const { where, rest } = rh.distribute(gates);
assert.deepEqual(where.remote, { mode: "from", values: ["country:DK"] });
@@ -137,7 +138,7 @@ test("a remote_from gate wins over the plain one, which stays a row", () => {
}
});
test("a second remote_from gate or a must stays a row", () => {
test("a second remote_from gate or a must is kept as stored", () => {
const second = from("country:SE");
const required = { field: "remote_from", values: ["country:DK"], mode: "require" };
const { where, rest } = rh.distribute([from("country:DK"), second, required]);