Change a path visibility

Change a path visibility

A version is sealed when you finalize it. loot migrate changes a path’s tier from its next version on: it writes the path’s rule into .lootattributes and re-seals the file in your working change, and loot new signs both. Every older version keeps the seal it was recorded with.

Tighten a path

loot migrate creds.txt restricted=alice
loot new -m "restrict creds.txt"
loot push
migrated creds.txt -> restricted=alice (new oid: a340a706)
  rule `creds.txt restricted=alice` is first in .lootattributes
  the re-seal is in the working change: `loot new` signs it, then a push or `loot bundle` ships it

The rule goes first in the file, so no broader rule decides the path ahead of it, and every later capture, yours or a peer’s, keeps the new tier. loot show HEAD shows the move:

  M  creds.txt              internal → restricted=alice
    content is byte-identical — only the seal moved

The spec is internal, restricted=a,b or embargoed=<unix-seconds>, as in the file’s syntax. The path is read from where you run the command, so loot migrate creds.txt … in src/ means src/creds.txt, and the file must be on disk.

The re-seal joins the working change you have open, and is signed with whatever else it holds, under its subject. To give the re-tier a change of its own, run loot new on your work first.

Share it with someone else

For each identity you name other than yourself, migrate writes grant-<name>.bundle into the directory given as its third argument, or .loot/grants/ without one, and prints the path. Send the file; they run loot apply on it.

loot migrate creds.txt restricted=alice,bob ../grants

A bundle holds the file’s key in the clear, so keep it outside the repo. Recorded, it would be an Internal file that everyone with repo access, and the relay, can read. Migrate refuses a directory inside the working tree, and a capture refuses any file that is a grant bundle, whatever its name, until you move it out.

Keep your own name on the list. Migrate refuses a list that leaves you out, as loot new would, because nobody could read the version. Run it again with your name, or give both migrate and loot new --allow-lockout <path> to seal yourself out on purpose.

Loosen a path

Making a path more readable is a demotion, and migrate refuses it until you name the path:

loot: refusing to demote visibility of creds.txt: an attributes change would re-seal private content more readably; restore the .lootattributes rule, or re-run with `--allow-demote <path>` to demote deliberately
loot migrate creds.txt internal --allow-demote creds.txt
loot new -m "make creds.txt internal"

A refused migrate leaves .lootattributes as it was. The consent is given once: loot new doesn’t ask again.

Edit the rule by hand

Writing the rule yourself and finalizing re-seals the path the same way. Put it above any broader rule that matches the path, and give loot new --allow-demote <path> if it loosens. A name with a space needs this route: no exact rule can spell it, so migrate refuses, and a pattern with * in place of the space matches it.

What re-tiering can’t do

  • It doesn’t reach history. After you restrict a path, anyone who could read it still runs loot cat creds.txt HEAD~1 and gets the old content, and so does a fresh clone from a relay, because the relay holds every Internal key.
  • It doesn’t reach disks. A reader’s next pull reports the path as relayed (sealed — you lack the key) and leaves the copy already in their working tree.
  • Loosening is forward-only too. Older restricted versions stay sealed to the holders they had.

If the old content must stop being readable, treat it as leaked: rotate the secret, and burn the old versions.