Your record is one record however many computers you use. Where some of it has to stay on some computers, those computers form a side, each lists the paths that stay on its side, and everything else is the middle, one private repository every one of your computers reads and writes (Foundation, Record, middle and sides). This module only applies that: it sees when you use a second computer, or work on one whose work isn't yours to keep, works out who can see that computer, draws the line, and sets it up with your yes. To turn it off, delete this file: your computers keep what they hold and stay in step while their grants are on.
Why
- Git is the ground truth. One history holds every change from every computer, in order, so any computer can be rebuilt from it and none quietly overwrites another. Nothing new runs and no service sits between them.
- A key per repository is the wall. A computer reaches only the repositories its key reaches, so the middle can be shared while each side's own paths never leave that side, and a tool on the work laptop cannot fetch the rest even when asked to. GitHub is the default; GitLab, Bitbucket and Codeberg give a key per repository too.
- Without a git host, accounts split instead. A file cloud (Google Drive, OneDrive, Dropbox) gives part of itself only to another account and can't keep a record's history safely. Then the work lives in the employer's own account on the work computer, your record stays on the computers only you see, and the split is what never leaves each.
- iCloud only joins, never splits. Every device on an Apple account gets all of it, so it is never where your computers meet, and a computer an employer can see is never signed in to yours.
How
It runs when a chat sees you use a second computer (you say so, or setup finds your private backup already holds a record), or work on a computer whose work comes with an employer's limits (a work account in one of your tools, a company's folders, or you saying so), and whenever you ask how to set up several computers or keep work apart.
What follows is a best guess for the common cases, not a list to match. Your model works from the one rule, that each computer holds only what everyone who can see into it may see, to what fits you and the computers you actually have, says what it chose and why in a line, and changes it when something doesn't work, a step is blocked, or you want it another way. Where a step here doesn't fit, it finds one that keeps the rule rather than applying the step anyway or dropping the whole thing.
1. Who can see this computer, and the default
Decide from what the computer shows, never by asking first. Enrolled in device management (profiles status -type enrollment on a Mac; dsregcmd /status on Windows), a work account signed in to the computer itself, or company security software: an employer's IT can see into it, unless the company is the person's own. Another person's account on it, or the person saying it is shared: family can. Nothing of the kind: only them.
- Only them (their own laptop, or a company they own): no sides. Every computer holds the whole record (2).
- Others too, and it is their only computer: no sides yet, since there is nothing to split from. Their employer's work stays apart by its rule (4); the record keeps what they are fine with the employer seeing, so the model keeps what is most private out of what it writes there and says so in a line; it never signs in to their own iCloud, and it answers no paid questions. Their own private backup, on their yes, carries the record and never the employer's work, and is how the record leaves with them. A computer only they see, when one comes, takes the record, and this one becomes the work side (3).
- Others too, beside a computer only they see: sides (3). By default the employer's confidential work stays on the work side; on the personal side stay what is most private about them (health, money, identity, accounts and keys, intimate life, what other people wrote or opened to them privately) and the chats and captures made there, since private things run all through them and no filter sorts them reliably; the middle is what they have distilled and made (their guide, practice, skills, constitution, works and projects, less the private facts) and the chats on the work laptop that aren't the employer's, since they were made where others could already see. A word from them brings their chats and captures in.
Say in one line what you concluded, show what stays on each side, and build whatever they say instead. Every other arrangement falls out of the same pieces: both computers hold everything (no side lists), wholly apart (no middle), everything one way only (the other computer's key may only read the middle), or two jobs, which is three sides. A second job, a client, a band: each is a side of its own when it needs one.
2. Both hold everything
- The first computer backs up, with your yes (
~/alexandria/system/.optional§ backup), to a private repository on your account. - The joining computer gets a key that reaches only the record:
ssh-keygen -t ed25519 -N '' -C 'alexandria <this computer>' -f ~/.ssh/alexandria_record, thengh repo deploy-key add ~/.ssh/alexandria_record.pub --repo <you>/alexandria-private --allow-write --title '<this computer>', from wherever GitHub's command line is signed in. - Take the record:
GIT_SSH_COMMAND='ssh -i ~/.ssh/alexandria_record -o IdentitiesOnly=yes' git clone git@github.com:<you>/alexandria-private.git ~/alexandria, thengit -C ~/alexandria config core.sshCommand 'ssh -i ~/.ssh/alexandria_record -o IdentitiesOnly=yes'. If~/alexandriaalready holds a record, move it aside first (mv ~/alexandria ~/alexandria-before-<date>), never merge two histories, and bring what was written there by hand in as captures once setup has run. - If it holds work, write its rule now (4), into the clone's
system/.restricted.conf, before setup runs. - Set up as usual, from the setup request in your email, as the returning record it is (
ALEXANDRIA_RETURNING_RECORD=1), then turn backup on there to the same address.
3. Sides
Three private repositories on your account: the middle, and one for each side's own paths, opened only by that side's keys. The personal side's is the backup of your whole record; the work side's is on your account unless the employer's policy wants it on the company's GitHub. On the computer that holds the whole record, whose backup is on (2, step 1):
- Draw the personal side. Your model reads the record, writes the paths that stay on this side into
~/alexandria/system/.side_paths, one a line, relative to~/alexandria, and shows them with what goes in the middle. Nothing insystem/.*is in any history. - Make the middle and the work side's repository, private and empty:
gh repo create alexandria-middle --privateandgh repo create alexandria-work --private. - Grant it outside the sandbox, in your app's approval prompt or your own terminal:
bash ~/.local/share/alexandria/scripts/permission.sh grant middle git@github.com:<you>/alexandria-middle.git. The grant keeps the side list as it is now, so nothing written later can put one of those paths in the middle. The next session end sends the middle, with none of the record's older history. - Name your own side, if you joined the Connector, through the same approval prompt:
node ~/.local/share/alexandria/scripts/sides.mjs own personal, so anyone new reaches you on the side only you see. Only a computer on no side can name it.
On the other computer:
- Give it two keys, since GitHub lets a key open one repository:
ssh-keygen -t ed25519 -N '' -C 'alexandria <this computer>' -f ~/.ssh/alexandria_middle, and the same withalexandria_work. Add them from the first computer:gh repo deploy-key add <alexandria_middle.pub> --repo <you>/alexandria-middle --allow-write --title '<this computer>'(without--allow-writefor a computer whose sorting you don't trust, which then only reads the middle), andalexandria_work.pubtoalexandria-workwith--allow-write. - Take the middle as its record: clone it into
~/alexandriawith the middle key, as in 2, step 3, then point the record at its side's own repository:git -C ~/alexandria remote set-url origin git@github.com:<you>/alexandria-work.gitandgit -C ~/alexandria config core.sshCommand 'ssh -i ~/.ssh/alexandria_work -o IdentitiesOnly=yes'. Before setup runs, write its rule (4) and its own side list, the paths where the work sits inside the record, if any. - Set up as the returning record, turn backup on to
alexandria-work, then grant the middle with its key:permission.sh grant middle git@github.com:<you>/alexandria-middle.git ~/.ssh/alexandria_middle, withreadat the end for a computer that may only read. - Leave nothing here that reaches more. Sign GitHub's command line out (
gh auth logout) and checkssh -T git@github.comdoes not greet you by name. While anything on it can reach your whole account, everything there can reach every repository, so say that once, as a fact. - Connect your account, if you joined the Connector, with a code for its side from the first computer (
~/alexandria/system/.optional§ account, Another computer), then put the first computer on its own side there,sides.mjs this personal, so what it publishes from a path on its list stays on that side; after that it makes codes only for its side. Never sign in to alexandria.place on the second computer: your own sign-in is the whole account wherever you type it, like signing in to GitHub itself. - Check it yourself. A note written in the middle on one computer is on the other after its next chat, and nothing from either side's list is in the middle (
git -C ~/alexandria ls-fileson the second; on the first, the same with--git-dir ~/.local/share/alexandria/middle.git --work-tree ~/alexandria).
From then on the session hooks keep the middle in step at every start and end, as they keep two computers on one record: where two changed the same lines of a note both versions are kept and session start names the files; a clash in a method file or the constitution waits, nothing lost. The split is made at every save: the model on each computer decides each time it writes whether a thing is the middle or stays on its side, and when unsure it stays, its path on the list first, since what reaches the middle stays on the other computers while a thing on a side joins the middle with a word. A path added to a side list is sent no more, and what the middle already had of it stays there; taking one off a side needs the grant again. A file another computer puts in the middle stays the middle's, even in a folder this computer keeps on its side. If another computer puts in the middle a path this one keeps on its side, nothing more is taken until it is moved, and session start says which. A second computer on a side joins that side's repository as in 2, with the middle beside it as here.
4. Work
On any computer whose work comes with an employer's limits, or a client's:
- Write this computer's rule. In
~/alexandria/system/.restricted.conf, one setting a line:owner: <the employer>, afolder: <path>for each place the work lives, and awords: <pattern>line for names that mark it, such as a client's code name (a Python regular expression, such as(?i)\bfalcon\b). Addvendor: <company>only when a contract binds the work to one model company's tools. Then runpython3 ~/.local/share/alexandria/scripts/vault_transcript.py --restricted --vault ~/alexandria, and add the map line:~/alexandria-restrictedholds <the employer>'s work on this computer. - The work side keeps it. Every chat that ran in a work folder, touched a file there or names a marked word is kept in
~/alexandria-restricted, beside the record and never in it, with your tools' memory of the work. Models here may read it for the work; none of it is in the record, the middle or another computer. - The filter decides what crosses. From a work chat, only what is about you goes into your record: how you think and decide, what you learned, your skills, where you stand, people as you know them yourself. No client, code name, figure, plan, document or detail of a person that came with the work. When unclear, it stays out, and a word from you brings it in.
- The work's own place is the employer's. When the work's copies should outlive this computer, push
~/alexandria-restrictedto a private repository in the company's GitHub organisation, or let the company's Google Drive or OneDrive back it up. Never iCloud, never your own repositories, and where the employer has a policy, the policy decides. - No paid answers from it. Answering the market's paid questions stays off on this computer (it has no market grant), since that is paid work for others on the employer's equipment; a computer only you see answers instead.
- Leaving the job. Your record is already on your own computers, or in your own backup where this was your only one. Hand back or delete
~/alexandria-restrictedas the employer requires, remove that computer's keys (gh repo deploy-key list --repo <you>/alexandria-middle, thendelete), and sign it out of anything of yours.
For example, a founder whose company is their own keeps the whole record on both laptops, the company's work kept by the rule on the company laptop. An engineer at a large company keeps money, health and family on the personal side, the client's work on the work side, and everything else in the middle, so the model at work works like them and what they decide about their career at work reaches their record.
5. What each computer holds and reaches
For a computer an employer can see, set up as in 1, 3 and 4, each line can be checked on the computer itself or in Alexandria's source, where the file named holds it, so neither you nor your IT team has to take it on trust.
-
What runs: two folders in your home folder and a few entries in your coding tools' own settings, nothing else; no administrator rights, system service, launch agent, login item or change to your shell, and nothing scheduled unless you turn on an add-on that says so; its scripts run only from a session you open (
TRUST.md§ what it changes in your tools, § what it leaves alone). It reaches the network only for what you said yes to, each call listed (TRUST.md§ every network call), andpython3 ~/.local/share/alexandria/scripts/uninstall.pytakes it all back out. -
On its disk: in
~/alexandria, the middle and the work side's paths, or, as your only computer, the record less what is most private; the employer's work in~/alexandria-restricted; nothing from another side's list (git -C ~/alexandria ls-files;blueprint/test/middle.sh). -
Its keys: a deploy key for each repository it uses, each opening that one repository and nothing else on your account, as GitHub makes deploy keys.
-
On the Connector: on a side, its account key opens the middle, the work side, your profile, settings, invite codes and feedback, and is refused circles, people and letters on another side (
server/src/labels.ts,server/test/labels.ts); a page it publishes from a path on its side list stays on the work side (blueprint/test/publish-sides.mjs). -
Never: the personal side's repository, your whole-record backup, your iCloud, or anything on the personal side's list, unless you move it to the middle yourself.
What none of that can hold, said once:
- The sorting is judgment. Each computer's model decides at every save what is the middle, and a thing it puts there by mistake stays in the middle's history on GitHub; that is why it keeps a thing on its side when unsure.
- A sign-in is the whole account. Signed in to alexandria.place in its browser or a chat app, or to your own GitHub, that computer reaches everything those reach, keys or not.
- The employer can read the disk. What is on the work laptop, the middle included, is as visible to its IT as the rest of it.
For more caution, each on its own or together:
- A separate GitHub account for the middle and the work side's repository, which the personal computer reaches with its own deploy key, so nothing on the work laptop can reach your own account even signed in there.
- A middle the work laptop may only read (
readon its grant), so nothing sorted there reaches your other computers. - Keep it local: no middle at all, so nothing leaves the work laptop and nothing of yours reaches it beyond what you carry over by hand.
Limits
- Nothing a rule keeps apart, and nothing on a side list, goes into the middle or reaches another side's computer, and nothing is set up, keyed, granted or published without your yes.
- A file too big for GitHub, or a link, stays on its computer. On a computer that may only read the middle, its own edits stay there, and one to a file the middle also changed waits for you, named at session start.
- It never uses iCloud as the way your computers meet and never merges two records' histories.
- Turned off, your computers keep what they hold; deleting a computer's middle switch (
rm ~/alexandria/system/computer/permissions/middle) stops it syncing the middle, and each computer's rule and what it keeps apart stay as they are.