oficina / equipo Public

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

Plain git — no account needed to clone.

Download

Download this file

1# Private-first repository storage (proposal)
2
3Status: design for Paul's decision, not approval to deploy or migrate. No repository existence has been verified remotely in this investigation.
4
5## Recommendation and alternatives
6
7Recommend **durable local bare repositories with explicit, optional Amadan publishing** for private incubation. “Local” means an operator-owned persistent storage root, outside runner workspaces and cleanup, not a disposable runner disk. Keep current hosted projects on their existing path. If private projects need multi-person collaboration and hosted CI immediately, prefer a private Amadan deployment instead of rebuilding those services in Equipo. Do not enable local default-branch merges until equivalent safety gates exist.
8
9| | Equipo-private Amadan | Durable bare repositories + optional publishing |
10| --- | --- | --- |
11| Authority | Separate private forge, persistent volume and metadata database | Operator-owned bare store; runner clones are disposable caches |
12| Benefits | Reuses forge grants, branch merge API and CI model, subject to deployment validation; natural multi-runner access | No forge service required for incubation; offline operation; sharing is a separate decision |
13| Costs | Operate upgrades, TLS/networking, identities, CI workers, monitoring and recovery | Equipo must supply authorization, locking, merge/check enforcement and durable operation records |
14| Sharing | Grant access on private instance if reachable, or explicitly publish to shared Amadan | Explicit publish to private Amadan repository and grant named collaborators; public visibility is separate |
15| Runner loss | Reclone from forge, recover task/control state separately | Reclone from surviving store; if colocated hardware is lost, restore off-machine backup |
16
17A private Amadan on the same disposable runner does not solve durability. Neither option is a configuration-only change: repository validators, bridge construction and forge URLs currently assume `amadan.net`. A second forge needs endpoint-scoped credentials and identities, not a DNS alias pretending to be the existing host.
18
19## What the code actually establishes
20
21- `internal/runner/thin/bridge.go` authorizes `create_project` through the instance, then calls `Forge.Exists` / `Forge.Create`, persists creation progress, and sends `project_created`. A resumed nonempty creation record skips the remote check. Clone work happens after registration.
22- `internal/equipo/chat/tools.go` authorizes using the runner hello's namespaces and refuses already registered/advertised repositories. `projectCreated` checks the preceding authorized call and inserts a project; it does not independently verify storage. `add_project` is registration, not repository provisioning.
23- `internal/runner/thin/forge.go` creates with `POST /api/v1/repos`, `tier: private`. `Exists` refreshes the agent's **writable repository list**, not a global existence query. An absent result can mean inaccessible, not nonexistent. Creation retries adopt an accessible existing repository. `create_test.go` verifies this contract with an in-memory fake, not a live host or the reported repository.
24- `Reachable` unions configured entries, `created-repos.json`, and cached host listings. Host errors retain previous listings; even a successful refresh does not remove configured/created entries. `Exists` does detect an unsuccessful refresh, but “reachable” is not proof of a successful fetch. `internal/runner/thin/index.go` keeps an old catalog entry on fetch failure; a new unfetchable repository gets no entry. Reads are authorized against that catalog, not simply project registration.
25- `Clones` in `forge.go` uses URL-derived paths, fetches with pruning, and can shallow-fetch for indexing. These are caches, not authoritative stores. `internal/runner/workspace/task.go` builds replaceable task trees with a private Git directory and object alternates to the clone. Such a tree is not a self-contained backup.
26
27**Reported discrepancy:** Paul reports that `neighbourhood-threat` exists nowhere; a status report naming it as reachable does not contradict that conclusively. Stale/configured/created-list membership, retained catalog data, or a registration followed by clone failure can explain differing status and read/find results. An empty newly created repository without a default-branch tip is another possible indexing failure, not evidence of this incident. No live response, creation ledger or incident log was available in the inspected source; the precise cause remains unproven. Do not announce creation success or attempt to recreate/adopt it on this evidence.
28
29Next authorized diagnostic step: correlate the original tool call ID and instance registration with runner creation state, sanitized POST outcome, configured/created/listed provenance, hello/catalog timestamps and clone/index errors. Then check the intended host and namespace with the intended agent and an owner, distinguishing not found, access denied, transport failure and empty repository. Do not dump credentials. Proposed status states should separate registered, provisioned, last verified readable/writable, empty, unavailable and shared, with timestamps and evidence provenance.
30
31## Storage, identity and permissions
32
33- Use immutable project and repository IDs independent of name, URL, host or storage path. Preserve existing project/task IDs, task branch names and commit SHAs; add a repository binding with backend, location, default branch and version. Retain old URL aliases for lookup, never as authorization. Audit current URL-keyed clone paths, grants, task payloads and operation journals before migration.
34- One authoritative writer destination per repository. Separate local durability from outward publication, even though today's code uses “publish” for task delivery. Persist provisioning, candidate delivery, merge and sharing intents with idempotency keys and binding versions. A retry reconciles refs before acting; uncertain outcomes remain uncertain.
35- Private by default: only the owning person and assigned runner service can access the store. Builders get task files, not storage paths, credentials or writable bare stores. Enforce per-project read/write/merge/share rights, isolated filesystem ownership, canonical paths and no symlink escapes. A namespace grant is not permission to share all private projects.
36- A trusted runner-side storage adapter accepts approved task refs and verified objects; it is not arbitrary filesystem access from a model. Keep current hook/helper/config restrictions. Sharing requires explicit destination, refs/history scope, visibility and collaborators. Explain that history may contain secrets; scan/review before export. Revoking access cannot recall existing clones.
37
38## Checks and merges are non-negotiable
39
40Preserve the existing candidate/check/review and person approval policy. `internal/runner/thin/relay.go` validates publication before the push; `internal/runner/forge/merge.go` validates task branch and judged SHA, confirms the lease, journals intent and reconciles uncertain results. Amadan performs the locked expected-SHA merge and enforces its own CI; pending, failed and unknown checks must not become success.
41
42A local adapter must provide the equivalent trusted merge boundary: serialize by repository, recheck task head and default tip, verify approvals and required checks for the exact candidate/policy, refuse conflicts or moved refs, atomically update refs, and persist/reconcile the outcome. Local checks need a defined trusted executor and result provenance, not a fabricated hosted CI result. Until this is built and tested, private repositories may retain candidates but cannot silently bypass hosted merge enforcement. A private Amadan also needs CI configured and validated, not merely a running Git server.
43
44## Backup, recovery and runner loss
45
46Back up full self-contained objects, all retained refs/tags, default HEAD, repository bindings/ACLs, Equipo project/task metadata, approvals/check evidence and operation journals. Include any LFS objects if supported; otherwise explicitly reject unsupported storage. Keep secrets separately encrypted and recoverable by the operator. Quiesce writes or use coordinated snapshots so refs and journals describe a recoverable point.
47
48Proposed starting target for Paul's approval: encrypted off-machine daily snapshots with 30-day retention, checkpoint after accepted candidates/merges, and recovery within one working day. A checkpoint is not off-machine protection unless replicated; show the last protected checkpoint and potential loss window. Never call an unreplicated runner-only candidate durably recoverable. Run periodic isolated restore drills, verifying object completeness, refs, task bindings and merge reconciliation. Amadan backups must include its database/config and CI policy, not just Git directories.
49
50On runner loss, fence its leases and credentials before a replacement writes. Mount the surviving durable store or restore the chosen snapshot, restore matching control state, verify refs and incomplete operations, then rebuild caches/workspaces. Work since the last protected checkpoint can be lost; do not infer it from a completed task label. Do not use concurrent independent restores as writers.
51
52## Optional publication and remote migration
53
54Start with one-way, explicit publication; avoid automatic bidirectional sync. Preview the destination and selected branches/tags/history, create or verify the private destination only with approval, transfer objects, and verify matching refs before reporting success. Retry by operation ID and expected destination state, never by overwriting unrelated content. Publication does not automatically grant access or switch authority.
55
56For a later authority switch: pause new work, fence old writers, drain or reconcile pending operations, snapshot, copy and verify refs/objects/default HEAD, apply destination permissions and CI, then atomically advance the repository binding version. Keep IDs and task history unchanged, rebuild URL-keyed caches, and reject stale commands targeting the old binding. Retain the old store read-only for an agreed rollback period. Roll back before new writes, or explicitly reconcile divergent history afterwards; never silently force-push or delete either copy.
57
58## Phases, each separately approved
59
601. **Evidence and decision:** diagnose the reported discrepancy without mutations; choose storage operator, durability targets and sharing semantics. Specify truth/provenance fields for status.
612. **Identity and contracts:** introduce backend-neutral bindings and operation states behind a disabled feature flag. Test registration versus provisioning, lost replies, revoked access, stale catalogs, empty repositories and retry/adoption collisions. Keep hosted behavior unchanged.
623. **Private storage pilot:** after approval, implement isolated durable provisioning and candidate retention, permissions, backups and restore drills. Test disk-full/crash recovery, runner replacement and cross-project denial. No local merge until the trusted check/approval/atomic-merge contract passes moved-head, failed-check and uncertain-result tests.
634. **Explicit sharing pilot:** implement preview/approval, private publication, grants and reconciliation. Test interrupted transfers, destination collisions and accidental history disclosure. Keep local authority unless separately switched.
645. **Migration only if requested:** exercise binding cutover and rollback with in-flight tasks in a disposable test environment; migrate real repositories only under a separate approved plan.
65
66## Questions for Paul
67
68- Is private incubation usually single-person/offline, or do collaborators and several runners need immediate access? Would maintaining private Amadan be preferable to owning local merge enforcement?
69- Which durable machine/volume should own private repositories, and who operates off-machine backups? What data-loss window and recovery time are acceptable?
70- Does “share” mean named collaborators on a private repository, public release, or moving authority to Amadan? Should full history travel by default?
71- Which checks and human approvals must private merges require, and where may those checks run?
72- Should unshared project names and task metadata also stay local, or is storage privacy sufficient while Equipo's instance tracks them?
73
74No infrastructure, repository or runtime behavior changes are part of this proposal.
75