From a5e2dfdcf34f53dd876bb3965beb264ff927a72b Mon Sep 17 00:00:00 2001 From: marshawcoco Date: Wed, 24 Jun 2026 17:09:33 +0000 Subject: [PATCH 1/7] feat(gc): publish gc and prune commands Signed-off-by: marshawcoco --- COMPATIBILITY.md | 2 + README.md | 5 +- docs/commands/README.md | 2 + docs/commands/gc.md | 14 +- docs/commands/maintenance.md | 2 +- docs/commands/prune.md | 11 +- docs/commands/zh-CN/README.md | 2 + docs/commands/zh-CN/prune.md | 39 ++++++ docs/development/commands/README.md | 4 +- docs/development/commands/_compatibility.md | 4 +- docs/development/commands/gc.md | 26 ++++ docs/development/commands/prune.md | 27 ++++ docs/development/integration-scenarios.yaml | 4 +- .../_parameter-tables.md | 2 +- .../integration-scenarios/cli.gc-smoke.md | 14 +- docs/development/internal/gc.md | 25 ++-- docs/development/internal/prune.md | 23 ++- src/cli.rs | 6 + src/command/agent/clean.rs | 12 +- src/command/gc.rs | 77 +++++----- src/command/mod.rs | 2 + src/command/prune.rs | 34 +++-- src/command/verify_pack.rs | 12 ++ .../ai/context_budget/compaction_agent.rs | 3 +- src/utils/client_storage.rs | 22 +++ tests/command/agent_push_test.rs | 8 +- tests/command/mod.rs | 2 + tests/command/prune_test.rs | 132 +++++++++++++++++- .../publish_ai_object_model_contract_test.rs | 2 +- 29 files changed, 393 insertions(+), 125 deletions(-) create mode 100644 docs/commands/zh-CN/prune.md create mode 100644 docs/development/commands/gc.md create mode 100644 docs/development/commands/prune.md diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 85f97c584..0476bcce0 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -73,6 +73,8 @@ batch document. | open | supported | | | config | partial | vault-backed local/global config is supported; system scope, editor round-trip, typed conversion, NUL output, section rename/remove, and includeIf are incomplete | | op | intentionally-different | Libra command-level operation history inspection/restore extension, not a Git command | +| gc | partial | Traces reachable objects, expires reflogs, prunes eligible unreachable loose objects, and cleans stale pack sidecar files; `--dry-run`, `--prune=`, `--no-prune`, `--aggressive` (accepted no-op), `--auto` (accepted no-op), `--force`, JSON, and machine output supported. Valid pack/index pairs are verified, but Libra does not repack, delta-compress, create cruft packs, or rewrite valid packfiles | +| prune | partial | Removes eligible unreachable loose objects, with `-n`/`--dry-run`, `-v`/`--verbose`, `--expire