cli

package
v0.0.0-...-a565272 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Overview

purge.go implements `acd purge-events` — operator-driven cleanup of non-published capture_events rows.

Why this exists: when a parallel committer (e.g. the atomic-commit hook plugin) lands the same edit acd captured, replay sees the captured `before_oid` no longer matching HEAD and terminally settles the event in `blocked_conflict`. Per architecture invariant the blocked row forms a seq barrier — every later pending row hides behind it in PendingEvents until an operator intervenes. The legacy recovery story was raw sqlite3 surgery, which is fine for engineers but unhelpful for users diagnosing a stuck queue.

`acd recover` already exists but does a different job: it RETARGETS stale rows onto the current HEAD/generation (preserving them). When the captured edits are already in the working tree (committed by the parallel committer), retarget just produces another mismatch on the next replay pass. Outright deletion is the right move for that case — hence this command.

Safety scaffolding mirrors recover.go:

  • Refuse while the daemon is alive.
  • Backup state.db before mutating.
  • --yes required to apply, --dry-run prints the plan without touching the DB.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCommand = errors.New("no command provided")

ErrNoCommand is returned when acd is invoked with no subcommand.

Functions

func Execute

func Execute() error

Execute builds the root command tree and runs it.

func ResolveEffectiveCommitStrategy

func ResolveEffectiveCommitStrategy(ctx context.Context, conn *sql.DB) (ai.CommitStrategy, error)

ResolveEffectiveCommitStrategy returns the commit strategy currently in effect for a repo. When conn is nil, the result reflects only env (ACD_COMMIT_STRATEGY) and the canonical default. When daemon_meta carries a *recognized* commit.strategy value, that overlay wins; unrecognized values are loud (slog.Warn) and the env-derived value is used so corrupt meta cannot silently override the operator's intent.

Types

type PauseMarker

type PauseMarker = pausepkg.Marker

PauseMarker is the durable gitDir/acd/paused file format.

func ReadMarker

func ReadMarker(gitDir string) (PauseMarker, bool, error)

ReadMarker reads gitDir/acd/paused. It returns ok=false when the marker is absent or malformed, matching the daemon's best-effort pause-marker handling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL