Skip to content

design: WorkerScheduleEvent should send a Qhorus COMMAND — wire casehub-engine into the normative commitment lifecycle #186

@mdproctor

Description

@mdproctor

Problem

When casehub-engine assigns work to a worker via WorkBrokerWorkerScheduleEvent, it calls WorkerProvisioner.provision() and CaseChannelProvider.open() — but it does not send a Qhorus COMMAND on the channel.

The channel is opened. The worker is provisioned. But no normative commitment is created.

This means the entire Qhorus obligation lifecycle (ACKNOWLEDGED, FULFILLED, FAILED, DELEGATED, EXPIRED, stalled detection, list_stalled_obligations, trust score feedback) is bypassed for every CaseHub-orchestrated work unit. Only spontaneous agent-to-agent messages outside of CaseHub go through the normative layer.

The architecture already supports this — ClaudonyCaseChannelProvider opens a Qhorus channel and exposes postMessage(). The missing step is sending a COMMAND after provisioning.

Proposed fix

In CaseContextChangedEventHandler (choreography) and WorkOrchestrator.submit() (orchestration), after provision() and open():

channelProvider.postMessage(channel, Message.builder()
    .type(MessageType.COMMAND)
    .sender("casehub-engine:orchestrator@v1")
    .content(buildWorkSpec(worker, context))
    .correlationId(workUnit.id().toString())
    .build());

The worker's DONE/FAILURE response then:

  1. Updates the CommitmentState in Qhorus (existing mechanism)
  2. Writes a LedgerAttestation (once qhorus-issue-123 is done)
  3. Feeds the trust score for the worker persona

This closes the prescriptive→normative→evaluative chain for all CaseHub-orchestrated work.

Requires

Part of

casehubio/parent#4 (platform coherence audit — finding #31, highest architectural priority)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions