Repository navigation
✨ workflow models P1: lifecycle schema, compiler, hive-default generator, DeriveFromModel (#17620) - #17639
✨ workflow models P1: lifecycle schema, compiler, hive-default generator, DeriveFromModel (#17620)#17639clubanderson wants to merge 2 commits into
Conversation
…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>
|
[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. |
|
Merge-state is 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
RFC #17620, phase 1 of 7. Stacked on #17630 (retarget to
v6after it merges).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.