Skip to content

✨ Workflow models resolve agent dispatch targets and a hive-side profile mapping - #18567

Merged
kubestellar-prow[bot] merged 3 commits into
v5from
feat/workflow-model-agent-dispatch-a
Nov 17, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
v5from
feat/workflow-model-agent-dispatch-a

Conversation

@clubanderson

Copy link
Copy Markdown
Member

What

First of three PRs for automatic agent dispatch from workflow-model states (drafter hand-off for cncf/techdocs#395). This PR is data and config only; nothing dispatches yet (PR B wires the scheduler).

  • workflowmodel.Profile now carries agents (the grants) and dispatch (state id -> DispatchTarget): profile, state kinds, trigger reply, the state's instructions (waiting reasons, column hint) and, for a PR-producing profile, the deliverable (PR state, draft flag, required labels from that state's first rule).
  • Resolution: an explicit spec.agents[].dispatch {states, reply, instructions}, or by convention the grant's first state, on entry for a profile that produces a PR/push, on the exit-gate reply for a reviewing profile. duplicate-dispatch / unknown-state refuse; dispatch-reply-undeclared warns. hive-default never dispatches.
  • workflow.dispatch config: enabled (default true), profiles.<profile>.{agent, prompt_template, disabled}. Config.WorkflowDispatchAgent resolves configured agent, else an agent named after the profile, else the first enabled writer/docs/feature agent; a configured typo never falls back.
  • The curated cncf-techdocs-assessment@curated-2026.11.2 resolves, unchanged: accepted -> techdocs-drafter (on entry, deliverable: draft PR labeled Docs analysis), drafting -> techdocs-verifier (on /verify). Pinned by TestTechDocsDispatch.

Docs: docs/design/workflow-models.md "Agent dispatch"; hive.yaml.example; settings parity allowlist (yaml-only knobs).

Tests

pkg/workflowmodel/dispatch_test.go, pkg/config/workflow_dispatch_test.go, TestTechDocsDispatch in the curated tests. CI is the verdict.

🤖 Generated with Claude Code

…e mapping

A compiled workflow model now carries its agent grants and, per state, the
profile the hive hands items to (Profile.Dispatch): an explicit
spec.agents[].dispatch block, or by convention the grant's first state,
on entry for a profile that produces a PR or push and on the exit-gate
reply for a reviewing profile. The target names the deliverable PR state
with the labels and draft flag its rule requires.

workflow.dispatch maps a profile to a hive agent (default: an agent named
after the profile, else a writer, docs or feature agent). The curated
cncf-techdocs-assessment model resolves Accepted -> techdocs-drafter and
/verify in Drafting -> techdocs-verifier with no model change.

Part of the drafter hand-off for cncf/techdocs#395.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@clubanderson

Copy link
Copy Markdown
Member Author

@nate-double-u FYI, part of the drafter hand-off for cncf/techdocs#395: this PR teaches the compiled workflow model which agent profile takes over in which state (Accepted -> drafter, /verify -> verifier) and adds the workflow.dispatch config that maps a profile to a hive agent.

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18571 ✨ Hand workflow-model states to their agent profiles (claim first, dispatch once) same files changelog.d/added-workflow-model-dispatch-targets.md
src/docs/design/workflow-models.md
src/hive.yaml.example
src/pkg/config/config.go
src/pkg/config/workflow_dispatch.go
src/pkg/config/workflow_dispatch_test.go
src/pkg/dashboard/settings_parity_allowlist.txt
src/pkg/hub/marketplace/curated/curated_test.go
src/pkg/workflowmodel/compile.go
src/pkg/workflowmodel/dispatch.go
src/pkg/workflowmodel/dispatch_test.go
src/pkg/workflowmodel/lifecycle.go
#18583 ✨ Governor: opt-in advisory report in every repo (default off) same files src/hive.yaml.example
src/pkg/config/config.go
#18536 ✨ feature: choose remote repository write identity same files src/pkg/dashboard/settings_parity_allowlist.txt
#18576 ✨ Owner-only Send to on model-owned stage-tracker rows same files changelog.d/added-workflow-model-dispatch-targets.md
src/docs/design/workflow-models.md
src/hive.yaml.example
src/pkg/config/config.go
src/pkg/config/workflow_dispatch.go
src/pkg/config/workflow_dispatch_test.go
src/pkg/dashboard/settings_parity_allowlist.txt
src/pkg/hub/marketplace/curated/curated_test.go
src/pkg/workflowmodel/compile.go
src/pkg/workflowmodel/dispatch.go
src/pkg/workflowmodel/dispatch_test.go
src/pkg/workflowmodel/lifecycle.go

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 5 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/workflowmodel/dispatch.go 173 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 173 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 215 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 236 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 256 CONDITIONALS_NEGATION

5 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/pkg/workflowmodel/dispatch.go 241 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 241 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 243 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 243 CONDITIONALS_NEGATION
src/pkg/workflowmodel/dispatch.go 243 CONDITIONALS_NEGATION

Verdict: lived (#17349).

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (rest 2/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 470f2b5 into v5 Nov 17, 2026
93 of 95 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/workflow-model-agent-dispatch-a branch November 17, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant