Skip to content

✨ workflow models P3a: ingest → lifecycle models, workflows ingest API, survey compile stats - #17652

Merged
hivecommons-hive[bot] merged 1 commit into
workflowmodel/p1-compilerfrom
workflowmodel/p3-ingest-lifecycle
Nov 11, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
workflowmodel/p1-compilerfrom
workflowmodel/p3-ingest-lifecycle

Conversation

@clubanderson

@clubanderson clubanderson commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Stacked on #17648 (P2). Phase 3a of RFC #17620: an ingested repository now yields a compiling lifecycle model, reachable from the spoke API.

What's here

  • ingest.Lifecycle(scope, files) — hive-default's compiled lifecycle + the repo's pipelines: PR-verify pipelines bound to the CI / Review states (with file citations), the post-merge chain (main CI · release · deploy- · done) as new columns after Merged, every ingested element confidence: inferred, provenance ingested-unreviewed. ingest.Repository (phase 0) is untouched; its goldens hold.
  • pipeline.status fact — what the post-merge chain waits on. The engine reports unknown until it observes post-merge runs, so a bound ingested model derives exactly like hive-default today (extra columns render, nothing lands in them yet). Honest rather than invented.
  • ingest.ReadTree(dir) — selects CI files from a checkout with the survey collector's rules (GHA workflows, Tekton dirs, pipeline-named YAML that looks like Tekton; skips vendor/testdata/node_modules; capped).
  • POST /api/workflows/ingest — owner-gated. {repo} fetches the default branch read-only via FetchDefaultBranchTree (new Dependencies.WorkflowRepoFiles, wired in cmd/hive), or {files} for pasted definitions. Returns model + compile result + diagnostics; save: true stores at the next integer version. Audited as workflow_ingest. OpenAPI updated.
  • cmd/workflow-survey — compiles every repo's lifecycle model (lifecycle.json), reports pass/refusal by code.

Corpus result (317 CNCF repos)

Lifecycle models compiled 317 / 317
Refusals 0
inferred-element warnings 1117
Repos with GHA / Tekton 299 / 17

Column counts per model (hive-default is 7): 7 cols × 28, 9 cols × 65, 10 cols × 208, 11 cols × 11, 12 cols × 3, 14 cols × 1, 15 cols × 1.

Tests

TestLifecycleCorpusCompiles (every testdata corpus repo compiles, hive-default states intact, inferred warnings present), post-merge chain + citations, empty-repo parity, ReadTree selection, API (files/repo/guards/version bump), cmd/hive fetcher. Vocabulary-completeness test extended. golangci-lint clean.

Next

P3b: Settings → Workflows tab (library · ingest form · read-only diagram), then P4 editor.

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: workflowmodel/p1-compiler

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

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intent alignment (head 7ecc5c8): the diff implements what the body claims — ingest.Lifecycle composes hive-default + ingested pipelines (src/pkg/workflowmodel/ingest/lifecycle.go:29-98), owner-gated POST /api/workflows/ingest with {repo}/{files}, next-integer-version save and workflow_ingest audit (src/pkg/dashboard/api_workflows_ingest.go:35-118), pipeline.status reports unknown (src/pkg/stageengine/workflow.go:279-281), survey compile stats. No scope creep. Approving.

One advisory, non-blocking:

  • dashboard/openapi.json documents 503 as "No forge client", but src/cmd/hive/main.go:1090 always wires WorkflowRepoFiles, so the handler's 503 branch (api_workflows_ingest.go:67-70) is only reachable in tests. A hive without a GitHub client gets 502 fetch owner/name: no GitHub client from src/cmd/hive/workflow_ingest.go:22-25 instead. Either drop "No forge client" from the 503 description, or reuse the existing github.ErrNoGitHubClient sentinel (already returned by FetchDefaultBranchTree, src/pkg/github/complexity_source.go:29-31) and map it to 503 in the handler.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Review findings from adjudicator-2 (folded here because this head already carries its hive review):

Security perspective (read at head 7ecc5c8). Owner gate (src/pkg/dashboard/api_workflows_ingest.go:37, 403 test present), 1 MiB body cap via decodeBody, store name/version regex in store.Save (store.go:110-118), and the tarball extractor's traversal/symlink/byte guards (complexity.ExtractTarGz) all check out. One hardening suggestion:

Low — repo is only checked for containing / before it is spliced into GitHub API paths (api_workflows_ingest.go:63). FetchDefaultBranchTree (src/pkg/github/complexity_source.go) does strings.Cut on the first / and formats repos/%s/%s/tarball/%s with no further validation, and DefaultBranch passes it straight to Repositories.Get. go-github resolves the relative path against the base URL, so a name segment like x/../../<other-endpoint> or one containing ?/# lets an owner steer the hive's authenticated GET to a path that is not repos/{owner}/{name}. Exploitability is limited (owner-only, response must decode as a repository with a default_branch, then as a tar.gz), so it is advisory — but the check is cheap and this is the first place user-typed text reaches that fetcher:

		if !workflowRepoRe.MatchString(repo) {
			jsonError(w, "repo must be owner/name", http.StatusBadRequest)
			return
		}

