Problem
SLA deadlines exist independently at three levels with no relationship between them:
casehub-engine: PropagationContext.deadline (case-level budget, propagates to sub-cases only)
quarkus-work: WorkItem.expiresAt (set independently by the spawning caller)
quarkus-qhorus: Commitment.expiresAt (set independently at COMMAND creation time)
A case with a 1-hour budget can legitimately spawn a WorkItem with expiresAt = +48h. The case will FAULT after 1 hour; the WorkItem will remain ASSIGNED for another 47 hours with no knowledge that its case has ended.
Similarly, a Qhorus COMMAND created during a 1-hour case can have expiresAt = +24h — the commitment will show as OPEN long after the case has faulted.
Proposed resolution
When the casehub-work-adapter (casehub-work-adapter module in casehub-engine) spawns a WorkItem, it should:
Instant effectiveDeadline = earliestOf(
requestedDeadline, // from CaseDefinition
ctx.propagationContext().deadline() // remaining case budget
);
workItemRequest.expiresAt(effectiveDeadline);
When ClaudonyCaseChannelProvider.postMessage() creates a Qhorus COMMAND (per engine issue #185), it should apply the same min(requested, case.budget.remaining) bound to Commitment.expiresAt.
The PropagationContext.createChild() already exists for sub-case budget propagation — the same concept needs to flow to WorkItems and Commitments at the integration layer.
Affected modules
casehub-work-adapter (casehub-engine) — WorkItem spawn deadline bounding
claudony-casehub — Qhorus COMMAND Commitment deadline bounding
- No changes needed in
quarkus-work or quarkus-qhorus core
Part of
#4 (platform coherence audit — finding #18)
Problem
SLA deadlines exist independently at three levels with no relationship between them:
casehub-engine:PropagationContext.deadline(case-level budget, propagates to sub-cases only)quarkus-work:WorkItem.expiresAt(set independently by the spawning caller)quarkus-qhorus:Commitment.expiresAt(set independently at COMMAND creation time)A case with a 1-hour budget can legitimately spawn a WorkItem with
expiresAt = +48h. The case will FAULT after 1 hour; the WorkItem will remain ASSIGNED for another 47 hours with no knowledge that its case has ended.Similarly, a Qhorus COMMAND created during a 1-hour case can have
expiresAt = +24h— the commitment will show as OPEN long after the case has faulted.Proposed resolution
When the casehub-work-adapter (
casehub-work-adaptermodule in casehub-engine) spawns a WorkItem, it should:When
ClaudonyCaseChannelProvider.postMessage()creates a Qhorus COMMAND (per engine issue #185), it should apply the samemin(requested, case.budget.remaining)bound toCommitment.expiresAt.The
PropagationContext.createChild()already exists for sub-case budget propagation — the same concept needs to flow to WorkItems and Commitments at the integration layer.Affected modules
casehub-work-adapter(casehub-engine) — WorkItem spawn deadline boundingclaudony-casehub— Qhorus COMMAND Commitment deadline boundingquarkus-workorquarkus-qhoruscorePart of
#4 (platform coherence audit — finding #18)