Skip to content

✨ feature(integration): verify genuine required candidate contexts - #16035

Merged
clubanderson merged 4 commits into
v5from
feat/integration-candidate-required-contexts
Oct 31, 2026
Merged

clubanderson merged 4 commits into
v5from
feat/integration-candidate-required-contexts

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Source-only required-context compatibility

Composes six real technical producers as top-level candidate jobs and adds five read-only governance verifiers for exact ordered members. Signed schema-2 receipts bind actual job/check/App/suite identities, latest attempt and current metadata. Missing, foreign-head, duplicate, skipped and drifted evidence fails closed. Historical receipts remain replayable; documented exact-prefix advancement does not spuriously invalidate metadata.

Uses explicitly pinned upstream pure verifier semantics rather than its advisory checks-writing image wrapper. No copied author-head statuses, impersonated App, bypass, deployment, live dispatch, permission/protection change or enrollment. Producer policy and execution remain OFF. Actual protected-promotion qualification is still mandatory; gate is not an ARM/image receipt.

Validation

CI is the sole verdict; no local repository suites run. Adds generator/DAG, immutable member/metadata, physical job/context, signed-receipt and archived false-green regressions. Draft intentionally prevents premature source merge while full exact-head CI runs. Will mark ready only after technical CI is complete and then verify the native policy replacement before guarded merge.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 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 kellyaa 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

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 31, 2026
@github-actions

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
#16026 🌱 ci: reduce PR critical path without dropping checks same files .github/workflows/integration-technical-v2-ci.yml
.github/workflows/v2-ci.yml

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor
ca204bb

ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blocked

Hive flagged this PR (author @clubanderson, head ca204bbf7202) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 3 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/integration-candidate.yml
    • .github/workflows/integration-technical-v2-ci.yml
    • .github/workflows/v2-ci.yml

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@clubanderson
clubanderson marked this pull request as ready for review October 31, 2026 13:05
@clubanderson
clubanderson requested a review from hanthor as a code owner October 31, 2026 13:05
@kubestellar-prow kubestellar-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 2026
@clubanderson

Copy link
Copy Markdown
Member Author

Verified source-only receipt: immutable HEAD ca204bbf7202e3f910a8b56fde25afc9506dda64; all eleven distinct protected contexts pass and every current-head workflow run is terminal. Full image workflow 41202393072 succeeded including ARM job 124540731855; v2 CI 41202393197 and Tests 41202393101 succeeded. Candidate/materializer contract suite: 16/16 pass, 0 skipped/failed; real pinned helper, unknown-author refusal, fragment isolation and forged-helper-source regressions included.

Native policy old draft refusal 41202392448 is retained history, not removed or bypassed. First ready-event run was normally superseded/canceled; exact-head newer ready-event 41204014111 completed SUCCESS. The stale historical row still makes the PR UI UNSTABLE, but all protected checks and the actual native successor are green. Prospective merged verifier tree independently matches its enrolled literal pin.

No live dispatch, qualification, authority enrollment, permission/protection change, activation or deployment. Producer policy/execution remain OFF. Runtime revision, actual trusted schema-2 candidate production and protected-CAS qualification remain separately required before live use; no throughput claim.

@clubanderson
clubanderson merged commit efc9408 into v5 Oct 31, 2026
88 of 91 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/integration-candidate-required-contexts branch October 31, 2026 13:16
@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

@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.

Decision needed: @hanthor should decide whether the integration-candidate producer may hold id-token: write and publish a GitHub OIDC token as a workflow artifact (.github/integration-candidate.template.yml receipt job), and whether the 11-name required-context list in src/pkg/forgestate/integration_contexts.go is the intended protected set.

Routing to a human rather than judging alone: this PR edits three workflow files, adds a new token permission, and defines the protected-promotion gate's required-context cohort — trust surfaces — and it already carries a <!-- hive-sentinel --> notice. Author @clubanderson is an OWNERS approver.

What I verified in the tree (v5 cf008a5c) and the diff at ca204bbf:

  • v2-ci.yml / integration-technical-v2-ci.yml changes are limited to adding .github/integration-candidate.template.yml to path filters, running test-generate-integration-ci.py after --check, and widening the node test glob to integration-*.test.cjs. No permission or required-check changes there.
  • New permission: the generated receipt job in .github/integration-candidate.template.yml gets contents: read, actions: read, checks: read, id-token: write, mints an OIDC token with audience hive-integration-producer-v1/<sha256 of payload>, and uploads it inside integration-producer-receipt-<attempt> (30-day retention, 0600 file but artifact-readable by anyone with actions: read). The token is core.setSecret-masked in logs. Verification uses the existing JWKS path in src/pkg/github/integration_producer_token.go; the bespoke audience means the token is only meaningful to Hive's verifier. Open question for the approver: is publishing a GitHub-signed OIDC JWT as an artifact an acceptable attestation carrier here?
  • Binding checks: bindCandidateContextReceipt (src/pkg/github/integration_candidate_governance.go) requires each of the 11 contexts to be a unique job/check pair with matching run ID, head SHA, suite ID, app ID (Actions, 15368 in the template), status completed and equal conclusions; VerifyIntegrationCandidateGovernance re-fetches every member PR and recomputes the metadata digest over number/head/base/author/draft/title/body/labels/head-ref hashes, failing closed on drift. Schema-1 receipts short-circuit to nil for replay — intended per the body, but it means v1 receipts bypass the new context binding entirely.
  • Context names: all 11 names in IntegrationRequiredContexts() map 1:1 to name: values of generated jobs in integration-candidate.yml (REQUIRED_CONTEXT_JOBS at the receipt step). DCO here is the Actions job governance-dco, not the probot check of the same name — worth confirming that is what branch protection will be told to require.

