This contract defines the reviewable output that OpenClaw should resolve for each Discord-originated turn before workflow execution: effective_context, effective_skills, and effective_capabilities.
The resolver exists to prevent routing drift. Skills, private profiles, context packs, and capability permissions must not be resolved independently by each workflow.
This is a fake-first contract only. It does not prove live Discord routing, live Engram reads/writes, prompt execution, filesystem access, browser automation, connector calls, publishing, scheduling, or production credentials.
- Start with the resolved Discord origin and artifact classification.
- Resolve allowed context by scope and route.
- Resolve skills using the scoped skills registry.
- Resolve capabilities separately from capability permission/config.
- Emit provenance and exclusion reasons for every included or excluded item.
- Require
discord-approval-gatefor write-like flows before any durable write.
| Input | Purpose |
|---|---|
runtime_namespace |
discord-project-manager/runtime/discord/<guild-id>/<channel-id>. |
routing_status and resolved_route |
Matched project/network route or none. |
artifact_classification |
Artifact type, operation, persistence target, approval, backup, deployment, runner backend, and writeback policy. |
scope_layers |
Global/category/channel/thread layers available for this turn. |
private_profile_refs |
Approved private profile definitions referenced by bindings. |
capability_registry |
Capability availability, permission, and private config status. |
effective_context:
included:
- ref: profile:writing.demo-linkedin-b2b
scope: category:linkedin
kind: private_profile_ref
provenance: private-runtime/profile-binding
reason: matched-route-category-binding
content_policy: reference-only-no-private-content
excluded:
- ref: profile:writing.demo-linkedin-b2b
scope: category:linkedin
kind: private_profile_ref
provenance: private-runtime/category-binding
reason: overridden-by-channel-binding
content_policy: reference-only-no-private-content
effective_skills:
included:
- skill_name: discord-approval-gate
class: runtime-core
provenance: mandatory-runtime-core
reason: write-like-flow
excluded:
- skill_name: x-queue-planner
class: scoped-workflow
provenance: channel-disabled
reason: explicit-channel-disable
effective_capabilities:
included:
- capability: engram
available: true
permitted: true
config_state: configured-private
provenance: capability-registry
reason: private-runtime-write-target-after-approval
excluded:
- capability: filesystem
available: true
permitted: false
config_state: private-config-required
approval_required: true
provenance: capability-registry
reason: capability-present-but-not-enabled-for-scopeResolve in this order:
- Runtime core safety requirements.
- Global defaults.
- Category bindings and category-local skills.
- Channel bindings, preferences, disables, and overrides.
- Thread/session summaries when explicitly modeled.
- Private profile references and disabled profile bindings.
- Capability availability and scoped permission/config.
- Write-like safety additions such as
discord-approval-gate.
Later layers may override earlier layers only when the override is explicit and reviewable. Disabled items stay excluded unless a reviewed override says otherwise.
| Context source | Include when | Output rule |
|---|---|---|
| Public repo docs/contracts | Relevant to the resolved route or runner boundary. | Include path/provenance, not copied large content. |
| Private profile definition | A binding references it for global/category/channel scope. | Include ref and summary metadata only; do not expose real profile content in repo fixtures. |
| Private profile binding | Binding applies to the current route/scope. | Include scope and reason. |
| Thread/session summary | Explicitly modeled and bounded. | Include summary ref, never raw chat logs. |
| Unmapped channel context | Route is not matched. | Exclude durable context; ask for clarification. |
Reuse docs/architecture/discord-scoped-skills-registry.md and skills/scoped-skill-resolver/SKILL.md.
Every skill item must include:
- skill name;
- class:
runtime-core,scoped-workflow, orpreserved-protocol; - included/excluded state;
- source scope or registry layer;
- inclusion or exclusion reason;
- provenance.
For write-like flows, discord-approval-gate is mandatory even if a draft registry omits it.
Capability availability and permission are different decisions.
| Field | Meaning |
|---|---|
capability |
Capability family such as filesystem, browser, buffer, engram, github, image_generation, or gentle_sdd. |
available |
Runtime/plugin/integration exists in the environment or inventory. |
permitted |
Current scope may use it. |
config_state |
not-required, private-config-required, configured-private, or missing-private-config. |
approval_required |
Whether using or changing the capability requires exact approval. |
reason |
Why it is included, excluded, or blocked. |
External-service and local filesystem capabilities must never expose credentials, local sensitive paths, raw browser session state, or private connector config in repo fixtures.
| Scenario | Expected resolver outcome |
|---|---|
| Shared profile referenced by LinkedIn and X categories | Same ref appears for both scopes; no clone unless operation is clone. |
| Channel-specific profile override | Category profile remains visible as overridden/excluded; channel profile is included with override provenance. |
| Disabled skill | Skill appears under excluded with explicit disabled reason. |
| Capability present but not permitted | Capability appears as available: true, permitted: false with permission/config reason. |
| Write-like private context update | discord-approval-gate appears in effective skills and approval remains required. |
docs/architecture/openclaw-artifact-classification.mddocs/architecture/discord-runtime-orchestrator.mddocs/architecture/discord-scoped-skills-registry.mddocs/architecture/discord-context-skill-packs.mddocs/architecture/discord-memory-gateway.mddocs/operations/private-runtime-backup-restore.mddocs/security/data-handling.md
- Fixture uses fake/demo markers only.
- Effective context includes provenance and reasons for included/excluded private profile refs.
- Effective skills include provenance and exclusion reasons.
- Effective capabilities distinguish availability from scoped permission/config.
- Shared profile references remain shared unless
operation: cloneis explicit. - Write-like flows include
discord-approval-gate. - No raw Discord IDs, private profile content, local sensitive paths, tokens, raw logs, screenshots, or production claims are introduced.