← Back to Pull requests

Greenfield: Triage judgement queue and finalize direct KRM types and identity for SecuritycenterEventThreatDetectionCustomModule #16782

Closed
unknown closed this pull request without merging on Nov 30, 2026 03:55 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 01:23 UTC
Author

This pull request was generated by an AI coding agent.

Triage apis/securitycenter/judgement_queue.yaml and finalize direct KRM types, identity, references, CRD, and controller for SecuritycenterEventThreatDetectionCustomModule (securitycenter.cnrm.cloud.google.com/v1alpha1) following Greenfield Step 1b:

1. Multi-Parent Scoping:
- google.cloud.securitycenter.v1.EventThreatDetectionCustomModule supports three parent patterns (projects/{project}/..., folders/{folder}/..., organizations/{organization}/...).
- Added optional ProjectRef, FolderRef, and OrganizationRef on SecuritycenterEventThreatDetectionCustomModuleSpec with a CEL validation rule requiring exactly one parent.
- Resolved identity-multi-pattern as edited.

2. Server-Generated ID:
- Confirmed CreateEventThreatDetectionCustomModuleRequest has no ID parameter and the proto specifies event_threat_detection_custom_module.name is ignored and server-generated.
- Verified SecuritycenterEventThreatDetectionCustomModuleIdentity implements identity.ServerGeneratedIdentity.
- Resolved identity-server-generated-id as accepted.

3. Judgement Queue Triage:
- Triaged root spec definition and resolved untriaged-bulk-generation as edited.

4. Generation & Verification:
- Ran apis/securitycenter/generate.sh to regenerate CRD, deepcopy, identity, and reference files.
- Added unit tests in securitycentereventthreatdetectioncustommodule_identity_test.go verifying parsing, formatting, and resolution across all three root parents and server-generated status resolution.
- Added common.NormalizeGreenfieldReferences in AdapterForObject.
- Verified TestFocusedMappers passes for SecuritycenterEventThreatDetectionCustomModule.
- Updated tests/apichecks/testdata/exceptions/alpha-missingfields.txt.
- Documented learnings in .gemini/journals/securitycenter.md.

Fixes #16777

``release-note
NONE
`

Review Instructions

Use .gemini/skills/reviewgen-greenfield-new-types/SKILL.md to conduct the review.

KCC Greenfield Step 2 (Judgement Queue) Auto-Review Results


Trigger criteria matched: Yes
Judgement Queue Completeness: Pass - (
untriaged-bulk-generation and all actionable entries for SecuritycenterEventThreatDetectionCustomModule resolved, no entries deleted, no leftover +kcc:guess markers)
Queue Resolution Accuracy: Pass - (Multi-parent modeled with optional
projectRef, folderRef, and organizationRef with CEL one-of rule; server-generated ID confirmed via Create RPC lacking ID parameter)
Parent, Identity & References: Pass - (Multi-parent identity generated via controllerbuilder generate-identity, conformance verified with identity.AssertConformance, unit tests added for all root scopes)
Unflagged Proto-vs-KRM Audit & Struct Isolation: Pass - (All primitive fields properly typed with pointers, no unflagged references, observed state properly modeled)
Generated Files, Pre-Existing Controller/Fuzzer Sync, &
BLOCKED_KINDS: Pass - (CRD, deepcopy, identity, and references in sync; controller and fuzzer compile and pass TestFocusedMappers; SecuritycenterEventThreatDetectionCustomModule preserved in BLOCKED_KINDS; missingrefs.txt` untouched)

Detailed Findings / Actions Required:


None. All Greenfield Step 1b types judgement criteria and invariants are satisfied.

<sub>🤖 Agent session</sub>

<!-- factory:task-output kind=Change task=recipe-fix-20261130-002720-96d1 -->

Diff: 457 lines (+342 / -115) across 5 files Reviewer: reviewbot-robot Review duration: 152m
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.69) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 457 lines diff across 5 files
0.69
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%
56%
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.367
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #16782"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed sensitive_module
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: 68.7% (HIGH) · Higher = larger blast radius
68.7%
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: 56.8% · Lower = rushed or shallow review
56.8%
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: 29.7% · Safe to merge
29.7%