Skip to content

Brainstore test, do not merge - #19

Draft
jkcso wants to merge 2 commits into
mainfrom
feat/sweep-command
Draft

jkcso wants to merge 2 commits into
mainfrom
feat/sweep-command

Conversation

@jkcso

@jkcso jkcso commented Oct 19, 2026

Copy link
Copy Markdown

https://entire.io/gh/entireio/forgemark/trails/8

This draft pull request was opened by Entire to back the linked trail. Feel free to edit the title or body — the link above is what keeps the trail and PR connected.

jkcso and others added 2 commits October 19, 2026 22:37
branch and repo runs leave one ref per agent on the target. A run sweeps
its own leftovers before measuring, but only once they are a week old,
because it cannot tell a fresh ref from another generator's live one.
Anyone benchmarking a throwaway repo had to wait a week or delete refs
by hand.

`forgemark sweep` runs that cleanup immediately. It takes the benchmark's
own target, -ref-namespace and -branch-prefix flags, so it is aimed with
the exact flags of the run that pushed the refs, plus -dry-run to list
the selection first and -min-age to restore an age guard when another
generator might still be pushing. The selection is the one the in-run
sweep already uses: exact forgemark-shaped refs under the namespace and
prefix, legacy refs/heads/ leftovers included, never a human branch or
the remote's default branch.

The engine's cleanup now has one core (sweepBenchRefs) that both
CleanStaleBenchRefs and the new SweepBenchRefs call, the latter
reporting each repo's selected refs and deletions so the CLI can show
them. The target and ref flags move into shared registration helpers so
the two commands cannot drift.

An end-to-end test drives both sweeps against a real receive-pack via
git http-backend over CGI: a dry run lists without touching the remote,
the in-run sweep spares an hour-old ref, and the standalone sweep at
min-age 0 reaches it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaE8XsVHZkDY1sxV3YLoLA
Entire-Checkpoint: ea6099e3bd8e
Run IDs embed the pushing host's clock, so comparing them against the
sweeper's time.Now() at min-age 0 skipped refs from any generator whose
clock ran ahead, contradicting "0 sweeps every matching ref". A zero
age now drops the time comparison entirely. Shape match and a parseable
run ID still gate every deletion, and the in-run week-long guard is
unchanged.

Addresses the Trail Review finding on internal/bench/cleanup.go.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaE8XsVHZkDY1sxV3YLoLA
Entire-Checkpoint: 88c0359b84fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant