Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/added-integration-orchestration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add default-off, explicitly scoped integration orchestration with durable change intents, separate candidate observations, workflow-job accounting, and bounded admission above the existing preparation and GitHub queue authorities.
51 changes: 51 additions & 0 deletions dashboard/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,57 @@
}
],
"paths": {
"/api/integration-orchestration": {
"get": {
"tags": ["System"],
"summary": "Inspect integration coordination evidence and unknowns (owner only)",
"description": "Reports source/schema/runtime identity, configured mode, immutable candidates, canonical intents, live reservations, physical workflow jobs and cohort coverage. This ledger never authorizes merges or substitutes integration evidence for author review.",
"responses": {
"200": {"description": "Configuration and ledger, or explicit unavailable/unknown state"},
"403": {"description": "Owner role required"}
}
}
},
"/api/config/integration-orchestration": {
"put": {
"tags": ["System"],
"summary": "Replace bounded integration orchestration configuration (owner only)",
"description": "Full off|advisory|enforce configuration with exact repository/base scopes, static execution/admission budgets, bounded lease/window/age/retries and optional pinned workflow contracts. JSON durations use nanoseconds. Disabling is independent of evidence-store availability and never releases authoritative claims/native entries.",
"requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}},
"responses": {
"200": {"description": "Validated effective configuration"},
"400": {"description": "Invalid mode, scope, contract or bounds"},
"403": {"description": "Owner role required"},
"500": {"description": "Configuration could not be persisted"},
"503": {"description": "Enforcement ledger unavailable; disable remains permitted"}
}
}
},
"/api/integration-orchestration/intents": {
"post": {
"tags": ["System"],
"summary": "Record a versioned canonical change intent (owner only)",
"description": "Requires canonical work identity, exact enrolled destination, monotonically increasing generation, plan/node/revision, anticipated scope and provenance. Enforceable prerequisites must match the complete bound approved plan DAG; semantic and same-file hints never grant authority.",
"requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}},
"responses": {
"200": {"description": "Durably recorded intent"},
"400": {"description": "Malformed intent or unenrolled scope"},
"403": {"description": "Owner role required"},
"409": {"description": "Unapproved dependencies, generation conflict, cycle or unavailable journal"}
}
}
},
"/api/integration-orchestration/reconcile": {
"post": {
"tags": ["System"],
"summary": "Reconcile a bounded workflow observation batch (owner only)",
"responses": {
"200": {"description": "Batch observed or minimum interval not elapsed; inspect per-scope completeness"},
"403": {"description": "Owner role required"},
"503": {"description": "Authoritative workflow observations unavailable"}
}
}
},
"/api/audit": {
"get": {
"tags": [
Expand Down
11 changes: 10 additions & 1 deletion src/cmd/hive/claimswire.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

import (
Expand Down Expand Up @@ -194,11 +194,20 @@
// installClaimAdmissionCheck gates every automated ledger producer on current
// labels, including renewals and forced takeovers. Resolve the client per call
// because App setup can finish after boot.
func installClaimAdmissionCheck(ctx context.Context, ledger *claims.Ledger, client func() *github.Client) {
func installClaimAdmissionCheck(ctx context.Context, ledger *claims.Ledger, client func() *github.Client, integrationCheck ...func(string, int) string) {
if ledger == nil || client == nil {
return
}
ledger.SetAdmissionCheck(func(req claims.Request) (string, error) {
if _, held := ledger.Lookup(req.Repo, req.Issue); !held && !req.PRStarted {
for _, check := range integrationCheck {
if check != nil {
if reason := check(req.Repo, req.Issue); reason != "" {
return reason, nil
}
}
}
}
ctx, cancel := context.WithTimeout(ctx, claimsGitHubTimeout)
defer cancel()
gh := client()
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/hive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@ func (b *boot) bootDashboardAPIWith(deps bootDashboardAPIDeps) {
b.dashSrv.InstallClaimHooks(gfiClaimHooks(b.ctx, b.cfg, b.gfiState(), ghClientFn, b.dashSrv, b.logger,
githubClaimHooks(b.ctx, b.cfg, ghClientFn, b.logger)))
b.dashSrv.SetGoodFirstIssueStats(func() any { return b.gfiState().sweeper.Stats() })
installClaimAdmissionCheck(b.ctx, b.issueClaims, func() *github.Client { return b.ghClient })
installClaimAdmissionCheck(b.ctx, b.issueClaims, func() *github.Client { return b.ghClient }, b.dashSrv.IntegrationClaimBlockReason)
releaseClaimsOnAgentRelaunch(b.agentMgr, b.dashSrv.IssueClaims, b.logger)
installContributorClaimGuard(b.cfg, b.dashSrv, b.logger)
// Forge App tab inventory: the resolved active key path and the per-app-id
Expand Down
4 changes: 4 additions & 0 deletions src/cmd/hive/main_eval_cycle.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

import (
Expand Down Expand Up @@ -939,6 +939,10 @@
// policy, dashboard status, PR/review dispatch, escalation, and every path
// not explicitly enrolled.
kickActionable := applyConvergenceKickAdmission(cfg, dashSrv, actionable, notifier, logger)
if err := dashSrv.ReconcileIntegration(ctx); err != nil {
logger.Warn("integration observations incomplete", "error", err)
}
kickActionable = dashSrv.IntegrationKickAdmission(kickActionable)

sched.SetLastActionable(kickActionable)
// The filter compacts agentsDue in place, so snapshot it first to report
Expand Down
22 changes: 12 additions & 10 deletions src/cmd/hive/main_sweeps.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,18 @@ func runAutoMergeSweepIfDue(ctx context.Context, ghClient *github.Client, cfg *c
ctx, sweepSpan := tracing.StartSpan(ctx, "governor.automerge")
defer sweepSpan.End()
opts := automerge.Options{
Logger: logger,
MergerAuthorizer: trustedMergerFunc(cfg),
HumanChangeRequests: review.DefaultHumanChangeRequests(),
TrustedAuthorizer: trustedAuthorFunc(cfg),
TrustedAuthorPolicy: trustedAuthorPolicyFunc(cfg),
ContributorLanePolicy: contributorLanePolicyFunc(cfg),
ContributorLaneVerdict: contributorLaneVerdictFunc(cfg, logger),
ContributorRegistryTier: contributorRegistryTierFunc(),
StageLabelPolicy: stageLabelPolicyFunc(cfg),
StageEngine: stageEngineOptions(cfg, logger),
IntegrationAdmission: dashSrv.IntegrationNativeAdmission,
IntegrationFilesObserved: dashSrv.IntegrationObserveFiles,
Logger: logger,
MergerAuthorizer: trustedMergerFunc(cfg),
HumanChangeRequests: review.DefaultHumanChangeRequests(),
TrustedAuthorizer: trustedAuthorFunc(cfg),
TrustedAuthorPolicy: trustedAuthorPolicyFunc(cfg),
ContributorLanePolicy: contributorLanePolicyFunc(cfg),
ContributorLaneVerdict: contributorLaneVerdictFunc(cfg, logger),
ContributorRegistryTier: contributorRegistryTierFunc(),
StageLabelPolicy: stageLabelPolicyFunc(cfg),
StageEngine: stageEngineOptions(cfg, logger),
}
syncStageEngineMode(cfg, ghClient, logger)
// hivecommons/hive#12436: the contribute hub is the stage-072 nudge sink
Expand Down
Loading
Loading