@trac3er/oh-my-god 2.0.3 → 2.0.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.
Files changed (95) hide show
  1. package/.agents/skills/omg/AGENTS.fragment.md +5 -0
  2. package/.agents/skills/omg/codex-mcp.toml +4 -0
  3. package/.agents/skills/omg/control-plane/SKILL.md +11 -0
  4. package/.agents/skills/omg/control-plane/openai.yaml +14 -0
  5. package/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  6. package/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  7. package/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  8. package/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  9. package/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  10. package/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  11. package/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  12. package/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  13. package/.claude-plugin/marketplace.json +3 -3
  14. package/.claude-plugin/plugin.json +1 -1
  15. package/.mcp.json +20 -4
  16. package/CHANGELOG.md +10 -0
  17. package/OMG-setup.sh +9 -3
  18. package/OMG_COMPAT_CONTRACT.md +92 -0
  19. package/README.md +24 -4
  20. package/SECURITY.md +6 -0
  21. package/commands/OMG:api-twin.md +22 -0
  22. package/commands/OMG:preflight.md +26 -0
  23. package/commands/OMG:security-check.md +28 -0
  24. package/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +5 -0
  25. package/dist/enterprise/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
  26. package/dist/enterprise/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
  27. package/dist/enterprise/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
  28. package/dist/enterprise/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  29. package/dist/enterprise/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  30. package/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  31. package/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  32. package/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  33. package/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  34. package/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  35. package/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  36. package/dist/enterprise/bundle/.claude-plugin/marketplace.json +36 -0
  37. package/dist/enterprise/bundle/.claude-plugin/plugin.json +23 -0
  38. package/dist/enterprise/bundle/.mcp.json +40 -0
  39. package/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +92 -0
  40. package/dist/enterprise/bundle/settings.json +366 -0
  41. package/dist/enterprise/manifest.json +99 -0
  42. package/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +5 -0
  43. package/dist/public/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
  44. package/dist/public/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
  45. package/dist/public/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
  46. package/dist/public/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  47. package/dist/public/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  48. package/dist/public/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  49. package/dist/public/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  50. package/dist/public/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  51. package/dist/public/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  52. package/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  53. package/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  54. package/dist/public/bundle/.claude-plugin/marketplace.json +36 -0
  55. package/dist/public/bundle/.claude-plugin/plugin.json +23 -0
  56. package/dist/public/bundle/.mcp.json +40 -0
  57. package/dist/public/bundle/OMG_COMPAT_CONTRACT.md +92 -0
  58. package/dist/public/bundle/settings.json +366 -0
  59. package/dist/public/manifest.json +99 -0
  60. package/hooks/policy_engine.py +38 -7
  61. package/hooks/post-write.py +1 -1
  62. package/hooks/prompt-enhancer.py +1 -1
  63. package/hooks/security_validators.py +75 -0
  64. package/hooks/setup_wizard.py +43 -8
  65. package/hooks/shadow_manager.py +22 -2
  66. package/package.json +1 -1
  67. package/plugins/README.md +3 -1
  68. package/plugins/advanced/commands/OMG:deep-plan.md +1 -1
  69. package/plugins/advanced/commands/OMG:security-review.md +10 -113
  70. package/plugins/advanced/commands/OMG:ship.md +1 -1
  71. package/plugins/advanced/plugin.json +1 -10
  72. package/plugins/core/plugin.json +25 -2
  73. package/pyproject.toml +1 -1
  74. package/runtime/adoption.py +1 -1
  75. package/runtime/api_twin.py +130 -0
  76. package/runtime/compat.py +21 -1
  77. package/runtime/contract_compiler.py +698 -0
  78. package/runtime/domain_packs.py +34 -0
  79. package/runtime/guide_assert.py +45 -0
  80. package/runtime/mcp_config_writers.py +147 -30
  81. package/runtime/omg_compat_contract_snapshot.json +8 -7
  82. package/runtime/omg_contract_snapshot.json +8 -7
  83. package/runtime/omg_mcp_server.py +205 -0
  84. package/runtime/preflight.py +52 -0
  85. package/runtime/providers/codex_provider.py +2 -12
  86. package/runtime/providers/gemini_provider.py +2 -21
  87. package/runtime/providers/kimi_provider.py +2 -21
  88. package/runtime/runtime_profile.py +61 -0
  89. package/runtime/security_check.py +347 -0
  90. package/runtime/subagent_dispatcher.py +117 -10
  91. package/runtime/team_router.py +3 -1
  92. package/runtime/untrusted_content.py +102 -0
  93. package/scripts/omg.py +174 -1
  94. package/settings.json +66 -18
  95. package/tools/python_repl.py +33 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omg-advanced",
