harness-everything 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +7 -0
- package/ci/mechanism-332-fable-directive.test.js +98 -2
- package/ci/mechanism-report-writer.test.js +17 -0
- package/harness-everything/SKILL.md +1 -1
- package/harness-everything/scripts/tier-router.js +27 -12
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +27 -12
- package/sbom.cdx.json +7 -7
- package/scripts/report-writer.js +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "harness-everything",
|
|
11
11
|
"source": "./",
|
|
12
12
|
"description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
|
|
13
|
-
"version": "1.5.
|
|
13
|
+
"version": "1.5.2",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Miya Daniel"
|
|
16
16
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harness-everything",
|
|
3
3
|
"description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Miya Daniel"
|
|
7
7
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.5.2](https://github.com/dyphn1/Harness-everything/compare/v1.5.1...v1.5.2) (2026-12-01)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **reports:** reject padded finalized status lines ([1b4963c](https://github.com/dyphn1/Harness-everything/commit/1b4963c6ee2b3ec8c4f9b8237c720a6339e56202)), closes [#542](https://github.com/dyphn1/Harness-everything/issues/542)
|
|
10
|
+
* **router:** honor fable quote boundaries and negation ([bdd4e44](https://github.com/dyphn1/Harness-everything/commit/bdd4e44d62becc104385b72ab5f2ba4baedd9f72)), closes [#558](https://github.com/dyphn1/Harness-everything/issues/558)
|
|
11
|
+
|
|
5
12
|
## [1.5.1](https://github.com/dyphn1/Harness-everything/compare/v1.5.0...v1.5.1) (2026-12-01)
|
|
6
13
|
|
|
7
14
|
### Bug Fixes
|
|
@@ -5,9 +5,14 @@ const path = require('node:path');
|
|
|
5
5
|
|
|
6
6
|
const ROOT = path.resolve(__dirname, '..');
|
|
7
7
|
const ROUTER = path.join(ROOT, 'harness-everything', 'scripts', 'kernel-router.js');
|
|
8
|
+
const PACKAGED_ROUTER = path.join(ROOT, 'plugins', 'harness-everything', 'skills', 'harness-everything', 'scripts', 'kernel-router.js');
|
|
9
|
+
const ROUTERS = [
|
|
10
|
+
['source', ROUTER],
|
|
11
|
+
['packaged', PACKAGED_ROUTER],
|
|
12
|
+
];
|
|
8
13
|
|
|
9
|
-
function route(prompt) {
|
|
10
|
-
const result = spawnSync(process.execPath, [
|
|
14
|
+
function route(prompt, router = ROUTER) {
|
|
15
|
+
const result = spawnSync(process.execPath, [router], {
|
|
11
16
|
cwd: ROOT,
|
|
12
17
|
encoding: 'utf8',
|
|
13
18
|
input: JSON.stringify({ hook_event_name: 'UserPromptSubmit', prompt }),
|
|
@@ -177,4 +182,95 @@ const quotedSeparator = route('Use “fable; use fable on opus” as an example'
|
|
|
177
182
|
assert.notEqual(quotedSeparator.strategy, 'fable-staged');
|
|
178
183
|
assert.ok(!quotedSeparator.reasonCodes.includes('explicit-strategy-request'));
|
|
179
184
|
|
|
185
|
+
const quotedFableExamples = [
|
|
186
|
+
'用「fable; use fable on opus」當例子說明',
|
|
187
|
+
'使用「fable; use fable on opus」作為範例',
|
|
188
|
+
'用『fable; use fable on opus』當例子說明',
|
|
189
|
+
'Use 「fable; use fable on opus」 as an example',
|
|
190
|
+
'Use 《fable; use fable on opus》 as an example',
|
|
191
|
+
];
|
|
192
|
+
const polarityCases = [
|
|
193
|
+
{
|
|
194
|
+
prompt: '不要改用 fable 重構整個 repository architecture',
|
|
195
|
+
tier: 'tier3',
|
|
196
|
+
strategy: 'iterative-single',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
prompt: 'Do not switch to fable; redesign the architecture across the repository',
|
|
200
|
+
tier: 'tier3',
|
|
201
|
+
strategy: 'iterative-single',
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
const contradictionCases = [
|
|
205
|
+
'不要改用 fable;改用 fable-staged 做這個任務',
|
|
206
|
+
'改用 fable-staged 做這個任務;不要改用 fable',
|
|
207
|
+
'Do not switch to fable; use fable-staged for this task',
|
|
208
|
+
'Use fable-staged for this task; do not switch to fable',
|
|
209
|
+
'Do not use fable; use fable-staged for this task',
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
for (const [name, router] of ROUTERS) {
|
|
213
|
+
const quotedProhibitionWithOuterRequest = route('用「不要使用 fable」當例子說明;改用 fable-staged 重構整個 repository architecture', router);
|
|
214
|
+
assert.equal(quotedProhibitionWithOuterRequest.strategy, 'fable-staged', `${name}: quoted prohibition is data and the real outer request selects Fable`);
|
|
215
|
+
assert.ok(quotedProhibitionWithOuterRequest.reasonCodes.includes('explicit-strategy-request'), `${name}: outer request is explicit`);
|
|
216
|
+
assert.notEqual(quotedProhibitionWithOuterRequest.fallback.disposition, 'blocked', `${name}: quoted prohibition does not conflict with the outer request`);
|
|
217
|
+
|
|
218
|
+
const quoteBoundaryDoesNotJoin = route('Do not "example" fable; use fable-staged for this task', router);
|
|
219
|
+
assert.equal(quoteBoundaryDoesNotJoin.strategy, 'fable-staged', `${name}: excluding a quote does not join text into a false prohibition`);
|
|
220
|
+
assert.notEqual(quoteBoundaryDoesNotJoin.fallback.disposition, 'blocked', `${name}: quote removal does not manufacture a conflict`);
|
|
221
|
+
|
|
222
|
+
const unquotedContradiction = route('不要使用 fable;改用 fable-staged 重構整個 repository architecture', router);
|
|
223
|
+
assert.equal(unquotedContradiction.fallback.disposition, 'blocked', `${name}: unquoted prohibition still conflicts`);
|
|
224
|
+
assert.ok(unquotedContradiction.reasonCodes.includes('explicit-request-conflicts-with-prohibition'), `${name}: unquoted conflict is recorded`);
|
|
225
|
+
|
|
226
|
+
for (const prompt of quotedFableExamples) {
|
|
227
|
+
const plan = route(prompt, router);
|
|
228
|
+
assert.ok(!String(plan.strategy).startsWith('fable-'), `${name}: ${prompt}: quoted text selects no Fable strategy`);
|
|
229
|
+
assert.ok(!plan.reasonCodes.includes('explicit-strategy-request'), `${name}: ${prompt}: quoted text is not an explicit request`);
|
|
230
|
+
assert.ok(!plan.routerOutput.includes('REQUESTED FABLE PROFILE'), `${name}: ${prompt}: quoted profile is not requested`);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const quotedAndUnquoted = route('Use 「fable; use fable on opus」 as an example; use fable-staged for this task', router);
|
|
234
|
+
assert.equal(quotedAndUnquoted.strategy, 'fable-staged', `${name}: unquoted directive still selects Fable`);
|
|
235
|
+
assert.ok(quotedAndUnquoted.reasonCodes.includes('explicit-strategy-request'), `${name}: unquoted directive is explicit`);
|
|
236
|
+
assert.ok(!quotedAndUnquoted.routerOutput.includes('REQUESTED FABLE PROFILE'), `${name}: quoted profile stays data`);
|
|
237
|
+
|
|
238
|
+
for (const verb of ['use', 'run', 'enter', 'switch to']) {
|
|
239
|
+
const affirmative = route(`${verb} fable for this task`, router);
|
|
240
|
+
assert.equal(affirmative.strategy, 'fable-staged', `${name}: ${verb} is an affirmative directive`);
|
|
241
|
+
assert.ok(affirmative.reasonCodes.includes('explicit-strategy-request'), `${name}: ${verb} is recorded as explicit`);
|
|
242
|
+
const prohibited = route(`Do not ${verb} fable; redesign the repository architecture`, router);
|
|
243
|
+
assert.equal(prohibited.strategy, 'iterative-single', `${name}: do not ${verb} fable downgrades the topology`);
|
|
244
|
+
assert.ok(prohibited.reasonCodes.includes('user-prohibited-fable'), `${name}: do not ${verb} fable is a prohibition`);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
for (const verb of ['使用', '用', '啟用', '進入', '執行', '改用']) {
|
|
248
|
+
const affirmative = route(`${verb} fable 做這個任務`, router);
|
|
249
|
+
assert.equal(affirmative.strategy, 'fable-staged', `${name}: ${verb} is an affirmative directive`);
|
|
250
|
+
assert.ok(affirmative.reasonCodes.includes('explicit-strategy-request'), `${name}: ${verb} is recorded as explicit`);
|
|
251
|
+
const prohibited = route(`不要${verb} fable 重構整個 repository architecture`, router);
|
|
252
|
+
assert.equal(prohibited.strategy, 'iterative-single', `${name}: 不要${verb} fable downgrades the topology`);
|
|
253
|
+
assert.ok(prohibited.reasonCodes.includes('user-prohibited-fable'), `${name}: 不要${verb} fable is a prohibition`);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
for (const { prompt, tier, strategy } of polarityCases) {
|
|
257
|
+
const plan = route(prompt, router);
|
|
258
|
+
assert.equal(plan.tier, tier, `${name}: ${prompt}: structural tier remains`);
|
|
259
|
+
assert.equal(plan.strategy, strategy, `${name}: ${prompt}: prohibition selects a single-agent topology`);
|
|
260
|
+
assert.ok(plan.reasonCodes.includes('user-prohibited-fable'), `${name}: ${prompt}: prohibition is recorded`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
for (const prompt of contradictionCases) {
|
|
264
|
+
const plan = route(prompt, router);
|
|
265
|
+
assert.equal(plan.fallback.disposition, 'blocked', `${name}: ${prompt}: contradiction is blocked`);
|
|
266
|
+
assert.ok(plan.reasonCodes.includes('explicit-request-conflicts-with-prohibition'), `${name}: ${prompt}: conflict is recorded`);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const existingChineseControl = route('不要使用 fable 重構整個 repository architecture', router);
|
|
270
|
+
assert.equal(existingChineseControl.strategy, 'iterative-single', `${name}: existing prohibition control downgrades`);
|
|
271
|
+
assert.ok(existingChineseControl.reasonCodes.includes('user-prohibited-fable'));
|
|
272
|
+
const quotedControl = route('Use “fable; use fable on opus” as an example', router);
|
|
273
|
+
assert.ok(!String(quotedControl.strategy).startsWith('fable-'), `${name}: paired curly-quote control stays non-Fable`);
|
|
274
|
+
}
|
|
275
|
+
|
|
180
276
|
console.log('PASS: #332 Fable directive real-entry controls');
|
|
@@ -205,6 +205,18 @@ test('441-A accepts trailing ASCII spaces or tabs on raw Codex STATUS and writes
|
|
|
205
205
|
assert.deepEqual(fs.readFileSync(output), Buffer.from('Summary\nSTATUS: DONE\n'));
|
|
206
206
|
assertOk(run(['check', '--file', output]));
|
|
207
207
|
|
|
208
|
+
// Raw Codex input remains normalized for both outcomes and padding forms.
|
|
209
|
+
for (const [rawStatus, status, reason, expected] of [
|
|
210
|
+
['STATUS: DONE ', 'DONE', null, 'STATUS: DONE'],
|
|
211
|
+
['STATUS: BLOCKED: verification unavailable\t', 'BLOCKED', 'verification unavailable', 'STATUS: BLOCKED: verification unavailable'],
|
|
212
|
+
]) {
|
|
213
|
+
fs.writeFileSync(raw, `Summary\n${rawStatus}\n`);
|
|
214
|
+
const args = writeArgs(output, status, ['--from-codex-output', raw], ...(reason ? ['--reason', reason] : []));
|
|
215
|
+
assertOk(run(args));
|
|
216
|
+
assert.deepEqual(fs.readFileSync(output), Buffer.from(`Summary\n${expected}\n`));
|
|
217
|
+
assertOk(run(['check', '--file', output]));
|
|
218
|
+
}
|
|
219
|
+
|
|
208
220
|
// Padded STATUS: BLOCKED followed by a blank line and an EOF host label.
|
|
209
221
|
const labeledRaw = Buffer.from(`Summary\nSTATUS: BLOCKED: verification unavailable \t\n\n${VALID_LABEL}\n`);
|
|
210
222
|
fs.writeFileSync(raw, labeledRaw);
|
|
@@ -371,6 +383,11 @@ test('check accepts one terminal status with LF or CRLF and rejects other contro
|
|
|
371
383
|
for (const invalid of [
|
|
372
384
|
'Summary',
|
|
373
385
|
'Summary\nSTATUS: DONE ',
|
|
386
|
+
'Summary\nSTATUS: DONE\t',
|
|
387
|
+
'Summary\nSTATUS: BLOCKED: reason ',
|
|
388
|
+
'Summary\nSTATUS: BLOCKED: reason\t',
|
|
389
|
+
'Summary\nSTATUS: BLOCKED: reason',
|
|
390
|
+
'Summary\nSTATUS: BLOCKED: reason ',
|
|
374
391
|
'Summary\n STATUS: DONE',
|
|
375
392
|
'Summary\nSTATUS: DONE\n\n',
|
|
376
393
|
'Summary\nSTATUS: DONE\ntrailing',
|
|
@@ -146,20 +146,33 @@ const FABLE_STRATEGIES = [
|
|
|
146
146
|
['fable-parallel', /\bfable[- ]parallel\b|\bparallel fable\b/i],
|
|
147
147
|
['fable-staged', /\bfable[- ]staged\b|\bstaged fable\b/i],
|
|
148
148
|
];
|
|
149
|
-
const
|
|
149
|
+
const FABLE_DIRECTIVE_VERBS = {
|
|
150
|
+
english: '(?:use|run|enter|switch\\s+to)',
|
|
151
|
+
chinese: '(?:使用|用|啟用|進入|執行|改用)',
|
|
152
|
+
};
|
|
153
|
+
const FABLE_PROHIBITION = new RegExp(
|
|
154
|
+
`\\b(?:no|without|do\\s+not|don't|never|cannot|can't|not)\\s+(?:(?:${FABLE_DIRECTIVE_VERBS.english})\\s+)?fable(?:[- ]mode)?\\b|(?:不要|不需要|無需|無須|不必|毋須|不用|別|勿|請勿|避免|停止|不)\\s*(?:(?:${FABLE_DIRECTIVE_VERBS.chinese})\\s*)?fable(?:[- ]mode)?`,
|
|
155
|
+
'i',
|
|
156
|
+
);
|
|
150
157
|
const FABLE_REQUEST_PREFIX = /^(?:(?:please|let's|now|could\s+you(?:\s+please)?|would\s+you(?:\s+please)?)\s+|(?:請|幫我|麻煩)\s*)*/i;
|
|
151
|
-
const FABLE_REQUEST_VERB =
|
|
152
|
-
const FABLE_NAMED_REQUEST =
|
|
153
|
-
const FABLE_PROFILE_REQUEST =
|
|
158
|
+
const FABLE_REQUEST_VERB = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english})\\s+fable(?:[- ]mode)?\\b|^(?:${FABLE_DIRECTIVE_VERBS.chinese})\\s*fable(?:[- ]mode)?`, 'i');
|
|
159
|
+
const FABLE_NAMED_REQUEST = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english}|改用)\\s+(fable[- ](?:multi[- ]agent[- ]workspace|parallel|staged))\\b`, 'i');
|
|
160
|
+
const FABLE_PROFILE_REQUEST = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english}|改用)\\s+fable(?:[- ]mode)?\\s+(?:on|with)\\s+(haiku|sonnet|sonnect|opus)\\b`, 'i');
|
|
161
|
+
const FABLE_QUOTE_PAIRS = new Map([
|
|
162
|
+
['"', '"'], ['`', '`'], ["'", "'"], ['“', '”'], ['‘', '’'],
|
|
163
|
+
['「', '」'], ['『', '』'], ['《', '》'],
|
|
164
|
+
]);
|
|
154
165
|
|
|
155
166
|
function splitFableDirectiveClauses(prompt) {
|
|
156
167
|
const text = String(prompt || '');
|
|
157
168
|
const parts = [];
|
|
158
169
|
let part = '';
|
|
170
|
+
let unquotedPart = '';
|
|
159
171
|
let quote = null;
|
|
160
172
|
const push = () => {
|
|
161
|
-
if (part.trim()) parts.push(part.trim());
|
|
173
|
+
if (part.trim()) parts.push({ text: part.trim(), unquotedText: unquotedPart.trim() });
|
|
162
174
|
part = '';
|
|
175
|
+
unquotedPart = '';
|
|
163
176
|
};
|
|
164
177
|
const wordSeparators = /^(?:and\s+then|and|then|also|plus|afterwards|additionally|but|並且|並|以及|接著|然後|另外)/iu;
|
|
165
178
|
|
|
@@ -170,10 +183,11 @@ function splitFableDirectiveClauses(prompt) {
|
|
|
170
183
|
part += char;
|
|
171
184
|
continue;
|
|
172
185
|
}
|
|
173
|
-
if (char
|
|
174
|
-
(char
|
|
175
|
-
quote = char
|
|
186
|
+
if (FABLE_QUOTE_PAIRS.has(char) &&
|
|
187
|
+
(char !== "'" || (!/[\p{L}\p{N}]/u.test(text[i - 1] || '') && /[\p{L}\p{N}]/u.test(text[i + 1] || '')))) {
|
|
188
|
+
quote = FABLE_QUOTE_PAIRS.get(char);
|
|
176
189
|
part += char;
|
|
190
|
+
unquotedPart += '\u0000';
|
|
177
191
|
continue;
|
|
178
192
|
}
|
|
179
193
|
if (/[;!??!,,;。、…]/u.test(char) || (char === '.' && (i + 1 === text.length || /\s/u.test(text[i + 1])))) {
|
|
@@ -188,6 +202,7 @@ function splitFableDirectiveClauses(prompt) {
|
|
|
188
202
|
continue;
|
|
189
203
|
}
|
|
190
204
|
part += char;
|
|
205
|
+
unquotedPart += char;
|
|
191
206
|
}
|
|
192
207
|
push();
|
|
193
208
|
return parts;
|
|
@@ -215,8 +230,8 @@ function detectFableDirective(prompt) {
|
|
|
215
230
|
let strategy = null;
|
|
216
231
|
let profile = null;
|
|
217
232
|
let prohibited = false;
|
|
218
|
-
for (const clause of clauses) {
|
|
219
|
-
const negated = FABLE_PROHIBITION.test(
|
|
233
|
+
for (const { text: clause, unquotedText } of clauses) {
|
|
234
|
+
const negated = FABLE_PROHIBITION.test(unquotedText);
|
|
220
235
|
if (negated) prohibited = true;
|
|
221
236
|
if (negated || strategy) continue;
|
|
222
237
|
const request = detectFableRequest(clause);
|
|
@@ -226,8 +241,8 @@ function detectFableDirective(prompt) {
|
|
|
226
241
|
}
|
|
227
242
|
}
|
|
228
243
|
if (!strategy) {
|
|
229
|
-
const linkedContinuations = clauses.slice(0, -1).flatMap((clause, index) => {
|
|
230
|
-
if (!isFableProfileLookup(clause, false) || !/^run\s+it\b/i.test(clauses[index + 1])) return [];
|
|
244
|
+
const linkedContinuations = clauses.slice(0, -1).flatMap(({ text: clause }, index) => {
|
|
245
|
+
if (!isFableProfileLookup(clause, false) || !/^run\s+it\b/i.test(clauses[index + 1].text)) return [];
|
|
231
246
|
const matches = clause.match(new RegExp(FABLE_PROFILE_INVOCATION.source, 'gi')) || [];
|
|
232
247
|
return matches.length === 1 ? [detectFableModel(clause)] : [];
|
|
233
248
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "harness-everything",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Miya Daniel",
|
|
@@ -146,20 +146,33 @@ const FABLE_STRATEGIES = [
|
|
|
146
146
|
['fable-parallel', /\bfable[- ]parallel\b|\bparallel fable\b/i],
|
|
147
147
|
['fable-staged', /\bfable[- ]staged\b|\bstaged fable\b/i],
|
|
148
148
|
];
|
|
149
|
-
const
|
|
149
|
+
const FABLE_DIRECTIVE_VERBS = {
|
|
150
|
+
english: '(?:use|run|enter|switch\\s+to)',
|
|
151
|
+
chinese: '(?:使用|用|啟用|進入|執行|改用)',
|
|
152
|
+
};
|
|
153
|
+
const FABLE_PROHIBITION = new RegExp(
|
|
154
|
+
`\\b(?:no|without|do\\s+not|don't|never|cannot|can't|not)\\s+(?:(?:${FABLE_DIRECTIVE_VERBS.english})\\s+)?fable(?:[- ]mode)?\\b|(?:不要|不需要|無需|無須|不必|毋須|不用|別|勿|請勿|避免|停止|不)\\s*(?:(?:${FABLE_DIRECTIVE_VERBS.chinese})\\s*)?fable(?:[- ]mode)?`,
|
|
155
|
+
'i',
|
|
156
|
+
);
|
|
150
157
|
const FABLE_REQUEST_PREFIX = /^(?:(?:please|let's|now|could\s+you(?:\s+please)?|would\s+you(?:\s+please)?)\s+|(?:請|幫我|麻煩)\s*)*/i;
|
|
151
|
-
const FABLE_REQUEST_VERB =
|
|
152
|
-
const FABLE_NAMED_REQUEST =
|
|
153
|
-
const FABLE_PROFILE_REQUEST =
|
|
158
|
+
const FABLE_REQUEST_VERB = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english})\\s+fable(?:[- ]mode)?\\b|^(?:${FABLE_DIRECTIVE_VERBS.chinese})\\s*fable(?:[- ]mode)?`, 'i');
|
|
159
|
+
const FABLE_NAMED_REQUEST = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english}|改用)\\s+(fable[- ](?:multi[- ]agent[- ]workspace|parallel|staged))\\b`, 'i');
|
|
160
|
+
const FABLE_PROFILE_REQUEST = new RegExp(`^(?:${FABLE_DIRECTIVE_VERBS.english}|改用)\\s+fable(?:[- ]mode)?\\s+(?:on|with)\\s+(haiku|sonnet|sonnect|opus)\\b`, 'i');
|
|
161
|
+
const FABLE_QUOTE_PAIRS = new Map([
|
|
162
|
+
['"', '"'], ['`', '`'], ["'", "'"], ['“', '”'], ['‘', '’'],
|
|
163
|
+
['「', '」'], ['『', '』'], ['《', '》'],
|
|
164
|
+
]);
|
|
154
165
|
|
|
155
166
|
function splitFableDirectiveClauses(prompt) {
|
|
156
167
|
const text = String(prompt || '');
|
|
157
168
|
const parts = [];
|
|
158
169
|
let part = '';
|
|
170
|
+
let unquotedPart = '';
|
|
159
171
|
let quote = null;
|
|
160
172
|
const push = () => {
|
|
161
|
-
if (part.trim()) parts.push(part.trim());
|
|
173
|
+
if (part.trim()) parts.push({ text: part.trim(), unquotedText: unquotedPart.trim() });
|
|
162
174
|
part = '';
|
|
175
|
+
unquotedPart = '';
|
|
163
176
|
};
|
|
164
177
|
const wordSeparators = /^(?:and\s+then|and|then|also|plus|afterwards|additionally|but|並且|並|以及|接著|然後|另外)/iu;
|
|
165
178
|
|
|
@@ -170,10 +183,11 @@ function splitFableDirectiveClauses(prompt) {
|
|
|
170
183
|
part += char;
|
|
171
184
|
continue;
|
|
172
185
|
}
|
|
173
|
-
if (char
|
|
174
|
-
(char
|
|
175
|
-
quote = char
|
|
186
|
+
if (FABLE_QUOTE_PAIRS.has(char) &&
|
|
187
|
+
(char !== "'" || (!/[\p{L}\p{N}]/u.test(text[i - 1] || '') && /[\p{L}\p{N}]/u.test(text[i + 1] || '')))) {
|
|
188
|
+
quote = FABLE_QUOTE_PAIRS.get(char);
|
|
176
189
|
part += char;
|
|
190
|
+
unquotedPart += '\u0000';
|
|
177
191
|
continue;
|
|
178
192
|
}
|
|
179
193
|
if (/[;!??!,,;。、…]/u.test(char) || (char === '.' && (i + 1 === text.length || /\s/u.test(text[i + 1])))) {
|
|
@@ -188,6 +202,7 @@ function splitFableDirectiveClauses(prompt) {
|
|
|
188
202
|
continue;
|
|
189
203
|
}
|
|
190
204
|
part += char;
|
|
205
|
+
unquotedPart += char;
|
|
191
206
|
}
|
|
192
207
|
push();
|
|
193
208
|
return parts;
|
|
@@ -215,8 +230,8 @@ function detectFableDirective(prompt) {
|
|
|
215
230
|
let strategy = null;
|
|
216
231
|
let profile = null;
|
|
217
232
|
let prohibited = false;
|
|
218
|
-
for (const clause of clauses) {
|
|
219
|
-
const negated = FABLE_PROHIBITION.test(
|
|
233
|
+
for (const { text: clause, unquotedText } of clauses) {
|
|
234
|
+
const negated = FABLE_PROHIBITION.test(unquotedText);
|
|
220
235
|
if (negated) prohibited = true;
|
|
221
236
|
if (negated || strategy) continue;
|
|
222
237
|
const request = detectFableRequest(clause);
|
|
@@ -226,8 +241,8 @@ function detectFableDirective(prompt) {
|
|
|
226
241
|
}
|
|
227
242
|
}
|
|
228
243
|
if (!strategy) {
|
|
229
|
-
const linkedContinuations = clauses.slice(0, -1).flatMap((clause, index) => {
|
|
230
|
-
if (!isFableProfileLookup(clause, false) || !/^run\s+it\b/i.test(clauses[index + 1])) return [];
|
|
244
|
+
const linkedContinuations = clauses.slice(0, -1).flatMap(({ text: clause }, index) => {
|
|
245
|
+
if (!isFableProfileLookup(clause, false) || !/^run\s+it\b/i.test(clauses[index + 1].text)) return [];
|
|
231
246
|
const matches = clause.match(new RegExp(FABLE_PROFILE_INVOCATION.source, 'gi')) || [];
|
|
232
247
|
return matches.length === 1 ? [detectFableModel(clause)] : [];
|
|
233
248
|
});
|
package/sbom.cdx.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"$schema": "https://cyclonedx.org/schema/bom-1.7.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.7",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:6a6091b8-299b-5def-a625-1e771d1b564c",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-12-
|
|
8
|
+
"timestamp": "2026-12-01T19:03:45.350Z",
|
|
9
9
|
"tools": [
|
|
10
10
|
{
|
|
11
11
|
"vendor": "Harness Everything",
|
|
12
12
|
"name": "generate-sbom.js",
|
|
13
|
-
"version": "1.5.
|
|
13
|
+
"version": "1.5.2"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "application",
|
|
18
|
-
"bom-ref": "pkg:npm/harness-everything@1.5.
|
|
18
|
+
"bom-ref": "pkg:npm/harness-everything@1.5.2",
|
|
19
19
|
"name": "harness-everything",
|
|
20
|
-
"version": "1.5.
|
|
21
|
-
"purl": "pkg:npm/harness-everything@1.5.
|
|
20
|
+
"version": "1.5.2",
|
|
21
|
+
"purl": "pkg:npm/harness-everything@1.5.2"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -2033,7 +2033,7 @@
|
|
|
2033
2033
|
]
|
|
2034
2034
|
},
|
|
2035
2035
|
{
|
|
2036
|
-
"ref": "pkg:npm/harness-everything@1.5.
|
|
2036
|
+
"ref": "pkg:npm/harness-everything@1.5.2",
|
|
2037
2037
|
"dependsOn": [
|
|
2038
2038
|
"pkg:npm/%40commitlint/cli@19.8.1",
|
|
2039
2039
|
"pkg:npm/%40commitlint/config-conventional@19.8.1",
|
package/scripts/report-writer.js
CHANGED
|
@@ -79,7 +79,7 @@ function splitLines(text) {
|
|
|
79
79
|
function statusLineStatus(line) {
|
|
80
80
|
if (line === 'STATUS: DONE') return 'STATUS: DONE';
|
|
81
81
|
const blocked = /^STATUS: BLOCKED: (.+)$/.exec(line);
|
|
82
|
-
if (blocked && blocked[1]
|
|
82
|
+
if (blocked && blocked[1] !== '' && blocked[1] === blocked[1].trim()) return line;
|
|
83
83
|
error('expected STATUS: DONE or STATUS: BLOCKED: <reason>');
|
|
84
84
|
}
|
|
85
85
|
|