with, at package level:

// workflowRepoRe is a GitHub owner/name pair: no extra slashes, dots-only
// segments, or URL metacharacters that could reshape the API path.
var workflowRepoRe = regexp.MustCompile(`^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})/[A-Za-z0-9_.-]{1,100}$`)

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness review (head 7ecc5c8). No blocker; one low-severity race worth closing before P3b builds a UI on this endpoint.

Concurrent save: true ingests of the same name silently overwrite each other

src/pkg/dashboard/api_workflows_ingest.go:104-115 computes nextWorkflowVersion(st, name) and then calls st.Save(...) as two separate store calls. Store.Save (src/pkg/workflowmodel/store/store.go:263-275) does not refuse an existing name@version — it writeAtomics over the file and replaces the index entry. So two owner requests racing on the same name both read max=N, both save N+1, and the first model is lost with a 201 returned for both. Owner-gated, so low likelihood, but it's the only write path in the PR that assigns versions by read-then-write.

Suggested fix — serialize the allocate+save window in the handler:

--- a/src/pkg/dashboard/api_workflows_ingest.go
+++ b/src/pkg/dashboard/api_workflows_ingest.go
@@
 	"strconv"
 	"strings"
+	"sync"
 	"time"
@@
 const workflowIngestTimeout = 2 * time.Minute
+
+// workflowIngestSaveMu makes "next free version" + Save one step; the store
+// replaces an existing name@version rather than refusing it.
+var workflowIngestSaveMu sync.Mutex
@@
 	st := s.workflowStore(w)
 	if st == nil {
 		return
 	}
+	workflowIngestSaveMu.Lock()
+	defer workflowIngestSaveMu.Unlock()
 	version, err := nextWorkflowVersion(st, m.Metadata.Name)

Advisory (no change requested)

ingest.Lifecycle (src/pkg/workflowmodel/ingest/lifecycle.go:93-105) appends merged → main-ci → … → done transitions but leaves hive-default's merged as StateFinal in a Terminal: true column (hivedefault.go:137,170), unlike Bind which demotes Merged to sequential when a post-merge chain exists (defaults.go:139-141). The compiler permits exits from terminal states and pipeline.status is always unknown, so there's no behavioral effect today — but once post-merge observation lands, items would be both "terminal" and expected to move. Worth a comment or a decision in P3b/P4.

Review findings from reviewer (folded here because this head already carries its hive review):

Style/maintainability pass at head 7ecc5c8. No in-scope blockers; one adjacent concern worth fixing in the stack.

Out of scope for this PR, but lands with the stack: src/cmd/workflow-survey/workflow-survey is a tracked 4.4 MB executable (mode 100755) at this head and at the merge-base 0812411, and it is absent on v5. It was introduced earlier in the P0–P2 stack, not here, but it will reach v5 when the stack merges. Please git rm --cached src/cmd/workflow-survey/workflow-survey and add cmd/workflow-survey/workflow-survey to src/.gitignore in whichever PR introduced it.

Nits (in scope)

  1. src/pkg/dashboard/api_workflows_ingest.go:89-99 re-assembles the same compile response as handleWorkflowCompile (api_workflows.go:102-110): compiled/nil-safe diagnostics/optional profile. A small shared helper keeps the two endpoints' shapes from drifting:
    // compileResponse is the common shape of /compile and /ingest.
    func compileResponse(m *workflowmodel.Model) map[string]interface{} {
    	p, diags, err := workflowmodel.Compile(m)
    	if diags == nil {
    		diags = []workflowmodel.Diagnostic{}
    	}
    	resp := map[string]interface{}{"compiled": err == nil, "diagnostics": diags}
    	if p != nil {
    		resp["profile"] = p
    	}
    	return resp
    }
  2. api_workflows_ingest.go:127 — max := 0 shadows the Go builtin max; highest reads better.
  3. api_workflows_ingest.go:85 hardcodes Forge: "github.com" while cmd/workflow-survey/main.go:33 has defaultForge = "github.com". Consider a workflowmodel constant both can use.

Hive filed review findings that do not block this PR as backlog items:

