Skip to content

feat(sdk): cross-society types — CrossSocietyContext, ReputationEnvelope, MCPContextResource#195

Merged
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260515-120725
May 15, 2026
Merged

feat(sdk): cross-society types — CrossSocietyContext, ReputationEnvelope, MCPContextResource#195
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260515-120725

Conversation

@dp-web4
Copy link
Copy Markdown
Owner

@dp-web4 dp-web4 commented May 15, 2026

Summary

  • Implements §7.3–7.6 from mcp-protocol.md in Python SDK
  • Adds OutcomeClass, PropagationScope, CrossSocietyInteractionType enums
  • Adds CrossSocietyContext envelope for cross-society MCP calls (§7.4)
  • Adds ReputationEnvelope for signed R7 action outcomes (§7.3)
  • Adds MCPContextResource for context resource definitions (§6.3)
  • Extends ErrorCategory with CROSS_SOCIETY (30 error codes, up from 24)

All types include to_dict()/from_dict() round-trip serialization.

Test plan

  • python -m pytest web4-standard/implementation/sdk/tests/ passes
  • Verify new types export from web4.mcp and web4.errors

🤖 Generated with Claude Code

…nvelope, MCPContextResource

Implements §7.3–7.6 from mcp-protocol.md: OutcomeClass, PropagationScope,
CrossSocietyInteractionType enums, CrossSocietyContext envelope, ReputationEnvelope
for R7 actions, MCPContextResource for context resources. ErrorCategory extended
with CROSS_SOCIETY (30 error codes, up from 24).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dp-web4 dp-web4 merged commit eeafb95 into main May 15, 2026
1 of 6 checks passed
dp-web4 added a commit that referenced this pull request May 17, 2026
Completes integration wiring for the cross-society MCP types
(OutcomeClass, PropagationScope, CrossSocietyInteractionType,
CrossSocietyContext, ReputationEnvelope, MCPContextResource) that
landed on main via PR #195 but lacked tests, error registry entries,
and package exports.

errors.py:
- Add CrossSocietyError subclass (was in __all__ but undefined)
- Add 6 ErrorMeta registry entries for §7.6 cross-society codes
- Add _CATEGORY_SUBCLASS dispatch for CROSS_SOCIETY

__init__.py:
- Export 6 cross-society MCP types + CrossSocietyError (369→376 exports)

test_mcp_cross_society.py (NEW):
- 37 tests: enum values, construction, defaults, to_dict/from_dict
  round-trips, frozen checks, package-level import verification

test_errors.py:
- Update assertions: 24→30 codes, 6→7 categories, per-category counts
- Add CrossSocietyError subclass/metadata/serialization tests

Re-scoped per PR #196 rejection directive: tests + integration
wiring only, no mcp.py formatting churn.

2746 passed, 8 xfailed. mypy --strict clean. ruff lint/format clean.

Co-authored-by: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant