feat: automate // Written by: annotation sync #8282
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 250 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.331
Real PR Conversation Timeline
1 comments
"Review active on #8282"
general
weight: 0.35
machi1990
What
Add tooling to automate maintenance of
// Written by:annotations on Cosmos struct fields inarohcp-cosmos-client/api/.Why
These annotations are currently maintained by hand in every PR that adds or modifies a controller's field writes. This causes merge conflicts and maintenance burden as the controller count grows (219 annotations across 16 files today). See review discussion.
How
Two new components, designed to plug into the existing hourly docs-sync cadence:
1. Generation prompt (
docs/prompts/written-by-annotations.md) — instructs the AI agent to analyze every controller and frontend handler, then output a structured JSON mapping of which actors write which Cosmos struct fields. Output:docs/generated/written-by-mapping.json.2. Codegen tool (
hack/writtenby/main.go) — reads the JSON mapping, parses Go source files withgo/ast, and updates or adds// Written by:comments. Writers are sorted alphabetically for deterministic output. Flags:-mapping,-api,-dry-run.This PR also includes:
docs/generated/written-by-mapping.jsonextracted from the 217 existing annotationsgo.workupdated to include the newhack/writtenbymoduleVerification
go build ./hack/writtenby/passesgo vet ./hack/writtenby/...passesIntegration
The intended workflow on the existing hourly bot cadence:
1. Bot runs the
written-by-annotations.mdprompt → regenerateswritten-by-mapping.json2. Bot runs
go run ./hack/writtenby/→ updates annotations in source3. If any changes → bot opens a PR (same pattern as PR #7878 for docs sync)
---
AI-generated. Review for accuracy.
@machi1990 requested from Slack
Chai persona:
ARO Engineering