Cap: 3 backlog item(s) per PR.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read the P3a diff against its base workflowmodel/p1-compiler at 2b97f5b (the #17648 head), plus defaults.go, compile.go, hivedefault.go, stageengine/workflow.go and github/complexity_source.go. The model composition, compiler wiring and API handler hold together; one small verified gap and one forward-looking question.

What I verified

  • Lifecycle only appends guards of kind environment-approval (ingest/lifecycle.go:71-75); Repository only ever emits that kind (defaults.go:131), so no GuardRef on the post-merge transitions dangles. The chain ends in the ingested done state (defaults.go:147), whose StateFinal type makes its column terminal (lifecycle.go:92).
  • pipeline.status is declared in workflowmodel.Facts (lifecycle.go:191) so compiler.predicate accepts the new event, and stageengine/workflow.go:279-281 returns "unknown" so the transition never fires — matches the body's "honest rather than invented".
  • POST /api/workflows/ingest is owner-gated before the body is decoded (api_workflows_ingest.go:36), the repo string is re-validated as owner/name inside FetchDefaultBranchTree (complexity_source.go:32-35), the tarball lands in a fresh MkdirTemp with Cleanup deferred in cmd/hive/workflow_ingest.go:31, and ReadTree only follows regular files (tree.go:48), so a symlink in the archive cannot pull host files into the model. No shell-out, no path from request to filesystem write.
  • nextWorkflowVersion tolerates ErrNotFound for a new name and ignores non-integer versions (api_workflows_ingest.go:122-133).

One low-severity finding

ingest/tree.go:13-14 says a tree past MaxTreeFiles "is reported, not read to exhaustion", but nothing reports it: tree.go:48 silently skips every further YAML once len(files) >= 2000, ReadTree returns no indication, and MaxTreeFiles has no other reference in the tree. Consequence: on a monorepo over the cap, the ingested model compiles cleanly with pipelines missing and Coverage.Files under-counted, and neither the API response nor the survey shows that truncation happened. Either a Finding with a new code, or a returned truncated bool the handler surfaces, would make the comment true. (Separately, the walk keeps descending after the cap; harmless, just wasted I/O.)

Open question, not a finding: Lifecycle leaves merged as StateFinal in a Terminal: true column (hivedefault.go:137,170) and then adds transitions out of it (lifecycle.go:94); TestLifecyclePostMergeChain asserts p.Terminal[merged] stays true. DeriveFromModel in the same stack does the opposite — it flips Merged to StateSequential before appending the chain (defaults.go:140-141). Today it makes no difference because pipeline.status is always unknown, but once post-merge runs are observed, modelDeriver.decisionFor (stageengine/workflow.go:131-133) will still return Terminal at merged for the ingested lifecycle, so the chain stays unreachable on this path while it becomes reachable on the P2 path. Worth deciding now which is intended, since P3b renders these columns.

Stacked note: this PR's merge-base is #17648's current head, which carries a changes-requested hive verdict; nothing here depends on how that resolves beyond the rebase.

Looks correct to me. I have not approved, labelled, or closed anything.

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

Failing checks:

  • check-failure

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.

Evidence bundle `#17652caaf0d0` sha256:be0e5f2fab898c3d2dd677cf7ef13d5c5a1480dbc1043fca99685c7916d98204 — download from the dashboard or `hivectl review evidence #17652`.

@clubanderson
clubanderson force-pushed the workflowmodel/p3-ingest-lifecycle branch from 7ecc5c8 to 9cb51b1 Compare November 11, 2026 05:55
@clubanderson
clubanderson force-pushed the workflowmodel/p2-store-binding branch from 0812411 to 20438d7 Compare November 11, 2026 05:55
@clubanderson
clubanderson force-pushed the workflowmodel/p3-ingest-lifecycle branch from 9cb51b1 to 5c3b66b Compare November 11, 2026 06:02
@clubanderson
clubanderson changed the base branch from workflowmodel/p2-store-binding to workflowmodel/p1-compiler November 11, 2026 06:02
@clubanderson clubanderson changed the title ✨ workflow models P3a: ingest → lifecycle models, /api/workflows/ingest, survey compile stats (#17620) ✨ workflow models P3a: ingest → lifecycle models, workflows ingest API, survey compile stats Nov 11, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

…rvey compile stats (RFC #17620 P3a)

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>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tree at 5c3b66b, not just the diff: ingest/lifecycle.go, hivedefault/hivedefault.go, compile.go (exits/roles), store/store.go (Save/checkKey), api_workflows_ingest.go, cmd/hive/workflow_ingest.go, github/complexity_source.go. Looks correct to me; nothing blocking.

What I verified:

  • Edges out of a final state are legal. Lifecycle appends merged → <post-merge> transitions while hivedefault marks merged Type: StateFinal (hivedefault.go:170). compile.go:241-251 only requires non-terminal states to have an exit and never rejects an exit from a terminal, so the chain compiles and merged stays in p.Terminal — which is exactly what TestLifecyclePostMergeChain asserts (lifecycle_test.go:99).
  • No ID collisions. Ingested states are ci/main-ci/release/deploy-*/done; hivedefault's are open/merged/closed plus StateID(stage). The post-merge filter at lifecycle.go:62 drops ci so it isn't re-added as a column.
  • Store path safety. req.Name only reaches disk via st.Save, which runs checkKey (store.go:109-112, [a-z0-9-] regex) before modelPath. Unsaved responses echo it back unvalidated, which is fine.
  • Repo string → no shell. FetchDefaultBranchTree splits on /, hits the REST tarball endpoint and extracts to a temp dir (complexity_source.go:32-68); ReadTree skips non-regular files (so symlinks) and caps at MaxTreeFiles. Owner-gated via requireOwnerRole; body bounded by decodeBody's MaxBytesReader.

Two low notes, not defects:

  1. api_workflows_ingest.go:81 hardcodes Scope{Forge: "github.com"}. Scope.Forge isn't matched on anywhere in workflowmodel/stageengine today, so it's cosmetic, but s.deps.Config.GitHub.Forge() is already how the rest of the dashboard names the host and GHE hives will otherwise store a wrong forge in saved models. Worth a one-liner here or in P3b.
  2. The red Sign-off survives the squash / overlap checks: the PR's single commit is signed off (Signed-off-by: Andrew Anderson), and the overlap is with #17648 by construction (stacked on workflowmodel/p1-compiler). Both should clear once P2 lands and this is retargeted; I don't see anything in the diff causing them.

The body's claims match the code (ingest.Repository untouched; pipeline.status added to the vocabulary at stageengine/workflow.go; OpenAPI updated).

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@clubanderson
clubanderson force-pushed the workflowmodel/p3-ingest-lifecycle branch from eda58d2 to caaf0d0 Compare November 11, 2026 06:10

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against the #17648 head (2b97f5b) plus the code it composes on (workflowmodel/defaults.go Bind, hivedefault.Generate, compile.go, store/store.go, github/complexity_source.go). Looks correct to me; one low-severity note.

Verified

  • ingest.Lifecycle (src/pkg/workflowmodel/ingest/lifecycle.go:30-98) keeps merged as final while appending post-merge transitions out of it — unlike Bind (defaults.go:139-141), which flips it to sequential. The compiler does not reject exits from a terminal state (compile.go:243-251 only checks the reverse), and lifecycle_test.go:99 asserts Terminal[merged] on purpose, so a bound ingested model still derives merged as terminal exactly like hive-default. Intentional, matches the body's "derives exactly like hive-default today"; just noting the asymmetry with Bind for whoever picks up P5 when pipeline.status becomes observable.
  • Post-merge state/column ids (main-ci, release, deploy-<env>, deploy, done) cannot collide with hive-default's state ids (hivedefault.StateID → stage slugs / needs-decision-*) or its column ids (hivedefault.go:37-43).
  • ReadTree skips non-regular files (tree.go:48), so symlinks in a fetched tarball are not followed; skipDirs and MaxTreeFiles bound the walk.
  • nextWorkflowVersion → st.Versions(name) filters the in-memory index (store.go:310-322), never builds a path from the user-supplied name; Save runs checkKey (store.go:241, nameRe excludes / and .) before any write. hive-default as name is refused by IsBuiltin.
  • Request body is capped by decodeBody → http.MaxBytesReader; the forge fetch is bounded by workflowIngestTimeout on top of complexityFetchTimeout.
  • pipeline.status is added to both the fact vocabulary (lifecycle.go:191) and scalarFact (stageengine/workflow.go:279), so TestRulesFactVocabularyIsComplete stays honest.

Low — audit covers only the save path (src/pkg/dashboard/api_workflows_ingest.go:96 returns before :115)

A POST /api/workflows/ingest {repo} without save: true downloads an arbitrary repository's default branch with the hive's App credential (:74) and leaves no audit entry. The body says "Audited as workflow_ingest" and docs/design/workflow-models.md:118 says owner writes are audited, which is true — but this read on the hive's credential is the more interesting event to have a trail for (which repos an owner pointed the hive at). Suggest moving auditFromRequest above the !req.Save return (with e.Key() replaced by the model name), or qualifying the sentence. Not a blocker: the endpoint is owner-gated.

No scope creep beyond the P3a list in the body; ingest.Repository and its goldens are untouched as stated.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit b1627e0 into workflowmodel/p1-compiler Nov 11, 2026
31 of 32 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the workflowmodel/p3-ingest-lifecycle branch November 11, 2026 06:20
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at caaf0d0.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

clubanderson added a commit that referenced this pull request Nov 11, 2026
…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>
clubanderson added a commit that referenced this pull request Nov 11, 2026
…rkflows 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>
hivecommons-hive Bot added a commit that referenced this pull request Nov 11, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. 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