build: unify bun quality gate
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {
|
||||
isTaskScopedIpcDir,
|
||||
resolveIpcDirectories,
|
||||
} from '../src/ipc-paths.js';
|
||||
import { isTaskScopedIpcDir, resolveIpcDirectories } from '../src/ipc-paths.js';
|
||||
|
||||
describe('ipc path helpers', () => {
|
||||
it('detects task-scoped IPC directories', () => {
|
||||
|
||||
@@ -14,11 +14,17 @@ describe('memory selection', () => {
|
||||
);
|
||||
|
||||
expect(selected).toHaveLength(2);
|
||||
expect(selected[0].content).toBe('방 메모리는 새 세션 시작 시에만 주입한다.');
|
||||
expect(selected[0].content).toBe(
|
||||
'방 메모리는 새 세션 시작 시에만 주입한다.',
|
||||
);
|
||||
expect(selected[0].memoryKind).toBe('room_norm');
|
||||
expect(selected[1].content).toBe('사용자는 수동 명령보다 자동 기억 형성을 원한다.');
|
||||
expect(selected[1].content).toBe(
|
||||
'사용자는 수동 명령보다 자동 기억 형성을 원한다.',
|
||||
);
|
||||
expect(selected[1].memoryKind).toBe('preference');
|
||||
expect(selected.every((memory) => memory.keywords.includes('room:ejclaw'))).toBe(true);
|
||||
expect(
|
||||
selected.every((memory) => memory.keywords.includes('room:ejclaw')),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('returns no memories for purely operational summaries', () => {
|
||||
@@ -37,7 +43,9 @@ describe('memory selection', () => {
|
||||
);
|
||||
|
||||
expect(selected).toHaveLength(1);
|
||||
expect(selected[0].content).toBe('배포 전에 항상 테스트를 돌리는 것이 원칙이다.');
|
||||
expect(selected[0].content).toBe(
|
||||
'배포 전에 항상 테스트를 돌리는 것이 원칙이다.',
|
||||
);
|
||||
expect(selected[0].memoryKind).toBe('room_norm');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -110,11 +110,11 @@ describe('claude reviewer runtime guard', () => {
|
||||
});
|
||||
|
||||
it('builds a read-only sandbox with normalized protected paths', () => {
|
||||
const sandbox = buildClaudeReadonlySandboxSettings([
|
||||
'/repo/work',
|
||||
'/repo/work',
|
||||
'/repo/owner/../owner',
|
||||
], 'linux', 'strict');
|
||||
const sandbox = buildClaudeReadonlySandboxSettings(
|
||||
['/repo/work', '/repo/work', '/repo/owner/../owner'],
|
||||
'linux',
|
||||
'strict',
|
||||
);
|
||||
|
||||
expect(sandbox).toMatchObject({
|
||||
enabled: true,
|
||||
@@ -157,12 +157,10 @@ describe('claude reviewer runtime guard', () => {
|
||||
|
||||
it('flags mutating shell commands', () => {
|
||||
expect(isReviewerMutatingShellCommand('git commit -m "x"')).toBe(false);
|
||||
expect(isReviewerMutatingShellCommand('git -c color.ui=false commit -m "x"')).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isReviewerMutatingShellCommand('sed -i s/a/b/ file.ts')).toBe(
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
isReviewerMutatingShellCommand('git -c color.ui=false commit -m "x"'),
|
||||
).toBe(false);
|
||||
expect(isReviewerMutatingShellCommand('sed -i s/a/b/ file.ts')).toBe(true);
|
||||
expect(isReviewerMutatingShellCommand('git status')).toBe(false);
|
||||
expect(isReviewerMutatingShellCommand('npm test')).toBe(false);
|
||||
});
|
||||
@@ -263,7 +261,9 @@ describe('claude reviewer runtime guard', () => {
|
||||
true,
|
||||
);
|
||||
|
||||
expect(() => assertReadonlyWorkspaceRepoConnectivity(env, true)).not.toThrow();
|
||||
expect(() =>
|
||||
assertReadonlyWorkspaceRepoConnectivity(env, true),
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it.each([
|
||||
@@ -286,7 +286,9 @@ describe('claude reviewer runtime guard', () => {
|
||||
true,
|
||||
);
|
||||
|
||||
expect(() => assertReadonlyWorkspaceRepoConnectivity(env, true)).not.toThrow();
|
||||
expect(() =>
|
||||
assertReadonlyWorkspaceRepoConnectivity(env, true),
|
||||
).not.toThrow();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -11,10 +11,15 @@ import {
|
||||
|
||||
describe('runner verification helpers', () => {
|
||||
it('computes the same snapshot when excluded files change', () => {
|
||||
const repoDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ejclaw-runner-snapshot-'));
|
||||
const repoDir = fs.mkdtempSync(
|
||||
path.join(os.tmpdir(), 'ejclaw-runner-snapshot-'),
|
||||
);
|
||||
fs.mkdirSync(path.join(repoDir, 'src'), { recursive: true });
|
||||
fs.mkdirSync(path.join(repoDir, 'node_modules'), { recursive: true });
|
||||
fs.writeFileSync(path.join(repoDir, 'src', 'index.ts'), 'export const x = 1;\n');
|
||||
fs.writeFileSync(
|
||||
path.join(repoDir, 'src', 'index.ts'),
|
||||
'export const x = 1;\n',
|
||||
);
|
||||
fs.writeFileSync(path.join(repoDir, '.env'), 'SECRET=1\n');
|
||||
|
||||
const first = computeVerificationSnapshotId(repoDir);
|
||||
|
||||
Reference in New Issue
Block a user