Skip to content

✨ review: add review.shadow to record would_have_held for the review gate - #12337

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
takeover/12158-review-shadow
Oct 16, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
takeover/12158-review-shadow

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Closes #12104

Adds review.shadow (default false). When on, the review-approval gate is evaluated as require_approval would (including the artifact-unavailable case) but the PR stays merge-eligible; shadow.review_gate.would_have_held + reason/confidence is recorded on the evidence bundle and an audit log line is emitted. require_approval: true still blocks. Nothing here can block a merge.

Behavior note (intent.shadow): writeIntentShadow now uses the shared writeShadowEvidence helper. When evidence.signing_key_path points at a key that exists but fails to load, the shadow observation is skipped with a Warn instead of being written unsigned (previously it fell back to key = nil), so a misconfigured key can't downgrade a signed bundle to "signed": false. An absent key path/missing key file still records unsigned as before. Covered by changelog.d/changed-12104-intent-shadow-signing-key.md.

Includes dashboard PUT + Settings toggle, docs, changelog fragment, and a table test (shadow on / off / require_approval on). Not run locally per AGENTS.md; CI is the verdict.

— hive: backend=copilot model=claude-sonnet-5.5


🐝 Hive Agent: contributor | SHA: ccd1e5722


Supersedes #12158 (taken over to finish rebase/CI; original commits by @mrbobbytables and the scanner follow-ups preserved). Beyond the rebase onto v5, the changes are: TestRecordReviewShadowSigningKeyUnusable now writes a malformed key file (a missing file is "no key" by design, so the old fixture never reached the guard); the new Settings toggle drops its inline style="margin-top:10px" to satisfy the style ratchet (.config-toggle already spaces stacked toggles); and the signing-key caveat is documented in review-swarm.md / intent-verification.md plus shadow: false listed in hive.yaml.example (swarm docs-currency notes).

mrbobbytables and others added 5 commits October 16, 2026 07:45
…gate

Hive-Run: #12104
Hive-Plan: RFC #12062 / #12068 shadow-mode gates
Hive-Spec: review-shadow#would-have-held

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
(cherry picked from commit a187caa)
Signed-off-by: Andy Anderson <clubanderson@users.noreply.github.com>
…adow write path

Adds a review.shadow reference in the review config handler so the
Settings parity test sees the new toggle, and a round-trip test for
recordReviewShadow through MergeReviewEvidenceShadow.

Hive-Fix-Attempt: 1/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
Signed-off-by: Andy Anderson <clubanderson@users.noreply.github.com>
…logging

Review follow-ups for #12158 (review.shadow, #12104):

- Branch the review-verdicts.json load warning on require_approval so a
  shadow-only run no longer claims merge eligibility will fail closed.
- Extract writeShadowEvidence, shared by intent.shadow and review.shadow,
  so the two recorders cannot drift again; recordReviewShadow now gets
  the logger==nil fallback and logs confidence like the intent gate.
- When a signing key is configured but unusable, skip the shadow write
  and Warn instead of rewriting a signed bundle as unsigned.
- Record both shadow observations from one eligible block with a shared
  evaluated_at.
- Move the review shadow code to review_shadow.go beside its test, and
  add the dashboard PUT/GET + Settings toggle parity coverage for
  review.shadow.

Hive-Fix-Attempt: 2/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
Signed-off-by: Andy Anderson <clubanderson@users.noreply.github.com>
…w signing-key change

Add review.shadow to the /api/config/review GET response and PUT request
schemas in dashboard/openapi.json so the spec matches what
handleReviewConfigGet/Put emit and accept. Add a changed- changelog fragment
for writeIntentShadow now skipping (Warn) instead of writing unsigned when a
configured signing key fails to load.

Hive-Fix-Attempt: 3/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
Signed-off-by: Andy Anderson <clubanderson@users.noreply.github.com>
…drop the toggle's inline style

- TestRecordReviewShadowSigningKeyUnusable pointed SigningKeyFile at a
  missing file, which LoadSigningKey treats as "no key" (records unsigned
  by design). Write a malformed key so the test exercises the guard that
  skips the write with a Warn.
- The new Settings toggle added an inline style="margin-top:10px", pushing
  operator index.html over the style-ratchet baseline; .config-toggle
  already spaces stacked toggles via margin-bottom, so drop it.
- Document the signing-key caveat in review-swarm.md / intent-verification.md
  and list review.shadow in hive.yaml.example (swarm docs-currency notes).

Signed-off-by: Andy Anderson <clubanderson@users.noreply.github.com>
@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 clubanderson 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 the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 16, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 16, 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
#12158 ✨ review: add review.shadow to record would_have_held for the review gate CONFLICT src/cmd/hive/review_shadow_test.go
src/docs/review-swarm.md
src/pkg/dashboard/static/index.html
#12328 ✨ feat(dashboard): close settings dialog when clicking Save & close with no changes same files src/pkg/dashboard/static/index.html
#12332 ✨ feature: Add cadence templates for quickly setting cadence for all agents (#12300) same files src/pkg/dashboard/static/index.html

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 16, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 55b7bd3 into v5 Oct 16, 2026
74 of 75 checks passed
@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 85247ed.

@kubestellar-prow
kubestellar-prow Bot deleted the takeover/12158-review-shadow branch October 16, 2026 12:00
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] ✨ review: review.shadow — record would_have_held for review-gated merge

2 participants