Repository navigation
fix(OMN-16840): refuse a delegation class the routing authority declares it cannot serve - #296
Conversation
…authority declares unavailable The routing authority declares agent_delegation routing_availability.status=pending_capability (omnimarket task_class_contracts.v1.yaml, omnimarket#2179) precisely so a consumer can refuse the class up front. No omnidash consumer reads it. Two failing assertions: - the agent_delegation option renders enabled with no reason surfaced - POST /api/delegation/trigger returns 200 and publishes the envelope Both companion assertions (escalation stays selectable, escalation still dispatches) already pass, so the red is the new behaviour only.
…res it cannot serve The routing authority declares agent_delegation routing_availability.status=pending_capability (omnimarket task_class_contracts.v1.yaml, omnimarket#2179) with the stated intent that a consumer refuse the class up front. Nothing read it, so the menu offered the class, the trigger route published the envelope, and the caller waited out the full ingress budget for an ONEX_CORE_041 that was knowable before dispatch. - shared/contracts/delegation-task-types.json mirrors the declaration verbatim - the task-type menu disables the option and renders the contract's own reason - POST /api/delegation/trigger answers 409 task_type_unavailable with the declared reason/missing_capability/tracking and does not publish Undeclared availability is availability, so the other 12 classes are untouched. The browser and server halves read the same contract block but cannot share one module: shared/types files consumed by the server belong to the composite tsconfig.node.json project and are excluded from the root project, so one module cannot be typechecked by both. The contract JSON is the shared authority, and 'refuses exactly the classes the contract declares unavailable' derives the route's refusal set from that JSON rather than from a literal, so a class added to or removed from the declaration moves this route with no edit here. When the agent_orchestration producer lands (OMN-15961 WS-4/C6) and the upstream declaration is deleted, deleting it here re-opens the class.
|
OCC autobind did not mint a companion for this PR: no changed-file candidate could be proven RED against the merge base, and emitting a PR-existence probe instead would be non-falsifiable evidence (OMN-15247). Hand-authored evidence is required. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe change adds shared routing availability metadata for delegation task types. The server rejects unavailable types before runtime dispatch. The dashboard disables those types and displays contract-provided reasons. Tests cover server and dashboard behavior. ChangesDelegation availability
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The dashboard and trigger endpoint now refuse unavailable delegation classes before dispatch and preserve existing behavior for other classes; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant Operator
participant DelegationTriggerPanel
participant TriggerEndpoint
participant TaskAvailability
participant Runtime
Operator->>DelegationTriggerPanel: select task type
DelegationTriggerPanel->>TaskAvailability: read routing availability
TaskAvailability-->>DelegationTriggerPanel: enabled or disabled state
Operator->>TriggerEndpoint: submit routable task type
TriggerEndpoint->>TaskAvailability: validate routing availability
TaskAvailability-->>TriggerEndpoint: routable
TriggerEndpoint->>Runtime: dispatch task
Runtime-->>TriggerEndpoint: dispatch result
TriggerEndpoint-->>Operator: response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
* evidence: OCC companion pass 1 for OmniNode-ai/omnidash#296 * evidence: OCC companion self-bind for #7402 --------- Co-authored-by: node-occ-companion-effect <occ-companion-effect@omninode.ai>
OMN-16840
Residual of OMN-16811. Its fix (omnimarket#2179, merged 2026-08-28) declared the
agent_delegationcapability gap in the routing authority's own contract:with the stated intent that "a consumer (dashboard menu, gateway admission) refuse the class up front instead of offering it and hanging for the full ingress budget." No consumer read it. The dashboard kept offering
agent_delegation,POST /api/delegation/triggerkept publishing the envelope, and the caller waited out the full ingress budget for anONEX_CORE_041_INVALID_CONFIGURATIONthat was knowable before dispatch.What changed
shared/contracts/delegation-task-types.jsonmirrors the upstream declaration verbatim onagent_delegation.shared/types/delegation-task-availability.ts— the browser-side reading. Undeclared availability is availability, so the other 12 classes are untouched.DelegationTriggerPaneldisables the option and renders the contract's ownreason. The dashboard renders the declaration; it does not author an availability rule.POST /api/delegation/triggeranswers409 task_type_unavailablewith the declaredreason/missing_capability/trackingandretryable: false, and does not publish.No new REST surface, no new authority. Both halves read the contract that was already imported here.
Why two readings, not one module
shared/types/*files consumed by the server belong to the compositetsconfig.node.jsonproject and areexcluded from the root project; a single module in both tripsTS6305/TS6307, whichever way it is placed (verified both directions locally). The contract JSON is therefore the shared authority.refuses exactly the classes the contract declares unavailablederives the route's refusal set from that JSON rather than from a literal, so adding or removing a declaration moves the route with no edit to the test or the handler.Evidence (local, this branch)
c23c0b6committed the two failing assertions (option enabled, route returns 200). The two companion assertions — escalation stays selectable, escalation still dispatches — passed at red, so only the new behaviour was failing.93fb274.npx vitest run server/__tests__/dispatch.test.ts src/.../DelegationTriggerPanel.test.tsx→ 28 passed.npm run test:run→ 1656 passed / 15 skipped, 178 files.npm run check(root tsc) clean;npm run build:server(tsconfig.node.json) clean;npm run lintclean;pre-commitfull hook set passed on both commits.Acceptance criteria
routing_availabilitypresent onagent_delegationin the omnidash contract — met.agent_delegationdisabled + declared reason visible;escalationenabled — met (2 tests).refuses a task_type the contract declares routing-unavailable).still dispatches a task_type with no routing_availability declaration+ the contract-derived symmetry test covering all 13).Scope
Dashboard/API-surface only. No lane mutation; no claim about
stability-test,judge, orprod. When theagent_orchestrationproducer lands and the upstream declaration is deleted, deleting it here re-opens the class.Evidence-Ticket: OMN-16840
Evidence-Source: OCC#7402
Summary by CodeRabbit