Skip to content

πŸ› mutation: bound journal prune clock to the journal's own time - #14866

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14830
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14830

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

pruneLocked was fed the caller-supplied work.UpdatedAt, so a forged future timestamp could age out valid terminal entries. The prune instant is now clamped to the journal's own clock (injectable via an unexported now field, defaulting to time.Now).

Closes #14830

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read pruneLocked (src/pkg/convergence/mutation/journal.go:565-595) and the three call sites that set work.UpdatedAt from the caller-supplied instant (journal.go:395,448,510). Clamping that instant to j.now() before pruneLocked closes the early-age-out path without changing the retention or maxEntries semantics. OpenJournal is the only constructor of *Journal in the package (journal.go:246), so the new now field is never nil. The new test fails without the fix: op 1 at baseβˆ’30m is pruned by cutoff base+99h on the old code.

Looks correct to me.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 3b5c3f1 into v5 Oct 28, 2026
77 of 81 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14830 branch October 28, 2026 06:21
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#148665a64f67` sha256:abfd5ad408e2d946497f6a06cbe631b830ae2ab4f468dfa8c4aebe2015da8075 β€” download from the dashboard or `hivectl review evidence #14866`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. Read src/pkg/convergence/mutation/journal.go at 5a64f67: every path into commit β€” Begin:372, RecordResult:416, Reconcile:477 β€” takes a caller-supplied now and writes it to work.UpdatedAt (:395, :448, :510) before commit hands it to pruneLocked (:531), so the clamp in pruneClock (:543-551) sits on the only path a skewed timestamp could reach retention. Journal is constructed solely in OpenJournal (:246), which sets now: time.Now, so the new func field is never nil. The clamp is one-sided (only future instants are pulled back), which is the right shape β€” a past UpdatedAt under-prunes rather than evicting live entries.

Verified the gap is real on the base: #14828 merged with j.pruneLocked(work.UpdatedAt) unclamped. Note for the maintainer: Closes #14830 points at an issue that is already closed (it was blocked-on #14828 and closed when that PR merged, without the clamp landing), so the keyword is a no-op; nothing to change in the PR, just don't expect it to close anything.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (security): pruneLocked trusts caller-supplied clock

0 participants