@devflow-tools/benchmark 0.17.3 → 0.17.4

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/dist/index.d.ts CHANGED
@@ -21,4 +21,7 @@ export type { EvidenceQualityMetadata, EvidenceQualityMetric, WilsonInterval95,
21
21
  export * from './graders/index.js';
22
22
  export { aggregateRepeatedTrials, createTrialReceipt, renderRepeatedTrialReport, } from './repeated-trials.js';
23
23
  export type { RepeatedTrial, RepeatedTrialReport, RepeatedTrialTaskReport, } from './repeated-trials.js';
24
+ export { evaluateSemanticFixtures } from './semantic-intent-quality.js';
25
+ export { evaluateSemanticCalibration, evaluateSemanticReleaseGates, wilsonInterval95 } from './semantic-intent-quality.js';
26
+ export type { SemanticIntentCorpus, SemanticIntentExpectedFrame, SemanticIntentFixture, SemanticMutationPermission, SemanticQualityReport, SemanticCalibrationReport, SemanticCalibrationSample, SemanticReleaseGates, } from './semantic-intent-quality.js';
24
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACn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A8B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3H,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -11,4 +11,6 @@ export { runEvidenceRuntimeQualityCorpus } from './retrieval-quality-corpus.js';
11
11
  export { evidenceQualityMetric } from './evidence-quality-metrics.js';
12
12
  export * from './graders/index.js';
13
13
  export { aggregateRepeatedTrials, createTrialReceipt, renderRepeatedTrialReport, } from './repeated-trials.js';
14
+ export { evaluateSemanticFixtures } from './semantic-intent-quality.js';
15
+ export { evaluateSemanticCalibration, evaluateSemanticReleaseGates, wilsonInterval95 } from './semantic-intent-quality.js';
14
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAQ3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAS1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAMtE,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAQ3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAS1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAMtE,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,82 @@
1
+ import type { CanonicalTaskIntent, RetrievalTaskAction } from '@devflow-tools/sdk';
2
+ export type SemanticMutationPermission = 'explicitly_authorized' | 'explicitly_forbidden' | 'not_requested' | 'conditional' | 'ambiguous';
3
+ export interface SemanticIntentExpectedFrame {
4
+ primaryIntent: CanonicalTaskIntent;
5
+ primaryAction: RetrievalTaskAction;
6
+ mutationPermission: SemanticMutationPermission;
7
+ memoryDirective: 'save' | 'forget' | 'recall' | 'none' | 'ambiguous';
8
+ knowledgeKind?: 'api' | 'behavior' | 'migration' | 'error' | 'overview';
9
+ outOfScope: boolean;
10
+ }
11
+ export interface SemanticIntentFixture {
12
+ id: string;
13
+ family: string;
14
+ partition: 'development' | 'heldout';
15
+ prompt: string;
16
+ expected: SemanticIntentExpectedFrame;
17
+ }
18
+ export interface SemanticIntentCorpus {
19
+ schemaVersion: 'devflow.semantic-intent-corpus.v1';
20
+ fixtures: SemanticIntentFixture[];
21
+ }
22
+ export interface SemanticQualityReport {
23
+ schemaVersion: 'devflow.semantic-quality-report.v1';
24
+ sampleCount: number;
25
+ exactFrameMatch: number;
26
+ mutationFalseAccept: {
27
+ numerator: number;
28
+ denominator: number;
29
+ value: number;
30
+ };
31
+ mutationFalseReject: {
32
+ numerator: number;
33
+ denominator: number;
34
+ value: number;
35
+ };
36
+ prohibitionAccuracy: number;
37
+ outOfScopeRecall: number;
38
+ macroF1: number;
39
+ diagnostics: Array<{
40
+ fixtureId: string;
41
+ fields: string[];
42
+ }>;
43
+ }
44
+ export interface SemanticCalibrationSample {
45
+ probability: number;
46
+ outcome: boolean;
47
+ outOfScope?: boolean;
48
+ language?: 'zh' | 'en' | 'mixed';
49
+ }
50
+ export interface SemanticCalibrationReport {
51
+ brierScore: number;
52
+ expectedCalibrationError: number;
53
+ wilson95: {
54
+ lower: number;
55
+ upper: number;
56
+ };
57
+ sampleCount: number;
58
+ }
59
+ export interface SemanticReleaseGates {
60
+ mutationFalseAccept: boolean;
61
+ structuralCompatibility: boolean;
62
+ prohibitionImproved: boolean;
63
+ conditionalImproved: boolean;
64
+ chineseMacroF1Improved: boolean;
65
+ englishMacroF1Improved: boolean;
66
+ outOfScopeImproved: boolean;
67
+ unavailableConservative: boolean;
68
+ observabilityComplete: boolean;
69
+ }
70
+ export declare function wilsonInterval95(successes: number, total: number): {
71
+ lower: number;
72
+ upper: number;
73
+ };
74
+ export declare function evaluateSemanticCalibration(samples: SemanticCalibrationSample[]): SemanticCalibrationReport;
75
+ export declare function evaluateSemanticReleaseGates(input: {
76
+ report: SemanticQualityReport;
77
+ baseline?: SemanticQualityReport;
78
+ calibration?: SemanticCalibrationReport;
79
+ observabilityComplete: boolean;
80
+ }): SemanticReleaseGates;
81
+ export declare function evaluateSemanticFixtures(fixtures: SemanticIntentFixture[], predict: (prompt: string) => SemanticIntentExpectedFrame): SemanticQualityReport;
82
+ //# sourceMappingURL=semantic-intent-quality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-intent-quality.d.ts","sourceRoot":"","sources":["../src/semantic-intent-quality.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,MAAM,0BAA0B,GAClC,uBAAuB,GACvB,sBAAsB,GACtB,eAAe,GACf,aAAa,GACb,WAAW,CAAC;AAEhB,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,mBAAmB,CAAC;IACnC,aAAa,EAAE,mBAAmB,CAAC;IACnC,kBAAkB,EAAE,0BAA0B,CAAC;IAC/C,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACrE,aAAa,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;IACxE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,GAAG,SAAS,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,2BAA2B,CAAC;CACvC;AAED,MAAM,W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CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQnG;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,yBAAyB,EAAE,GAAG,yBAAyB,CAyB3G;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,MAAM,EAAE,qBAAqB,CAAC;IAC9B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,qBAAqB,EAAE,OAAO,CAAC;CAChC,GAAG,oBAAoB,CAavB;AAWD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,qBAAqB,EAAE,EACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,2BAA2B,GACvD,qBAAqB,CA0CvB"}
@@ -0,0 +1,111 @@
1
+ export function wilsonInterval95(successes, total) {
2
+ if (total <= 0)
3
+ return { lower: 0, upper: 0 };
4
+ const z = 1.959963984540054;
5
+ const p = successes / total;
6
+ const denominator = 1 + (z * z) / total;
7
+ const centre = (p + (z * z) / (2 * total)) / denominator;
8
+ const spread = z * Math.sqrt((p * (1 - p) / total) + (z * z) / (4 * total * total)) / denominator;
9
+ return { lower: Math.max(0, centre - spread), upper: Math.min(1, centre + spread) };
10
+ }
11
+ export function evaluateSemanticCalibration(samples) {
12
+ if (samples.length === 0)
13
+ return { brierScore: 0, expectedCalibrationError: 0, wilson95: { lower: 0, upper: 0 }, sampleCount: 0 };
14
+ const bins = Array.from({ length: 10 }, () => ({ count: 0, probability: 0, outcome: 0 }));
15
+ let brierScore = 0;
16
+ let successes = 0;
17
+ for (const sample of samples) {
18
+ const probability = Math.max(0, Math.min(1, sample.probability));
19
+ const outcome = sample.outcome ? 1 : 0;
20
+ brierScore += (probability - outcome) ** 2;
21
+ successes += outcome;
22
+ const bin = bins[Math.min(9, Math.floor(probability * 10))];
23
+ bin.count += 1;
24
+ bin.probability += probability;
25
+ bin.outcome += outcome;
26
+ }
27
+ const expectedCalibrationError = bins.reduce((sum, bin) => {
28
+ if (bin.count === 0)
29
+ return sum;
30
+ return sum + (bin.count / samples.length) * Math.abs(bin.probability / bin.count - bin.outcome / bin.count);
31
+ }, 0);
32
+ return {
33
+ brierScore: brierScore / samples.length,
34
+ expectedCalibrationError,
35
+ wilson95: wilsonInterval95(successes, samples.length),
36
+ sampleCount: samples.length,
37
+ };
38
+ }
39
+ export function evaluateSemanticReleaseGates(input) {
40
+ const baseline = input.baseline;
41
+ return {
42
+ mutationFalseAccept: input.report.mutationFalseAccept.numerator === 0,
43
+ structuralCompatibility: input.report.sampleCount > 0,
44
+ prohibitionImproved: !baseline || input.report.prohibitionAccuracy >= baseline.prohibitionAccuracy,
45
+ conditionalImproved: !baseline || input.report.macroF1 >= baseline.macroF1,
46
+ chineseMacroF1Improved: !baseline || input.report.macroF1 >= baseline.macroF1,
47
+ englishMacroF1Improved: !baseline || input.report.macroF1 >= baseline.macroF1,
48
+ outOfScopeImproved: !baseline || input.report.outOfScopeRecall >= baseline.outOfScopeRecall,
49
+ unavailableConservative: input.report.mutationFalseAccept.numerator === 0,
50
+ observabilityComplete: input.observabilityComplete && Boolean(input.calibration),
51
+ };
52
+ }
53
+ const FRAME_FIELDS = [
54
+ 'primaryIntent',
55
+ 'primaryAction',
56
+ 'mutationPermission',
57
+ 'memoryDirective',
58
+ 'knowledgeKind',
59
+ 'outOfScope',
60
+ ];
61
+ export function evaluateSemanticFixtures(fixtures, predict) {
62
+ const diagnostics = [];
63
+ const predictions = fixtures.map(fixture => {
64
+ const actual = predict(fixture.prompt);
65
+ const fields = FRAME_FIELDS.filter(field => actual[field] !== fixture.expected[field]);
66
+ if (fields.length > 0)
67
+ diagnostics.push({ fixtureId: fixture.id, fields });
68
+ return { fixture, actual, fields };
69
+ });
70
+ const falseAcceptPopulation = predictions.filter(({ fixture }) => fixture.expected.mutationPermission !== 'explicitly_authorized');
71
+ const falseAcceptCount = falseAcceptPopulation.filter(({ actual }) => actual.mutationPermission === 'explicitly_authorized').length;
72
+ const falseRejectPopulation = predictions.filter(({ fixture }) => fixture.expected.mutationPermission === 'explicitly_authorized');
73
+ const falseRejectCount = falseRejectPopulation.filter(({ actual }) => actual.mutationPermission !== 'explicitly_authorized').length;
74
+ const prohibitions = predictions.filter(({ fixture }) => fixture.expected.mutationPermission === 'explicitly_forbidden');
75
+ const outOfScope = predictions.filter(({ fixture }) => fixture.expected.outOfScope);
76
+ return {
77
+ schemaVersion: 'devflow.semantic-quality-report.v1',
78
+ sampleCount: fixtures.length,
79
+ exactFrameMatch: ratio(predictions.filter(item => item.fields.length === 0).length, fixtures.length, diagnostics, 'exact-frame-empty'),
80
+ mutationFalseAccept: fraction(falseAcceptCount, falseAcceptPopulation.length, diagnostics, 'mutation-false-accept-empty'),
81
+ mutationFalseReject: fraction(falseRejectCount, falseRejectPopulation.length, diagnostics, 'mutation-false-reject-empty'),
82
+ prohibitionAccuracy: ratio(prohibitions.filter(({ actual }) => actual.mutationPermission === 'explicitly_forbidden').length, prohibitions.length, diagnostics, 'prohibition-empty'),
83
+ outOfScopeRecall: ratio(outOfScope.filter(({ actual }) => actual.outOfScope).length, outOfScope.length, diagnostics, 'out-of-scope-empty'),
84
+ macroF1: intentMacroF1(predictions),
85
+ diagnostics,
86
+ };
87
+ }
88
+ function fraction(numerator, denominator, diagnostics, diagnosticId) {
89
+ return { numerator, denominator, value: ratio(numerator, denominator, diagnostics, diagnosticId) };
90
+ }
91
+ function ratio(numerator, denominator, diagnostics, diagnosticId) {
92
+ if (denominator === 0) {
93
+ diagnostics.push({ fixtureId: diagnosticId, fields: ['denominator'] });
94
+ return 0;
95
+ }
96
+ return numerator / denominator;
97
+ }
98
+ function intentMacroF1(predictions) {
99
+ const labels = [...new Set(predictions.map(({ fixture }) => fixture.expected.primaryIntent))];
100
+ if (labels.length === 0)
101
+ return 0;
102
+ return labels.reduce((sum, label) => {
103
+ const truePositive = predictions.filter(({ fixture, actual }) => fixture.expected.primaryIntent === label && actual.primaryIntent === label).length;
104
+ const falsePositive = predictions.filter(({ fixture, actual }) => fixture.expected.primaryIntent !== label && actual.primaryIntent === label).length;
105
+ const falseNegative = predictions.filter(({ fixture, actual }) => fixture.expected.primaryIntent === label && actual.primaryIntent !== label).length;
106
+ const precision = truePositive + falsePositive === 0 ? 0 : truePositive / (truePositive + falsePositive);
107
+ const recall = truePositive + falseNegative === 0 ? 0 : truePositive / (truePositive + falseNegative);
108
+ return sum + (precision + recall === 0 ? 0 : (2 * precision * recall) / (precision + recall));
109
+ }, 0) / labels.length;
110
+ }
111
+ //# sourceMappingURL=semantic-intent-quality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-intent-quality.js","sourceRoot":"","sources":["../src/semantic-intent-quality.ts"],"names":[],"mappings":"AAqEA,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,KAAa;IAC/D,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC9C,MAAM,CAAC,GAAG,iBAAiB,CAAC;IAC5B,MAAM,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC;IAC5B,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IACxC,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,GAAG,IAA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AG,aAAa,CAAC,CAAC;QACtG,OAAO,GAAG,GAAG,CAAC,SAAS,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACxB,CAAC"}
@@ -0,0 +1,125 @@
1
+ {
2
+ "schemaVersion": "devflow.semantic-intent-corpus.v1",
3
+ "fixtures": [
4
+ { "id": "debug-mutate-01", "family": "debug_mutate", "partition": "development", "prompt": "fix the login page crash", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
5
+ { "id": "debug-mutate-02", "family": "debug_mutate", "partition": "development", "prompt": "修复登录崩溃", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
6
+ { "id": "debug-mutate-03", "family": "debug_mutate", "partition": "development", "prompt": "debug the failing token refresh", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
7
+ { "id": "debug-mutate-04", "family": "debug_mutate", "partition": "development", "prompt": "解决支付回调异常", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
8
+ { "id": "debug-mutate-05", "family": "debug_mutate", "partition": "development", "prompt": "fix the useAuth hook in LoginPage", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
9
+ { "id": "debug-mutate-06", "family": "debug_mutate", "partition": "development", "prompt": "请直接修复 build failure", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
10
+
11
+ { "id": "feature-mutate-01", "family": "feature_mutate", "partition": "development", "prompt": "add a new search feature", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
12
+ { "id": "feature-mutate-02", "family": "feature_mutate", "partition": "development", "prompt": "帮我生成一个登录组件", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
13
+ { "id": "feature-mutate-03", "family": "feature_mutate", "partition": "development", "prompt": "create a Login component", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
14
+ { "id": "feature-mutate-04", "family": "feature_mutate", "partition": "development", "prompt": "build a Login component", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
15
+ { "id": "feature-mutate-05", "family": "feature_mutate", "partition": "development", "prompt": "编写登录组件", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
16
+ { "id": "feature-mutate-06", "family": "feature_mutate", "partition": "development", "prompt": "创建组件 Login", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
17
+
18
+ { "id": "analysis-only-01", "family": "analysis_only", "partition": "development", "prompt": "how does the auth system work", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
19
+ { "id": "analysis-only-02", "family": "analysis_only", "partition": "development", "prompt": "这个实现没有 bug,只想了解它为什么这样设计", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
20
+ { "id": "analysis-only-03", "family": "analysis_only", "partition": "development", "prompt": "analyze the current VideoPlayer implementation in src/components/video-player/VideoPlayer.tsx", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
21
+ { "id": "analysis-only-04", "family": "analysis_only", "partition": "development", "prompt": "分析当前登录模块的实现逻辑", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
22
+ { "id": "analysis-only-05", "family": "analysis_only", "partition": "development", "prompt": "how to implement a cache without changing the current code", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
23
+ { "id": "analysis-only-06", "family": "analysis_only", "partition": "development", "prompt": "查看现有组件实现方式", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
24
+ { "id": "analysis-only-07", "family": "analysis_only", "partition": "development", "prompt": "review the existing authentication implementation", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
25
+
26
+ { "id": "release-mutate-01", "family": "release_mutate", "partition": "development", "prompt": "publish version 0.18.0", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
27
+ { "id": "release-mutate-02", "family": "release_mutate", "partition": "development", "prompt": "发布 0.18.0", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
28
+ { "id": "release-mutate-03", "family": "release_mutate", "partition": "development", "prompt": "release the approved package", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
29
+ { "id": "release-mutate-04", "family": "release_mutate", "partition": "development", "prompt": "开始发版 npm 包", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
30
+ { "id": "release-mutate-05", "family": "release_mutate", "partition": "development", "prompt": "publish the current workspace as 0.18.1", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
31
+ { "id": "release-mutate-06", "family": "release_mutate", "partition": "development", "prompt": "请发布新版本", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
32
+
33
+ { "id": "memory-save-01", "family": "memory_save", "partition": "development", "prompt": "remember that this project uses pnpm", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
34
+ { "id": "memory-save-02", "family": "memory_save", "partition": "development", "prompt": "记住项目统一使用 pnpm", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
35
+ { "id": "memory-save-03", "family": "memory_save", "partition": "development", "prompt": "save this convention to project memory", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
36
+ { "id": "memory-save-04", "family": "memory_save", "partition": "development", "prompt": "请记住我们不使用 yarn", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
37
+ { "id": "memory-save-05", "family": "memory_save", "partition": "development", "prompt": "请记住项目使用 TanStack Router,不修改项目文件", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
38
+ { "id": "memory-save-06", "family": "memory_save", "partition": "development", "prompt": "store the API naming rule for later", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "save", "outOfScope": false } },
39
+
40
+ { "id": "knowledge-api-01", "family": "knowledge_api", "partition": "development", "prompt": "query the React 19 use API", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "api", "outOfScope": false } },
41
+ { "id": "knowledge-api-02", "family": "knowledge_api", "partition": "development", "prompt": "查询 React 19 use API", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "api", "outOfScope": false } },
42
+ { "id": "knowledge-api-03", "family": "knowledge_api", "partition": "development", "prompt": "what is the signature of useActionState", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "api", "outOfScope": false } },
43
+ { "id": "knowledge-api-04", "family": "knowledge_api", "partition": "development", "prompt": "查一下 BGE-M3 的调用参数", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "api", "outOfScope": false } },
44
+ { "id": "knowledge-api-05", "family": "knowledge_api", "partition": "development", "prompt": "show the MCP sampling method reference", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "api", "outOfScope": false } },
45
+ { "id": "knowledge-api-06", "family": "knowledge_api", "partition": "development", "prompt": "解释 React hooks 的原理", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "overview", "outOfScope": false } },
46
+
47
+ { "id": "conditional-mutation-01", "family": "conditional_mutation", "partition": "development", "prompt": "analyze the issue and implement the approved solution", "expected": { "primaryIntent": "debug", "primaryAction": "create", "mutationPermission": "conditional", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
48
+ { "id": "conditional-mutation-02", "family": "conditional_mutation", "partition": "development", "prompt": "先分析登录崩溃,确认根因后再修复", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "conditional", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
49
+ { "id": "conditional-mutation-03", "family": "conditional_mutation", "partition": "development", "prompt": "if the tests reproduce it, fix the cache race", "expected": { "primaryIntent": "debug", "primaryAction": "debug", "mutationPermission": "conditional", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
50
+ { "id": "conditional-mutation-04", "family": "conditional_mutation", "partition": "development", "prompt": "如果能确认类型错误,再修改接口", "expected": { "primaryIntent": "debug", "primaryAction": "modify", "mutationPermission": "conditional", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
51
+ { "id": "conditional-mutation-05", "family": "conditional_mutation", "partition": "development", "prompt": "分析完成后实现这个方案", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
52
+ { "id": "conditional-mutation-06", "family": "conditional_mutation", "partition": "development", "prompt": "once I approve the diff, apply the refactor", "expected": { "primaryIntent": "refactor", "primaryAction": "modify", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
53
+
54
+ { "id": "negated-debug-01", "family": "negated_debug", "partition": "heldout", "prompt": "The build command is failing; explain why, do not execute anything", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
55
+ { "id": "negated-debug-02", "family": "negated_debug", "partition": "heldout", "prompt": "登录一直崩溃,只分析原因,不要修复", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
56
+ { "id": "negated-debug-03", "family": "negated_debug", "partition": "heldout", "prompt": "diagnose the failing test without changing files", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
57
+ { "id": "negated-debug-04", "family": "negated_debug", "partition": "heldout", "prompt": "解释缓存 race,不执行命令也不改代码", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
58
+ { "id": "negated-debug-05", "family": "negated_debug", "partition": "heldout", "prompt": "review the crash report; never run the fix", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
59
+ { "id": "negated-debug-06", "family": "negated_debug", "partition": "heldout", "prompt": "分析构建失败,但不要重新构建", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
60
+
61
+ { "id": "negated-release-analysis", "family": "negated_release", "partition": "heldout", "prompt": "如果发布失败,只分析日志,不要重新发布", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
62
+ { "id": "negated-release-02", "family": "negated_release", "partition": "heldout", "prompt": "analyze why 0.17.3 publish failed; do not republish", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
63
+ { "id": "negated-release-03", "family": "negated_release", "partition": "heldout", "prompt": "查看发版错误,不要运行 npm publish", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
64
+ { "id": "negated-release-04", "family": "negated_release", "partition": "heldout", "prompt": "explain the release pipeline without publishing", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
65
+ { "id": "negated-release-05", "family": "negated_release", "partition": "heldout", "prompt": "审查发布脚本,禁止发版", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
66
+ { "id": "negated-release-06", "family": "negated_release", "partition": "heldout", "prompt": "find the npm publish failure but make no release", "expected": { "primaryIntent": "debug", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "error", "outOfScope": false } },
67
+
68
+ { "id": "memory-forget-recall-01", "family": "memory_forget_recall", "partition": "heldout", "prompt": "删除“旧缓存策略”这条记忆", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "forget", "outOfScope": false } },
69
+ { "id": "memory-forget-recall-02", "family": "memory_forget_recall", "partition": "heldout", "prompt": "forget the old cache policy", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "forget", "outOfScope": false } },
70
+ { "id": "memory-forget-recall-03", "family": "memory_forget_recall", "partition": "heldout", "prompt": "回忆项目选择路由库的原因", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "recall", "outOfScope": false } },
71
+ { "id": "memory-forget-recall-04", "family": "memory_forget_recall", "partition": "heldout", "prompt": "recall why we chose the router", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "recall", "outOfScope": false } },
72
+ { "id": "memory-forget-recall-05", "family": "memory_forget_recall", "partition": "heldout", "prompt": "别记住这个临时 pnpm 命令", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
73
+ { "id": "memory-forget-recall-06", "family": "memory_forget_recall", "partition": "heldout", "prompt": "记一下还是算了", "expected": { "primaryIntent": "memory", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "ambiguous", "outOfScope": false } },
74
+
75
+ { "id": "knowledge-migration-01", "family": "knowledge_migration", "partition": "heldout", "prompt": "migrate React 18 to React 19", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
76
+ { "id": "knowledge-migration-02", "family": "knowledge_migration", "partition": "heldout", "prompt": "迁移 React 18 到 React 19", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
77
+ { "id": "knowledge-migration-03", "family": "knowledge_migration", "partition": "heldout", "prompt": "what are the breaking changes in Vue 4", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
78
+ { "id": "knowledge-migration-04", "family": "knowledge_migration", "partition": "heldout", "prompt": "查询 Node 24 升级指南", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
79
+ { "id": "knowledge-migration-05", "family": "knowledge_migration", "partition": "heldout", "prompt": "compare the migration notes for Vite 7", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
80
+ { "id": "knowledge-migration-06", "family": "knowledge_migration", "partition": "heldout", "prompt": "了解 TypeScript 6 迁移风险", "expected": { "primaryIntent": "knowledge", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "migration", "outOfScope": false } },
81
+
82
+ { "id": "negative-performance-01", "family": "negative_performance", "partition": "heldout", "prompt": "not a performance problem; review naming only", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": false } },
83
+ { "id": "negative-performance-02", "family": "negative_performance", "partition": "heldout", "prompt": "不是性能问题,只分析变量命名", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": false } },
84
+ { "id": "negative-performance-03", "family": "negative_performance", "partition": "heldout", "prompt": "分析 React 组件渲染性能", "expected": { "primaryIntent": "performance", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
85
+ { "id": "negative-performance-04", "family": "negative_performance", "partition": "heldout", "prompt": "不要优化性能,只解释渲染顺序", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
86
+ { "id": "negative-performance-05", "family": "negative_performance", "partition": "heldout", "prompt": "this is not a memory leak; explain ownership", "expected": { "primaryIntent": "understand", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "knowledgeKind": "behavior", "outOfScope": false } },
87
+ { "id": "negative-performance-06", "family": "negative_performance", "partition": "heldout", "prompt": "不处理卡顿,审查组件职责即可", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
88
+
89
+ { "id": "oos-01", "family": "out_of_scope", "partition": "heldout", "prompt": "天气怎么样", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
90
+ { "id": "oos-02", "family": "out_of_scope", "partition": "heldout", "prompt": "write a poem about the ocean", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
91
+ { "id": "oos-03", "family": "out_of_scope", "partition": "heldout", "prompt": "上海明天限行吗", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
92
+ { "id": "oos-04", "family": "out_of_scope", "partition": "heldout", "prompt": "recommend a dinner recipe", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
93
+ { "id": "oos-05", "family": "out_of_scope", "partition": "heldout", "prompt": "讲一个冷笑话", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
94
+ { "id": "oos-06", "family": "out_of_scope", "partition": "heldout", "prompt": "translate this legal contract", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "not_requested", "memoryDirective": "none", "outOfScope": true } },
95
+ { "id": "oos-07", "family": "out_of_scope", "partition": "heldout", "prompt": "hmm", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
96
+
97
+ { "id": "review-nonmutating-01", "family": "review_nonmutating", "partition": "heldout", "prompt": "review LoginPage without modifying the project", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
98
+ { "id": "review-nonmutating-02", "family": "review_nonmutating", "partition": "heldout", "prompt": "审查 LoginPage,不要创建或修改任何文件", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
99
+ { "id": "review-nonmutating-03", "family": "review_nonmutating", "partition": "heldout", "prompt": "please critique the component; no file changes", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
100
+ { "id": "review-nonmutating-04", "family": "review_nonmutating", "partition": "heldout", "prompt": "只做代码审查,禁止编辑", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
101
+ { "id": "review-nonmutating-05", "family": "review_nonmutating", "partition": "heldout", "prompt": "assess the architecture and do not implement recommendations", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
102
+ { "id": "review-nonmutating-06", "family": "review_nonmutating", "partition": "heldout", "prompt": "检查类型设计,不要提交修改", "expected": { "primaryIntent": "review", "primaryAction": "analyze", "mutationPermission": "explicitly_forbidden", "memoryDirective": "none", "outOfScope": false } },
103
+
104
+ { "id": "conditional-release-01", "family": "conditional_release", "partition": "heldout", "prompt": "if all tests pass, publish 0.18.0", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
105
+ { "id": "conditional-release-02", "family": "conditional_release", "partition": "heldout", "prompt": "测试全部通过后再发布 0.18.0", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
106
+ { "id": "conditional-release-03", "family": "conditional_release", "partition": "heldout", "prompt": "publish only after I approve the changelog", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
107
+ { "id": "conditional-release-04", "family": "conditional_release", "partition": "heldout", "prompt": "等我确认版本号之后发版", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
108
+ { "id": "conditional-release-05", "family": "conditional_release", "partition": "heldout", "prompt": "when CI is green, run npm publish", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
109
+ { "id": "conditional-release-06", "family": "conditional_release", "partition": "heldout", "prompt": "如果 tag 尚未存在,就发布新版本", "expected": { "primaryIntent": "feature", "primaryAction": "release", "mutationPermission": "conditional", "memoryDirective": "none", "outOfScope": false } },
110
+
111
+ { "id": "ambiguous-followup-01", "family": "ambiguous_followup", "partition": "heldout", "prompt": "继续", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
112
+ { "id": "ambiguous-followup-02", "family": "ambiguous_followup", "partition": "heldout", "prompt": "按刚才批准的方案执行", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
113
+ { "id": "ambiguous-followup-03", "family": "ambiguous_followup", "partition": "heldout", "prompt": "do it", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
114
+ { "id": "ambiguous-followup-04", "family": "ambiguous_followup", "partition": "heldout", "prompt": "用上一个", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
115
+ { "id": "ambiguous-followup-05", "family": "ambiguous_followup", "partition": "heldout", "prompt": "apply that change", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
116
+ { "id": "ambiguous-followup-06", "family": "ambiguous_followup", "partition": "heldout", "prompt": "就这么办", "expected": { "primaryIntent": "unknown", "primaryAction": "analyze", "mutationPermission": "ambiguous", "memoryDirective": "none", "outOfScope": true } },
117
+
118
+ { "id": "explicit-implementation-01", "family": "explicit_implementation", "partition": "development", "prompt": "implement a Login component", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
119
+ { "id": "explicit-implementation-02", "family": "explicit_implementation", "partition": "development", "prompt": "implement a cache for the authentication module", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
120
+ { "id": "explicit-implementation-03", "family": "explicit_implementation", "partition": "development", "prompt": "帮我实现登录组件", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
121
+ { "id": "explicit-implementation-04", "family": "explicit_implementation", "partition": "development", "prompt": "新增缓存模块", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
122
+ { "id": "explicit-implementation-05", "family": "explicit_implementation", "partition": "development", "prompt": "scaffold a settings page", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } },
123
+ { "id": "explicit-implementation-06", "family": "explicit_implementation", "partition": "development", "prompt": "开发一个用户搜索功能", "expected": { "primaryIntent": "feature", "primaryAction": "create", "mutationPermission": "explicitly_authorized", "memoryDirective": "none", "outOfScope": false } }
124
+ ]
125
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schemaVersion": "devflow.semantic-regex-inventory.v1",
3
+ "entries": [
4
+ { "file": "packages/context-engine/src/intent-parser.ts", "symbol": "INTENT_PATTERNS", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.primaryIntent" },
5
+ { "file": "packages/context-engine/src/intent-parser.ts", "symbol": "CN_INTENT_MAP", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.primaryIntent" },
6
+ { "file": "packages/context-engine/src/intent-parser.ts", "symbol": "ZH_EN_MAP", "responsibility": "lexical_feature", "disposition": "retain_for_retrieval_only" },
7
+ { "file": "packages/context-engine/src/retrieval-task-plan.ts", "symbol": "canonicalIntent", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.primaryIntent" },
8
+ { "file": "packages/context-engine/src/retrieval-task-plan.ts", "symbol": "inferAction", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.primaryAction" },
9
+ { "file": "packages/context-engine/src/retrieval-task-plan.ts", "symbol": "extractKnowledgeSymbols", "responsibility": "structural_authority", "disposition": "keep" },
10
+ { "file": "packages/context-engine/src/retrieval-task-plan.ts", "symbol": "extractEntityVersions", "responsibility": "structural_authority", "disposition": "keep" },
11
+ { "file": "packages/memory-engine/src/signal-analyzer.ts", "symbol": "detectCheap", "scope": "user_message", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.memoryDirective" },
12
+ { "file": "packages/memory-engine/src/signal-analyzer.ts", "symbol": "detectCheap", "scope": "tool_event", "responsibility": "structural_authority", "disposition": "keep" },
13
+ { "file": "packages/memory-engine/src/explicit-memory-enricher.ts", "symbol": "classifyExplicitMemory", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.memoryDirective" },
14
+ { "file": "packages/memory-engine/src/observation-quality.ts", "symbol": "classifyFailureCategory", "responsibility": "lexical_feature", "disposition": "retain_non_authoritative" },
15
+ { "file": "packages/knowledge-engine/src/source-selector.ts", "symbol": "SOURCE_FAMILIES", "scope": "query", "responsibility": "semantic_classifier", "disposition": "shadow_only", "replacementField": "TaskSemanticFrameV2.knowledgeNeeds" },
16
+ { "file": "packages/knowledge-engine/src/source-selector.ts", "symbol": "SOURCE_FAMILIES", "scope": "source/dependencies/frameworks/languages/files", "responsibility": "structural_authority", "disposition": "keep" },
17
+ { "file": "packages/devflow/src/hooks/evidence-contract.ts", "symbol": "validateEvidenceContract", "responsibility": "safety_defense", "disposition": "keep" },
18
+ { "file": "packages/devflow/src/hooks/slash-command.ts", "symbol": "parseSlashCommand", "responsibility": "structural_authority", "disposition": "keep" }
19
+ ]
20
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemaVersion": "semantic-thresholds.v1",
3
+ "version": "semantic-intent-corpus.v1",
4
+ "modelId": "Xenova/all-MiniLM-L6-v2",
5
+ "modelRevision": "751bff37182d3f1213fa05d7196b954e230abad9",
6
+ "routeCatalogVersion": "semantic-route-catalog.v1",
7
+ "minimumScore": 0.55,
8
+ "minimumMargin": 0.08,
9
+ "fitPartition": "development"
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/benchmark",
3
- "version": "0.17.3",
3
+ "version": "0.17.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@colbymchenry/codegraph": "^1.1.1",
22
- "@devflow-tools/context-engine": "0.17.3",
23
- "@devflow-tools/database": "0.17.3",
24
- "@devflow-tools/sdk": "0.17.3"
22
+ "@devflow-tools/context-engine": "0.17.4",
23
+ "@devflow-tools/database": "0.17.4",
24
+ "@devflow-tools/sdk": "0.17.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typescript": "^5.5.0",
@@ -31,5 +31,5 @@
31
31
  "dist",
32
32
  "fixtures"
33
33
  ],
34
- "gitHead": "964af33767bf232606e63d973b3a29d7d53c8119"
34
+ "gitHead": "b880054f9cef4ed62b4d02544257c9f5cbd811bc"
35
35
  }