3
3
  "version": "1.0.5",
4
- "description": "Advanced OMG commands - deep planning, learning, code review, security review, and specialized workflows",
4
+ "description": "Advanced OMG commands - deep planning, learning, code review, and specialized workflows",
5
5
  "type": "omg-plugin",
6
6
  "commands": {
7
7
  "deep-plan": {
@@ -19,11 +19,6 @@
19
19
  "description": "Deep code review with line-by-line analysis",
20
20
  "category": "quality"
21
21
  },
22
- "security-review": {
23
- "path": "commands/OMG:security-review.md",
24
- "description": "Security vulnerability scanning",
25
- "category": "security"
26
- },
27
22
  "ship": {
28
23
  "path": "commands/OMG:ship.md",
29
24
  "description": "Ship pipeline - idea to PR-ready summary",
@@ -69,10 +64,6 @@
69
64
  "description": "Code quality and review",
70
65
  "commands": ["code-review"]
71
66
  },
72
- "security": {
73
- "description": "Security analysis and review",
74
- "commands": ["security-review"]
75
- },
76
67
  "knowledge": {
77
68
  "description": "Learning and skill creation",
78
69
  "commands": ["learn"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omg-core",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Core OMG commands - native setup, routing, orchestration, and verification surfaces",
5
5
  "type": "omg-plugin",
6
6
  "commands": {
@@ -39,6 +39,21 @@
39
39
  "description": "Legacy skill compatibility dispatcher",
40
40
  "category": "compatibility"
41
41
  },
42
+ "security-check": {
43
+ "path": "commands/OMG:security-check.md",
44
+ "description": "Canonical security pipeline with normalized findings and evidence",
45
+ "category": "security"
46
+ },
47
+ "api-twin": {
48
+ "path": "commands/OMG:api-twin.md",
49
+ "description": "Contract replay and fixture-based API simulation",
50
+ "category": "contracts"
51
+ },
52
+ "preflight": {
53
+ "path": "commands/OMG:preflight.md",
54
+ "description": "Structured routing and evidence planning before execution",
55
+ "category": "routing"
56
+ },
42
57
  "health-check": {
43
58
  "path": "commands/OMG:health-check.md",
44
59
  "description": "Verify project setup and tool integration",
@@ -90,7 +105,7 @@
90
105
  },
91
106
  "routing": {
92
107
  "description": "Model routing and escalation",
93
- "commands": ["escalate", "teams", "ccg"]
108
+ "commands": ["escalate", "teams", "ccg", "preflight"]
94
109
  },
95
110
  "orchestration": {
96
111
  "description": "Multi-agent orchestration modes",
@@ -108,6 +123,14 @@
108
123
  "description": "Cost tracking and session observability",
109
124
  "commands": ["cost", "stats", "deps"]
110
125
  },
126
+ "security": {
127
+ "description": "Canonical security and trust checks",
128
+ "commands": ["security-check"]
129
+ },
130
+ "contracts": {
131
+ "description": "Contract replay and API simulation",
132
+ "commands": ["api-twin"]
133
+ },
111
134
  "visualization": {
112
135
  "description": "Codebase visualization and architecture diagrams",
113
136
  "commands": ["arch"]
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "oh-my-god"
7
- version = "2.0.0b1"
7
+ version = "2.0.4"
8
8
  description = "OMG (Oh My God) — Multi-agent orchestration, intelligent model routing, and durable session state for Claude Code"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -11,7 +11,7 @@ CANONICAL_REPO_URL = "https://github.com/trac3er00/OMG"
11
11
  CANONICAL_PACKAGE_NAME = "@trac3er/oh-my-god"
12
12
  CANONICAL_PLUGIN_ID = "omg"
13
13
  CANONICAL_MARKETPLACE_ID = "omg"
14
- CANONICAL_VERSION = "2.0.3"
14
+ CANONICAL_VERSION = "2.0.4"
15
15
 
16
16
  VALID_ADOPTION_MODES = ("omg-only", "coexist")
17
17
  VALID_PRESETS = ("safe", "balanced", "interop", "labs")
@@ -0,0 +1,130 @@
1
+ """Fixture-based API twin state and replay helpers."""
2
+ from __future__ import annotations
3
+
4
+ import json
5
+ from pathlib import Path
6
+ from typing import Any
7
+
8
+
9
+ STATE_REL_PATH = Path(".omg") / "state" / "api_twin.json"
10
+
11
+
12
+ def ingest_contract(project_dir: str, *, name: str, source_path: str) -> dict[str, Any]:
13
+ state = _load_state(project_dir)
14
+ contract_path = Path(source_path)
15
+ contract = {
16
+ "name": name,
17
+ "source_path": str(contract_path),
18
+ "content": contract_path.read_text(encoding="utf-8"),
19
+ "fidelity": "schema-only",
20
+ }
21
+ state.setdefault("contracts", {})[name] = contract
22
+ _save_state(project_dir, state)
23
+ return {
24
+ "schema": "ApiTwinContract",
25
+ "name": name,
26
+ "fidelity": "schema-only",
27
+ "source_path": str(contract_path),
28
+ }
29
+
30
+
31
+ def record_fixture(
32
+ project_dir: str,
33
+ *,
34
+ name: str,
35
+ request: dict[str, Any],
36
+ response: dict[str, Any],
37
+ validated: bool,
38
+ ) -> dict[str, Any]:
39
+ state = _load_state(project_dir)
40
+ fixture = {
41
+ "name": name,
42
+ "request": request,
43
+ "response": response,
44
+ "fidelity": "recorded-validated" if validated else "recorded",
45
+ "validated": validated,
46
+ }
47
+ state.setdefault("fixtures", {})[name] = fixture
48
+ _save_state(project_dir, state)
49
+ return {
50
+ "schema": "ApiTwinFixture",
51
+ "name": name,
52
+ "fidelity": fixture["fidelity"],
53
+ }
54
+
55
+
56
+ def serve_fixture(
57
+ project_dir: str,
58
+ *,
59
+ name: str,
60
+ latency_ms: int = 0,
61
+ failure_mode: str = "",
62
+ schema_drift: bool = False,
63
+ ) -> dict[str, Any]:
64
+ state = _load_state(project_dir)
65
+ fixture = _fixture(state, name)
66
+ response = dict(fixture.get("response", {}))
67
+ fidelity = str(fixture.get("fidelity", "recorded"))
68
+ if schema_drift:
69
+ response["__schema_drift__"] = True
70
+ fidelity = "stale"
71
+ if failure_mode:
72
+ response = {"error": failure_mode}
73
+ fidelity = "stale"
74
+ return {
75
+ "schema": "ApiTwinServeResult",
76
+ "name": name,
77
+ "latency_ms": latency_ms,
78
+ "failure_mode": failure_mode,
79
+ "fidelity": fidelity,
80
+ "response": response,
81
+ }
82
+
83
+
84
+ def verify_fixture(project_dir: str, *, name: str, live_response: dict[str, Any]) -> dict[str, Any]:
85
+ state = _load_state(project_dir)
86
+ fixture = _fixture(state, name)
87
+ matches_live = fixture.get("response", {}) == live_response
88
+ fidelity = "recorded-validated" if matches_live else "stale"
89
+ fixture["fidelity"] = fidelity
90
+ fixture["validated"] = matches_live
91
+ state.setdefault("fixtures", {})[name] = fixture
92
+ _save_state(project_dir, state)
93
+ return {
94
+ "schema": "ApiTwinVerifyResult",
95
+ "name": name,
96
+ "fidelity": fidelity,
97
+ "matches_live": matches_live,
98
+ "live_verification_required": True,
99
+ }
100
+
101
+
102
+ def _state_path(project_dir: str) -> Path:
103
+ return Path(project_dir) / STATE_REL_PATH
104
+
105
+
106
+ def _load_state(project_dir: str) -> dict[str, Any]:
107
+ path = _state_path(project_dir)
108
+ if not path.exists():
109
+ return {"contracts": {}, "fixtures": {}}
110
+ try:
111
+ payload = json.loads(path.read_text(encoding="utf-8"))
112
+ except (OSError, json.JSONDecodeError):
113
+ return {"contracts": {}, "fixtures": {}}
114
+ return payload if isinstance(payload, dict) else {"contracts": {}, "fixtures": {}}
115
+
116
+
117
+ def _save_state(project_dir: str, payload: dict[str, Any]) -> None:
118
+ path = _state_path(project_dir)
119
+ path.parent.mkdir(parents=True, exist_ok=True)
120
+ path.write_text(json.dumps(payload, indent=2, ensure_ascii=True) + "\n", encoding="utf-8")
121
+
122
+
123
+ def _fixture(state: dict[str, Any], name: str) -> dict[str, Any]:
124
+ fixtures = state.get("fixtures", {})
125
+ if not isinstance(fixtures, dict) or name not in fixtures:
126
+ raise ValueError(f"Unknown API twin fixture: {name}")
127
+ fixture = fixtures[name]
128
+ if not isinstance(fixture, dict):
129
+ raise ValueError(f"Invalid API twin fixture: {name}")
130
+ return fixture
package/runtime/compat.py CHANGED
@@ -16,6 +16,7 @@ from typing import Any
16
16
  from hooks.policy_engine import evaluate_bash_command
17
17
  from lab.pipeline import run_pipeline
18
18
  from runtime.dispatcher import dispatch_runtime
19
+ from runtime.security_check import run_security_check
19
20
  from runtime.team_router import TeamDispatchRequest, dispatch_team
20
21
 
21
22
  CONTRACT_SNAPSHOT_SCHEMA = "OmgCompatContractSnapshot"
@@ -103,7 +104,7 @@ LEGACY_SKILL_ROUTES: dict[str, str] = {
103
104
  "release": "runtime_ship",
104
105
  "review": "review",
105
106
  "sci-omg": "maintainer",
106
- "security-review": "secure",
107
+ "security-review": "security_check",
107
108
  "skill": "learn",
108
109
  "omg-superpowers": "plan",
109
110
  "tdd": "plan",
@@ -129,6 +130,7 @@ ROUTE_MATURITY: dict[str, str] = {
129
130
  "review": "native",
130
131
  "plan": "native",
131
132
  "secure": "native",
133
+ "security_check": "native",
132
134
  "learn": "native",
133
135
  "maintainer": "native",
134
136
  "cancel": "native",
@@ -183,6 +185,7 @@ ROUTE_INPUTS: dict[str, dict[str, Any]] = {
183
185
  "review": {"required": ["problem"], "optional": ["context", "files"]},
184
186
  "plan": {"required": ["problem"], "optional": ["expected_outcome"]},
185
187
  "secure": {"required": ["problem"], "optional": []},
188
+ "security_check": {"required": [], "optional": ["problem"]},
186
189
  "learn": {"required": ["problem"], "optional": ["context"]},
187
190
  "maintainer": {"required": ["problem"], "optional": ["context"]},
188
191
  "cancel": {"required": [], "optional": []},
@@ -200,6 +203,7 @@ ROUTE_OUTPUTS: dict[str, dict[str, Any]] = {
200
203
  "review": {"schema": "TeamDispatchResult"},
201
204
  "plan": {"schema": "PlanningArtifacts"},
202
205
  "secure": {"schema": "PolicyDecision"},
206
+ "security_check": {"schema": "SecurityCheckResult"},
203
207
  "learn": {"schema": "LearningArtifact"},
204
208
  "maintainer": {"schema": "MaintainerCompatArtifact"},
205
209
  "cancel": {"schema": "CancelResult"},
@@ -217,6 +221,7 @@ ROUTE_SIDE_EFFECTS: dict[str, list[str]] = {
217
221
  "review": [],
218
222
  "plan": [".omg/state/_plan.md", ".omg/state/_checklist.md", ".omg/idea.yml"],
219
223
  "secure": [],
224
+ "security_check": [],
220
225
  "learn": [".omg/state/working-memory.md"],
221
226
  "maintainer": [".omg/evidence/compat-*.json"],
222
227
  "cancel": [".omg/shadow/active-run (removed when exists)"],
@@ -268,6 +273,7 @@ SKILL_ROUTE_NOTES: dict[str, str] = {
268
273
  "pipeline": "Routes to OMG lab policy+pipeline executor.",
269
274
  "release": "Routes to runtime ship and emits release draft artifact.",
270
275
  "tdd": "Generates plan/checklist scaffolding for red-green-refactor workflow.",
276
+ "security-review": "Deprecated alias to the canonical OMG security-check engine.",
271
277
  "build-fix": "Creates targeted fix checklist and routes execution to runtime.",
272
278
  "analyze": "Writes structured analysis evidence artifact.",
273
279
  "trace": "Writes trace evidence artifact for debugging chain.",
@@ -1177,6 +1183,20 @@ def dispatch_compat_skill(
1177
1183
  result=decision.to_dict(),
1178
1184
  )
1179
1185
 
1186
+ if route == "security_check":
1187
+ check = run_security_check(
1188
+ project_dir=root,
1189
+ scope=msg or ".",
1190
+ include_live_enrichment=False,
1191
+ )
1192
+ return _res(
1193
+ skill=normalized,
1194
+ route=route,
1195
+ findings=["Canonical OMG security check completed."],
1196
+ actions=["Review high-severity findings before ship/release."],
1197
+ result=check,
1198
+ )
1199
+
1180
1200
  if route == "learn":
1181
1201
  if normalized in {"learn-about-omg", "learner", "skill"}:
1182
1202
  learn_path = _write_learning_artifact(root, normalized, msg, context)