Repository navigation
✨ workflow models P1+P2: schema, compiler, DeriveFromModel, store, workflows API, repo bindings, tracker columns - #17648
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
Mutation testing (advisory)Head No surviving mutants reported in the packages that finished. ⏱ Time budget (1020s) exhausted: 3 of 6 changed package(s) were not fully mutated, so this report is partial:
Advisory only; this job never blocks the PR (#17349). |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. clubanderson this PR is held at Why:
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. Review findings from Security delta re-review at Still present — raw store errors echoed to clients (
Suggested fix — log, return a generic message: --- a/src/pkg/dashboard/api_workflows.go
+++ b/src/pkg/dashboard/api_workflows.go
@@
-func workflowStoreError(w http.ResponseWriter, err error) {
+func (s *Server) workflowStoreError(w http.ResponseWriter, err error) {
switch {
case errors.Is(err, wfstore.ErrNotFound):
jsonError(w, err.Error(), http.StatusNotFound)
case errors.Is(err, wfstore.ErrReadOnly):
jsonError(w, err.Error(), http.StatusForbidden)
case errors.Is(err, wfstore.ErrBadName), errors.Is(err, wfstore.ErrBadVersion), errors.Is(err, wfstore.ErrNotCompiled):
jsonError(w, err.Error(), http.StatusBadRequest)
default:
- jsonError(w, err.Error(), http.StatusInternalServerError)
+ s.logger.Error("workflow store", "error", err)
+ jsonError(w, "workflow store error", http.StatusInternalServerError)
}
}
@@ handleWorkflowBindingPut
- jsonError(w, "save config: "+err.Error(), http.StatusInternalServerError)
+ s.logger.Error("workflow binding: save config", "error", err)
+ jsonError(w, "save config failed", http.StatusInternalServerError)
--- a/src/pkg/dashboard/stage_tracker_workflows.go
+++ b/src/pkg/dashboard/stage_tracker_workflows.go
@@
p, err := lookup(b.Name, b.Version)
if err != nil {
- out.Repos[repo] = StageTrackerWorkflow{Name: b.Name, Version: b.Version, Error: err.Error()}
+ msg := "workflow model unavailable"
+ if errors.Is(err, wfstore.ErrNotFound) || errors.Is(err, wfstore.ErrNotCompiled) {
+ msg = err.Error()
+ }
+ out.Repos[repo] = StageTrackerWorkflow{Name: b.Name, Version: b.Version, Error: msg}
continue
}( Review findings from Intent-alignment (delta re-review, head PR title/body no longer describe the diff. The only new commit since
Whatever lands on
Prior findings (
Review findings from Scoped review: the stage-engine integration only. This PR is 6460+/732− over 70 files; I read the slice that touches every item's What checks out in the slice:
Low — a bound repository re-reads and recompiles its model on every derivation. I have not changed or closed anything. Review findings from Style / conventions re-review at The delta turns this "P1" PR into P1+P2 (store, 1. PR title/body contradict the diff (medium)Body: " 2. Repo ratchets not updated — CI red at this head (medium)
3.
|
There was a problem hiding this comment.
Correctness review at f2a631f.
type: final state placed only via lifecycle.column is never marked terminal → spurious state-no-exit refusal (src/pkg/workflowmodel/compile.go:195-204)
Profile.Terminal is documented as "states in a terminal column or of final type" (compile.go:68), but the second pass in columns() hits continue at line 198 when a state's column comes from lifecycle.column rather than columns[].states, so the s.Type == StateFinal marking at 202-204 is skipped (and the col.Terminal marking only ever runs in the first loop, 178-180). Consequences for such a state: exits() (compile.go:246-251) refuses the model with state-no-exit because a final state has no outgoing transition; and even if it did compile, rules-mode derivation would abstain at stageengine/workflow.go:102-107 instead of returning Terminal: true. Neither fixture exercises this path — hivedefault.go lists merged/closed in both columns[].states and lifecycle.column, and testdata/models/techdocs.json uses columns[].states only — so the 24-case TestCompileRefusals table does not catch it.
if _, ok := c.p.ColumnOf[s.ID]; !ok {
if s.Lifecycle.Column != "" && cols[s.Lifecycle.Column] {
c.p.ColumnOf[s.ID] = s.Lifecycle.Column
if terminalCols[s.Lifecycle.Column] {
c.p.Terminal[s.ID] = true
}
} else {
c.errorf(CodeNoColumn, s.ID, "state %q is not in any column", s.ID)
}
}
if s.Type == StateFinal {
c.p.Terminal[s.ID] = true
}
(with terminalCols := map[string]bool{} populated alongside cols[col.ID] = true in the first loop). A compile test with a final state carrying only lifecycle.column would pin it.
Low — region states are resolvable but skip per-state checks (compile.go:140-148 vs 215, 246, 438): flatten registers Regions in p.States, so rules/agents/columns may reference them and decisionFor will use their Lifecycle.Number, yet numbers()/exits()/inferred() iterate only m.Spec.States, so a region state escapes duplicate-stage-number, state-no-exit and the inferred-element warning. defaults.go:48 already produces a parallel state with regions. Either iterate the flattened map in those passes or document that region states must not carry a number.
Could not run go test in this environment; findings are from reading the head tree.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Review follow-ups (below
|
|
CI triage at head 0dca60c — every red check is PR-local and deterministic (
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
CI triage at head 0dca60c — every red check is PR-local (
Note: the title says P1 but Contributor-authored branch, so the hive does not push to it. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
…DeriveFromModel (#17620 P1) Extends the v1alpha1 schema with columns, derivation, events, gates, roles, agents, checks, bookkeeping, labels and meta; adds Compile with coded refusals; generates hive-default from the stage table and the engine's expected edges; adds stageengine.DeriveFromModel (builtin delegation + rules evaluator) and Options.Workflow; adds the workflow.enabled flag (default false, no wiring effect yet). The PR stage-golden corpus derives identically under hive-default. Signed-off-by: Andrew Anderson <andy@clubanderson.com> (cherry picked from commit 43eb8b2)
…ring, tracker columns (#17620) (#17649) * ✨ workflowmodel: store, /api/workflows, repo bindings (RFC #17620 P2a) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * ✨ stageengine: per-repo workflow binding, tracker workflows block (RFC #17620 P2b) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * workflow models P2: Settings/tracker UI, openapi, gates, docs (P2c) Per-repo Workflow select on Settings → Repos, tracker workflows block rendering (model column header, per-row strip, Not covered chevron), openapi routes/schemas, import ratchet and settings-parity allowlist, regenerated agent-runtime golden, phase-2 design notes and fragment. Refs #17620 Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…ding, lower style ratchet baselines Signed-off-by: Andrew Anderson <andy@clubanderson.com>
0dca60c to
cfd333a
Compare
…RFC #17620 P2) Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Correctness re-review at 2b97f5b (delta since 0dca60c: the branch was rebased onto v6, so the GitHub compare is noisy; the PR-side delta is commits cfd333a5 + 2b97f5ba — api-reference resync, import-allowlist entry, CSS token swap, style-ratchet baselines). No Go logic changed in the workflow code, so the three in-scope correctness findings from the previous round are still present:
1. Tracker shows bound-model columns the engine will not use when workflow.enabled is false — src/pkg/dashboard/stage_tracker_workflows.go:68 gates only on len(cfg.Project.WorkflowBindings) == 0, while the engine resolver at src/cmd/hive/stage_engine.go:67 returns nil whenever !cfg.Workflow.Enabled. A hive with bindings in hive.yaml but the flag off gets per-repo columns in the SPA while every item is still derived by hive-default.
if cfg == nil || !cfg.Workflow.Enabled || len(cfg.Project.WorkflowBindings) == 0 {
return nil
}
2. Saving a non-compiling draft over a bound version breaks the live binding — src/pkg/dashboard/api_workflows.go:129 calls st.Save, and store.Save (src/pkg/workflowmodel/store/store.go:233-276) deliberately persists drafts with Compiled=false. Nothing checks Project.WorkflowBindings on the save path the way handleWorkflowDelete does at :147-154, so after the save st.Profile (store.go:212-214) returns ErrNotCompiled, stageEngineWorkflowFor falls back to hive-default (stage_engine.go:78-83), and the tracker reports Error for that repo. Suggested guard, mirroring the delete path:
e, err := st.Save(&m, requestUser(r), time.Now().UTC())
+ // refuse to break a live binding with a draft: compile first when boundbetter placed before the save:
+ if s.deps.Config != nil {
+ for _, b := range s.deps.Config.Project.WorkflowBindings {
+ if b.Name == m.Metadata.Name && b.Version == m.Spec.Meta.Version {
+ if _, _, cerr := workflowmodel.Compile(&m); cerr != nil {
+ jsonError(w, fmt.Sprintf("%s is bound to %s and must compile: %v", b.Key(), b.Repo, cerr), http.StatusConflict)
+ return
+ }
+ }
+ }
+ }
e, err := st.Save(&m, requestUser(r), time.Now().UTC())3. Unlocked reads of Project.WorkflowBindings — SetWorkflowBinding mutates the slice under repoPauseMu (src/pkg/config/workflow_binding.go:56-75), but api_workflows.go:148 (delete), :167 (workflowBindings()), and stage_tracker_workflows.go:68,75 range over it with no lock. A dashboard PUT concurrent with a tracker build or list is a data race (go test -race on a concurrent handler test would flag it). Expose a locked accessor in pkg/config:
// WorkflowBindings returns a copy of the bindings under the binding lock.
func (c *Config) WorkflowBindings() []WorkflowBinding {
if c == nil { return nil }
repoPauseMu.RLock()
defer repoPauseMu.RUnlock()
return append([]WorkflowBinding(nil), c.Project.WorkflowBindings...)
}and use it at the three dashboard sites.
Advisory (unchanged, not blocking): Store.Profile (store.go:204-217) re-reads and recompiles the model on every call, so the per-profile hash cache in DeriveForRepo never hits across derivations.
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
…rvey compile stats (RFC #17620 P3a) (#17652) ingest.Lifecycle composes hive-default's compiled lifecycle with a repository's pipelines: PR-verify pipelines on the CI / Review states with citations, the post-merge chain as inferred columns after Merged, provenance ingested-unreviewed. New pipeline.status fact (engine reports unknown until post-merge runs are observed). ingest.ReadTree selects CI files from a checkout. POST /api/workflows/ingest fetches a repo's default branch read-only (or takes pasted files), compiles, optionally saves at the next integer version. workflow-survey compiles every corpus repo's lifecycle model: 317/317 compile, 0 refusals. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
b1627e0 to
37caad9
Compare
There was a problem hiding this comment.
Intent alignment — delta re-review at 37caad96
The body now covers P2 (previous P1-only gap: fixed for P2), but head commit 37caad96 merges #17652 (P3a) into this branch while the body still says under Not in this PR: "P3 (ingest → lifecycle draft models)". The diff contradicts that:
src/pkg/workflowmodel/ingest/lifecycle.go/tree.go— new ingest packagesrc/pkg/dashboard/api_workflows_ingest.go:36—POST /api/workflows/ingest, owner-gated, fetches the forge on the hive credential and can write the store (:100-117)src/cmd/hive/workflow_ingest.go:20+src/cmd/hive/main.go:1090—WorkflowRepoFileswired into the live serversrc/cmd/workflow-survey/main.go— compile statschangelog.d/added-workflowmodel-ingest-lifecycle.md— fragment titled "RFC phase 3a"
Either drop 37caad96 from this branch (land P3a as its own PR against this one, as #17652 originally was), or make the description match what ships. Suggested body edit:
-RFC #17620, phases 1 and 2 of 7 (#17649 was merge-trained into this branch, so this PR now carries both). Base `v6`.
+RFC #17620, phases 1, 2 and 3a of 7 (#17649 and #17652 were merge-trained into this branch, so this PR now carries all three). Base `v6`.
...
+# Phase 3a (from #17652)
+- `pkg/workflowmodel/ingest`: `Lifecycle` composes hive-default with the repo's pipelines; `ReadTree` selects CI files.
+- `POST /api/workflows/ingest` (owner-gated, `{repo}` or `{files}`, `save: true` stores next integer version).
+- `cmd/workflow-survey` compiles every repo model and reports refusal counts.
...
## Not in this PR
-P3 (ingest → lifecycle draft models), P4 (visual editor), ...
+P3b (reviewed/promoted ingest drafts), P4 (visual editor), ...and retitle to ✨ workflow models P1+P2+P3a: ….
Still present from the earlier review (not re-filed): hive.yaml.example has no workflow.enabled / data.workflows_dir / project.workflow_bindings keys; src/docs/env-vars.md has no HIVE_WORKFLOWS_DATA_DIR row (declared at src/pkg/config/config.go:301); reconciler.go not gofmt-clean; main.go:8 wfstore import in the stdlib group; store opened in both main.go:1089 and stage_engine.go:49.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Read the store, the /api/workflows* handlers (including ingest), the engine wiring (DeriveForRepo / DeriveFromModel / stageEngineWorkflowFor) and the binding config against the tree at 2ceee43. The parts I read look correct to me; nothing blocking. Three notes, two low and one on the PR body.
1. DeriveFromModel under derivation: builtin uses the package-internal deriver, not the one the engine was configured with (low, latent).
src/pkg/stageengine/workflow.go:56 builds modelDeriver{inner: builtinDeriver(kind)} = issueDeriverF, and DeriveForRepo (workflow.go:17-36) never hands its fallback into it. Production wires Issue: github.IssueDeriver() (src/cmd/hive/stage_engine.go:45), which wraps stageengine.DeriveIssue with resolveIssueLabelFacts (src/pkg/github/issue_stage_facts.go:164-171). So for a repo bound to hive-default, the label-resolution wrapper is bypassed. Today this is harmless because every Facts producer already resolves before Reconcile (issue_stage_facts.go:39, stage_facts_sink.go:174), and TestDeriveFromModelHiveDefaultParity compares against stageengine.IssueDeriver(), so it passes. But the parity the PR promises ("delegates to the existing derivers") is to the raw engine deriver, not to whatever Options.Issue/Options.PR was set to — the next caller that relies on the configured wrapper gets different derivation only in bound repos. Suggestion: let DeriveForRepo pass fallback as the builtin-mode inner (e.g. an unexported deriveFromModelWith(p, kind, inner)), and point the parity test at github.IssueDeriver() so the test guards the production pair.
2. Binding dedupe key differs from the lookup key (low).
src/pkg/config/workflow_binding.go:81-91 rejects duplicates on strings.ToLower(b.Repo), while WorkflowBindingFor (:27-36) matches on repoPauseKey(org, repo), which normalises bare vs org-qualified names. repo: hive and repo: hivecommons/hive therefore validate as two bindings but resolve to one by slice order. SetWorkflowBinding would collapse them on the next edit, so a hand-edited hive.yaml is the only way to get there; using repoPauseKey in the validator closes it.
3. PR body is stale about scope. It says "Not in this PR: P3 (ingest …)", but 37caad9 (#17652, P3a) is merge-trained into this branch: src/pkg/workflowmodel/ingest/, src/pkg/dashboard/api_workflows_ingest.go, src/cmd/hive/workflow_ingest.go and changelog.d/added-workflowmodel-ingest-lifecycle.md all land here. The title says P1+P2. Worth a one-line body/title update so the squash message matches what merges.
Checked and fine: name/version regexes in store.go:53-54 exclude / and a leading ., so no traversal from the {name}/{version} path params; writes are atomic; all mutating routes are requireOwnerRole-gated and audited; compile is unauthenticated but read-only and bounded by decodeBody's MaxBytesReader; handleWorkflowDelete 409s on a bound model; ingest's forge fetch reuses the existing tarball path in complexity_source.go. Everything is behind workflow.enabled: false plus an explicit binding, so unbound hives are untouched.
Not read: the compiler internals (compile.go), the hivedefault generator, and the tracker/settings JS — CI covers those and I did not re-derive them.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…tore, workflows API, repo bindings, tracker columns (#17679) * ✨ workflowmodel: phase-1 ingest (GitHub Actions, Tekton), renderers and survey harness (#17620) (#17630) * ✨ workflowmodel: phase-1 ingest (GitHub Actions, Tekton), renderers and survey harness (#17620) Deterministic ingest of a repository's GitHub Actions workflows and Tekton / OpenShift Pipelines resources into one content-hashed workflow model bound onto the hive default lifecycle; Mermaid and Activity Monitor column renderers; cmd/workflow-survey proving harness; golden fixtures from six real repositories. Nothing wires into the stage engine yet. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * workflow-survey: make main testable, drop unused const golangci-lint flagged maxFileBytes as unused and the coverage gate hard-fails any new cmd package without tests. Split main into realMain(args, stdout, stderr) and run over the curated fixture corpus in-process (96.6% statement coverage). Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> (cherry picked from commit a59684c) * ✨ workflow models P1+P2: schema, compiler, DeriveFromModel, store, workflows API, repo bindings, tracker columns (#17648) * ✨ workflowmodel: lifecycle schema, compiler, hive-default generator, DeriveFromModel (#17620 P1) Extends the v1alpha1 schema with columns, derivation, events, gates, roles, agents, checks, bookkeeping, labels and meta; adds Compile with coded refusals; generates hive-default from the stage table and the engine's expected edges; adds stageengine.DeriveFromModel (builtin delegation + rules evaluator) and Options.Workflow; adds the workflow.enabled flag (default false, no wiring effect yet). The PR stage-golden corpus derives identically under hive-default. Signed-off-by: Andrew Anderson <andy@clubanderson.com> (cherry picked from commit 43eb8b2) * ✨ workflow models P2: store, /api/workflows, repo bindings, engine wiring, tracker columns (#17620) (#17649) * ✨ workflowmodel: store, /api/workflows, repo bindings (RFC #17620 P2a) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * ✨ stageengine: per-repo workflow binding, tracker workflows block (RFC #17620 P2b) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * workflow models P2: Settings/tracker UI, openapi, gates, docs (P2c) Per-repo Workflow select on Settings → Repos, tracker workflows block rendering (model column header, per-row strip, Not covered chevron), openapi routes/schemas, import ratchet and settings-parity allowlist, regenerated agent-runtime golden, phase-2 design notes and fragment. Refs #17620 Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> * workflowmodel P2: refresh api-reference citations, tokenize badge padding, lower style ratchet baselines Signed-off-by: Andrew Anderson <andy@clubanderson.com> * testutil: allow pkg/dashboard → pkg/workflowmodel in import ratchet (RFC #17620 P2) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * ✨ workflowmodel: ingest → lifecycle models, /api/workflows/ingest, survey compile stats (RFC #17620 P3a) (#17652) ingest.Lifecycle composes hive-default's compiled lifecycle with a repository's pipelines: PR-verify pipelines on the CI / Review states with citations, the post-merge chain as inferred columns after Merged, provenance ingested-unreviewed. New pipeline.status fact (engine reports unknown until post-merge runs are observed). ingest.ReadTree selects CI files from a checkout. POST /api/workflows/ingest fetches a repo's default branch read-only (or takes pasted files), compiles, optionally saves at the next integer version. workflow-survey compiles every corpus repo's lifecycle model: 317/317 compile, 0 refusals. Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com> (cherry picked from commit 1217d64) --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
RFC #17620, phases 1 and 2 of 7 (#17649 was merge-trained into this branch, so this PR now carries both). Base
v6.What this adds
workflow.hivecommons.dev/v1alpha1gainscolumns,derivation,events,gates,roles,agents,checks,bookkeeping,labels,meta, and per-statelifecycle{column, number, kinds, waiting, replies, confidence, citations}. Existing fields and goldens untouched.workflowmodel.Compile(m) (*Profile, []Diagnostic, error). Refuses with coded diagnostics:state-no-exit,gate-no-owner,agent-no-human-gate,duplicate-event-fact,state-no-column/unknown-column,duplicate-stage-number,unknown-fact/bad-op,no-rules,no-version, plus unknown state/role/gate/event references.confidence: inferredelements compile with a warning.hive-defaultis generated, not hand-written —pkg/workflowmodel/hivedefault.Generate()builds it fromstagelabels.Table+stageengine.DiagramEdges()+ the monitor's column anchors (Open · Actionable · Claimed · PR in progress · CI / Review · Merge queue · Merged). 23 states, ~70 transitions, compiles clean.stageengine.DeriveFromModel(profile, kind)— the third Deriver.hive-defaultdeclaresderivation: builtinand delegates to the existing derivers, checking only coverage. Custom models declarederivation: rules: ordered first-match predicates over the fact vocabulary (workflowmodel.Facts); unmatched → Abstainworkflow: not covered.Options.Workflow *Profileselects it.workflow.enabledconfig flag, defaultfalse. No wiring effect yet (P2 binds repos).Design decision
hive-defaultderivation stays in Go. That is what makes the P1 bar — goldens byte-for-byte — hold without a second state machine. Documented insrc/docs/design/workflow-models.md.Tests
TestDeriveFromModelHiveDefaultParity: every PR stage golden + an issue sweep derive to identicalDecisions under built-in and underhive-default.TestCompileRefusals: 24-case table, one per refusal code, on the hand-writtentestdata/models/techdocs.json(cncf/techdocs engagement model,derivation: rules).TestDeriveFromModelRuleswalks a TechDocs engagement through the rules evaluator;TestRulesFactVocabularyIsCompleteproves every fact in the vocabulary evaluates.tracker-row-anchor.js, edges mirror the engine, JSON round-trip keeps the hash.Coverage: workflowmodel 91.4%, hivedefault 95.4%, stageengine 90.2%. golangci-lint clean.
v5/v6 impact
None for any hive: flag off, no repo bound, built-in derivers untouched.
pkg/configgolden regenerated for the newworkflowkey.Phase 2 (from #17649)
What's here
pkg/workflowmodel/store:<data>/workflows/<name>/<version>.json+index.json.hive-defaultvirtual/read-only; drafts save butProfile()→ErrNotCompiled; name/version regex guards; atomic writes;Rebuild. Entries reserveadoption/ratings/benchmarks(raw JSON, carried verbatim) for the P7 marketplace and future rate/vote/benchmark work.project.workflow_bindings: [{repo, name, version}](mirrorsrepo_policies),WorkflowBindingFor/SetWorkflowBinding, validated inValidateWithOptions. Bind requires a compiling model; deleting a bound model is 409.data.workflows_diroverride.GET/POST /api/workflows,POST /api/workflows/compile,GET/PUT /api/workflows/bindings,GET/PUT/DELETE /api/workflows/{name}/{version}. Owner-gated writes, audited, 503 without a store. OpenAPI updated.stageengine.Options.WorkflowFor(owner, repo)+DeriveForRepo(hash-cached per-profile deriver). Bound repos derive viaDeriveFromModel; unbound/flag-off take the builtin path unchanged. Unusable binding warns once and falls back.workflows: {default, repos: {<repo>: {name, version, columns, numbers, error}}}(nil when nothing is bound). JS: model badge, model column header, per-row column strip by stage number, amber Not covered chevron on abstention.<select>, immediate PUT to bindings.Tests / gates
store92.4%,api_workflows_test.go,stage_engine_workflow_test.go(live rebind, fallback, warn-once), node-harnessstage_tracker_workflows_ui_test.go./var-symlink failures (TestKnowledgeDrainLegacyMemory, memory-drainer tests) are unrelated.Not in this PR
P3 (ingest → lifecycle draft models), P4 (visual editor), P5 (monitor CI sub-stages), P6 (marketplace on hive.hivecommons.dev), P7 (benchmark/ratings). Tracked on #17620.