Checks: native-queue-policy has one FAILURE and one CANCELLED run alongside a SUCCESS at this head; tide pending. I have no file:line defect to report; the question is one of policy, not correctness.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

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

Trust-surface change — routing to the repository owner rather than judging it alone. I read the diff and the tree at ca204bb; I found no defect, but this PR rewrites required-CI plumbing and workflow permissions, which is a human sign-off every time.

What I verified:

  • .github/workflows/integration-candidate.yml is generated (header line 1) from .github/integration-candidate.template.yml via generate-integration-ci.py; --check runs in required CI (v2-ci.yml:151-153, integration-technical-v2-ci.yml:97-99) and both v2-ci.yml:26 / :111 and the technical twin now re-run on template edits, so the committed YAML cannot silently drift from the template.
  • Trigger is workflow_dispatch only (integration-candidate.yml:5-11); top-level permissions are contents: read, pull-requests: read (:12-14). No pull_request_target, no secrets.* references, no curl | sh, all uses: are SHA-pinned; docker/build-push-action emits an OCI tar (outputs: type=oci,...,dest=/tmp/hive-oci.tar, :666-680), it does not push.
  • The only elevated grant is the finalizer job at :2109-2113 (actions: read, checks: read, id-token: write). It mints an OIDC token with audience hive-integration-producer-v1/<sha256(payload)> and uploads it inside receipt.json as an artifact (:2158-2180). The receipt binds run id, attempt, each required job's jobID/checkID/appID(15368)/suiteID/conclusion, and cross-checks listJobsForWorkflowRunAttempt + checks.listForRef with truncation guards (:2133-2156). This is the same receipt mechanism v1 already used; v2 extends the payload.
  • Go side fails closed: forgestate.IntegrationContextsPassed (src/pkg/forgestate/integration_contexts.go:23-44) requires exactly the 11 named contexts, all success, unique job/check ids, single app+suite; ReadIntegrationCandidateObservation refuses schema-1 receipts once a protected name is in RequiredJobs (integration_candidate_observation.go:252-257) and only calls VerifyIntegrationCandidateGovernance after the context set passes (:302-308).

One body/state mismatch, informational: the body says "Draft intentionally prevents premature source merge … Will mark ready only after technical CI is complete", but the PR is no longer a draft (isDraft: false). If that was deliberate after CI went green, ignore; if not, it should go back to draft until the native-policy replacement step the body describes is done.

Nothing in the diff looked wrong to me. I have not approved, labelled, or changed anything.

Karibhou added a commit to Karibhou/hive that referenced this pull request Oct 31, 2026
…ency pin

hivecommons#16035 composed the gosec Scan job into integration-candidate.yml, so
after rebasing onto it the generator --check (build-and-test, "Check
readonly candidate CI generation") flagged the candidate as stale. Rerun
generate-integration-ci.py so the composed Scan step carries
-concurrency 4 too.

Refs hivecommons#16040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
kubestellar-prow Bot pushed a commit that referenced this pull request Nov 2, 2026
…16045)

* 🐛 fix(ci): bound gosec concurrency so Scan stops losing its runner

gosec v2.29.0 defaults -concurrency to runtime.NumCPU(). Inside a
self-hosted runner pod that is the node's 32 vCPUs, not the pod's 6-CPU
limit, and every worker type-checks and builds SSA for its own package.
Thirty-two of those at once push the pod far past its 3Gi request on an
overcommitted node, and it is killed mid-Scan: "The self-hosted runner
lost communication with the server", logs BlobNotFound.

Evidence: in the four failing jobs cited by the issue (124530335184,
124538397043, 124527124413, 124542607459) the job died in the Scan step
every time, on four different runner pods, while the green runs finish
Scan in about four minutes.

Pin -concurrency 4 (at or below the runner CPU limit), regenerate the
integration twin, and add a workflow contract asserting both gosec
invocations pass an explicit -concurrency no higher than the runner
container CPU limit in hive-runners-lke-values.yaml.

Fixes #16040

Hive-Run: #16040
Hive-Plan: issue-16040 asks 1-2 (runner-side evidence, gosec resource profile)
Hive-Spec: issue-16040#ask-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HRH6kn7bGF1abH5x72U7zL
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>

* 🐛 fix(ci): regenerate integration-candidate.yml for the gosec concurrency pin

#16035 composed the gosec Scan job into integration-candidate.yml, so
after rebasing onto it the generator --check (build-and-test, "Check
readonly candidate CI generation") flagged the candidate as stale. Rerun
generate-integration-ci.py so the composed Scan step carries
-concurrency 4 too.

Refs #16040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>

---------

Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant