Skip to content

Commit 19992ea

Browse files
Codex Agentclaude
andcommitted
EPIC-OC: OpenClaw Architecture Integration (Phases 1-7)
Seven phases of architectural improvements inspired by the OpenClaw Applicability Assessment: Phase 1 - Concurrency: Lane-aware executor with configurable concurrency caps, queue modes (collect/followup/steer), concurrent step tracking. Phase 2 - Skill Hardening: Semantic versioning, precedence-aware skill discovery (workspace > managed > bundled), SHA-256 hash pinning, SecurityScanner SKILL_MD_INJECTION rules, pack CLI commands. Phase 3 - Memory/Compaction: 4-tier compaction engine (pin > recent > summary > discard), context pin registry with SQLite persistence, pre-compaction memory flush manager. Phase 4 - Security: Ed25519 pack signing/verification, tool sandbox profiles with deny-wins merge, gateway budget enforcement, circuit breaker in model router. Phase 5 - Hooks/Webhooks: 6 new hook points, outbound webhook dispatcher with HMAC-SHA256 signing and retry, webhook bridge hook, CLI commands for webhook management. Phase 6 - Harness Abstraction: RuntimeHarness protocol with PydanticAI implementation, per-run session sandbox with path boundary enforcement, scoped approvals store. Phase 7 - Gateway Protocol: Idempotency cache with TTL for WS message deduplication, client identity tracking on connect. 540 tests pass, mypy clean, ruff clean. All 18 key classes verified with production call sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b2f497f commit 19992ea

106 files changed

