Skip to content

Commit e37b600

Browse files
authored
Make Smart Route starter copy direct (#2)
* fix: make Smart Route starter copy direct * fix: sharpen Smart Route lane boundaries
1 parent fe4fd3f commit e37b600

4 files changed

Lines changed: 354 additions & 355 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ one part of the catalog without being copied. `revision` changes when the
7979
curated starter changes. Existing Smart Routes are independent copies and are
8080
never changed by a catalog update.
8181

82-
All displayed descriptions use first-person copy. Lane descriptions are capped
83-
at 512 bytes because that is the classifier input limit.
82+
Displayed copy describes each starter and lane directly. Lane descriptions are
83+
capped at 512 bytes because that is the classifier input limit.
8484

8585
Validate a catalog edit before committing it:
8686

‎scripts/smart-route-starters.mjs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function byteLength(value) {
2323
return Buffer.byteLength(value, "utf8");
2424
}
2525

26-
function cleanText(problems, value, label, maxBytes, firstPerson = false) {
26+
function cleanText(problems, value, label, maxBytes, direct = false) {
2727
if (typeof value !== "string" || value.trim() !== value || value === "") {
2828
problems.push(`${label} must be a non-empty trimmed string`);
2929
return "";
@@ -37,8 +37,8 @@ function cleanText(problems, value, label, maxBytes, firstPerson = false) {
3737
if (value.includes("—")) {
3838
problems.push(`${label} uses an em dash`);
3939
}
40-
if (firstPerson && !/^I(?:\b|['’])/.test(value)) {
41-
problems.push(`${label} must use first-person copy`);
40+
if (direct && /^I(?:\b|['’])/.test(value)) {
41+
problems.push(`${label} must describe the item directly`);
4242
}
4343
const words = value.toLowerCase().match(/[a-z]+/g) ?? [];
4444
for (const word of words) {
@@ -253,4 +253,3 @@ export function validateSmartRouteStarters(artifact) {
253253
findForbiddenTargetFields(artifact, "artifact", problems);
254254
return problems;
255255
}
256-

‎scripts/smart-route-starters.test.mjs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function artifact() {
1313
{
1414
id: "featured",
1515
title: "Featured starters",
16-
description: "I want a useful starting point.",
16+
description: "Useful starting points for daily work.",
1717
starters: ["daily-work"],
1818
},
1919
],
@@ -22,30 +22,30 @@ function artifact() {
2222
id: "daily-work",
2323
revision: 1,
2424
name: "Daily Work",
25-
summary: "I want one route for daily work.",
25+
summary: "Routes common daily work.",
2626
tags: ["general"],
2727
endpoint_families: ["openai.responses"],
2828
lanes: [
2929
{
3030
id: "quick-help",
3131
name: "Quick help",
32-
description: "I need a short answer.",
33-
target_hint: "I want a fast target.",
32+
description: "Short answers and simple questions.",
33+
target_hint: "Best with a fast target.",
3434
},
3535
{
3636
id: "deep-work",
3737
name: "Deep work",
38-
description: "I need a difficult problem worked through.",
39-
target_hint: "I want a reasoning target.",
38+
description: "Difficult problems and multi-step reasoning.",
39+
target_hint: "Best with a reasoning target.",
4040
},
4141
],
42-
fallback: { target_hint: "I want a dependable target." },
42+
fallback: { target_hint: "Best with a dependable target." },
4343
},
4444
],
4545
};
4646
}
4747

48-
test("accepts a model-neutral first-person starter catalog", () => {
48+
test("accepts a model-neutral starter catalog with direct copy", () => {
4949
assert.deepEqual(validateSmartRouteStarters(artifact()), []);
5050
});
5151

@@ -66,12 +66,12 @@ test("rejects model bindings and unsupported endpoints", () => {
6666
assert.ok(problems.some((problem) => problem.includes("unsupported endpoint")));
6767
});
6868

69-
test("rejects non-first-person and oversized classifier copy", () => {
69+
test("rejects first-person and oversized classifier copy", () => {
7070
const input = artifact();
71-
input.starters[0].summary = "Routes daily work.";
72-
input.starters[0].lanes[0].description = `I ${"x".repeat(512)}`;
71+
input.starters[0].summary = "I want a route for daily work.";
72+
input.starters[0].lanes[0].description = `A ${"x".repeat(512)}`;
7373
const problems = validateSmartRouteStarters(input);
74-
assert.ok(problems.some((problem) => problem.includes("must use first-person copy")));
74+
assert.ok(problems.some((problem) => problem.includes("must describe the item directly")));
7575
assert.ok(problems.some((problem) => problem.includes("longer than 512 bytes")));
7676
});
7777

0 commit comments

Comments
 (0)