feat(worker): dispatch Qhorus COMMAND on worker channel after scheduling#218
Merged
Conversation
Collaborator
|
/retest |
|
✅ Tests restarted — check the Actions tab |
…ing (#186) When WorkerScheduleEventHandler successfully submits a worker execution, open a worker-specific channel and post a COMMAND message containing the capability name, input data, and correlation ID (event log ID). This closes the prescriptive→normative lifecycle gap: previously the engine provisioned workers and opened case coordination channels but never sent a COMMAND, so the entire Qhorus obligation lifecycle (ACKNOWLEDGED, FULFILLED, FAILED, EXPIRED, stall detection) was bypassed for all CaseHub-orchestrated work. The worker-specific channel (purpose "worker:<name>") is tracked by the CaseChannelProvider alongside the case coordination channel. When the case reaches a terminal state, CaseStatusChangedHandler calls listChannels() + closeChannel() for all of them, so worker channels are cleaned up automatically with no additional wiring required. Adds commandDispatchedToChannelWhenWorkerScheduled test to SpiWiringIntegrationTest. Also fixes application-memory.properties missing H2 datasource config (needed when casehub-ledger JPA entities are on the test classpath) and adds quarkus-jdbc-h2 to the persistence-memory profile. Closes #186 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… cleanup - Delete leaked build artefacts at project root (io/, META-INF/, application.properties) and add to .gitignore to prevent recurrence - Delete engine-model/ ghost directory (module renamed to casehub-engine-common; stale shell only contained target/) - Remove duplicate stale scheduler-quartz test dep from casehub-work-adapter/pom.xml; correct dep is casehub-engine-scheduler-quartz - Fix casehub-work-adapter pom description: quarkus-work → casehub-work - Update adr/0003: io.quarkiverse.work:quarkus-work-api → io.casehub:casehub-work-api, quarkus-work-core → casehub-work-core - Fix stale quarkus-work references in CLAUDE.md, CallerRef.java, WorkItemLifecycleAdapter.java - Untrack docs/superpowers/ from git (Claude workflow docs; now gitignored) - GitHub issues #78 #80 #82 #83 #84 #212: update engine terminology (CaseContext not CaseFile, Worker/Binding not TaskDefinition, etc.) Closes #219 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…N.md Updates all references to the old artifact name quarkus-ledger throughout DESIGN.md. Also corrects a stale personal-repo issue reference (casehubio/ledger#39 → casehubio/ledger#39). Refs #219 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
b9eeb06 to
a2a52a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #186
What
When
WorkerScheduleEventHandlersuccessfully submits a worker execution, it now:caseChannelProvider.openChannel(caseId, "worker:<name>")caseChannelProvider.postToChannel(channel, "casehub-engine:orchestrator", json)The COMMAND payload:
{ "type": "COMMAND", "capability": "<capability-name>", "correlationId": "<event-log-id>", "input": { ... } }Why
Previously the engine provisioned workers and opened a case coordination channel but never sent a COMMAND. The entire Qhorus obligation lifecycle (ACKNOWLEDGED → FULFILLED/FAILED → trust score) was bypassed for all CaseHub-orchestrated work. There was no way to distinguish "agent acknowledged and is working" from "agent never picked up the work."
How cleanup works
Worker channels are tracked by the
CaseChannelProvideralongside the case coordination channel.CaseStatusChangedHandleralready callslistChannels()+closeChannel()for all open channels when a case reaches a terminal state — worker channels are cleaned up automatically with no additional wiring.Test
Adds
commandDispatchedToChannelWhenWorkerScheduledtoSpiWiringIntegrationTest, which recordspostToChannelcalls and asserts a COMMAND containing the capability name is sent.Also fixes
application-memory.propertiesmissing H2 datasource config (ledger JPA entities need it even in in-memory test profile) and addsquarkus-jdbc-h2to thepersistence-memoryMaven profile.🤖 Generated with Claude Code