docs: query comments say what each query selects and why, not how it came to be (#6277)
Rewrites the internal/db/queries comments to rule 32 and regenerates dbq, whose doc comments and embedded SQL carry them. The bugs behind the tiered mixes, the md5 order seed, the score bands and the round-robin arms are restated as the constraint each one enforces; counts from one library and stale cross-references are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,7 +70,7 @@ SELECT id, changed_at, scope, action, changes
|
||||
LIMIT $1
|
||||
`
|
||||
|
||||
// Newest first; consumed by the metrics trend view (#1251) to annotate
|
||||
// Newest first; consumed by the metrics trend view to annotate
|
||||
// knob turns on the timeline.
|
||||
func (q *Queries) ListTuningAudit(ctx context.Context, limit int32) ([]RecommendationTuningAudit, error) {
|
||||
rows, err := q.db.Query(ctx, listTuningAudit, limit)
|
||||
@@ -279,8 +279,8 @@ type UpsertDiscoverTuningDefaultsParams struct {
|
||||
SnoozeDays float64
|
||||
}
|
||||
|
||||
// Boot reconcile for the Discover scope (#2377). Never overwrites
|
||||
// operator-tuned values, same contract as the other two.
|
||||
// Boot reconcile for the Discover scope. Never overwrites
|
||||
// admin-tuned values, same contract as the other two.
|
||||
func (q *Queries) UpsertDiscoverTuningDefaults(ctx context.Context, arg UpsertDiscoverTuningDefaultsParams) error {
|
||||
_, err := q.db.Exec(ctx, upsertDiscoverTuningDefaults, arg.TagOverlapWeight, arg.SnoozeDays)
|
||||
return err
|
||||
@@ -341,10 +341,10 @@ type UpsertWeightProfileDefaultsParams struct {
|
||||
ContextTimeWeight float64
|
||||
}
|
||||
|
||||
// Recommendation tuning lab queries (#1250). Seeding happens via the
|
||||
// Recommendation tuning lab queries. Seeding happens via the
|
||||
// recsettings boot reconcile; shipped defaults live in Go only.
|
||||
// Boot reconcile: insert the shipped defaults for a profile if the row
|
||||
// doesn't exist yet. Never overwrites operator-tuned values.
|
||||
// doesn't exist yet. Never overwrites admin-tuned values.
|
||||
func (q *Queries) UpsertWeightProfileDefaults(ctx context.Context, arg UpsertWeightProfileDefaultsParams) error {
|
||||
_, err := q.db.Exec(ctx, upsertWeightProfileDefaults,
|
||||
arg.Profile,
|
||||
|
||||
Reference in New Issue
Block a user