delimit-cli 3.6.2 → 3.6.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/README.md +125 -30
- package/gateway/ai/governance.py +4 -0
- package/package.json +11 -2
- package/.dockerignore +0 -7
- package/.github/workflows/api-governance.yml +0 -43
- package/.github/workflows/ci.yml +0 -22
- package/CODE_OF_CONDUCT.md +0 -48
- package/CONTRIBUTING.md +0 -67
- package/Dockerfile +0 -9
- package/SECURITY.md +0 -42
- package/adapters/codex-forge.js +0 -107
- package/adapters/codex-jamsons.js +0 -142
- package/adapters/codex-security.js +0 -94
- package/adapters/gemini-forge.js +0 -120
- package/adapters/gemini-jamsons.js +0 -152
- package/delimit.yml +0 -19
- package/glama.json +0 -1
- package/hooks/evidence-status.sh +0 -12
- package/hooks/git/commit-msg +0 -4
- package/hooks/git/pre-commit +0 -4
- package/hooks/git/pre-push +0 -4
- package/hooks/install-hooks.sh +0 -583
- package/hooks/message-auth-hook.js +0 -9
- package/hooks/message-governance-hook.js +0 -9
- package/hooks/models/claude-post.js +0 -4
- package/hooks/models/claude-pre.js +0 -4
- package/hooks/models/codex-post.js +0 -4
- package/hooks/models/codex-pre.js +0 -4
- package/hooks/models/cursor-post.js +0 -4
- package/hooks/models/cursor-pre.js +0 -4
- package/hooks/models/gemini-post.js +0 -4
- package/hooks/models/gemini-pre.js +0 -4
- package/hooks/models/openai-post.js +0 -4
- package/hooks/models/openai-pre.js +0 -4
- package/hooks/models/windsurf-post.js +0 -4
- package/hooks/models/windsurf-pre.js +0 -4
- package/hooks/models/xai-post.js +0 -4
- package/hooks/models/xai-pre.js +0 -4
- package/hooks/post-bash-hook.js +0 -13
- package/hooks/post-mcp-hook.js +0 -13
- package/hooks/post-response-hook.js +0 -4
- package/hooks/post-tool-hook.js +0 -126
- package/hooks/post-write-hook.js +0 -13
- package/hooks/pre-bash-hook.js +0 -30
- package/hooks/pre-mcp-hook.js +0 -13
- package/hooks/pre-read-hook.js +0 -13
- package/hooks/pre-search-hook.js +0 -13
- package/hooks/pre-submit-hook.js +0 -4
- package/hooks/pre-task-hook.js +0 -13
- package/hooks/pre-tool-hook.js +0 -121
- package/hooks/pre-web-hook.js +0 -13
- package/hooks/pre-write-hook.js +0 -31
- package/hooks/test-hooks.sh +0 -12
- package/hooks/update-delimit.sh +0 -6
- package/scripts/infect.js +0 -128
- package/tests/setup-onboarding.test.js +0 -147
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
const { describe, it } = require('node:test');
|
|
2
|
-
const assert = require('node:assert');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
// Extract getClaudeMdContent by loading the setup script source
|
|
8
|
-
// We test the content function and upgrade logic in isolation.
|
|
9
|
-
|
|
10
|
-
function getClaudeMdContent() {
|
|
11
|
-
return `# Delimit
|
|
12
|
-
|
|
13
|
-
Your AI has persistent memory, verified execution, and governance.
|
|
14
|
-
|
|
15
|
-
## First time? Say one of these:
|
|
16
|
-
- "check this project's health" -- see what Delimit finds
|
|
17
|
-
- "add to ledger: [anything]" -- start tracking tasks
|
|
18
|
-
- "what's on the ledger?" -- see what's pending
|
|
19
|
-
|
|
20
|
-
## Returning? Your AI remembers:
|
|
21
|
-
- Ledger items persist across sessions
|
|
22
|
-
- Governance rules stay configured
|
|
23
|
-
- Memory carries forward
|
|
24
|
-
|
|
25
|
-
## On first session, your AI will automatically:
|
|
26
|
-
1. Diagnose the environment to verify everything is connected
|
|
27
|
-
2. Check the ledger for any pending items from previous sessions
|
|
28
|
-
3. If no governance exists yet, suggest initializing it
|
|
29
|
-
|
|
30
|
-
## Available Agents
|
|
31
|
-
- /lint -- check API specs for breaking changes
|
|
32
|
-
- /engineering -- build, test, refactor with governance checks
|
|
33
|
-
- /governance -- full compliance audit
|
|
34
|
-
|
|
35
|
-
## Need help?
|
|
36
|
-
Say "delimit help" for docs on any capability.
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
describe('CLAUDE.md onboarding content', () => {
|
|
41
|
-
it('does not mention individual tool names', () => {
|
|
42
|
-
const content = getClaudeMdContent();
|
|
43
|
-
// These tool names should never appear in user-facing CLAUDE.md
|
|
44
|
-
const toolNames = [
|
|
45
|
-
'delimit_init',
|
|
46
|
-
'delimit_lint',
|
|
47
|
-
'delimit_diff',
|
|
48
|
-
'delimit_test_coverage',
|
|
49
|
-
'delimit_gov_health',
|
|
50
|
-
'delimit_repo_analyze',
|
|
51
|
-
'delimit_diagnose',
|
|
52
|
-
'delimit_ledger_context',
|
|
53
|
-
];
|
|
54
|
-
for (const tool of toolNames) {
|
|
55
|
-
assert.ok(
|
|
56
|
-
!content.includes(tool),
|
|
57
|
-
`CLAUDE.md should not contain tool name "${tool}"`
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('contains natural language prompts for first-time users', () => {
|
|
63
|
-
const content = getClaudeMdContent();
|
|
64
|
-
assert.ok(content.includes('check this project\'s health'), 'Should have health check prompt');
|
|
65
|
-
assert.ok(content.includes('add to ledger'), 'Should have ledger add prompt');
|
|
66
|
-
assert.ok(content.includes('what\'s on the ledger'), 'Should have ledger check prompt');
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('mentions persistent memory and governance', () => {
|
|
70
|
-
const content = getClaudeMdContent();
|
|
71
|
-
assert.ok(content.includes('persistent memory'), 'Should mention persistent memory');
|
|
72
|
-
assert.ok(content.includes('governance'), 'Should mention governance');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('includes returning user section', () => {
|
|
76
|
-
const content = getClaudeMdContent();
|
|
77
|
-
assert.ok(content.includes('Returning?'), 'Should have returning user section');
|
|
78
|
-
assert.ok(content.includes('Ledger items persist'), 'Should mention ledger persistence');
|
|
79
|
-
assert.ok(content.includes('Memory carries forward'), 'Should mention memory persistence');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('includes automatic first-session actions', () => {
|
|
83
|
-
const content = getClaudeMdContent();
|
|
84
|
-
assert.ok(content.includes('Diagnose the environment'), 'Should mention auto-diagnose');
|
|
85
|
-
assert.ok(content.includes('Check the ledger'), 'Should mention auto-ledger check');
|
|
86
|
-
assert.ok(content.includes('suggest initializing'), 'Should mention governance init suggestion');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('includes help instruction', () => {
|
|
90
|
-
const content = getClaudeMdContent();
|
|
91
|
-
assert.ok(content.includes('delimit help'), 'Should tell users how to get help');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('lists agents by slash-command not tool name', () => {
|
|
95
|
-
const content = getClaudeMdContent();
|
|
96
|
-
assert.ok(content.includes('/lint'), 'Should reference /lint agent');
|
|
97
|
-
assert.ok(content.includes('/engineering'), 'Should reference /engineering agent');
|
|
98
|
-
assert.ok(content.includes('/governance'), 'Should reference /governance agent');
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
describe('CLAUDE.md upgrade detection', () => {
|
|
103
|
-
it('detects old-format CLAUDE.md with "Delimit AI Guardrails" header', () => {
|
|
104
|
-
const oldContent = '# Delimit AI Guardrails\n\nSome old content';
|
|
105
|
-
assert.ok(
|
|
106
|
-
oldContent.includes('# Delimit AI Guardrails'),
|
|
107
|
-
'Should detect old header'
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('detects old-format CLAUDE.md with tool names', () => {
|
|
112
|
-
const oldContent = 'Some content with delimit_init and delimit_lint';
|
|
113
|
-
assert.ok(
|
|
114
|
-
oldContent.includes('delimit_init') || oldContent.includes('delimit_lint'),
|
|
115
|
-
'Should detect old tool name references'
|
|
116
|
-
);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('does not upgrade custom CLAUDE.md without Delimit markers', () => {
|
|
120
|
-
const customContent = '# My Project\n\nThis is a custom CLAUDE.md for my project.';
|
|
121
|
-
const hasOldMarkers =
|
|
122
|
-
customContent.includes('# Delimit AI Guardrails') ||
|
|
123
|
-
customContent.includes('delimit_init') ||
|
|
124
|
-
customContent.includes('delimit_lint');
|
|
125
|
-
assert.ok(!hasOldMarkers, 'Custom content should not be detected as old Delimit format');
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
describe('setup script output messaging', () => {
|
|
130
|
-
it('setup script file contains try-it-now messaging', () => {
|
|
131
|
-
const setupPath = path.join(__dirname, '..', 'bin', 'delimit-setup.js');
|
|
132
|
-
const setupContent = fs.readFileSync(setupPath, 'utf-8');
|
|
133
|
-
assert.ok(setupContent.includes('Try it now:'), 'Should have "Try it now:" prompt');
|
|
134
|
-
assert.ok(setupContent.includes('$ claude'), 'Should suggest running claude');
|
|
135
|
-
assert.ok(setupContent.includes('check this project\'s health'), 'Should suggest health check');
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it('setup script does not list tool names in output', () => {
|
|
139
|
-
const setupPath = path.join(__dirname, '..', 'bin', 'delimit-setup.js');
|
|
140
|
-
const setupContent = fs.readFileSync(setupPath, 'utf-8');
|
|
141
|
-
// Check that Step 6 output area does not reference internal tool names
|
|
142
|
-
const step6Onwards = setupContent.split('// Step 6')[1];
|
|
143
|
-
assert.ok(step6Onwards, 'Should have Step 6 section');
|
|
144
|
-
assert.ok(!step6Onwards.includes('delimit_init'), 'Step 6 should not mention delimit_init');
|
|
145
|
-
assert.ok(!step6Onwards.includes('delimit_gov_health'), 'Step 6 should not mention delimit_gov_health');
|
|
146
|
-
});
|
|
147
|
-
});
|