Repository layout
A repository must follow the appreise layout before it can be added:
main.beancount: the top file. It holdsoptionandincludelines only, includingoption "operating_currency" "USD"(or your currency).tail.beancount: the only file appreise writes to. Itsincludemust be the last line ofmain.beancount.invariants.beancount(optional): balance assertions. When it exists,main.beancountmust include it.
A new ledger: ask the AI app to start a new ledger. When the GitHub App has repository creation permission, create_ledger creates the private GitHub repository itself, lays it out, commits, pushes and adds it in one step. When automatic creation is not available (or on another forge), create_ledger gives you a link that creates an empty private repository and the link that gives appreise access to it; once both are done, it lays the repository out, commits and adds it.
add_repo refuses a repository that does not follow this, and its error names the one thing to fix. An existing ledger in another layout can be adopted: adopt_repo finds the top file, makes it main.beancount, and adds the tail. It shows you the plan first, and proves the ledger unchanged: every transaction and every account's balance are identical before and after. Approve the plan, and it commits it as one commit, "adopt into appreise", which one revert undoes.
A minimal main.beancount:
option "operating_currency" "USD"
include "accounts.beancount"
include "invariants.beancount"
include "tail.beancount"