groove-dev 0.27.179 → 0.27.180
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/moe-training/client/envelope-builder.js +22 -5
- package/moe-training/shared/constants.js +11 -1
- package/moe-training/shared/envelope-schema.js +11 -3
- package/moe-training/test/client/envelope-builder.test.js +42 -6
- package/moe-training/test/shared/envelope-schema.test.js +11 -4
- package/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/node_modules/moe-training/client/envelope-builder.js +22 -5
- package/node_modules/moe-training/shared/constants.js +11 -1
- package/node_modules/moe-training/shared/envelope-schema.js +11 -3
- package/node_modules/moe-training/test/client/envelope-builder.test.js +42 -6
- package/node_modules/moe-training/test/shared/envelope-schema.test.js +11 -4
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/gui/package.json +1 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// FSL-1.1-Apache-2.0 — see LICENSE
|
|
2
2
|
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import { CHUNK_SIZE } from '../shared/constants.js';
|
|
4
|
+
import { CHUNK_SIZE, MAX_STEP_CONTENT_CHARS, MAX_TOKEN_COUNT } from '../shared/constants.js';
|
|
5
|
+
|
|
6
|
+
function estimateTokens(text) {
|
|
7
|
+
if (!text) return 0;
|
|
8
|
+
return Math.ceil(text.length / 4);
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
export class EnvelopeBuilder {
|
|
7
12
|
constructor(sessionId, contributorId, metadata) {
|
|
@@ -13,11 +18,23 @@ export class EnvelopeBuilder {
|
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
addStep(step) {
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
// Last-resort trim so the envelope passes ingest validation (an oversized
|
|
22
|
+
// step.content is rejected, which drops the whole session). Parsers already
|
|
23
|
+
// truncate observations to OBSERVATION_TOKEN_LIMIT and flag it; this only
|
|
24
|
+
// fires for content that slipped past them. When it does fire it MUST record
|
|
25
|
+
// the loss — a silent trim looks like complete data to downstream training.
|
|
26
|
+
if (step.content && typeof step.content === 'string' && step.content.length > MAX_STEP_CONTENT_CHARS) {
|
|
27
|
+
const originalTokens = estimateTokens(step.content);
|
|
28
|
+
step.content = step.content.slice(0, MAX_STEP_CONTENT_CHARS);
|
|
29
|
+
step.truncated = true;
|
|
30
|
+
// Preserve the parser's count if it already trimmed — that one reflects
|
|
31
|
+
// the true original size, ours only sees what survived the first pass.
|
|
32
|
+
if (typeof step.original_token_count !== 'number') {
|
|
33
|
+
step.original_token_count = Math.min(originalTokens, MAX_TOKEN_COUNT);
|
|
34
|
+
}
|
|
18
35
|
}
|
|
19
|
-
if (typeof step.token_count === 'number' && step.token_count >
|
|
20
|
-
step.token_count =
|
|
36
|
+
if (typeof step.token_count === 'number' && step.token_count > MAX_TOKEN_COUNT) {
|
|
37
|
+
step.token_count = MAX_TOKEN_COUNT;
|
|
21
38
|
}
|
|
22
39
|
this._buffer.push(step);
|
|
23
40
|
if (this._buffer.length >= CHUNK_SIZE) {
|
|
@@ -28,7 +28,17 @@ export const QUALITY_MULTIPLIERS = {
|
|
|
28
28
|
highQuality: 1.5,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// Hard ceiling on step.content, shared by the client trimmer (envelope-builder)
|
|
32
|
+
// and the ingest validator (envelope-schema). These MUST stay equal: the
|
|
33
|
+
// validator rejects the whole envelope when exceeded, which drops the entire
|
|
34
|
+
// session — so the client must trim to exactly this before building.
|
|
35
|
+
export const MAX_STEP_CONTENT_CHARS = 100_000;
|
|
36
|
+
export const MAX_TOKEN_COUNT = 100_000;
|
|
37
|
+
|
|
38
|
+
// Per-observation budget, in estimated tokens (~4 chars/token). Kept safely
|
|
39
|
+
// under MAX_STEP_CONTENT_CHARS so a parser-truncated observation plus its
|
|
40
|
+
// "[TRUNCATED …]" suffix still fits without a second trim downstream.
|
|
41
|
+
export const OBSERVATION_TOKEN_LIMIT = 24_000;
|
|
32
42
|
export const TIER_A_MIN_QUALITY = 70;
|
|
33
43
|
export const TIER_B_MIN_QUALITY = 50;
|
|
34
44
|
export const TRAINING_MIN_STEPS = 5;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// FSL-1.1-Apache-2.0 — see LICENSE
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
SUPPORTED_PROVIDERS,
|
|
5
|
+
MODEL_TIERS,
|
|
6
|
+
TRAINING_EXCLUSION_REASONS,
|
|
7
|
+
MAX_STEP_CONTENT_CHARS,
|
|
8
|
+
MAX_TOKEN_COUNT,
|
|
9
|
+
} from './constants.js';
|
|
4
10
|
|
|
5
11
|
export const STEP_TYPES = ['thought', 'action', 'observation', 'correction', 'resolution', 'error', 'coordination', 'edit', 'instruction', 'clarification', 'approval', 'delegate', 'yield'];
|
|
6
12
|
const VALID_QUALITY_TIERS = ['TIER_A', 'TIER_B', 'TIER_C'];
|
|
@@ -10,8 +16,10 @@ const VALID_MODEL_ENGINES = Object.keys(MODEL_TIERS);
|
|
|
10
16
|
const VALID_COMPLEXITIES = ['light', 'medium', 'heavy'];
|
|
11
17
|
const VALID_OUTCOME_STATUSES = ['SUCCESS', 'CRASH', 'KILLED'];
|
|
12
18
|
const MAX_STEPS_PER_ENVELOPE = 500;
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
// Sourced from shared constants — the client trims to the same value before
|
|
20
|
+
// building envelopes. Keeping one definition prevents the drift that silently
|
|
21
|
+
// truncated observations at 10k while the validator allowed more.
|
|
22
|
+
const MAX_STEP_CONTENT_LENGTH = MAX_STEP_CONTENT_CHARS;
|
|
15
23
|
const MAX_STEP_NUMBER = 50_000;
|
|
16
24
|
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
|
17
25
|
const ONE_HOUR_MS = 60 * 60 * 1000;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, it } from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
import { EnvelopeBuilder } from '../../client/envelope-builder.js';
|
|
6
|
-
import { CHUNK_SIZE } from '../../shared/constants.js';
|
|
6
|
+
import { CHUNK_SIZE, MAX_STEP_CONTENT_CHARS } from '../../shared/constants.js';
|
|
7
7
|
|
|
8
8
|
const metadata = {
|
|
9
9
|
model_engine: 'claude-opus-4-6',
|
|
@@ -74,12 +74,48 @@ describe('EnvelopeBuilder', () => {
|
|
|
74
74
|
assert.deepEqual(close.outcome, outcome);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it('
|
|
77
|
+
it('leaves content under the ingest ceiling untouched', () => {
|
|
78
78
|
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
assert.
|
|
79
|
+
builder.addStep({ step: 1, type: 'thought', timestamp: 123, content: 'x'.repeat(15_000) });
|
|
80
|
+
const step = builder.flush().trajectory_log[0];
|
|
81
|
+
assert.equal(step.content.length, 15_000);
|
|
82
|
+
assert.ok(!step.truncated);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('truncates step content at MAX_STEP_CONTENT_CHARS', () => {
|
|
86
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
87
|
+
builder.addStep({ step: 1, type: 'thought', timestamp: 123, content: 'x'.repeat(150_000) });
|
|
88
|
+
const step = builder.flush().trajectory_log[0];
|
|
89
|
+
assert.equal(step.content.length, MAX_STEP_CONTENT_CHARS);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Regression: a trim that doesn't flag itself looks like complete data to
|
|
93
|
+
// downstream training and silently corrupts the corpus.
|
|
94
|
+
it('never truncates silently — always sets truncated + original_token_count', () => {
|
|
95
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
96
|
+
builder.addStep({ step: 1, type: 'observation', timestamp: 123, content: 'x'.repeat(150_000) });
|
|
97
|
+
const step = builder.flush().trajectory_log[0];
|
|
98
|
+
assert.equal(step.truncated, true);
|
|
99
|
+
assert.equal(step.original_token_count, 37_500); // 150k chars / 4
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('preserves a parser-supplied original_token_count when trimming again', () => {
|
|
103
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
104
|
+
builder.addStep({
|
|
105
|
+
step: 1, type: 'observation', timestamp: 123,
|
|
106
|
+
content: 'x'.repeat(150_000), truncated: true, original_token_count: 99_000,
|
|
107
|
+
});
|
|
108
|
+
const step = builder.flush().trajectory_log[0];
|
|
109
|
+
// The parser saw the true original; our count only sees what survived it.
|
|
110
|
+
assert.equal(step.original_token_count, 99_000);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('output always satisfies the ingest validator', () => {
|
|
114
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
115
|
+
builder.addStep({ step: 1, type: 'observation', timestamp: 123, content: 'x'.repeat(500_000) });
|
|
116
|
+
const step = builder.flush().trajectory_log[0];
|
|
117
|
+
assert.ok(step.content.length <= MAX_STEP_CONTENT_CHARS,
|
|
118
|
+
'client must trim to the validator ceiling or the whole session is rejected');
|
|
83
119
|
});
|
|
84
120
|
|
|
85
121
|
it('caps token_count at 100000', () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, it } from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
import { validateEnvelope, STEP_TYPES } from '../../shared/envelope-schema.js';
|
|
6
|
-
import { TRAINING_EXCLUSION_REASONS } from '../../shared/constants.js';
|
|
6
|
+
import { TRAINING_EXCLUSION_REASONS, MAX_STEP_CONTENT_CHARS } from '../../shared/constants.js';
|
|
7
7
|
|
|
8
8
|
const VALID_HMAC = 'a'.repeat(64);
|
|
9
9
|
const VALID_APP_HASH = 'b'.repeat(64);
|
|
@@ -113,12 +113,19 @@ describe('envelope-schema', () => {
|
|
|
113
113
|
assert.ok(result.errors.some(e => e.includes('500')));
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
it('
|
|
116
|
+
it('accepts step content up to MAX_STEP_CONTENT_CHARS', () => {
|
|
117
117
|
const env = validEnvelope();
|
|
118
|
-
env.trajectory_log[0].content = 'x'.repeat(
|
|
118
|
+
env.trajectory_log[0].content = 'x'.repeat(MAX_STEP_CONTENT_CHARS);
|
|
119
|
+
const result = validateEnvelope(env);
|
|
120
|
+
assert.ok(!result.errors.some(e => e.includes('step.content exceeds')));
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('rejects step content over MAX_STEP_CONTENT_CHARS', () => {
|
|
124
|
+
const env = validEnvelope();
|
|
125
|
+
env.trajectory_log[0].content = 'x'.repeat(MAX_STEP_CONTENT_CHARS + 1);
|
|
119
126
|
const result = validateEnvelope(env);
|
|
120
127
|
assert.equal(result.valid, false);
|
|
121
|
-
assert.ok(result.errors.some(e => e.includes(
|
|
128
|
+
assert.ok(result.errors.some(e => e.includes(String(MAX_STEP_CONTENT_CHARS))));
|
|
122
129
|
});
|
|
123
130
|
|
|
124
131
|
it('rejects step with token_count > 100,000', () => {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// FSL-1.1-Apache-2.0 — see LICENSE
|
|
2
2
|
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import { CHUNK_SIZE } from '../shared/constants.js';
|
|
4
|
+
import { CHUNK_SIZE, MAX_STEP_CONTENT_CHARS, MAX_TOKEN_COUNT } from '../shared/constants.js';
|
|
5
|
+
|
|
6
|
+
function estimateTokens(text) {
|
|
7
|
+
if (!text) return 0;
|
|
8
|
+
return Math.ceil(text.length / 4);
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
export class EnvelopeBuilder {
|
|
7
12
|
constructor(sessionId, contributorId, metadata) {
|
|
@@ -13,11 +18,23 @@ export class EnvelopeBuilder {
|
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
addStep(step) {
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
// Last-resort trim so the envelope passes ingest validation (an oversized
|
|
22
|
+
// step.content is rejected, which drops the whole session). Parsers already
|
|
23
|
+
// truncate observations to OBSERVATION_TOKEN_LIMIT and flag it; this only
|
|
24
|
+
// fires for content that slipped past them. When it does fire it MUST record
|
|
25
|
+
// the loss — a silent trim looks like complete data to downstream training.
|
|
26
|
+
if (step.content && typeof step.content === 'string' && step.content.length > MAX_STEP_CONTENT_CHARS) {
|
|
27
|
+
const originalTokens = estimateTokens(step.content);
|
|
28
|
+
step.content = step.content.slice(0, MAX_STEP_CONTENT_CHARS);
|
|
29
|
+
step.truncated = true;
|
|
30
|
+
// Preserve the parser's count if it already trimmed — that one reflects
|
|
31
|
+
// the true original size, ours only sees what survived the first pass.
|
|
32
|
+
if (typeof step.original_token_count !== 'number') {
|
|
33
|
+
step.original_token_count = Math.min(originalTokens, MAX_TOKEN_COUNT);
|
|
34
|
+
}
|
|
18
35
|
}
|
|
19
|
-
if (typeof step.token_count === 'number' && step.token_count >
|
|
20
|
-
step.token_count =
|
|
36
|
+
if (typeof step.token_count === 'number' && step.token_count > MAX_TOKEN_COUNT) {
|
|
37
|
+
step.token_count = MAX_TOKEN_COUNT;
|
|
21
38
|
}
|
|
22
39
|
this._buffer.push(step);
|
|
23
40
|
if (this._buffer.length >= CHUNK_SIZE) {
|
|
@@ -28,7 +28,17 @@ export const QUALITY_MULTIPLIERS = {
|
|
|
28
28
|
highQuality: 1.5,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// Hard ceiling on step.content, shared by the client trimmer (envelope-builder)
|
|
32
|
+
// and the ingest validator (envelope-schema). These MUST stay equal: the
|
|
33
|
+
// validator rejects the whole envelope when exceeded, which drops the entire
|
|
34
|
+
// session — so the client must trim to exactly this before building.
|
|
35
|
+
export const MAX_STEP_CONTENT_CHARS = 100_000;
|
|
36
|
+
export const MAX_TOKEN_COUNT = 100_000;
|
|
37
|
+
|
|
38
|
+
// Per-observation budget, in estimated tokens (~4 chars/token). Kept safely
|
|
39
|
+
// under MAX_STEP_CONTENT_CHARS so a parser-truncated observation plus its
|
|
40
|
+
// "[TRUNCATED …]" suffix still fits without a second trim downstream.
|
|
41
|
+
export const OBSERVATION_TOKEN_LIMIT = 24_000;
|
|
32
42
|
export const TIER_A_MIN_QUALITY = 70;
|
|
33
43
|
export const TIER_B_MIN_QUALITY = 50;
|
|
34
44
|
export const TRAINING_MIN_STEPS = 5;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// FSL-1.1-Apache-2.0 — see LICENSE
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
SUPPORTED_PROVIDERS,
|
|
5
|
+
MODEL_TIERS,
|
|
6
|
+
TRAINING_EXCLUSION_REASONS,
|
|
7
|
+
MAX_STEP_CONTENT_CHARS,
|
|
8
|
+
MAX_TOKEN_COUNT,
|
|
9
|
+
} from './constants.js';
|
|
4
10
|
|
|
5
11
|
export const STEP_TYPES = ['thought', 'action', 'observation', 'correction', 'resolution', 'error', 'coordination', 'edit', 'instruction', 'clarification', 'approval', 'delegate', 'yield'];
|
|
6
12
|
const VALID_QUALITY_TIERS = ['TIER_A', 'TIER_B', 'TIER_C'];
|
|
@@ -10,8 +16,10 @@ const VALID_MODEL_ENGINES = Object.keys(MODEL_TIERS);
|
|
|
10
16
|
const VALID_COMPLEXITIES = ['light', 'medium', 'heavy'];
|
|
11
17
|
const VALID_OUTCOME_STATUSES = ['SUCCESS', 'CRASH', 'KILLED'];
|
|
12
18
|
const MAX_STEPS_PER_ENVELOPE = 500;
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
// Sourced from shared constants — the client trims to the same value before
|
|
20
|
+
// building envelopes. Keeping one definition prevents the drift that silently
|
|
21
|
+
// truncated observations at 10k while the validator allowed more.
|
|
22
|
+
const MAX_STEP_CONTENT_LENGTH = MAX_STEP_CONTENT_CHARS;
|
|
15
23
|
const MAX_STEP_NUMBER = 50_000;
|
|
16
24
|
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
|
17
25
|
const ONE_HOUR_MS = 60 * 60 * 1000;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, it } from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
import { EnvelopeBuilder } from '../../client/envelope-builder.js';
|
|
6
|
-
import { CHUNK_SIZE } from '../../shared/constants.js';
|
|
6
|
+
import { CHUNK_SIZE, MAX_STEP_CONTENT_CHARS } from '../../shared/constants.js';
|
|
7
7
|
|
|
8
8
|
const metadata = {
|
|
9
9
|
model_engine: 'claude-opus-4-6',
|
|
@@ -74,12 +74,48 @@ describe('EnvelopeBuilder', () => {
|
|
|
74
74
|
assert.deepEqual(close.outcome, outcome);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it('
|
|
77
|
+
it('leaves content under the ingest ceiling untouched', () => {
|
|
78
78
|
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
assert.
|
|
79
|
+
builder.addStep({ step: 1, type: 'thought', timestamp: 123, content: 'x'.repeat(15_000) });
|
|
80
|
+
const step = builder.flush().trajectory_log[0];
|
|
81
|
+
assert.equal(step.content.length, 15_000);
|
|
82
|
+
assert.ok(!step.truncated);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('truncates step content at MAX_STEP_CONTENT_CHARS', () => {
|
|
86
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
87
|
+
builder.addStep({ step: 1, type: 'thought', timestamp: 123, content: 'x'.repeat(150_000) });
|
|
88
|
+
const step = builder.flush().trajectory_log[0];
|
|
89
|
+
assert.equal(step.content.length, MAX_STEP_CONTENT_CHARS);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Regression: a trim that doesn't flag itself looks like complete data to
|
|
93
|
+
// downstream training and silently corrupts the corpus.
|
|
94
|
+
it('never truncates silently — always sets truncated + original_token_count', () => {
|
|
95
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
96
|
+
builder.addStep({ step: 1, type: 'observation', timestamp: 123, content: 'x'.repeat(150_000) });
|
|
97
|
+
const step = builder.flush().trajectory_log[0];
|
|
98
|
+
assert.equal(step.truncated, true);
|
|
99
|
+
assert.equal(step.original_token_count, 37_500); // 150k chars / 4
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('preserves a parser-supplied original_token_count when trimming again', () => {
|
|
103
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
104
|
+
builder.addStep({
|
|
105
|
+
step: 1, type: 'observation', timestamp: 123,
|
|
106
|
+
content: 'x'.repeat(150_000), truncated: true, original_token_count: 99_000,
|
|
107
|
+
});
|
|
108
|
+
const step = builder.flush().trajectory_log[0];
|
|
109
|
+
// The parser saw the true original; our count only sees what survived it.
|
|
110
|
+
assert.equal(step.original_token_count, 99_000);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('output always satisfies the ingest validator', () => {
|
|
114
|
+
const builder = new EnvelopeBuilder('sess_1', 'user_1', metadata);
|
|
115
|
+
builder.addStep({ step: 1, type: 'observation', timestamp: 123, content: 'x'.repeat(500_000) });
|
|
116
|
+
const step = builder.flush().trajectory_log[0];
|
|
117
|
+
assert.ok(step.content.length <= MAX_STEP_CONTENT_CHARS,
|
|
118
|
+
'client must trim to the validator ceiling or the whole session is rejected');
|
|
83
119
|
});
|
|
84
120
|
|
|
85
121
|
it('caps token_count at 100000', () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, it } from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
import { validateEnvelope, STEP_TYPES } from '../../shared/envelope-schema.js';
|
|
6
|
-
import { TRAINING_EXCLUSION_REASONS } from '../../shared/constants.js';
|
|
6
|
+
import { TRAINING_EXCLUSION_REASONS, MAX_STEP_CONTENT_CHARS } from '../../shared/constants.js';
|
|
7
7
|
|
|
8
8
|
const VALID_HMAC = 'a'.repeat(64);
|
|
9
9
|
const VALID_APP_HASH = 'b'.repeat(64);
|
|
@@ -113,12 +113,19 @@ describe('envelope-schema', () => {
|
|
|
113
113
|
assert.ok(result.errors.some(e => e.includes('500')));
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
it('
|
|
116
|
+
it('accepts step content up to MAX_STEP_CONTENT_CHARS', () => {
|
|
117
117
|
const env = validEnvelope();
|
|
118
|
-
env.trajectory_log[0].content = 'x'.repeat(
|
|
118
|
+
env.trajectory_log[0].content = 'x'.repeat(MAX_STEP_CONTENT_CHARS);
|
|
119
|
+
const result = validateEnvelope(env);
|
|
120
|
+
assert.ok(!result.errors.some(e => e.includes('step.content exceeds')));
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('rejects step content over MAX_STEP_CONTENT_CHARS', () => {
|
|
124
|
+
const env = validEnvelope();
|
|
125
|
+
env.trajectory_log[0].content = 'x'.repeat(MAX_STEP_CONTENT_CHARS + 1);
|
|
119
126
|
const result = validateEnvelope(env);
|
|
120
127
|
assert.equal(result.valid, false);
|
|
121
|
-
assert.ok(result.errors.some(e => e.includes(
|
|
128
|
+
assert.ok(result.errors.some(e => e.includes(String(MAX_STEP_CONTENT_CHARS))));
|
|
122
129
|
});
|
|
123
130
|
|
|
124
131
|
it('rejects step with token_count > 100,000', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groove-dev",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.180",
|
|
4
4
|
"description": "Open-source agent orchestration layer — the AI company OS. Local model agent engine (GGUF/Ollama/llama-server), HuggingFace model browser, MCP integrations (Slack, Gmail, Stripe, 15+), agent scheduling (cron), business roles (CMO, CFO, EA). GUI dashboard, multi-agent coordination, zero cold-start, infinite sessions. Works with Claude Code, Codex, Gemini CLI, Ollama, any local model.",
|
|
5
5
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
6
|
"author": "Groove Dev <hello@groovedev.ai> (https://groovedev.ai)",
|