@wipcomputer/wip-ai-devops-toolbox 1.9.70 → 1.9.71-alpha.2
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/tools/deploy-public/deploy-public.sh +2 -1
- package/tools/wip-branch-guard/RELEASE-NOTES-v1-9-64.md +23 -0
- package/tools/wip-branch-guard/guard.mjs +8 -0
- package/tools/wip-file-guard/guard.mjs +14 -2
- package/tools/wip-file-guard/package.json +1 -1
- package/tools/wip-file-guard/test.sh +22 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -99,6 +99,7 @@ rsync -a \
|
|
|
99
99
|
--exclude='.git/' \
|
|
100
100
|
--exclude='.DS_Store' \
|
|
101
101
|
--exclude='.wrangler/' \
|
|
102
|
+
--exclude='.worktrees/' \
|
|
102
103
|
--exclude='.claude/' \
|
|
103
104
|
--exclude='CLAUDE.md' \
|
|
104
105
|
"$PRIVATE_REPO/" "$TMPDIR/public/"
|
|
@@ -123,7 +124,7 @@ fi
|
|
|
123
124
|
BRANCH="$HARNESS_ID/deploy-$(date +%Y%m%d-%H%M%S)"
|
|
124
125
|
|
|
125
126
|
git add -A
|
|
126
|
-
git commit -m "$COMMIT_MSG (from $COMMIT_HASH)"
|
|
127
|
+
git commit --no-verify -m "$COMMIT_MSG (from $COMMIT_HASH)"
|
|
127
128
|
|
|
128
129
|
if [[ "$EMPTY_REPO" == "true" ]]; then
|
|
129
130
|
# Empty repo: push directly to main (no base branch to PR against)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Release Notes: wip-branch-guard v1.9.64
|
|
2
|
+
|
|
3
|
+
**One-line summary of what this release does**
|
|
4
|
+
|
|
5
|
+
Tell the story. What was broken or missing? What did we build? Why does the user care?
|
|
6
|
+
Write at least one real paragraph of prose. Not just bullets. The release notes gate
|
|
7
|
+
will block if there is no narrative. Bullets are fine for details, but the story comes first.
|
|
8
|
+
|
|
9
|
+
## The story
|
|
10
|
+
|
|
11
|
+
(Write a paragraph here. What was the problem? What does this release fix? Why does it matter?
|
|
12
|
+
This is what users read. Make it worth reading.)
|
|
13
|
+
|
|
14
|
+
## Issues closed
|
|
15
|
+
|
|
16
|
+
- #296
|
|
17
|
+
- #295
|
|
18
|
+
|
|
19
|
+
## How to verify
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Commands to test the changes
|
|
23
|
+
```
|
|
@@ -413,6 +413,14 @@ This is a warning, not a block. If you need to create it here, retry.`);
|
|
|
413
413
|
process.exit(0);
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
// Allow everything in repos with zero commits (bootstrap)
|
|
417
|
+
try {
|
|
418
|
+
const hasCommits = execSync('git rev-parse HEAD', { cwd: repoDir, stdio: 'pipe' });
|
|
419
|
+
} catch {
|
|
420
|
+
// No commits yet. Allow the first commit so the repo can be bootstrapped.
|
|
421
|
+
process.exit(0);
|
|
422
|
+
}
|
|
423
|
+
|
|
416
424
|
if (branch !== 'main' && branch !== 'master' && worktree) {
|
|
417
425
|
// On a branch AND in a worktree. Correct workflow. Allow.
|
|
418
426
|
process.exit(0);
|
|
@@ -48,6 +48,8 @@ const SHARED_STATE_PATHS = [
|
|
|
48
48
|
/\.ldm\/agents\/.*\/memory\/daily\/.*\.md$/,
|
|
49
49
|
/\.ldm\/memory\/daily\/.*\.md$/,
|
|
50
50
|
/\.ldm\/memory\/shared-log\.jsonl$/,
|
|
51
|
+
/\.claude\/projects\/.*\/memory\/.*\.md$/, // harness auto-memory files
|
|
52
|
+
/\.claude\/memory\/.*\.md$/, // harness global memory files
|
|
51
53
|
];
|
|
52
54
|
|
|
53
55
|
function isSharedState(filePath) {
|
|
@@ -118,13 +120,23 @@ async function main() {
|
|
|
118
120
|
// Block Write on protected files
|
|
119
121
|
// Exact matches: always block Write (use Edit instead)
|
|
120
122
|
// Pattern matches: only block if file already exists (allow creating new files)
|
|
123
|
+
// Shared state paths (harness memory, daily logs): allow Write freely
|
|
121
124
|
if (toolName === 'Write') {
|
|
122
125
|
const isExactMatch = PROTECTED.has(fileName);
|
|
123
|
-
if (isExactMatch
|
|
126
|
+
if (isExactMatch) {
|
|
124
127
|
deny(`BLOCKED: Write tool on ${match} is not allowed. Use Edit to make specific changes. Never overwrite protected files.`);
|
|
125
128
|
process.exit(0);
|
|
126
129
|
}
|
|
127
|
-
//
|
|
130
|
+
// Shared state paths get Write access (harness manages its own memory files)
|
|
131
|
+
if (isSharedState(filePath)) {
|
|
132
|
+
process.exit(0);
|
|
133
|
+
}
|
|
134
|
+
// Other pattern matches: block if file exists, allow creation of new files
|
|
135
|
+
if (existsSync(filePath)) {
|
|
136
|
+
deny(`BLOCKED: Write tool on ${match} is not allowed. Use Edit to make specific changes. Never overwrite protected files.`);
|
|
137
|
+
process.exit(0);
|
|
138
|
+
}
|
|
139
|
+
// Pattern match but file doesn't exist yet ... allow creation
|
|
128
140
|
process.exit(0);
|
|
129
141
|
}
|
|
130
142
|
|
|
@@ -116,5 +116,27 @@ check "Allow Write to unrelated file with no pattern match" \
|
|
|
116
116
|
'{"tool_name":"Write","tool_input":{"file_path":"/src/utils/helper.js","content":"new"}}' \
|
|
117
117
|
"allow"
|
|
118
118
|
|
|
119
|
+
|
|
120
|
+
# Harness memory paths (shared state - lenient limits)
|
|
121
|
+
check "Allow Write to harness project memory file" \
|
|
122
|
+
'{"tool_name":"Write","tool_input":{"file_path":"/Users/lesa/.claude/projects/-Users-lesa--openclaw/memory/repo-locations.md","content":"new"}}' \
|
|
123
|
+
"allow"
|
|
124
|
+
|
|
125
|
+
check "Allow Write to harness global memory file" \
|
|
126
|
+
'{"tool_name":"Write","tool_input":{"file_path":"/Users/lesa/.claude/memory/feedback.md","content":"new"}}' \
|
|
127
|
+
"allow"
|
|
128
|
+
|
|
129
|
+
check "Allow Edit removing 10 lines from harness memory (lenient limit)" \
|
|
130
|
+
'{"tool_name":"Edit","tool_input":{"file_path":"/Users/lesa/.claude/projects/-foo/memory/test.md","old_string":"a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl","new_string":"x\ny"}}' \
|
|
131
|
+
"allow"
|
|
132
|
+
|
|
133
|
+
check "Block Write to SOUL.md even under .claude/projects/memory/" \
|
|
134
|
+
'{"tool_name":"Write","tool_input":{"file_path":"/Users/lesa/.claude/projects/foo/memory/SOUL.md","content":"new"}}' \
|
|
135
|
+
"block"
|
|
136
|
+
|
|
137
|
+
check "Block Write to SHARED-CONTEXT.md even under .claude path" \
|
|
138
|
+
'{"tool_name":"Write","tool_input":{"file_path":"/Users/lesa/.claude/projects/foo/memory/SHARED-CONTEXT.md","content":"new"}}' \
|
|
139
|
+
"block"
|
|
140
|
+
|
|
119
141
|
echo ""
|
|
120
142
|
echo "Results: $PASS passed, $FAIL failed"
|