oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Equipo
2
3One instance belongs to one team. Members share projects and work.
4Read `docs/superpowers/specs/2026-11-01-equipo-design.md` and the current
5controller brief before changing behavior. Task dispatch instructions take
6precedence over generic workflows.
7
8## Model text and authority
9
101. Model-written text is never the person's words. A tapped option the model
11 wrote is a choice among model text, not a statement by the person.
122. A change never authorises its own merge. Evidence the candidate can edit
13 (its own checks, its own diff) is never trusted.
143. Untrusted text enters a prompt only quoted, under a label naming its source.
154. Anything an agent writes that leaves the system or opens in a browser needs
16 the person's tap or a standing project setting they chose, plus deterministic
17 checks. A private tailnet limits readers; it does not stop a page sending
18 data elsewhere.
195. A sandbox that runs agent-chosen code has no network. Dependencies come
20 from a mirror.
21
22## Data and authority
23
24- Never use `scope.Owned` or `scope.OwnedBy` for shared team records.
25- Derive `Actor` from the verified session, never a submitted form field.
26- Check the current roster inside each write transaction. Removal and role
27 changes must affect existing sessions immediately. Lookup errors deny access.
28- Use the transaction handle throughout a transaction. Append the audit event
29 there too, with no credentials in it.
30- Never bind requests onto GORM models. Read allowed fields explicitly and use
31 `.Select` for updates.
32- Keep migrations additive. App tables belong in `Models` and `Schema`;
33 framework sessions, auth and proof tables belong only in `BootSchema`.
34- An unknown count must remain unknown. Never turn a query error into zero.
35- `NewStore` grants no authority. Execution is off unless
36 `EQUIPO_EXECUTION_ENABLED=1`; runner dispatch uses only the gated paths.
37
38## Boot and interface
39
40Require `EQUIPO_ORIGIN` and `EQUIPO_INSTANCE_KEY`. Require a mail channel:
41CARLOS mail submission (`CARLOS_MAIL=submit`, set only by the CARLOS agent), or
42both `CARLOS_SMTP_HOST` and `CARLOS_SMTP_FROM`, unless local logged mail is
43explicitly enabled with `EQUIPO_ALLOW_LOGGED_MAIL=1`. Logged mail is
44allowed only on loopback or a staging origin. Build the sender with `equipo.Mailer` (`mail.FromCarlos`) only on
45the serve path, never in a seed or one-shot, which has no control socket.
46`EQUIPO_OWNERS` is enforced by bootstrap only when the database has no team.
47Never log credentials or sign-in links in production.
48
49Production upgrades: an agent runs `scripts/upgrade-thin.sh <version> --execute` (and its rollback) itself, then tells Paul. With a green staging run and no waiver it needs no one's go (Paul, 2026-11-20). A waiver is Paul's decision; once he approves one, the agent still runs the upgrade, not Paul (Paul, 2026-11-22). The cutover scripts and anything needing the owner's sign-in (enrolment links, revoking machines) stay with Paul.
50
51The page renderer is not in the instance (it would pass the platform's 256 MiB ship cap). A release whose `renderer.tar.gz` changed is published before staging with `scripts/publish-renderer.sh publish <the runner release directory>`: the archive and its `SOURCES` on the forge, under the tag linked into the runner. Staging downloads and checks it (`publish-renderer.sh check`) before it installs anything, and refuses an unpublished one. Self-serve installs fetch it from there.
52
53Use Rastrillo v0.45.0 APIs from the pinned module cache. Resolve activation,
54open one database, construct the app, clear `opts.DBPath`, then serve.
55The database closes on shutdown and on failed app construction.
56
57Use the day theme and sidebar shell. Link tokens.css and theme.css. Keep
58vendored static files byte-identical and put app styling in equipo.css.
59The sign-in door (`internal/equipo/door`, Home's smart-door spec) is
60estilo's door around rastrillo's one-way screen; `static/estilo/` is
61estilo's, byte for byte.
62Use the attribute grammar, token colors, scriptless forms and phone index
63navigation. Do not add a split screen or an authentication bypass.
64
65## Copy and verification
66
67App-owned runtime strings live only in `internal/equipo/copy.go`. Mark changed
68entries pending with `python3 scripts/copy-status.py pending` (bounded JSON
69stdin: candidate root and keys). The trusted-base `.equipo/copy.json` contract
70extracts changed values independently of markers. When an owner enables
71"Copy can accept on my behalf" for this project, Copy reviews structured
72strings and the runner applies the result and invokes `accept` only for the
73reviewed changed keys, with matching server records and exact text hashes.
74Engineering never invokes `accept` or writes acceptance markers. With the
75setting off, Copy does not run and pending copy still blocks release.
76`regenerate` repairs pending bookkeeping; `verify` checks without writing.
77The release gate remains `make copy-release-check`. Owner edits and imports
78teach only that delegating owner's Copy notes; forge diffs never teach.
79Use plain words, no em dashes and no exclamation marks. Leave README prose
80unchanged unless the task explicitly authorizes reviewed or flagged draft copy.
81
82Write a failing test before implementation. Observe each guard fail by
83breaking the behavior it protects, then restore it. Record the commands and
84results in the controller report.
85
86`make ci` is the shared local and CI gate: build, vet, formatting, staticcheck,
87govulncheck, gitleaks, budgets, tests, migration check and performance. Keep
88`.amadan/ci` and `.amadan/ci.d/` delegating to the same Make targets. Follow the
89controller's narrower gate list for individual tasks. Builds use `CGO_ENABLED=0`.
90
91Never merge, push the default branch, or deploy autonomously. Human deployment
92uses a versioned release. Keep scratch under on-disk `$TMPDIR`, leave Go caches
93at their defaults, bind local servers to `127.0.0.1`, and clean up processes
94and scratch before handing back.
95