← Back to Pull requests

docs(client): name the methods that check RecipeResult ownership #3396

Closed
unknown closed this pull request without merging on Oct 26, 2026 17:28 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 22:23 UTC
Author

Summary

Corrects the RecipeResult ownership docs from #3364: the bundle, validate, preflight, and evidence methods reject an unowned result, and Client.MirrorInventory accepts one by design. Comment and doc text only.

Motivation / Context

#3364 wrote that "every Client method that consumes a result" rejects an unowned result. MirrorInventory never calls assertOwns, and aicr mirror depends on that by passing WrapResolved(rec) to it. Read as an invariant, the old wording invites adding assertOwns to MirrorInventory for consistency, which would break every aicr mirror run. Raised in a review round on #3364 after it merged.

Fixes: #3395
Related: #3364

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundler and deployers (pkg/bundler, pkg/component)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: SDK facade comments (pkg/client/v1)
  • Implementation Notes

    Four places, same wording: docs/integrator/go-library.md (the WrapResolved paragraph), the owner field doc in pkg/client/v1/types.go, and the assertOwns and ResolveRecipe stamp comments in pkg/client/v1/aicr.go. No code path changes; MirrorInventory already accepts an unowned result and keeps doing so.

    Testing

    gofmt -l pkg/client/v1
    go build ./pkg/client/v1/
    golangci-lint run -c .golangci.yaml ./pkg/client/v1/...
    make check-docs-filenames check-docs-mdx check-docs-mdx-parse check-docs-yaml check-docs-shell check-docs-links
    

    All pass: gofmt clean, build ok, lint 0 issues, six docs checks OK. Full make qualify was skipped: the diff is Go comments and Markdown only, so tests, e2e, and Go lint cannot regress. The lychee link check runs in CI on docs/ changes.

    Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • Rollout notes:** N/A, documentation and comments only.

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info
  • Diff: 383 lines (+287 / -96) across 4 files Reviewer: yuanchen8911 Review duration: 4025m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 383 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3396"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.0% (MEDIUM) · Higher = larger blast radius
    43.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%
    Repository