Skip to content

Commit 3a8276e

Browse files
author
StackMemory Bot (CLI)
committed
chore: handoff checkpoint on main
1 parent 36d0a87 commit 3a8276e

5 files changed

Lines changed: 107 additions & 13 deletions

File tree

.claude/settings.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"matcher": "",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "entire hooks claude-code session-start"
10+
}
11+
]
12+
}
13+
],
14+
"SessionEnd": [
15+
{
16+
"matcher": "",
17+
"hooks": [
18+
{
19+
"type": "command",
20+
"command": "entire hooks claude-code session-end"
21+
}
22+
]
23+
}
24+
],
25+
"UserPromptSubmit": [
26+
{
27+
"matcher": "",
28+
"hooks": [
29+
{
30+
"type": "command",
31+
"command": "entire hooks claude-code user-prompt-submit"
32+
}
33+
]
34+
}
35+
],
36+
"Stop": [
37+
{
38+
"matcher": "",
39+
"hooks": [
40+
{
41+
"type": "command",
42+
"command": "entire hooks claude-code stop"
43+
}
44+
]
45+
}
46+
],
47+
"PreToolUse": [
48+
{
49+
"matcher": "Task",
50+
"hooks": [
51+
{
52+
"type": "command",
53+
"command": "entire hooks claude-code pre-task"
54+
}
55+
]
56+
}
57+
],
58+
"PostToolUse": [
59+
{
60+
"matcher": "Task",
61+
"hooks": [
62+
{
63+
"type": "command",
64+
"command": "entire hooks claude-code post-task"
65+
}
66+
]
67+
},
68+
{
69+
"matcher": "TodoWrite",
70+
"hooks": [
71+
{
72+
"type": "command",
73+
"command": "entire hooks claude-code post-todo"
74+
}
75+
]
76+
}
77+
]
78+
},
79+
"permissions": {
80+
"deny": [
81+
"Read(./.entire/metadata/**)"
82+
]
83+
}
84+
}

scripts/test-pre-publish-quick.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ log_success "Package structure valid"
5353

5454
# Core tests + search benchmark (100-frame smoke)
5555
log_info "Running tests..."
56-
npx vitest run --reporter=dot --bail=3 2>&1 | tail -5
56+
npx vitest run --reporter=dot --bail=3 --retry 1 2>&1 | tail -5
5757
if [ ${PIPESTATUS[0]} -ne 0 ]; then
5858
log_error "Tests failed"
5959
fi

src/__tests__/integration/cli-integration.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function createTestDb(testDir: string): void {
7373
db.close();
7474
}
7575

76-
describe('CLI Integration', () => {
76+
describe('CLI Integration', { timeout: 60_000 }, () => {
7777
let testDir: string;
7878

7979
beforeEach(() => {
@@ -135,16 +135,16 @@ describe('CLI Integration', () => {
135135
});
136136

137137
describe('Clear Command', () => {
138-
it('should show clear status', { timeout: 15000 }, () => {
138+
it('should show clear status', { timeout: 45000 }, () => {
139139
// Initialize first
140-
execSync(`node ${cliPath} init`, { cwd: testDir, timeout: 10000 });
140+
execSync(`node ${cliPath} init`, { cwd: testDir, timeout: 30000 });
141141
// Create DB since init skips it in test mode
142142
createTestDb(testDir);
143143

144144
const result = execSync(`node ${cliPath} clear --status`, {
145145
cwd: testDir,
146146
encoding: 'utf8',
147-
timeout: 10000,
147+
timeout: 30000,
148148
});
149149

150150
expect(result).toContain('Context Usage');

src/cli/commands/__tests__/integration.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const cli = (cmd: string) => `node ${cliPath} ${cmd}`;
1717
// NOTE: These tests have implementation dependencies
1818
// Simpler tests are in src/__tests__/integration/cli-integration.test.ts
1919

20-
describe('CLI Integration Tests', () => {
20+
describe('CLI Integration Tests', { timeout: 60_000 }, () => {
2121
let testDir: string;
2222

2323
beforeEach(() => {
@@ -27,7 +27,7 @@ describe('CLI Integration Tests', () => {
2727
process.chdir(testDir);
2828

2929
// Initialize StackMemory in test directory
30-
execSync(cli('init'), { cwd: testDir, timeout: 10000 });
30+
execSync(cli('init'), { cwd: testDir, timeout: 30000 });
3131

3232
// Create context.db since init skips DB creation in test mode
3333
const dbDir = path.join(testDir, '.stackmemory');
@@ -98,7 +98,7 @@ describe('CLI Integration Tests', () => {
9898
const result = execSync(cli('clear --status'), {
9999
cwd: testDir,
100100
encoding: 'utf8',
101-
timeout: 25000,
101+
timeout: 30000,
102102
});
103103

104104
// Updated expectations to match actual output
@@ -112,7 +112,7 @@ describe('CLI Integration Tests', () => {
112112
const result = execSync(cli('capture'), {
113113
cwd: testDir,
114114
encoding: 'utf8',
115-
timeout: 15000,
115+
timeout: 30000,
116116
});
117117

118118
// Check for any successful output
@@ -128,13 +128,13 @@ describe('CLI Integration Tests', () => {
128128

129129
it('should load handoff document', { timeout: 30000 }, () => {
130130
// First generate a handoff
131-
execSync(cli('capture'), { cwd: testDir, timeout: 15000 });
131+
execSync(cli('capture'), { cwd: testDir, timeout: 30000 });
132132

133133
// Then load it
134134
const result = execSync(cli('restore'), {
135135
cwd: testDir,
136136
encoding: 'utf8',
137-
timeout: 15000,
137+
timeout: 30000,
138138
});
139139

140140
// Just check it ran without error
@@ -143,12 +143,12 @@ describe('CLI Integration Tests', () => {
143143

144144
it('should capture handoff document', { timeout: 30000 }, () => {
145145
// Generate a capture
146-
execSync(cli('capture'), { cwd: testDir, timeout: 15000 });
146+
execSync(cli('capture'), { cwd: testDir, timeout: 30000 });
147147

148148
const result = execSync(cli('capture'), {
149149
cwd: testDir,
150150
encoding: 'utf8',
151-
timeout: 15000,
151+
timeout: 30000,
152152
});
153153

154154
// Just check it ran without error

vitest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ export default defineConfig({
77
testTimeout: 30000,
88
hookTimeout: 30000,
99
include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
10+
sequence: {
11+
// Run CLI integration tests sequentially to avoid execSync resource contention
12+
sequenceFiles: true,
13+
},
14+
poolOptions: {
15+
forks: {
16+
// Limit parallelism to prevent CLI integration test timeouts
17+
maxForks: 6,
18+
},
19+
},
1020
exclude: [
1121
'node_modules',
1222
'dist',

0 commit comments

Comments
 (0)