From 0221b14269080212ca8d4bdaf761514db5868c40 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:02:18 -0400 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20fix:=20measure=20empty-diff?= =?UTF-8?q?=20head=20age=20from=20the=20head=20commit,=20not=20updated=5Fa?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../fixed-15603-empty-diff-head-age.md | 1 + .../github/pr_empty_diff_hive_autoclose.go | 31 ++++++++++++++++--- .../pr_empty_diff_hive_autoclose_test.go | 13 ++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 changelog.d/fixed-15603-empty-diff-head-age.md diff --git a/changelog.d/fixed-15603-empty-diff-head-age.md b/changelog.d/fixed-15603-empty-diff-head-age.md new file mode 100644 index 0000000000..cb63c67b7b --- /dev/null +++ b/changelog.d/fixed-15603-empty-diff-head-age.md @@ -0,0 +1 @@ +- Empty-diff autoclose now measures head age from the head commit instead of `updated_at`, which labels and comments bump ([#15603](https://github.com/hivecommons/hive/issues/15603)) diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose.go b/src/pkg/github/pr_empty_diff_hive_autoclose.go index baeee60072..04e06aafa9 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose.go @@ -76,8 +76,8 @@ type HiveEmptyDiffAutoCloseFacts struct { // complete file list; DiffFiles is its length. DiffKnown bool DiffFiles int - // HeadAge is now minus the PR's last update (or creation when GitHub - // reports no update). + // HeadAge is now minus the head commit's committer date (the PR's last + // update, or creation, when the commit date is unavailable). HeadAge time.Duration // Level is the repo's ACMM level; own-PR closes need L6 like the // superseded rule. @@ -187,7 +187,7 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string HiveAuthored: identity.Matches(safeGetLogin(pr.GetUser())), Held: c.isHeld(labels) || c.isExempt(labels), KeptOpen: supersessionHasLabel(pr, SupersessionKeepOpenLabel), - HeadAge: emptyDiffHeadAge(pr, time.Now()), + HeadAge: emptyDiffHeadAge(pr, time.Time{}, time.Now()), } if pr.ChangedFiles != nil && *pr.ChangedFiles > 0 { // The GET payload already shows a diff: no compare needed. @@ -198,6 +198,7 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string out.Verdict, out.Reason = DecideHiveEmptyDiffAutoClose(facts) return out, nil } + facts.HeadAge = emptyDiffHeadAge(pr, c.headCommitTime(ctx, owner, name, pr), time.Now()) if !facts.DiffKnown { facts.DiffFiles, facts.DiffKnown = c.prDiffAgainstBase(ctx, owner, name, pr) } @@ -238,8 +239,28 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string return out, nil } -func emptyDiffHeadAge(pr *gh.PullRequest, now time.Time) time.Duration { - at := pr.GetUpdatedAt().Time +// headCommitTime is the head commit's committer date, or the zero time when +// it cannot be read. +func (c *Client) headCommitTime(ctx context.Context, owner, name string, pr *gh.PullRequest) time.Time { + sha := strings.TrimSpace(pr.GetHead().GetSHA()) + if sha == "" { + return time.Time{} + } + commit, _, err := c.client.Repositories.GetCommit(WithRESTCaller(ctx, "hive:empty_diff_head_age"), owner, name, sha, nil) + if err != nil || commit == nil { + return time.Time{} + } + return commit.GetCommit().GetCommitter().GetDate().Time +} + +// emptyDiffHeadAge measures from the head commit's committer date; updated_at +// is bumped by labels and comments, so it only stands in when the commit date +// is unavailable. +func emptyDiffHeadAge(pr *gh.PullRequest, headCommitAt, now time.Time) time.Duration { + at := headCommitAt + if at.IsZero() { + at = pr.GetUpdatedAt().Time + } if at.IsZero() { at = pr.GetCreatedAt().Time } diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go index 1042a87044..c3df782e5a 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go @@ -95,3 +95,16 @@ func TestReviewRedundantOfNumber(t *testing.T) { } } } + +// hivecommons/hive#15603: updated_at is bumped by labels and comments, so a +// recently touched PR with an old head must still count as old. +func TestEmptyDiffHeadAgeUsesHeadCommit(t *testing.T) { + now := time.Date(2026, 10, 29, 12, 0, 0, 0, time.UTC) + pr := &gh.PullRequest{UpdatedAt: &gh.Timestamp{Time: now.Add(-time.Minute)}} + if got := emptyDiffHeadAge(pr, now.Add(-time.Hour), now); got != time.Hour { + t.Fatalf("head age = %v, want 1h from the head commit", got) + } + if got := emptyDiffHeadAge(pr, time.Time{}, now); got != time.Minute { + t.Fatalf("head age = %v, want 1m from updated_at fallback", got) + } +} From e1f52010b7b419e6ba8546cbd8c02ce259295950 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 01:53:36 -0400 Subject: [PATCH 2/4] fix: floor empty-diff head age at the PR's created_at Measuring from the head commit's committer date dropped the implicit just-opened grace period: a PR opened from a branch whose head commit was already older than EmptyDiffMinHeadAge was eligible for autoclose on the first sweep. The age is now never older than the PR itself. Also drop the dead HeadAge seed before the cheap guards (no guard there reads it) and log when the head commit cannot be read, so the updated_at fallback is visible instead of silently masking the regression this rule fixes. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../github/pr_empty_diff_hive_autoclose.go | 23 +++++++++++++------ .../pr_empty_diff_hive_autoclose_test.go | 17 ++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose.go b/src/pkg/github/pr_empty_diff_hive_autoclose.go index 04e06aafa9..ee1ac1605e 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose.go @@ -187,7 +187,6 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string HiveAuthored: identity.Matches(safeGetLogin(pr.GetUser())), Held: c.isHeld(labels) || c.isExempt(labels), KeptOpen: supersessionHasLabel(pr, SupersessionKeepOpenLabel), - HeadAge: emptyDiffHeadAge(pr, time.Time{}, time.Now()), } if pr.ChangedFiles != nil && *pr.ChangedFiles > 0 { // The GET payload already shows a diff: no compare needed. @@ -195,10 +194,11 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string } if !enabled || facts.Merged || facts.Draft || facts.Held || facts.KeptOpen || facts.DiffFiles > 0 { // Cheap guards first: no compare for a PR the rule cannot touch. + // Every guard here decides before the rule reads HeadAge. out.Verdict, out.Reason = DecideHiveEmptyDiffAutoClose(facts) return out, nil } - facts.HeadAge = emptyDiffHeadAge(pr, c.headCommitTime(ctx, owner, name, pr), time.Now()) + facts.HeadAge = emptyDiffHeadAge(pr, c.headCommitTime(ctx, repo, owner, name, pr), time.Now()) if !facts.DiffKnown { facts.DiffFiles, facts.DiffKnown = c.prDiffAgainstBase(ctx, owner, name, pr) } @@ -240,14 +240,22 @@ func (c *Client) CloseEmptyDiffHivePRIfEligible(ctx context.Context, repo string } // headCommitTime is the head commit's committer date, or the zero time when -// it cannot be read. -func (c *Client) headCommitTime(ctx context.Context, owner, name string, pr *gh.PullRequest) time.Time { +// it cannot be read (logged, since the caller then falls back to updated_at). +func (c *Client) headCommitTime(ctx context.Context, repo, owner, name string, pr *gh.PullRequest) time.Time { sha := strings.TrimSpace(pr.GetHead().GetSHA()) if sha == "" { return time.Time{} } commit, _, err := c.client.Repositories.GetCommit(WithRESTCaller(ctx, "hive:empty_diff_head_age"), owner, name, sha, nil) if err != nil || commit == nil { + if c.logger != nil { + msg := "nil commit" + if err != nil { + msg = err.Error() + } + c.logger.Warn("empty-diff auto-close: head commit unreadable; measuring head age from updated_at", + slog.String("repo", repo), slog.Int("pr", pr.GetNumber()), slog.String("sha", sha), slog.String("error", msg)) + } return time.Time{} } return commit.GetCommit().GetCommitter().GetDate().Time @@ -255,14 +263,15 @@ func (c *Client) headCommitTime(ctx context.Context, owner, name string, pr *gh. // emptyDiffHeadAge measures from the head commit's committer date; updated_at // is bumped by labels and comments, so it only stands in when the commit date -// is unavailable. +// is unavailable. The age never exceeds the PR's own age: a PR just opened +// from an old branch is still a just-opened PR whose commits may be arriving. func emptyDiffHeadAge(pr *gh.PullRequest, headCommitAt, now time.Time) time.Duration { at := headCommitAt if at.IsZero() { at = pr.GetUpdatedAt().Time } - if at.IsZero() { - at = pr.GetCreatedAt().Time + if created := pr.GetCreatedAt().Time; !created.IsZero() && created.After(at) { + at = created } if at.IsZero() { return 0 diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go index c3df782e5a..85b130ba6e 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go @@ -107,4 +107,21 @@ func TestEmptyDiffHeadAgeUsesHeadCommit(t *testing.T) { if got := emptyDiffHeadAge(pr, time.Time{}, now); got != time.Minute { t.Fatalf("head age = %v, want 1m from updated_at fallback", got) } + // A PR just opened from an old branch: its head commit predates the PR, + // so the age is the PR's own age and the just-opened grace period holds. + justOpened := &gh.PullRequest{ + CreatedAt: &gh.Timestamp{Time: now.Add(-2 * time.Minute)}, + UpdatedAt: &gh.Timestamp{Time: now.Add(-time.Minute)}, + } + if got := emptyDiffHeadAge(justOpened, now.Add(-time.Hour), now); got != 2*time.Minute { + t.Fatalf("head age = %v, want 2m floored at created_at", got) + } + // A head commit pushed after the PR opened measures from the commit. + if got := emptyDiffHeadAge(justOpened, now.Add(-90*time.Second), now); got != 90*time.Second { + t.Fatalf("head age = %v, want 90s from the head commit", got) + } + // No commit date and no created_at: updated_at still stands in. + if got := emptyDiffHeadAge(&gh.PullRequest{}, time.Time{}, now); got != 0 { + t.Fatalf("head age = %v, want 0 with no timestamps", got) + } } From ba2a98ac5c983b1969208cd3367bb3ea72ed97b7 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 02:26:48 -0400 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20fix:=20floor=20the=20empty-d?= =?UTF-8?q?iff=20head=20age=20at=20created=5Fat;=20drop=20the=20extra=20Ge?= =?UTF-8?q?tCommit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The head-commit measurement landed on v5 via #15671 (the compare's newest commit sets HeadAge). What this PR still adds is the created_at floor: a PR just opened from an old branch is a just-opened PR whose commits may be arriving, so its age never exceeds the PR's own age. The redundant headCommitTime GetCommit round-trip is gone; emptyDiffHeadAge takes the compare's headAt directly. Refs #15603 Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../fixed-15603-empty-diff-head-age.md | 2 +- .../github/pr_empty_diff_hive_autoclose.go | 23 ++++++++++++------- .../pr_empty_diff_hive_autoclose_test.go | 5 ++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/changelog.d/fixed-15603-empty-diff-head-age.md b/changelog.d/fixed-15603-empty-diff-head-age.md index cb63c67b7b..49fcb6f2ee 100644 --- a/changelog.d/fixed-15603-empty-diff-head-age.md +++ b/changelog.d/fixed-15603-empty-diff-head-age.md @@ -1 +1 @@ -- Empty-diff autoclose now measures head age from the head commit instead of `updated_at`, which labels and comments bump ([#15603](https://github.com/hivecommons/hive/issues/15603)) +- Empty-diff autoclose head age is floored at the PR's `created_at`, so a PR just opened from an old branch keeps its just-opened grace period ([#15603](https://github.com/hivecommons/hive/issues/15603)) diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose.go b/src/pkg/github/pr_empty_diff_hive_autoclose.go index 0b0db89aff..c12e4bbcf9 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose.go @@ -105,7 +105,9 @@ type HiveEmptyDiffAutoCloseFacts struct { DiffKnown bool DiffFiles int // HeadAge is now minus the head commit's date when the compare - // reported one, else minus the PR's last update (or creation). + // reported one, else minus the PR's last update (or creation). It + // never exceeds the PR's own age: a PR just opened from an old branch + // is still a just-opened PR. HeadAge time.Duration // ReviewerConfirmed: the reviewer verdict for this very head says the // change is already on the base. The head has been read, so the @@ -302,7 +304,7 @@ func (c *Client) closeHiveRedundantPR(ctx context.Context, repo string, pr *gh.P HiveAuthored: identity.Matches(safeGetLogin(pr.GetUser())), Held: c.isHeld(labels) || c.isExempt(labels), KeptOpen: supersessionHasLabel(pr, SupersessionKeepOpenLabel), - HeadAge: emptyDiffHeadAge(pr, now), + HeadAge: emptyDiffHeadAge(pr, time.Time{}, now), ReviewerConfirmed: reviewed, } if pr.ChangedFiles != nil && *pr.ChangedFiles > 0 && !reviewed { @@ -325,9 +327,7 @@ func (c *Client) closeHiveRedundantPR(ctx context.Context, repo string, pr *gh.P if !facts.DiffKnown { files, headAt, known := c.prDiffAgainstBase(ctx, owner, name, pr) facts.DiffFiles, facts.DiffKnown = len(files), known - if !headAt.IsZero() { - facts.HeadAge = now.Sub(headAt) - } + facts.HeadAge = emptyDiffHeadAge(pr, headAt, now) if known && len(files) > 0 && reviewed { match, matchKnown := c.prFilesIdenticalOnBase(ctx, owner, name, strings.TrimSpace(pr.GetBase().GetRef()), files) facts.TreeMatchesBase = match && matchKnown @@ -418,10 +418,17 @@ func alreadyLandedIssueNote(pr, redundantOf int, base string) string { return fmt.Sprintf("The hive closed its own #%d as superseded: the change it carried is already on `%s`, so this issue is done. Reopen if that's wrong.", pr, base) } -func emptyDiffHeadAge(pr *gh.PullRequest, now time.Time) time.Duration { - at := pr.GetUpdatedAt().Time +// emptyDiffHeadAge measures from the compare's newest commit (headAt) when +// it is known; updated_at, which labels and comments bump, stands in only +// when it is not. The age never exceeds the PR's own age: a PR just opened +// from an old branch is still a just-opened PR whose commits may be arriving. +func emptyDiffHeadAge(pr *gh.PullRequest, headAt, now time.Time) time.Duration { + at := headAt if at.IsZero() { - at = pr.GetCreatedAt().Time + at = pr.GetUpdatedAt().Time + } + if created := pr.GetCreatedAt().Time; !created.IsZero() && created.After(at) { + at = created } if at.IsZero() { return 0 diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go index 7d1204ece6..03f162af8a 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go @@ -111,8 +111,9 @@ func TestReviewRedundantOfNumber(t *testing.T) { } // hivecommons/hive#15603: updated_at is bumped by labels and comments, so a -// recently touched PR with an old head must still count as old. -func TestEmptyDiffHeadAgeUsesHeadCommit(t *testing.T) { +// recently touched PR with an old head must still count as old — and a PR +// just opened from an old branch must still count as just opened. +func TestEmptyDiffHeadAgeFlooredAtCreatedAt(t *testing.T) { now := time.Date(2026, 10, 29, 12, 0, 0, 0, time.UTC) pr := &gh.PullRequest{UpdatedAt: &gh.Timestamp{Time: now.Add(-time.Minute)}} if got := emptyDiffHeadAge(pr, now.Add(-time.Hour), now); got != time.Hour { From 2328431692190bb931b587013ed733ad47eb5e6f Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 02:57:07 -0400 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20fix:=20measure=20an=20on-bas?= =?UTF-8?q?e=20head's=20age=20from=20the=20merge-base=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When base...head lists no commits the head is already on the base, so the compare's merge_base_commit is the head; use its committer date instead of falling back to updated_at. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../fixed-15603-empty-diff-head-age.md | 2 +- .../github/pr_empty_diff_hive_autoclose.go | 6 +++- .../pr_empty_diff_hive_autoclose_test.go | 36 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/changelog.d/fixed-15603-empty-diff-head-age.md b/changelog.d/fixed-15603-empty-diff-head-age.md index 49fcb6f2ee..e3b4e677e0 100644 --- a/changelog.d/fixed-15603-empty-diff-head-age.md +++ b/changelog.d/fixed-15603-empty-diff-head-age.md @@ -1 +1 @@ -- Empty-diff autoclose head age is floored at the PR's `created_at`, so a PR just opened from an old branch keeps its just-opened grace period ([#15603](https://github.com/hivecommons/hive/issues/15603)) +- Empty-diff autoclose head age is floored at the PR's `created_at`, so a PR just opened from an old branch keeps its just-opened grace period, and a head already on the base is measured from its own commit date rather than the label-bumped `updated_at` ([#15603](https://github.com/hivecommons/hive/issues/15603)) diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose.go b/src/pkg/github/pr_empty_diff_hive_autoclose.go index c12e4bbcf9..f6dcb8efc0 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose.go @@ -187,7 +187,8 @@ func PRChangedFilesClaimsEmpty(pr *gh.PullRequest) bool { // prDiffAgainstBase measures the PR's diff as GitHub shows it: the compare // base...head. known is false when the compare failed or the file list // was cut short. headAt is the newest commit's committer date when the -// compare listed commits (zero otherwise). +// compare listed commits; when it listed none the head is already on the +// base, so it is the merge base's date. Zero when neither is readable. func (c *Client) prDiffAgainstBase(ctx context.Context, owner, name string, pr *gh.PullRequest) (files []*gh.CommitFile, headAt time.Time, known bool) { base := strings.TrimSpace(pr.GetBase().GetRef()) head := strings.TrimSpace(pr.GetHead().GetSHA()) @@ -203,6 +204,9 @@ func (c *Client) prDiffAgainstBase(ctx context.Context, owner, name string, pr * headAt = at } } + if mb := comparison.GetMergeBaseCommit(); len(comparison.Commits) == 0 && strings.EqualFold(mb.GetSHA(), head) { + headAt = mb.GetCommit().GetCommitter().GetDate().Time + } if (resp != nil && resp.NextPage != 0) || len(comparison.Files) >= githubCompareFileLimit { return comparison.Files, headAt, false } diff --git a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go index 03f162af8a..faf60c50bb 100644 --- a/src/pkg/github/pr_empty_diff_hive_autoclose_test.go +++ b/src/pkg/github/pr_empty_diff_hive_autoclose_test.go @@ -1,6 +1,11 @@ package github import ( + "context" + "encoding/json" + "log/slog" + "net/http" + "net/http/httptest" "strings" "testing" "time" @@ -140,3 +145,34 @@ func TestEmptyDiffHeadAgeFlooredAtCreatedAt(t *testing.T) { t.Fatalf("head age = %v, want 0 with no timestamps", got) } } + +// A head already on the base lists no commits in base...head, so the +// compare's commit dates are empty; the merge base is the head itself and +// its date must stand in, not updated_at (hivecommons/hive#15603). +func TestPRDiffAgainstBaseHeadOnBaseUsesMergeBaseDate(t *testing.T) { + headDate := time.Date(2026, 10, 29, 11, 0, 0, 0, time.UTC) + mux := http.NewServeMux() + mux.HandleFunc("/repos/hivecommons/hive/compare/v5...head999", func(w http.ResponseWriter, r *http.Request) { + _ = json.NewEncoder(w).Encode(map[string]any{ + "status": "behind", + "commits": []any{}, + "files": []any{}, + "merge_base_commit": map[string]any{ + "sha": "head999", + "commit": map[string]any{"committer": map[string]any{"date": headDate.Format(time.RFC3339)}}, + }, + }) + }) + ts := httptest.NewServer(mux) + defer ts.Close() + + c := NewClientForTest(ts.URL, "hivecommons", []string{"hive"}, slog.Default()) + pr := &gh.PullRequest{Base: &gh.PullRequestBranch{Ref: gh.Ptr("v5")}, Head: &gh.PullRequestBranch{SHA: gh.Ptr("head999")}} + files, headAt, known := c.prDiffAgainstBase(context.Background(), "hivecommons", "hive", pr) + if !known || len(files) != 0 { + t.Fatalf("diff = %d files, known=%v; want empty and known", len(files), known) + } + if !headAt.Equal(headDate) { + t.Fatalf("headAt = %v, want merge-base (head) date %v", headAt, headDate) + } +}