| 1 | # equipo |
| 2 | |
| 3 | An Oficina app: a coordinator and a team of AI specialists for running your own apps. The design is on the `design` branch. |
| 4 | |
| 5 | <!-- COPY APPROVED BY DELEGATION (Luna pass, 2026-11-01, house rules). --> |
| 6 | |
| 7 | ## Local startup |
| 8 | |
| 9 | Create `.env.local` with the values below. Generate the instance key once with |
| 10 | `openssl rand -hex 32` and keep that value across restarts. |
| 11 | |
| 12 | ```sh |
| 13 | EQUIPO_ORIGIN=http://127.0.0.1:8824 |
| 14 | EQUIPO_INSTANCE_KEY=replace-with-your-generated-key |
| 15 | EQUIPO_OWNERS=you@example.com |
| 16 | EQUIPO_ALLOW_LOGGED_MAIL=1 |
| 17 | ``` |
| 18 | |
| 19 | Run `./run.sh`. It builds the app when needed and stores its data in `equipo.db`. |
| 20 | Owners are seeded on the first boot only when the database has no team. With |
| 21 | logged mail enabled, sign-in links are written to the local log. The environment |
| 22 | file, database and `.local` build directory are ignored. |
| 23 | |
| 24 | For disposable sample data, run |
| 25 | `CGO_ENABLED=0 go run ./tools/drive -db "$TMPDIR/equipo-drive.db"`. |
| 26 | The path must be unused. Open the sign-in link it prints and confirm it in your |
| 27 | browser. The drive listens on `127.0.0.1:8824` and removes its database when you |
| 28 | stop it with Ctrl-C. |
| 29 | |
| 30 | |
| 31 | ## Deploying |
| 32 | |
| 33 | Deploy Equipo to account `oficina` on the flagship console: |
| 34 | [https://console.carloku.com/a/oficina](https://console.carloku.com/a/oficina). |
| 35 | Project account labels do not change the deployment target. |
| 36 | |
| 37 | Before the first boot, configure app `equipo` in account `oficina`: |
| 38 | |
| 39 | - Use `carlos env set` for `EQUIPO_ORIGIN`, the confirmed HTTPS origin people |
| 40 | will use, and `EQUIPO_OWNERS`, the comma-separated owner addresses. Owners |
| 41 | are seeded only when the database has no team. Use People to change the |
| 42 | roster after the first boot. |
| 43 | - Use `carlos env set` for `EQUIPO_ASSISTANT_HOSTS`, the comma-separated |
| 44 | origins of the Base instances whose operations the Assistant may call, for |
| 45 | example `https://base.example.com`. A person's Base registers one of them as |
| 46 | its host; Equipo calls no other address. Unset, nobody can register one. |
| 47 | - Use `carlos secrets set` for `EQUIPO_INSTANCE_KEY`. Generate it once and keep |
| 48 | it stable across releases and restarts. CARLOS seals app secrets and delivers |
| 49 | them to the process as environment variables. |
| 50 | - Enable the app's email sender with `carlos email enable`. CARLOS verifies the |
| 51 | sending domain through SES and delivers `CARLOS_SMTP_HOST`, |
| 52 | `CARLOS_SMTP_FROM`, `CARLOS_SMTP_PORT`, `CARLOS_SMTP_USER` and |
| 53 | `CARLOS_SMTP_PASS`. Equipo reads these platform settings for sign-in mail. |
| 54 | |
| 55 | Leave `EQUIPO_ALLOW_LOGGED_MAIL` unset in production. It is for local use and |
| 56 | writes sign-in links to the log. Equipo makes no provider calls and needs no |
| 57 | CARLOS CLI credentials at runtime. The human operator uses their own CARLOS CLI |
| 58 | access to deploy. |
| 59 | |
| 60 | Confirm the target architecture before building. Start from a clean, reviewed |
| 61 | commit and run: |
| 62 | |
| 63 | ```sh |
| 64 | make release |
| 65 | ``` |
| 66 | |
| 67 | This builds `releases/equipo-linux-arm64` with CGO disabled and stamps the value |
| 68 | from `git rev-parse --short HEAD` into the binary. Tracked changes block the |
| 69 | build. For an amd64 target, use `make release RELEASE_GOARCH=amd64` and deploy |
| 70 | `releases/equipo-linux-amd64` instead. |
| 71 | |
| 72 | Confirm that your CLI targets the flagship console. Run this command for the |
| 73 | default arm64 build: |
| 74 | |
| 75 | ```sh |
| 76 | carlos deploy --app equipo --account oficina --channel edge --timeout 5m ./releases/equipo-linux-arm64 |
| 77 | ``` |
| 78 | |
| 79 | With `EQUIPO_EXECUTION_ENABLED=1`, add `--swap hold` (before the binary path). Only one |
| 80 | process may own execution, so the old build must stop before the new one starts; |
| 81 | without it the new build exits with "This record changed" and the rollout stops. |
| 82 | |
| 83 | `EQUIPO_EXECUTION_MARKER_PATH` is the execution witness. It must sit |
| 84 | outside the database's directory, on storage that survives a database |
| 85 | restore on its own. On CARLOS, that is the instance's own directory, for |
| 86 | example `/data/instances/<instance host>/execution/witness`. If the witness |
| 87 | is lost or disagrees with the database (a restored snapshot, a replaced |
| 88 | box), Equipo still starts, but execution comes up quarantined. Every action |
| 89 | that was in flight is marked uncertain, and no new work is admitted. An |
| 90 | owner reviews the uncertain actions and releases execution at Settings, |
| 91 | Recovery (`/settings/recovery`). Equipo never resumes on its own after a |
| 92 | lost witness. |
| 93 | |
| 94 | Equipo also answers `GET /api/team`, the readiness probe Alta reads before |
| 95 | it activates a team instance in Home's directory. Equipo has no Home roster |
| 96 | mode, so the probe answers in the seeded mode: the configured |
| 97 | `EQUIPO_HOME_CONSUMER_ID`, and whether an active owner exists. It carries |
| 98 | no address, and answers 404 without Oficina ID. |
| 99 | |
| 100 | |
| 101 | Keep the flags before the binary path. After deployment, poll `GET /api/version` |
| 102 | on the deployed origin until the process reports the stamped commit. The |
| 103 | router's `X-Carlos-Version` header does not confirm the running process version. |
| 104 | A successful local build does not confirm a successful deployment. |
| 105 | |
| 106 | After deployment, complete these checks: |
| 107 | |
| 108 | 1. Sign in as a configured owner. Add a second roster member and an account |
| 109 | label. Create App, Website and Repository projects, including one with only |
| 110 | a repository. Refresh and restart the app, then check that the data persists. |
| 111 | 2. Sign in as the member. Check shared visibility and denied owner edits. Open |
| 112 | every empty destination and the phone Work index. |
| 113 | 3. Confirm that no runner is enrolled, no execution job exists, and Equipo made |
| 114 | no provider or CARLOS credential request. Record acceptance in the normal |
| 115 | review record. |
| 116 | |
| 117 | 4. Walk the app once with normal motion, with reduced motion turned off, and |
| 118 | note any browser console error. The automated walk uses reduced motion. |
| 119 | |