@sdotwinter/openclaw-deterministic 0.17.8 → 0.17.10
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 +25 -0
- package/bin/revert.js +11 -1
- package/index.js +13 -0
- package/package.json +1 -1
- package/templates/config/.deterministic.json +0 -1
package/README.md
CHANGED
|
@@ -14,19 +14,39 @@ It is a governance layer.
|
|
|
14
14
|
|
|
15
15
|
Install globally:
|
|
16
16
|
|
|
17
|
+
```bash
|
|
17
18
|
npm install -g @sdotwinter/openclaw-deterministic
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Add to your PATH (optional but recommended):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export PATH="$PATH:$(npm root -g)/@sdotwinter/openclaw-deterministic/bin"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or create a symlink:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sudo ln -s $(npm root -g)/@sdotwinter/openclaw-deterministic/bin/oc-deterministic /usr/local/bin/
|
|
31
|
+
```
|
|
18
32
|
|
|
19
33
|
Apply deterministic governance to an existing OpenClaw workspace:
|
|
20
34
|
|
|
35
|
+
```bash
|
|
21
36
|
oc-deterministic install
|
|
37
|
+
```
|
|
22
38
|
|
|
23
39
|
Verify installation:
|
|
24
40
|
|
|
41
|
+
```bash
|
|
25
42
|
oc-deterministic doctor
|
|
43
|
+
```
|
|
26
44
|
|
|
27
45
|
Concise health summary (CI-friendly):
|
|
28
46
|
|
|
47
|
+
```bash
|
|
29
48
|
oc-deterministic status
|
|
49
|
+
```
|
|
30
50
|
|
|
31
51
|
---
|
|
32
52
|
|
|
@@ -156,12 +176,17 @@ Configuration file:
|
|
|
156
176
|
|
|
157
177
|
Example:
|
|
158
178
|
|
|
179
|
+
```json
|
|
159
180
|
{
|
|
160
181
|
"semantic": {
|
|
161
182
|
"HARD_LIMIT": 1200,
|
|
162
183
|
"RISK_THRESHOLD_PERCENT": 85
|
|
184
|
+
},
|
|
185
|
+
"governance": {
|
|
186
|
+
"violation_logging": true
|
|
163
187
|
}
|
|
164
188
|
}
|
|
189
|
+
```
|
|
165
190
|
|
|
166
191
|
This prevents uncontrolled memory expansion.
|
|
167
192
|
|
package/bin/revert.js
CHANGED
|
@@ -46,10 +46,20 @@ function restoreDirectoryRecursive(srcDir, destDir) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function restoreBackup(timestamp) {
|
|
49
|
+
// Validate timestamp format (ISO-like: YYYY-MM-DDTHH-MM-SS.mmmZ)
|
|
50
|
+
const timestampRegex = /^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}\.\d{3}Z$/;
|
|
51
|
+
if (!timestampRegex.test(timestamp)) {
|
|
52
|
+
console.error(`Invalid timestamp format: ${timestamp}`);
|
|
53
|
+
console.error("Expected format: 2026-02-21T04-43-51.094Z");
|
|
54
|
+
console.error("Use 'oc-deterministic revert --list' to see available backups.");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
const backupDir = path.join(BACKUP_ROOT, timestamp);
|
|
50
59
|
|
|
51
60
|
if (!fs.existsSync(backupDir)) {
|
|
52
|
-
console.
|
|
61
|
+
console.error(`Backup not found: ${timestamp}`);
|
|
62
|
+
console.error("Use 'oc-deterministic revert --list' to see available backups.");
|
|
53
63
|
process.exit(1);
|
|
54
64
|
}
|
|
55
65
|
|
package/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// OpenClaw Deterministic - Entry point
|
|
2
|
+
// Re-exports CLI for programmatic use
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
doctor: require("./bin/doctor"),
|
|
6
|
+
status: require("./bin/status"),
|
|
7
|
+
install: require("./bin/install"),
|
|
8
|
+
init: require("./bin/init"),
|
|
9
|
+
enable: require("./bin/enable"),
|
|
10
|
+
revert: require("./bin/revert"),
|
|
11
|
+
audit: require("./bin/audit"),
|
|
12
|
+
upgrade: require("./bin/upgrade"),
|
|
13
|
+
};
|
package/package.json
CHANGED