jettypod 4.1.2 → 4.1.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/.nvmrc +1 -0
- package/docs/COMPLETE-TESTING-STRATEGY.md +970 -0
- package/docs/DECISIONS.md +10 -12
- package/docs/NODE_VERSION.md +83 -0
- package/docs/TDD-INFRASTRUCTURE-STRATEGY.md +1374 -0
- package/docs/TESTING-FOR-NON-ENGINEERS.md +1588 -0
- package/docs/TESTING-STRATEGY-AUDIT.md +698 -0
- package/hooks/post-checkout +17 -0
- package/hooks/post-merge +17 -0
- package/hooks/pre-commit +30 -0
- package/jettypod.js +259 -120
- package/lib/coverage-tracker.js +218 -0
- package/lib/database.js +2 -0
- package/lib/db-export.js +192 -0
- package/lib/db-import.js +193 -0
- package/lib/external-transition-handler.js +32 -0
- package/lib/git-hook-helpers.js +174 -0
- package/lib/git-root.js +90 -0
- package/lib/infrastructure-chore-generator.js +45 -0
- package/lib/install-hooks.js +52 -0
- package/lib/jettypod-backup.js +238 -0
- package/lib/merge-lock.js +193 -0
- package/lib/migrations/012-add-worktree-path.js +38 -0
- package/lib/migrations/013-worktrees-table.js +86 -0
- package/lib/migrations/014-migrate-worktree-data.js +161 -0
- package/lib/migrations/015-merge-locks-table.js +67 -0
- package/lib/pattern-finder.js +152 -0
- package/lib/process-manager.js +140 -0
- package/lib/production-standards-reader.js +13 -2
- package/lib/production-standards-writer.js +85 -0
- package/lib/skills/feature-planning/dry-run-validator.js +135 -0
- package/lib/skills/feature-planning/validation-formatter.js +160 -0
- package/lib/smart-conflict-detection.js +168 -0
- package/lib/smart-fetch-rebase.js +614 -0
- package/lib/step-definition-parser.js +76 -0
- package/lib/unit-test-generator.js +232 -0
- package/lib/verification-command-generator.js +66 -0
- package/lib/worktree-diagnostics.js +413 -0
- package/lib/worktree-facade.js +174 -0
- package/lib/worktree-manager.js +636 -0
- package/lib/worktree-reconciler.js +429 -0
- package/package.json +30 -3
- package/skills-templates/external-transition/SKILL.md +34 -3
- package/skills-templates/feature-planning/SKILL.md +190 -24
- package/skills-templates/production-mode/SKILL.md +127 -9
- package/skills-templates/speed-mode/SKILL.md +454 -51
- package/skills-templates/stable-mode/SKILL.md +285 -76
- package/.claude/PROTECT_SKILLS.md +0 -28
- package/.claude/settings.json +0 -24
- package/.claude/settings.local.json +0 -16
- package/.claude/skills/epic-planning/SKILL.md +0 -297
- package/.claude/skills/external-transition/SKILL.md +0 -384
- package/.claude/skills/feature-planning/SKILL.md +0 -464
- package/.claude/skills/production-mode/SKILL.md +0 -369
- package/.claude/skills/speed-mode/SKILL.md +0 -481
- package/.claude/skills/stable-mode/SKILL.md +0 -713
- package/.claude/skills.backup-2025-11-10T23-33-09-368Z/epic-planning/SKILL.md +0 -297
- package/.claude/skills.backup-2025-11-10T23-33-09-368Z/feature-planning/SKILL.md +0 -464
- package/.claude/skills.backup-2025-11-10T23-33-09-368Z/speed-mode/SKILL.md +0 -467
- package/.claude/skills.backup-2025-11-10T23-33-09-368Z/stable-mode/SKILL.md +0 -673
- package/.claude/skills.backup-2025-11-11T16-15-10-070Z/epic-discover/SKILL.md +0 -297
- package/.claude/skills.backup-2025-11-11T16-42-43-212Z/epic-planning/SKILL.md +0 -297
- package/.claude/skills.backup-2025-11-11T16-42-43-212Z/feature-planning/SKILL.md +0 -464
- package/.claude/skills.backup-2025-11-11T16-42-43-212Z/speed-mode/SKILL.md +0 -467
- package/.claude/skills.backup-2025-11-11T16-42-43-212Z/stable-mode/SKILL.md +0 -673
- package/.claude/skills.backup-2025-11-11T17-06-09-783Z/epic-planning/SKILL.md +0 -297
- package/.claude/skills.backup-2025-11-11T17-06-09-783Z/feature-planning/SKILL.md +0 -464
- package/.claude/skills.backup-2025-11-11T17-06-09-783Z/speed-mode/SKILL.md +0 -467
- package/.claude/skills.backup-2025-11-11T17-06-09-783Z/stable-mode/SKILL.md +0 -673
- package/.devpod/current-work.json +0 -10
- package/.devpod/work.db +0 -0
- package/.github/workflows/test-safety.yml +0 -85
- package/.jettypod/config.json +0 -5
- package/.jettypod/current-work.json +0 -10
- package/.jettypod/hooks/README.md +0 -77
- package/.jettypod/hooks/protect-claude-md.js +0 -338
- package/.jettypod/test-work.db +0 -0
- package/.jettypod/work.db +0 -0
- package/CLAUDE.md +0 -49
- package/SPEED-STABLE-AUDIT.md +0 -853
- package/SYSTEM-BEHAVIOR.md +0 -2199
- package/TEST_SAFETY_AUDIT.md +0 -314
- package/TEST_SAFETY_IMPLEMENTATION.md +0 -97
- package/cucumber-report.html +0 -45
- package/dist/devpod-linux +0 -0
- package/dist/devpod-macos +0 -0
- package/dist/devpod-win.exe +0 -0
- package/docs/features/jettypod-standards-explained.md +0 -543
- package/docs/features/standards-inventory.md +0 -257
- package/features/auto-generate-production-chores.feature +0 -13
- package/features/backlog-command.feature +0 -26
- package/features/backlog-filtering-production.feature +0 -10
- package/features/claude-md-protection/steps.js +0 -498
- package/features/decisions/index.js +0 -490
- package/features/decisions/index.test.js +0 -208
- package/features/fix-text-wrapping.feature +0 -42
- package/features/git-hooks/git-hooks.feature +0 -30
- package/features/git-hooks/index.js +0 -93
- package/features/git-hooks/index.test.js +0 -137
- package/features/git-hooks/post-commit +0 -56
- package/features/git-hooks/post-merge +0 -47
- package/features/git-hooks/pre-commit +0 -28
- package/features/git-hooks/simple-steps.js +0 -53
- package/features/git-hooks/simple-test.feature +0 -10
- package/features/git-hooks/steps.js +0 -196
- package/features/jettypod-update-command.feature +0 -46
- package/features/mode-prompts/index.js +0 -95
- package/features/mode-prompts/simple-steps.js +0 -44
- package/features/mode-prompts/simple-test.feature +0 -9
- package/features/mode-prompts/validation.test.js +0 -120
- package/features/multiple-claude-instances.feature +0 -121
- package/features/production-mode-skill.feature +0 -121
- package/features/refactor-mode/steps.js +0 -217
- package/features/refactor-mode.feature +0 -49
- package/features/simplify-external-transition.feature +0 -166
- package/features/skills-update/index.test.js +0 -216
- package/features/step_definitions/backlog-command.steps.js +0 -37
- package/features/step_definitions/fix-text-wrapping.steps.js +0 -271
- package/features/step_definitions/multiple-claude-instances.steps.js +0 -621
- package/features/step_definitions/production-mode-skill.steps.js +0 -862
- package/features/step_definitions/simplify-external-transition.steps.js +0 -370
- package/features/step_definitions/terminal-logo.steps.js +0 -145
- package/features/step_definitions/update-command.steps.js +0 -183
- package/features/support/hooks.js +0 -9
- package/features/terminal-logo/index.js +0 -39
- package/features/terminal-logo/terminal-logo.feature +0 -30
- package/features/update-command/index.js +0 -181
- package/features/update-command/index.test.js +0 -225
- package/features/work-commands/bug-workflow-display.feature +0 -22
- package/features/work-commands/index.js +0 -498
- package/features/work-commands/simple-steps.js +0 -69
- package/features/work-commands/stable-tests.feature +0 -57
- package/features/work-commands/steps.js +0 -1174
- package/features/work-commands/validation.test.js +0 -88
- package/features/work-commands/work-commands.feature +0 -13
- package/features/work-tracking/discovery-validation.test.js +0 -228
- package/features/work-tracking/index.js +0 -1921
- package/features/work-tracking/mode-required.feature +0 -112
- package/features/work-tracking/phase-tracking.test.js +0 -482
- package/features/work-tracking/prototype-tracking.test.js +0 -485
- package/features/work-tracking/tree-view.test.js +0 -310
- package/features/work-tracking/work-set-mode.feature +0 -71
- package/features/work-tracking/work-start-mode.feature +0 -88
- package/full-test.txt +0 -0
- package/lib/bug-workflow.test.js +0 -177
- package/lib/claudemd.test.js +0 -195
- package/lib/config.test.js +0 -511
- package/lib/constants.test.js +0 -164
- package/lib/current-work.test.js +0 -146
- package/lib/database-project-config.test.js +0 -111
- package/lib/database.test.js +0 -106
- package/lib/decisions-generator.test.js +0 -457
- package/lib/decisions-helpers.test.js +0 -310
- package/lib/git-coordinator.js +0 -167
- package/lib/git.test.js +0 -145
- package/lib/migrations/002-default-work-item-modes.test.js +0 -351
- package/lib/production-chore-generator.test.js +0 -432
- package/lib/production-context-detector.test.js +0 -277
- package/lib/production-scenario-appender.test.js +0 -235
- package/lib/production-scenario-validator.test.js +0 -246
- package/lib/production-standards-reader.test.js +0 -270
- package/lib/project-state.test.js +0 -92
- package/lib/push-queue.js +0 -417
- package/lib/queue-processor.js +0 -74
- package/lib/test-helpers.js +0 -202
- package/lib/test-helpers.test.js +0 -255
- package/prototypes/2025-01-11-production-mode-autonomous.js +0 -119
- package/prototypes/2025-01-11-production-mode-collaborative.js +0 -166
- package/prototypes/2025-01-11-production-mode-guided.js +0 -217
- package/prototypes/2025-01-11-production-mode-smart-context.js +0 -347
- package/prototypes/2025-01-11-production-standards-example.md +0 -204
- package/prototypes/2025-11-10-backlog-filtering-tree-aware.js +0 -242
- package/prototypes/test/index.html +0 -1
- package/setup-dist-repo.sh +0 -68
- package/test-production-standards-engine.js +0 -130
- package/test-results.json +0 -2195
- package/test-safety-check.sh +0 -80
- package/work-item-tracking-plan.md +0 -199
- /package/{.jettypod/devpod.db → jettypod.db} +0 -0
package/lib/test-helpers.test.js
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const {
|
|
5
|
-
createTestEnvironment,
|
|
6
|
-
copyDirRecursive,
|
|
7
|
-
runCommand,
|
|
8
|
-
readConfig,
|
|
9
|
-
readClaude,
|
|
10
|
-
initializeTracking
|
|
11
|
-
} = require('./test-helpers');
|
|
12
|
-
|
|
13
|
-
describe('Test Helpers Module', () => {
|
|
14
|
-
describe('createTestEnvironment()', () => {
|
|
15
|
-
test('should create isolated test directory', () => {
|
|
16
|
-
const env = createTestEnvironment();
|
|
17
|
-
|
|
18
|
-
expect(env.testDir).toBeTruthy();
|
|
19
|
-
expect(fs.existsSync(env.testDir)).toBe(true);
|
|
20
|
-
expect(env.testDir).toContain('jettypod-test-');
|
|
21
|
-
expect(env.originalCwd).toBeTruthy();
|
|
22
|
-
|
|
23
|
-
env.cleanup();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('should provide cleanup function', () => {
|
|
27
|
-
const env = createTestEnvironment();
|
|
28
|
-
const testDir = env.testDir;
|
|
29
|
-
|
|
30
|
-
expect(fs.existsSync(testDir)).toBe(true);
|
|
31
|
-
env.cleanup();
|
|
32
|
-
expect(fs.existsSync(testDir)).toBe(false);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('should handle cleanup when directory already deleted', () => {
|
|
36
|
-
const env = createTestEnvironment();
|
|
37
|
-
fs.rmSync(env.testDir, { recursive: true });
|
|
38
|
-
|
|
39
|
-
expect(() => env.cleanup()).not.toThrow();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('should restore original working directory on cleanup', () => {
|
|
43
|
-
const originalCwd = process.cwd();
|
|
44
|
-
const env = createTestEnvironment();
|
|
45
|
-
|
|
46
|
-
process.chdir(env.testDir);
|
|
47
|
-
env.cleanup();
|
|
48
|
-
|
|
49
|
-
expect(process.cwd()).toBe(originalCwd);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('copyDirRecursive()', () => {
|
|
54
|
-
let testEnv;
|
|
55
|
-
|
|
56
|
-
beforeEach(() => {
|
|
57
|
-
testEnv = createTestEnvironment();
|
|
58
|
-
process.chdir(testEnv.testDir);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
afterEach(() => {
|
|
62
|
-
testEnv.cleanup();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('should copy directory recursively', () => {
|
|
66
|
-
const srcDir = path.join(testEnv.testDir, 'src');
|
|
67
|
-
const destDir = path.join(testEnv.testDir, 'dest');
|
|
68
|
-
|
|
69
|
-
fs.mkdirSync(srcDir);
|
|
70
|
-
fs.writeFileSync(path.join(srcDir, 'file1.js'), 'content1');
|
|
71
|
-
fs.writeFileSync(path.join(srcDir, 'file2.js'), 'content2');
|
|
72
|
-
|
|
73
|
-
copyDirRecursive(srcDir, destDir);
|
|
74
|
-
|
|
75
|
-
expect(fs.existsSync(path.join(destDir, 'file1.js'))).toBe(true);
|
|
76
|
-
expect(fs.existsSync(path.join(destDir, 'file2.js'))).toBe(true);
|
|
77
|
-
expect(fs.readFileSync(path.join(destDir, 'file1.js'), 'utf-8')).toBe('content1');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test('should skip .test.js files when copying', () => {
|
|
81
|
-
const srcDir = path.join(testEnv.testDir, 'src');
|
|
82
|
-
const destDir = path.join(testEnv.testDir, 'dest');
|
|
83
|
-
|
|
84
|
-
fs.mkdirSync(srcDir);
|
|
85
|
-
fs.writeFileSync(path.join(srcDir, 'file.js'), 'content');
|
|
86
|
-
fs.writeFileSync(path.join(srcDir, 'file.test.js'), 'test content');
|
|
87
|
-
|
|
88
|
-
copyDirRecursive(srcDir, destDir);
|
|
89
|
-
|
|
90
|
-
expect(fs.existsSync(path.join(destDir, 'file.js'))).toBe(true);
|
|
91
|
-
expect(fs.existsSync(path.join(destDir, 'file.test.js'))).toBe(false);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test('should copy nested directories', () => {
|
|
95
|
-
const srcDir = path.join(testEnv.testDir, 'src');
|
|
96
|
-
const destDir = path.join(testEnv.testDir, 'dest');
|
|
97
|
-
const nestedDir = path.join(srcDir, 'nested');
|
|
98
|
-
|
|
99
|
-
fs.mkdirSync(srcDir);
|
|
100
|
-
fs.mkdirSync(nestedDir);
|
|
101
|
-
fs.writeFileSync(path.join(nestedDir, 'file.js'), 'nested content');
|
|
102
|
-
|
|
103
|
-
copyDirRecursive(srcDir, destDir);
|
|
104
|
-
|
|
105
|
-
expect(fs.existsSync(path.join(destDir, 'nested', 'file.js'))).toBe(true);
|
|
106
|
-
expect(fs.readFileSync(path.join(destDir, 'nested', 'file.js'), 'utf-8')).toBe('nested content');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test('should create destination directory if it does not exist', () => {
|
|
110
|
-
const srcDir = path.join(testEnv.testDir, 'src');
|
|
111
|
-
const destDir = path.join(testEnv.testDir, 'dest');
|
|
112
|
-
|
|
113
|
-
fs.mkdirSync(srcDir);
|
|
114
|
-
fs.writeFileSync(path.join(srcDir, 'file.js'), 'content');
|
|
115
|
-
|
|
116
|
-
expect(fs.existsSync(destDir)).toBe(false);
|
|
117
|
-
copyDirRecursive(srcDir, destDir);
|
|
118
|
-
expect(fs.existsSync(destDir)).toBe(true);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('should throw error for non-existent source directory', () => {
|
|
122
|
-
const srcDir = path.join(testEnv.testDir, 'nonexistent');
|
|
123
|
-
const destDir = path.join(testEnv.testDir, 'dest');
|
|
124
|
-
|
|
125
|
-
expect(() => copyDirRecursive(srcDir, destDir)).toThrow('Source directory does not exist');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
test('should throw error for invalid source path', () => {
|
|
129
|
-
expect(() => copyDirRecursive(null, 'dest')).toThrow('Source path must be a non-empty string');
|
|
130
|
-
expect(() => copyDirRecursive('', 'dest')).toThrow('Source path must be a non-empty string');
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test('should throw error for invalid destination path', () => {
|
|
134
|
-
const srcDir = path.join(testEnv.testDir, 'src');
|
|
135
|
-
fs.mkdirSync(srcDir);
|
|
136
|
-
|
|
137
|
-
expect(() => copyDirRecursive(srcDir, null)).toThrow('Destination path must be a non-empty string');
|
|
138
|
-
expect(() => copyDirRecursive(srcDir, '')).toThrow('Destination path must be a non-empty string');
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test('should throw error if source is not a directory', () => {
|
|
142
|
-
const srcFile = path.join(testEnv.testDir, 'file.js');
|
|
143
|
-
fs.writeFileSync(srcFile, 'content');
|
|
144
|
-
|
|
145
|
-
expect(() => copyDirRecursive(srcFile, 'dest')).toThrow('Source is not a directory');
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
describe('runCommand()', () => {
|
|
150
|
-
let testEnv;
|
|
151
|
-
|
|
152
|
-
beforeEach(() => {
|
|
153
|
-
testEnv = createTestEnvironment();
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
afterEach(() => {
|
|
157
|
-
testEnv.cleanup();
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
test('should throw error for invalid command', () => {
|
|
161
|
-
expect(() => runCommand(null, testEnv)).toThrow('Command must be a non-empty string');
|
|
162
|
-
expect(() => runCommand('', testEnv)).toThrow('Command must be a non-empty string');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
test('should throw error for invalid context', () => {
|
|
166
|
-
expect(() => runCommand('jettypod --version', null)).toThrow('Context must be an object');
|
|
167
|
-
expect(() => runCommand('jettypod --version', 'string')).toThrow('Context must be an object');
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
test('should return error message if jettypod.js not found', () => {
|
|
171
|
-
const invalidContext = { originalCwd: '/nonexistent/path' };
|
|
172
|
-
const result = runCommand('jettypod --version', invalidContext);
|
|
173
|
-
expect(result).toContain('JettyPod script not found');
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
describe('readConfig()', () => {
|
|
178
|
-
let testEnv;
|
|
179
|
-
|
|
180
|
-
beforeEach(() => {
|
|
181
|
-
testEnv = createTestEnvironment();
|
|
182
|
-
process.chdir(testEnv.testDir);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
afterEach(() => {
|
|
186
|
-
testEnv.cleanup();
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
test('should return null if config file does not exist', () => {
|
|
190
|
-
expect(readConfig()).toBeNull();
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
test('should read config.json successfully', () => {
|
|
194
|
-
const jettypodDir = path.join(testEnv.testDir, '.jettypod');
|
|
195
|
-
fs.mkdirSync(jettypodDir);
|
|
196
|
-
fs.writeFileSync(
|
|
197
|
-
path.join(jettypodDir, 'config.json'),
|
|
198
|
-
JSON.stringify({ mode: 'speed', stage: 'starting' })
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
const config = readConfig();
|
|
202
|
-
expect(config).toEqual({ mode: 'speed', stage: 'starting' });
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
test('should throw error for corrupted JSON', () => {
|
|
206
|
-
const jettypodDir = path.join(testEnv.testDir, '.jettypod');
|
|
207
|
-
fs.mkdirSync(jettypodDir);
|
|
208
|
-
fs.writeFileSync(path.join(jettypodDir, 'config.json'), 'not valid json');
|
|
209
|
-
|
|
210
|
-
expect(() => readConfig()).toThrow('Config file contains invalid JSON');
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
describe('readClaude()', () => {
|
|
215
|
-
let testEnv;
|
|
216
|
-
|
|
217
|
-
beforeEach(() => {
|
|
218
|
-
testEnv = createTestEnvironment();
|
|
219
|
-
process.chdir(testEnv.testDir);
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
afterEach(() => {
|
|
223
|
-
testEnv.cleanup();
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
test('should return empty string if CLAUDE.md does not exist', () => {
|
|
227
|
-
expect(readClaude()).toBe('');
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
test('should read CLAUDE.md successfully', () => {
|
|
231
|
-
fs.writeFileSync('CLAUDE.md', '# Test CLAUDE.md');
|
|
232
|
-
|
|
233
|
-
const content = readClaude();
|
|
234
|
-
expect(content).toBe('# Test CLAUDE.md');
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
describe('initializeTracking()', () => {
|
|
239
|
-
test('should initialize tracking properties on context', () => {
|
|
240
|
-
const context = {};
|
|
241
|
-
initializeTracking(context);
|
|
242
|
-
|
|
243
|
-
expect(context.createdFiles).toEqual([]);
|
|
244
|
-
expect(context.createdDirs).toEqual([]);
|
|
245
|
-
expect(context.modifiedFiles).toBeInstanceOf(Map);
|
|
246
|
-
expect(context.createdTestDirs).toEqual([]);
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
test('should throw error for invalid context', () => {
|
|
250
|
-
expect(() => initializeTracking(null)).toThrow('Context must be an object');
|
|
251
|
-
expect(() => initializeTracking('string')).toThrow('Context must be an object');
|
|
252
|
-
expect(() => initializeTracking(undefined)).toThrow('Context must be an object');
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
});
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// Prototype: Production Mode Skill - Option 1 (Autonomous Execution)
|
|
2
|
-
// Created: 2025-01-11
|
|
3
|
-
// Purpose: Demonstrate minimal-intervention production mode workflow
|
|
4
|
-
// Decision: [to be filled after testing]
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* PROTOTYPE: Autonomous Production Mode
|
|
8
|
-
*
|
|
9
|
-
* User starts chore → Claude analyzes → proposes scenarios → implements → done
|
|
10
|
-
* Minimal user intervention, maximum automation
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const readline = require('readline');
|
|
14
|
-
const rl = readline.createInterface({
|
|
15
|
-
input: process.stdin,
|
|
16
|
-
output: process.stdout
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
function sleep(ms) {
|
|
20
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function autonomousProductionMode() {
|
|
24
|
-
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
25
|
-
console.log('🚀 Production Mode: Autonomous Execution');
|
|
26
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
27
|
-
|
|
28
|
-
console.log('Starting work on: #1715 Implement audit logging for external transitions\n');
|
|
29
|
-
|
|
30
|
-
await sleep(500);
|
|
31
|
-
console.log('📊 Analyzing implementation from stable mode...');
|
|
32
|
-
await sleep(800);
|
|
33
|
-
|
|
34
|
-
console.log('\nFiles analyzed:');
|
|
35
|
-
console.log(' • jettypod.js (external command)');
|
|
36
|
-
console.log(' • lib/config.js (state management)');
|
|
37
|
-
console.log(' • features/work-tracking/index.js (work item creation)\n');
|
|
38
|
-
|
|
39
|
-
await sleep(500);
|
|
40
|
-
console.log('🎯 Production scenarios identified:\n');
|
|
41
|
-
console.log('**Security:**');
|
|
42
|
-
console.log(' • Audit logging for state transitions');
|
|
43
|
-
console.log(' • Sensitive data protection in logs\n');
|
|
44
|
-
console.log('**Scale:**');
|
|
45
|
-
console.log(' • Performance with high-frequency transitions');
|
|
46
|
-
console.log(' • Log rotation for long-running projects\n');
|
|
47
|
-
console.log('**Compliance:**');
|
|
48
|
-
console.log(' • Immutable audit trail');
|
|
49
|
-
console.log(' • GDPR-compliant data retention\n');
|
|
50
|
-
|
|
51
|
-
await sleep(500);
|
|
52
|
-
console.log('Adding scenarios to features/simplify-external-transition.feature...');
|
|
53
|
-
await sleep(300);
|
|
54
|
-
console.log('✅ 5 production scenarios added\n');
|
|
55
|
-
|
|
56
|
-
await sleep(300);
|
|
57
|
-
console.log('Implementing scenario: Audit logging for state transitions...');
|
|
58
|
-
await sleep(600);
|
|
59
|
-
console.log(' ✓ Created lib/audit-logger.js');
|
|
60
|
-
console.log(' ✓ Added logTransition() function');
|
|
61
|
-
console.log(' ✓ Integrated with external command');
|
|
62
|
-
await sleep(300);
|
|
63
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
64
|
-
|
|
65
|
-
await sleep(300);
|
|
66
|
-
console.log('Implementing scenario: Sensitive data protection...');
|
|
67
|
-
await sleep(600);
|
|
68
|
-
console.log(' ✓ Added data sanitization');
|
|
69
|
-
console.log(' ✓ Masked sensitive fields');
|
|
70
|
-
await sleep(300);
|
|
71
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
72
|
-
|
|
73
|
-
await sleep(300);
|
|
74
|
-
console.log('Implementing scenario: Performance with high-frequency transitions...');
|
|
75
|
-
await sleep(600);
|
|
76
|
-
console.log(' ✓ Added async logging');
|
|
77
|
-
console.log(' ✓ Buffered writes');
|
|
78
|
-
await sleep(300);
|
|
79
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
80
|
-
|
|
81
|
-
await sleep(300);
|
|
82
|
-
console.log('Implementing scenario: Log rotation...');
|
|
83
|
-
await sleep(600);
|
|
84
|
-
console.log(' ✓ Max log size: 10MB');
|
|
85
|
-
console.log(' ✓ Keep last 5 rotations');
|
|
86
|
-
await sleep(300);
|
|
87
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
88
|
-
|
|
89
|
-
await sleep(300);
|
|
90
|
-
console.log('Implementing scenario: Immutable audit trail & GDPR compliance...');
|
|
91
|
-
await sleep(600);
|
|
92
|
-
console.log(' ✓ Append-only log file');
|
|
93
|
-
console.log(' ✓ 90-day retention policy');
|
|
94
|
-
await sleep(300);
|
|
95
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
96
|
-
|
|
97
|
-
await sleep(500);
|
|
98
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
99
|
-
console.log('🎉 Production Mode Chore Complete!');
|
|
100
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
101
|
-
|
|
102
|
-
console.log('✅ All production scenarios passing');
|
|
103
|
-
console.log('✅ Code meets production standards');
|
|
104
|
-
console.log('✅ Ready for deployment\n');
|
|
105
|
-
|
|
106
|
-
console.log('Committing changes...');
|
|
107
|
-
await sleep(300);
|
|
108
|
-
console.log('✅ Pushed to main\n');
|
|
109
|
-
|
|
110
|
-
console.log('**UX NOTES:**');
|
|
111
|
-
console.log(' • Very fast - minimal waiting');
|
|
112
|
-
console.log(' • No decisions needed from user');
|
|
113
|
-
console.log(' • Claude made all production choices');
|
|
114
|
-
console.log(' • Great for experienced users who trust the process\n');
|
|
115
|
-
|
|
116
|
-
rl.close();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
autonomousProductionMode();
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
// Prototype: Production Mode Skill - Option 2 (Collaborative Checkpoints)
|
|
2
|
-
// Created: 2025-01-11
|
|
3
|
-
// Purpose: Demonstrate balanced control with key approval points
|
|
4
|
-
// Decision: [to be filled after testing]
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* PROTOTYPE: Collaborative Production Mode
|
|
8
|
-
*
|
|
9
|
-
* Claude proposes → User reviews/adjusts → Claude implements → User confirms
|
|
10
|
-
* Balanced control, educational, flexible
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const readline = require('readline');
|
|
14
|
-
const rl = readline.createInterface({
|
|
15
|
-
input: process.stdin,
|
|
16
|
-
output: process.stdout
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
function question(prompt) {
|
|
20
|
-
return new Promise(resolve => rl.question(prompt, resolve));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function sleep(ms) {
|
|
24
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function collaborativeProductionMode() {
|
|
28
|
-
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
29
|
-
console.log('🤝 Production Mode: Collaborative Checkpoints');
|
|
30
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
31
|
-
|
|
32
|
-
console.log('Starting work on: #1715 Implement audit logging for external transitions\n');
|
|
33
|
-
|
|
34
|
-
await sleep(500);
|
|
35
|
-
console.log('📊 Analyzing implementation from stable mode...');
|
|
36
|
-
await sleep(800);
|
|
37
|
-
|
|
38
|
-
console.log('\nFiles analyzed:');
|
|
39
|
-
console.log(' • jettypod.js (external command)');
|
|
40
|
-
console.log(' • lib/config.js (state management)');
|
|
41
|
-
console.log(' • features/work-tracking/index.js (work item creation)\n');
|
|
42
|
-
|
|
43
|
-
await sleep(500);
|
|
44
|
-
console.log('💡 Production Scenarios Proposal\n');
|
|
45
|
-
console.log('Based on the implementation, here are production scenarios I recommend:\n');
|
|
46
|
-
|
|
47
|
-
console.log('**Security:**');
|
|
48
|
-
console.log('1. Audit logging for state transitions');
|
|
49
|
-
console.log(' - Record who/when/what for compliance');
|
|
50
|
-
console.log('2. Sensitive data protection in logs');
|
|
51
|
-
console.log(' - Mask tokens, API keys, PII\n');
|
|
52
|
-
|
|
53
|
-
console.log('**Scale:**');
|
|
54
|
-
console.log('3. Performance with high-frequency transitions');
|
|
55
|
-
console.log(' - Handle 100+ transitions/minute');
|
|
56
|
-
console.log('4. Log rotation for long-running projects');
|
|
57
|
-
console.log(' - Max 10MB per log, keep last 5\n');
|
|
58
|
-
|
|
59
|
-
console.log('**Compliance:**');
|
|
60
|
-
console.log('5. Immutable audit trail');
|
|
61
|
-
console.log(' - Append-only, tamper-proof');
|
|
62
|
-
console.log('6. GDPR-compliant data retention');
|
|
63
|
-
console.log(' - 90-day retention, automatic cleanup\n');
|
|
64
|
-
|
|
65
|
-
const response1 = await question('Do these scenarios cover your production needs? (yes/adjust/add): ');
|
|
66
|
-
|
|
67
|
-
if (response1.toLowerCase() === 'adjust') {
|
|
68
|
-
console.log('\n**User:** Actually, we don\'t need GDPR compliance - this is internal only.');
|
|
69
|
-
console.log('And let\'s add a scenario for audit log export.\n');
|
|
70
|
-
await sleep(300);
|
|
71
|
-
console.log('✅ Adjusted scenarios:');
|
|
72
|
-
console.log(' • Removed: GDPR compliance scenario');
|
|
73
|
-
console.log(' • Added: Export audit logs in JSON/CSV formats\n');
|
|
74
|
-
} else {
|
|
75
|
-
console.log('\n✅ Scenarios confirmed\n');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
await sleep(300);
|
|
79
|
-
console.log('Adding scenarios to features/simplify-external-transition.feature...');
|
|
80
|
-
await sleep(300);
|
|
81
|
-
console.log('✅ 6 production scenarios added\n');
|
|
82
|
-
|
|
83
|
-
await sleep(500);
|
|
84
|
-
console.log('📋 Implementation Plan\n');
|
|
85
|
-
console.log('I\'ll implement these in order:');
|
|
86
|
-
console.log('1. Audit logging infrastructure (lib/audit-logger.js)');
|
|
87
|
-
console.log('2. Security: Data sanitization');
|
|
88
|
-
console.log('3. Performance: Async logging + buffering');
|
|
89
|
-
console.log('4. Scale: Log rotation');
|
|
90
|
-
console.log('5. Compliance: Immutable storage');
|
|
91
|
-
console.log('6. Export functionality\n');
|
|
92
|
-
|
|
93
|
-
const response2 = await question('Sound good? (yes/adjust): ');
|
|
94
|
-
|
|
95
|
-
if (response2.toLowerCase() === 'yes') {
|
|
96
|
-
console.log('\n✅ Starting implementation...\n');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
await sleep(300);
|
|
100
|
-
console.log('[1/6] Implementing audit logging infrastructure...');
|
|
101
|
-
await sleep(600);
|
|
102
|
-
console.log(' ✓ Created lib/audit-logger.js');
|
|
103
|
-
console.log(' ✓ Added logTransition() function');
|
|
104
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
105
|
-
|
|
106
|
-
await sleep(300);
|
|
107
|
-
console.log('[2/6] Implementing data sanitization...');
|
|
108
|
-
await sleep(500);
|
|
109
|
-
console.log(' ✓ Added sanitizeData() function');
|
|
110
|
-
console.log(' ✓ Masks: tokens, passwords, API keys');
|
|
111
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
112
|
-
|
|
113
|
-
await sleep(300);
|
|
114
|
-
console.log('[3/6] Implementing async logging with buffering...');
|
|
115
|
-
await sleep(500);
|
|
116
|
-
console.log(' ✓ Buffer size: 100 entries');
|
|
117
|
-
console.log(' ✓ Flush interval: 5 seconds');
|
|
118
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
119
|
-
|
|
120
|
-
await sleep(300);
|
|
121
|
-
console.log('[4/6] Implementing log rotation...');
|
|
122
|
-
await sleep(500);
|
|
123
|
-
console.log(' ✓ Max size: 10MB');
|
|
124
|
-
console.log(' ✓ Keep: 5 rotations');
|
|
125
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
126
|
-
|
|
127
|
-
await sleep(300);
|
|
128
|
-
console.log('[5/6] Implementing immutable storage...');
|
|
129
|
-
await sleep(500);
|
|
130
|
-
console.log(' ✓ Append-only writes');
|
|
131
|
-
console.log(' ✓ Read-only permissions after write');
|
|
132
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
133
|
-
|
|
134
|
-
await sleep(300);
|
|
135
|
-
console.log('[6/6] Implementing export functionality...');
|
|
136
|
-
await sleep(500);
|
|
137
|
-
console.log(' ✓ JSON export');
|
|
138
|
-
console.log(' ✓ CSV export');
|
|
139
|
-
console.log(' 🧪 Running tests... ✅ Passing\n');
|
|
140
|
-
|
|
141
|
-
await sleep(500);
|
|
142
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
143
|
-
console.log('🎉 All Scenarios Implemented!');
|
|
144
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
|
|
145
|
-
|
|
146
|
-
const response3 = await question('Ready to commit and push? (yes/review): ');
|
|
147
|
-
|
|
148
|
-
if (response3.toLowerCase() === 'yes') {
|
|
149
|
-
console.log('\n✅ Committing changes...');
|
|
150
|
-
await sleep(300);
|
|
151
|
-
console.log('✅ Pushed to main\n');
|
|
152
|
-
} else {
|
|
153
|
-
console.log('\n📝 Opening files for your review...\n');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
console.log('**UX NOTES:**');
|
|
157
|
-
console.log(' • Balanced speed with control');
|
|
158
|
-
console.log(' • User approved scenarios and plan');
|
|
159
|
-
console.log(' • Educational - saw reasoning');
|
|
160
|
-
console.log(' • Flexible - adjusted to project needs');
|
|
161
|
-
console.log(' • User felt involved in production decisions\n');
|
|
162
|
-
|
|
163
|
-
rl.close();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
collaborativeProductionMode();
|