Lines changed: 12167 additions & 80 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "PackManifest",
4+
"description": "Schema for OpenEinstein campaign pack manifests.",
5+
"type": "object",
6+
"required": ["name", "version", "author", "license", "sha256"],
7+
"properties": {
8+
"name": {
9+
"type": "string",
10+
"description": "Unique pack identifier."
11+
},
12+
"version": {
13+
"type": "string",
14+
"pattern": "^\\d+\\.\\d+\\.\\d+",
15+
"description": "Semantic version string."
16+
},
17+
"author": {
18+
"type": "string",
19+
"description": "Pack author or organization."
20+
},
21+
"license": {
22+
"type": "string",
23+
"description": "SPDX license identifier."
24+
},
25+
"sha256": {
26+
"type": "string",
27+
"description": "SHA-256 hash of the pack contents."
28+
},
29+
"description": {
30+
"type": "string",
31+
"description": "Human-readable pack description."
32+
},
33+
"dependencies": {
34+
"type": "array",
35+
"items": { "type": "string" },
36+
"default": [],
37+
"description": "List of required dependency pack names."
38+
},
39+
"min_platform_version": {
40+
"type": "string",
41+
"pattern": "^\\d+\\.\\d+\\.\\d+",
42+
"description": "Minimum OpenEinstein platform version required."
43+
},
44+
"tags": {
45+
"type": "array",
46+
"items": { "type": "string" },
47+
"default": [],
48+
"description": "Categorization tags."
49+
}
50+
},
51+
"additionalProperties": false
52+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
campaign:
2+
name: "Scalar-Tensor Lab Starter"
3+
version: "0.1.0"
4+
description: "Starter campaign for scalar-tensor gravity model sweeps."
5+
search_space:
6+
generator_skill: "scalar-tensor-search"
7+
gate_pipeline:
8+
- name: "stability"
9+
skill: "stability-analysis"
10+
cas_requirements: ["tensor_algebra"]
11+
timeout_seconds: 45
12+
dependencies:
13+
tools: ["sympy", "scanner"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Scalar-Tensor Lab Starter
2+
3+
Marketplace pack used by dashboard integration tests for install and schema wiring.

configs/compaction.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Compaction engine defaults
2+
recent_turns_keep: 5
3+
summary_model_role: fast
4+
budget_trigger_pct: 70

configs/lanes.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Default lane configuration for concurrent campaign step dispatch.
2+
# Each lane controls how many steps of a given type may run simultaneously.
3+
4+
lanes:
5+
main:
6+
max_concurrent: 4
7+
queue_mode: collect
8+
subagent:
9+
max_concurrent: 8
10+
queue_mode: collect
11+
literature:
12+
max_concurrent: 2
13+
queue_mode: followup
14+
gating:
15+
max_concurrent: 2
16+
queue_mode: collect

configs/openeinstein.example.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ model_routing:
1818
provider: anthropic
1919
model: claude-sonnet-4-5
2020
fallback:
21-
provider: openai
22-
model: gpt-4.1
21+
- provider: openai
22+
model: gpt-4.1
23+
- provider: google
24+
model: gemini-2.5-pro
2325

2426
fast:
2527
description: Classification and simple extraction

configs/tool-profiles.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Tool Sandbox Profiles
2+
# Controls per-tool permissions enforced by the ToolSandboxHook.
3+
#
4+
# Presets define reusable permission sets with optional inheritance.
5+
# Profiles match tools by name (exact or glob) and inherit from presets.
6+
# Merge logic: deny-wins for booleans, stricter-wins for numeric limits.
7+
8+
presets:
9+
minimal:
10+
allow_network: false
11+
allow_fs_write: false
12+
allow_shell: false
13+
14+
research:
15+
inherits: minimal
16+
allow_network: true
17+
18+
full:
19+
allow_network: true
20+
allow_fs_write: true
21+
allow_shell: true
22+
23+
profiles:
24+
- tool_name_pattern: "arxiv_*"
25+
inherits: research
26+
max_tokens_per_call: 8000
27+
max_calls_per_run: 20
28+
29+
- tool_name_pattern: "semantic_scholar_*"
30+
inherits: research
31+
max_tokens_per_call: 8000
32+
max_calls_per_run: 20
33+
34+
- tool_name_pattern: "shell_exec"
35+
inherits: full
36+
max_calls_per_run: 10
37+
38+
- tool_name_pattern: "file_write"
39+
inherits: minimal
40+
allow_fs_write: true
41+
max_calls_per_run: 50

configs/trusted-keys/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Trusted Keys
2+
3+
Place Ed25519 public keys here for pack signature verification.
4+
Keys should be stored as raw bytes in `.pub` files.

configs/webhooks.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Outbound Webhook Configuration
2+
# Each webhook receives HTTP POST notifications for subscribed event types.
3+
# Events are signed with HMAC-SHA256 using the per-webhook secret.
4+
#
5+
# Available event types:
6+
# before_tool_call, after_tool_call, campaign_state_transition,
7+
# before_run_start, after_run_end,
8+
# before_compaction, after_compaction,
9+
# candidate_generated, gate_passed, gate_failed, budget_warning
10+
11+
webhooks: []
12+
# - url: https://example.com/openeinstein/webhook
13+
# events: [candidate_generated, gate_passed, gate_failed]
14+
# secret: change-me-to-a-strong-secret

docs/audits/production-audit-a.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Production Audit A
2+
3+
## Scope
4+
Acceptance matrix and red-test validity review after WP-1 (tests-first cutover baseline).
5+
6+
## Findings
7+
- Medium: `tests/production/*` initially failed collection due missing runtime modules (`CampaignExecutor`, provider qualification, subjective evals). This confirmed a true red baseline.
8+
- Low: Production profile marker registration (`@pytest.mark.production`) was missing and added in `pyproject.toml`.
9+
10+
## Evidence
11+
- Baseline command: `.venv/bin/pytest tests/production -q`
12+
- Baseline failure classes: `ModuleNotFoundError` for:
13+
- `openeinstein.campaigns.executor`
14+
- `openeinstein.routing.provider_qualification`
15+
16+
## Unmet Contracts (at audit time)
17+
- IC-PR-01 through IC-PR-12 were not yet implemented at runtime.
18+
19+
## Remediation
20+
- Implemented runtime executor, v2 surface, provider qualification module, subjective eval module, and production profile policy script.
21+
22+
## Decision
23+
- No-Go at audit capture time (expected red baseline). Go-forward approved after remediation.

0 commit comments

Comments
 (0)