feat(I198): migrate to InvocationContext (lockstep) #1

Merged
buildagent merged 2 commits from feat/i198-invocation-context into main 2026-05-27 13:55:02 +02:00
Member

Lockstep with h-dv/ixt#173 and h-dv/ixt-public#1 per spec doc/concept/21-invocation-context.md.

Summary

MIT crate, independent of ixt-core. Defines its own mirror types matching the new wire schema in ixt-public.

What changed

  • src/types.rs:
    • DELETED: RequestContext, SecurityContext, SecurityLevel (pre-1.0, no compat shim per feedback_no_premature_compat).
    • ADDED: InvocationContext, ActorIdentity, ActorSubject, TokenRef, MessageTarget, metadata_keys — structurally identical to the runtime side.
    • SessionToken kept as a sibling (spec 21 §11.2: dispatched alongside the context, not inside it).
  • src/conversions.rs: invocation_context_to/from_capnp + actor_identity_* + message_target_* replace the legacy converters.
  • src/ffi.rs: deserialiser decodes module_capnp::invocation_context::Reader.
  • IxtModule::handle(&InvocationContext, ...) everywhere.
  • examples/auth_basic.rs + examples/auth_truststore_client.rs DELETED — taught the deleted SecurityLevel/SecurityContext model. Spec-21/22-aligned auth examples will land with I199.
  • tests/module_interface_tests.rs: 5 new tests covering InvocationContext::anonymous, capability checks, wildcard semantics, TokenRef redaction, and metadata lookup.

Submodule

  • Nested ixt-public submodule bumped to d1b377c422a164a6da7f903b16f6b50a5b6193c6 (PR #1 there).

Test plan

  • CI green (Forgejo workflow)
  • Locally validated as part of workspace check in h-dv/ixt PR #173

Merge order: h-dv/ixt-public#1 first, then this PR, then h-dv/ixt#173.

🤖 Generated with Claude Code

Lockstep with [h-dv/ixt#173](https://git.h-dv.de/h-dv/ixt/pulls/173) and [h-dv/ixt-public#1](https://git.h-dv.de/h-dv/ixt-public/pulls/1) per spec `doc/concept/21-invocation-context.md`. ## Summary MIT crate, independent of ixt-core. Defines its own mirror types matching the new wire schema in `ixt-public`. ## What changed - `src/types.rs`: - DELETED: `RequestContext`, `SecurityContext`, `SecurityLevel` (pre-1.0, no compat shim per `feedback_no_premature_compat`). - ADDED: `InvocationContext`, `ActorIdentity`, `ActorSubject`, `TokenRef`, `MessageTarget`, `metadata_keys` — structurally identical to the runtime side. - `SessionToken` kept as a sibling (spec 21 §11.2: dispatched alongside the context, not inside it). - `src/conversions.rs`: `invocation_context_to/from_capnp` + `actor_identity_*` + `message_target_*` replace the legacy converters. - `src/ffi.rs`: deserialiser decodes `module_capnp::invocation_context::Reader`. - `IxtModule::handle(&InvocationContext, ...)` everywhere. - `examples/auth_basic.rs` + `examples/auth_truststore_client.rs` DELETED — taught the deleted `SecurityLevel`/`SecurityContext` model. Spec-21/22-aligned auth examples will land with I199. - `tests/module_interface_tests.rs`: 5 new tests covering `InvocationContext::anonymous`, capability checks, wildcard semantics, `TokenRef` redaction, and metadata lookup. ## Submodule - Nested `ixt-public` submodule bumped to `d1b377c422a164a6da7f903b16f6b50a5b6193c6` (PR #1 there). ## Test plan - [ ] CI green (Forgejo workflow) - [ ] Locally validated as part of workspace check in `h-dv/ixt` PR #173 Merge order: `h-dv/ixt-public#1` first, then this PR, then `h-dv/ixt#173`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Lockstep with the ixt-public Cap'n Proto schema bump
(feat/i198-invocation-context) and the ixt-core wire migration on
branch feat/i198-invocation-context-lockstep.

Types (src/types.rs):
- Deleted: RequestContext, SecurityContext, SecurityLevel
  (pre-1.0, no compat shim per feedback_no_premature_compat).
- Added: InvocationContext, ActorIdentity, ActorSubject, TokenRef,
  MessageTarget, metadata_keys. Mirrors ixt_core::invocation::*.
- TokenRef Debug/Display always render <redacted> (spec 21 §7).
- SessionToken stays as a sibling type (spec 21 §11.2: dispatched
  alongside the context, never inside it).

Conversions (src/conversions.rs):
- Replaced request_context_to/from_capnp + security_context_* +
  security_level_* with invocation_context_to/from_capnp and the
  supporting actor_identity_* / message_target_* converters.
- token_ref bytes are projected onto the wire as opaque Data
  (spec 21 §7 — never raw token material).

FFI bridge (src/ffi.rs):
- Deserialiser now decodes module_capnp::invocation_context::Reader.

Macros (src/macros.rs):
- IxtModule trait signature is &InvocationContext.

Examples / tests:
- hello_module, async_init_demo, lifecycle_demo migrated.
- module_interface_tests: deleted SecurityContext/RequestContext tests;
  added InvocationContext / ActorIdentity / TokenRef coverage.
- auth_basic + auth_truststore_client examples DELETED — they taught
  the pre-spec-21 SecurityLevel/SecurityContext model that is gone.
  Spec-21/spec-22-aligned auth examples will return with I199.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pure formatting follow-up to the InvocationContext migration commit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
h-dv/ixt-sdk-rust!1
No description provided.