@trac3er/oh-my-god 2.0.3 → 2.0.5
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/.agents/skills/omg/AGENTS.fragment.md +5 -0
- package/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/.agents/skills/omg/codex-mcp.toml +4 -0
- package/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/.agents/skills/omg/health/SKILL.md +11 -0
- package/.agents/skills/omg/health/openai.yaml +11 -0
- package/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/.agents/skills/omg/vision/SKILL.md +11 -0
- package/.agents/skills/omg/vision/openai.yaml +11 -0
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.claude-plugin/scripts/uninstall.sh +2 -2
- package/.mcp.json +20 -4
- package/CHANGELOG.md +10 -0
- package/OMG-setup.sh +9 -3
- package/OMG_COMPAT_CONTRACT.md +92 -0
- package/README.md +24 -4
- package/SECURITY.md +6 -0
- package/commands/OMG:api-twin.md +22 -0
- package/commands/OMG:preflight.md +26 -0
- package/commands/OMG:security-check.md +28 -0
- package/commands/__init__.py +1 -0
- package/control_plane/__init__.py +2 -0
- package/control_plane/openapi.yaml +228 -0
- package/control_plane/server.py +123 -0
- package/control_plane/service.py +185 -0
- package/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +5 -0
- package/dist/enterprise/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
- package/dist/enterprise/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/dist/enterprise/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/dist/enterprise/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/dist/enterprise/bundle/.claude-plugin/marketplace.json +36 -0
- package/dist/enterprise/bundle/.claude-plugin/plugin.json +23 -0
- package/dist/enterprise/bundle/.mcp.json +40 -0
- package/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +92 -0
- package/dist/enterprise/bundle/registry/bundles/algorithms.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/api-twin.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/control-plane.yaml +61 -0
- package/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/health.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/dist/enterprise/bundle/registry/bundles/preflight.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/dist/enterprise/bundle/registry/bundles/robotics.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/dist/enterprise/bundle/registry/bundles/security-check.yaml +50 -0
- package/dist/enterprise/bundle/registry/bundles/tracebank.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/vision.yaml +45 -0
- package/dist/enterprise/bundle/registry/omg-capability.schema.json +80 -0
- package/dist/enterprise/bundle/settings.json +381 -0
- package/dist/enterprise/manifest.json +255 -0
- package/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +5 -0
- package/dist/public/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
- package/dist/public/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/dist/public/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/dist/public/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/dist/public/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/dist/public/bundle/.claude-plugin/marketplace.json +36 -0
- package/dist/public/bundle/.claude-plugin/plugin.json +23 -0
- package/dist/public/bundle/.mcp.json +40 -0
- package/dist/public/bundle/OMG_COMPAT_CONTRACT.md +92 -0
- package/dist/public/bundle/registry/bundles/algorithms.yaml +45 -0
- package/dist/public/bundle/registry/bundles/api-twin.yaml +48 -0
- package/dist/public/bundle/registry/bundles/control-plane.yaml +61 -0
- package/dist/public/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/dist/public/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/dist/public/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/dist/public/bundle/registry/bundles/health.yaml +45 -0
- package/dist/public/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/dist/public/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/dist/public/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/dist/public/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/dist/public/bundle/registry/bundles/preflight.yaml +48 -0
- package/dist/public/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/dist/public/bundle/registry/bundles/robotics.yaml +45 -0
- package/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/dist/public/bundle/registry/bundles/security-check.yaml +50 -0
- package/dist/public/bundle/registry/bundles/tracebank.yaml +47 -0
- package/dist/public/bundle/registry/bundles/vision.yaml +45 -0
- package/dist/public/bundle/registry/omg-capability.schema.json +80 -0
- package/dist/public/bundle/settings.json +379 -0
- package/dist/public/manifest.json +255 -0
- package/docs/assets/omg-hud.svg +32 -0
- package/docs/install/claude-code.md +31 -0
- package/docs/install/codex.md +29 -0
- package/docs/migration/native-adoption.md +57 -0
- package/docs/proof.md +55 -0
- package/docs/release-checklist.md +38 -0
- package/docs/transcripts/crazy.md +17 -0
- package/docs/transcripts/setup.md +25 -0
- package/hooks/policy_engine.py +38 -7
- package/hooks/post-write.py +1 -1
- package/hooks/prompt-enhancer.py +1 -1
- package/hooks/security_validators.py +75 -0
- package/hooks/setup_wizard.py +43 -8
- package/hooks/shadow_manager.py +28 -2
- package/package.json +1 -1
- package/plugins/README.md +3 -1
- package/plugins/__init__.py +1 -0
- package/plugins/advanced/commands/OMG:deep-plan.md +1 -1
- package/plugins/advanced/commands/OMG:security-review.md +10 -113
- package/plugins/advanced/commands/OMG:ship.md +1 -1
- package/plugins/advanced/plugin.json +1 -10
- package/plugins/core/plugin.json +25 -2
- package/pyproject.toml +38 -2
- package/registry/__init__.py +1 -0
- package/registry/bundles/algorithms.yaml +45 -0
- package/registry/bundles/api-twin.yaml +48 -0
- package/registry/bundles/control-plane.yaml +61 -0
- package/registry/bundles/data-lineage.yaml +47 -0
- package/registry/bundles/delta-classifier.yaml +47 -0
- package/registry/bundles/eval-gate.yaml +47 -0
- package/registry/bundles/health.yaml +45 -0
- package/registry/bundles/hook-governor.yaml +97 -0
- package/registry/bundles/incident-replay.yaml +47 -0
- package/registry/bundles/lsp-pack.yaml +48 -0
- package/registry/bundles/mcp-fabric.yaml +53 -0
- package/registry/bundles/preflight.yaml +48 -0
- package/registry/bundles/remote-supervisor.yaml +49 -0
- package/registry/bundles/robotics.yaml +45 -0
- package/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/registry/bundles/security-check.yaml +50 -0
- package/registry/bundles/tracebank.yaml +47 -0
- package/registry/bundles/vision.yaml +45 -0
- package/registry/omg-capability.schema.json +80 -0
- package/registry/verify_artifact.py +90 -0
- package/runtime/adapters/claude.py +3 -0
- package/runtime/adapters/gpt.py +3 -0
- package/runtime/adapters/local.py +3 -0
- package/runtime/adoption.py +1 -1
- package/runtime/api_twin.py +179 -0
- package/runtime/asset_loader.py +62 -0
- package/runtime/compat.py +24 -3
- package/runtime/contract_compiler.py +847 -0
- package/runtime/data_lineage.py +73 -0
- package/runtime/delta_classifier.py +81 -0
- package/runtime/domain_packs.py +46 -0
- package/runtime/ecosystem.py +1 -1
- package/runtime/eval_gate.py +50 -0
- package/runtime/guide_assert.py +45 -0
- package/runtime/incident_replay.py +47 -0
- package/runtime/mcp_config_writers.py +147 -30
- package/runtime/mcp_memory_server.py +1 -1
- package/runtime/omg_compat_contract_snapshot.json +9 -8
- package/runtime/omg_contract_snapshot.json +9 -8
- package/runtime/omg_mcp_server.py +207 -0
- package/runtime/preflight.py +73 -0
- package/runtime/providers/codex_provider.py +2 -12
- package/runtime/providers/gemini_provider.py +2 -21
- package/runtime/providers/kimi_provider.py +2 -21
- package/runtime/remote_supervisor.py +64 -0
- package/runtime/runtime_profile.py +61 -0
- package/runtime/security_check.py +464 -0
- package/runtime/subagent_dispatcher.py +117 -10
- package/runtime/team_router.py +3 -1
- package/runtime/tracebank.py +53 -0
- package/runtime/untrusted_content.py +102 -0
- package/scripts/omg.py +360 -2
- package/settings.json +81 -18
- package/tools/python_repl.py +33 -3
package/settings.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
-
"_comment": "OMG 2.0.
|
|
3
|
+
"_comment": "OMG 2.0.5 - project-level config with hook registrations, presets, and feature flags.",
|
|
4
4
|
"permissions": {
|
|
5
5
|
"allow": [
|
|
6
6
|
"Agent",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"Bash(tree *)",
|
|
43
43
|
"Bash(du *)",
|
|
44
44
|
"Bash(df *)",
|
|
45
|
-
"Bash(env *)",
|
|
46
45
|
"Bash(type *)",
|
|
47
46
|
"Bash(command *)",
|
|
48
47
|
"Bash(test *)",
|
|
@@ -52,17 +51,12 @@
|
|
|
52
51
|
"Bash(ln *)",
|
|
53
52
|
"Bash(cp *)",
|
|
54
53
|
"Bash(mv *)",
|
|
55
|
-
"Bash(chmod *)",
|
|
56
|
-
"Bash(chown *)",
|
|
57
54
|
"Bash(git *)",
|
|
58
55
|
"Bash(npm *)",
|
|
59
56
|
"Bash(npx *)",
|
|
60
57
|
"Bash(yarn *)",
|
|
61
58
|
"Bash(pnpm *)",
|
|
62
59
|
"Bash(bun *)",
|
|
63
|
-
"Bash(node *)",
|
|
64
|
-
"Bash(python *)",
|
|
65
|
-
"Bash(python3 *)",
|
|
66
60
|
"Bash(pip *)",
|
|
67
61
|
"Bash(pip3 *)",
|
|
68
62
|
"Bash(uv *)",
|
|
@@ -115,6 +109,12 @@
|
|
|
115
109
|
"Bash(terraform apply *)",
|
|
116
110
|
"Bash(terraform destroy *)",
|
|
117
111
|
"Bash(terraform import *)",
|
|
112
|
+
"Bash(env *)",
|
|
113
|
+
"Bash(node *)",
|
|
114
|
+
"Bash(python *)",
|
|
115
|
+
"Bash(python3 *)",
|
|
116
|
+
"Bash(chmod *)",
|
|
117
|
+
"Bash(chown *)",
|
|
118
118
|
"Bash(docker *)",
|
|
119
119
|
"Bash(docker-compose *)",
|
|
120
120
|
"Bash(kubectl get *)",
|
|
@@ -188,45 +188,66 @@
|
|
|
188
188
|
}
|
|
189
189
|
],
|
|
190
190
|
"PreToolUse": [
|
|
191
|
+
{
|
|
192
|
+
"hooks": [
|
|
193
|
+
{
|
|
194
|
+
"type": "command",
|
|
195
|
+
"command": "python3 \"$HOME/.claude/hooks/firewall.py\"",
|
|
196
|
+
"timeout": 10
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"matcher": "Bash"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"hooks": [
|
|
203
|
+
{
|
|
204
|
+
"type": "command",
|
|
205
|
+
"command": "python3 \"$HOME/.claude/hooks/secret-guard.py\"",
|
|
206
|
+
"timeout": 10
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"matcher": "Read|Write|Edit|MultiEdit"
|
|
210
|
+
},
|
|
191
211
|
{
|
|
192
212
|
"hooks": [
|
|
193
213
|
{
|
|
194
214
|
"type": "command",
|
|
195
215
|
"command": "python3 \"$HOME/.claude/hooks/pre-tool-inject.py\""
|
|
196
216
|
}
|
|
197
|
-
]
|
|
217
|
+
],
|
|
218
|
+
"matcher": ""
|
|
198
219
|
}
|
|
199
220
|
],
|
|
200
221
|
"PostToolUse": [
|
|
201
222
|
{
|
|
202
|
-
"matcher": "Bash",
|
|
203
223
|
"hooks": [
|
|
204
224
|
{
|
|
205
225
|
"type": "command",
|
|
206
226
|
"command": "python3 \"$HOME/.claude/hooks/circuit-breaker.py\"",
|
|
207
227
|
"timeout": 10
|
|
208
228
|
}
|
|
209
|
-
]
|
|
229
|
+
],
|
|
230
|
+
"matcher": "Bash"
|
|
210
231
|
},
|
|
211
232
|
{
|
|
212
|
-
"matcher": "Write|Edit|MultiEdit",
|
|
213
233
|
"hooks": [
|
|
214
234
|
{
|
|
215
235
|
"type": "command",
|
|
216
236
|
"command": "python3 \"$HOME/.claude/hooks/tool-ledger.py\"",
|
|
217
237
|
"timeout": 10
|
|
218
238
|
}
|
|
219
|
-
]
|
|
239
|
+
],
|
|
240
|
+
"matcher": "Write|Edit|MultiEdit"
|
|
220
241
|
},
|
|
221
242
|
{
|
|
222
|
-
"matcher": "Write|Edit|MultiEdit",
|
|
223
243
|
"hooks": [
|
|
224
244
|
{
|
|
225
245
|
"type": "command",
|
|
226
246
|
"command": "python3 \"$HOME/.claude/hooks/test_generator_hook.py\"",
|
|
227
247
|
"timeout": 10
|
|
228
248
|
}
|
|
229
|
-
]
|
|
249
|
+
],
|
|
250
|
+
"matcher": "Write|Edit|MultiEdit"
|
|
230
251
|
},
|
|
231
252
|
{
|
|
232
253
|
"hooks": [
|
|
@@ -235,7 +256,8 @@
|
|
|
235
256
|
"command": "python3 \"$HOME/.claude/hooks/budget_governor.py\"",
|
|
236
257
|
"timeout": 10
|
|
237
258
|
}
|
|
238
|
-
]
|
|
259
|
+
],
|
|
260
|
+
"matcher": ""
|
|
239
261
|
}
|
|
240
262
|
],
|
|
241
263
|
"PostToolUseFailure": [
|
|
@@ -250,19 +272,19 @@
|
|
|
250
272
|
],
|
|
251
273
|
"Stop": [
|
|
252
274
|
{
|
|
253
|
-
"matcher": "",
|
|
254
275
|
"hooks": [
|
|
255
276
|
{
|
|
256
277
|
"type": "command",
|
|
257
278
|
"command": "python3 \"$HOME/.claude/hooks/stop_dispatcher.py\"",
|
|
258
279
|
"timeout": 90
|
|
259
280
|
}
|
|
260
|
-
]
|
|
281
|
+
],
|
|
282
|
+
"matcher": ""
|
|
261
283
|
}
|
|
262
284
|
]
|
|
263
285
|
},
|
|
264
286
|
"_omg": {
|
|
265
|
-
"_version": "2.0.
|
|
287
|
+
"_version": "2.0.5",
|
|
266
288
|
"preset": "safe",
|
|
267
289
|
"default_mode": "ulw+ralph",
|
|
268
290
|
"vision_auto": true,
|
|
@@ -313,6 +335,47 @@
|
|
|
313
335
|
"DEP_HEALTH": false,
|
|
314
336
|
"CODEBASE_VIZ": false,
|
|
315
337
|
"CONTEXT_MANAGER": false
|
|
338
|
+
},
|
|
339
|
+
"generated": {
|
|
340
|
+
"contract_version": "2.0.5",
|
|
341
|
+
"channel": "enterprise",
|
|
342
|
+
"required_bundles": [
|
|
343
|
+
"control-plane",
|
|
344
|
+
"hook-governor",
|
|
345
|
+
"mcp-fabric",
|
|
346
|
+
"lsp-pack",
|
|
347
|
+
"secure-worktree-pipeline",
|
|
348
|
+
"security-check",
|
|
349
|
+
"api-twin",
|
|
350
|
+
"preflight",
|
|
351
|
+
"robotics",
|
|
352
|
+
"vision",
|
|
353
|
+
"algorithms",
|
|
354
|
+
"health",
|
|
355
|
+
"tracebank",
|
|
356
|
+
"eval-gate",
|
|
357
|
+
"delta-classifier",
|
|
358
|
+
"incident-replay",
|
|
359
|
+
"data-lineage",
|
|
360
|
+
"remote-supervisor"
|
|
361
|
+
],
|
|
362
|
+
"protected_paths": [
|
|
363
|
+
".omg/**",
|
|
364
|
+
".agents/**",
|
|
365
|
+
".codex/**",
|
|
366
|
+
".claude/**",
|
|
367
|
+
"registry/**",
|
|
368
|
+
"dist/**"
|
|
369
|
+
],
|
|
370
|
+
"emulated_events": [
|
|
371
|
+
"PreCompact",
|
|
372
|
+
"ConfigChange",
|
|
373
|
+
"WorktreeCreate",
|
|
374
|
+
"WorktreeRemove",
|
|
375
|
+
"SubagentStart",
|
|
376
|
+
"SubagentStop",
|
|
377
|
+
"TaskCompleted"
|
|
378
|
+
]
|
|
316
379
|
}
|
|
317
380
|
}
|
|
318
381
|
}
|
package/tools/python_repl.py
CHANGED
|
@@ -25,11 +25,13 @@ from typing import Any, Dict, Generator, List, Optional, Union
|
|
|
25
25
|
|
|
26
26
|
_get_feature_flag = None
|
|
27
27
|
_atomic_json_write = None
|
|
28
|
+
_validate_opaque_identifier = None
|
|
29
|
+
_ensure_path_within_dir = None
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
def _ensure_imports():
|
|
31
33
|
"""Lazy import feature flag and atomic write from hooks/_common.py."""
|
|
32
|
-
global _get_feature_flag, _atomic_json_write
|
|
34
|
+
global _get_feature_flag, _atomic_json_write, _validate_opaque_identifier, _ensure_path_within_dir
|
|
33
35
|
if _get_feature_flag is not None:
|
|
34
36
|
return
|
|
35
37
|
repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
@@ -38,8 +40,12 @@ def _ensure_imports():
|
|
|
38
40
|
try:
|
|
39
41
|
from hooks._common import get_feature_flag as _gff
|
|
40
42
|
from hooks._common import atomic_json_write as _ajw
|
|
43
|
+
from hooks.security_validators import ensure_path_within_dir as _epwd
|
|
44
|
+
from hooks.security_validators import validate_opaque_identifier as _voi
|
|
41
45
|
_get_feature_flag = _gff
|
|
42
46
|
_atomic_json_write = _ajw
|
|
47
|
+
_validate_opaque_identifier = _voi
|
|
48
|
+
_ensure_path_within_dir = _epwd
|
|
43
49
|
except ImportError:
|
|
44
50
|
pass
|
|
45
51
|
|
|
@@ -217,6 +223,23 @@ def _now_iso() -> str:
|
|
|
217
223
|
return datetime.now(timezone.utc).isoformat()
|
|
218
224
|
|
|
219
225
|
|
|
226
|
+
def _validate_session_id(session_id: str) -> str:
|
|
227
|
+
"""Validate a caller-supplied session identifier."""
|
|
228
|
+
_ensure_imports()
|
|
229
|
+
if _validate_opaque_identifier is None:
|
|
230
|
+
raise ValueError("Invalid session_id: validator unavailable")
|
|
231
|
+
return _validate_opaque_identifier(session_id, "session_id")
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def _resolve_session_path(session_id: str) -> str:
|
|
235
|
+
"""Resolve the on-disk session path and reject directory escapes."""
|
|
236
|
+
_ensure_imports()
|
|
237
|
+
if _ensure_path_within_dir is None:
|
|
238
|
+
raise ValueError("Invalid session_id: path validator unavailable")
|
|
239
|
+
state_dir = os.path.abspath(_STATE_DIR)
|
|
240
|
+
return _ensure_path_within_dir(state_dir, os.path.join(state_dir, f"{session_id}.json"))
|
|
241
|
+
|
|
242
|
+
|
|
220
243
|
def _persist_session(session_id: str) -> None:
|
|
221
244
|
"""Persist session metadata to disk (best-effort)."""
|
|
222
245
|
if session_id not in _sessions:
|
|
@@ -232,10 +255,11 @@ def _persist_session(session_id: str) -> None:
|
|
|
232
255
|
"exec_count": session["exec_count"],
|
|
233
256
|
"backend": session.get("backend", "stdlib"),
|
|
234
257
|
}
|
|
235
|
-
path = os.path.join(_STATE_DIR, f"{session_id}.json")
|
|
236
258
|
try:
|
|
259
|
+
safe_session_id = _validate_session_id(session_id)
|
|
260
|
+
path = _resolve_session_path(safe_session_id)
|
|
237
261
|
_atomic_json_write(path, meta)
|
|
238
|
-
except
|
|
262
|
+
except (OSError, ValueError):
|
|
239
263
|
pass # best-effort
|
|
240
264
|
|
|
241
265
|
|
|
@@ -411,6 +435,12 @@ def start_repl_session(session_id: Optional[str] = None) -> Dict[str, Any]:
|
|
|
411
435
|
if not _is_enabled():
|
|
412
436
|
return {"error": _DISABLED_MSG}
|
|
413
437
|
|
|
438
|
+
if session_id is not None:
|
|
439
|
+
try:
|
|
440
|
+
session_id = _validate_session_id(session_id)
|
|
441
|
+
except ValueError as exc:
|
|
442
|
+
return {"error": str(exc)}
|
|
443
|
+
|
|
414
444
|
# Resume existing session
|
|
415
445
|
if session_id and session_id in _sessions:
|
|
416
446
|
session = _sessions[session_id]
|