LibraLibra
LibraLibra
DocsBlogLibra
Getting Started
Architecture
Design
Commands
libra addlibra agentlibra alternateslibra applylibra archivelibra authlibra automationlibra bisectlibra blamelibra branchlibra bundlelibra cachelibra cat-filelibra check-attrlibra check-ignorelibra check-mailmaplibra checkoutlibra cherry-picklibra cleanlibra clonelibra cloudlibra code-controllibra codelibra commit-treelibra commitlibra completionslibra configlibra credentiallibra depslibra describelibra diff-fileslibra diff-indexlibra diff-treelibra difflibra dirtylibra fast-exportlibra fast-importlibra fetchlibra filelibra for-each-reflibra format-patchlibra fscklibra gclibra graphlibra greplibra hash-objectlibra hookslibra hydratelibra index-packlibra initlibra investigatelibra layerlibra lfslibra loglibra logfilelibra loginlibra logoutlibra ls-fileslibra ls-remotelibra ls-treelibra maintenancelibra medialibra merge-baselibra merge-filelibra mergelibra metadatalibra mvlibra noteslibra oplibra openlibra pack-objectslibra packagelibra prunelibra publishlibra pulllibra pushlibra read-treelibra rebaselibra refloglibra remotelibra repacklibra replacelibra rererelibra resetlibra restorelibra rev-listlibra rev-parselibra revertlibra reviewlibra revisionlibra rmlibra sandboxlibra servicelibra shortloglibra show-reflibra showlibra sparse-viewlibra stashlibra statslibra statuslibra switchlibra symbolic-reflibra taglibra update-indexlibra update-reflibra usagelibra verify-packlibra whoamilibra worktreelibra write-tree
API Reference
Policy
Commands

libra file

Command reference for `libra file`

libra file groups object-level operations (a Libra extension, no Git equivalent). Its one v1 subcommand is obliterate (lore.md 2.5).

file obliterate — index-flagged payload obliteration

Implements the "保留 ADDRESS 删 PAYLOAD" compliance-deletion model (§19.6): physically removes an object's PAYLOAD bytes while PRESERVING its address so referencing history stays traversable. It is destructive and IRREVERSIBLE.

  • Compatibility: intentionally-different.
  • Synopsis: libra file obliterate <oid> [--reason <text>] [--dry-run] [--yes] or libra file obliterate --recover.

Safety model

  • --dry-run prints the blast-radius preview and deletes nothing; a real run REQUIRES --yes (LBR-OBLITERATE-003 otherwise).
  • v1 refuses a packed-only object (LBR-OBLITERATE-002) — no pack surgery (that is declined history-rewrite territory); loosen/repack first.
  • Every run appends a durable, append-only, 0600 audit record to .libra/obliteration-audit.jsonl (§7.8) — OID (address), actor, approval source, reason, outcome; NEVER the erased content.

State machine (crash-safe)

A tombstone row's ABSENCE means Live: (no row) → INSERT obliterating (fsynced BEFORE any payload touch) → physical payload delete → UPDATE obliterated. A crash can only leave obliterating with the payload maybe still present — never "deleted but Live". file obliterate --recover (and an opportunistic sweep at the start of every obliterate) re-runs the tail idempotently.

fsck / heal / restore integration

fsck reports an obliterated object as intentionally absent — a diagnostic DISTINCT from missing that never flips the exit code — across the object, tree, commit, parent, tag, and index seams. fsck --heal never resurrects it, and cloud restore refuses to re-download it (拒绝重建).

Examples

libra file obliterate <oid> --dry-run
libra file obliterate <oid> --reason "gdpr erasure" --yes
libra file obliterate --recover

Deferred (not v1)

Byte-level in-object erasure (§3.5, declined); pack surgery / history rewrite (declined); the §6.8 media/LFS chunk obliterate (waits on the media layer).

libra fetch

Command reference for `libra fetch`

libra for-each-ref

Command reference for `libra for-each-ref`

On this page

file obliterate — index-flagged payload obliterationSafety modelState machine (crash-safe)fsck / heal / restore integrationExamplesDeferred (not v1)