Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f6cdd9ee1481d17c5fbb6d35aa538aba1c6cbb4e7f71ea67112356c958a668c1
Ticket: e67a02268c38cc37d2ad1956a9bcbb7891716046
Repositories can only be added by restarting the server
User & Date: dmestas on 2026-08-18 00:33:26
Changes

  1. comment changed to:
    A repository can only be added to quarry by editing the server's command line and restarting it. Neither a user nor an admin can do it through the forge.
    
    The whole mechanism is a startup flag:
    
        quarry serve --repo name=/path/to/store --repo other=/path/...
    
    There is no `repo.add` op — the registry holds only `repo.list` and `repo.counts`, both read-only — and no CLI verb (`version|spec|serve|reindex|user|account|webhook|docs`). quarry also never creates a store: there is no `zit init` path anywhere, so the repository must already exist on disk before it can be named.
    
    Hosting repositories is the feature of a forge, and none of it is reachable through the API. Principle 5 again, and a more central case than account management.
    
    ## What adding one costs today
    
    Observed, twelve times over, adding the gaia-gis repositories:
    
    1. Clone or create the store yourself, outside quarry.
    2. `zit import-fossil --compatible` if it came from fossil.
    3. Edit the server invocation to add `--repo name=path`.
    4. **Restart the server** — every other repository goes down and re-runs its ingest round.
    
    Step 4 is what makes this worse than the account gap. Creating an account needs shell access but disturbs nothing; adding a repository takes the whole fleet offline. With 23 repositories the restart also re-opens 23 indexes and re-runs 23 ingest rounds, which is the exact path that has to be bounded for memory (see the ingest lane).
    
    ## The invocation is itself a liability
    
    The serve command is now 57 argv elements held nowhere but shell history. That is not a hypothetical problem: building it with an unquoted shell variable silently dropped twelve `--repo` flags, and quarry started and served the remaining eleven **without any diagnostic**, because Go's flag parser treats the malformed element as a positional argument and ignores it.
    
    Two things fall out:
    
    - The registry belongs in storage, not in argv. It is forge configuration exactly like `mirror` and `webhook`, and those already live in OLTP.
    - `serve` should refuse unknown positional arguments. It accepts and ignores them today, which turned a twelve-repository omission into a silent one.
    
    ## What is needed
    
    1. **Persist the registry** in OLTP beside `mirror` and `webhook`. `--repo` stays as a bootstrap and override, but stops being the only source of truth.
    2. **`repo.add` / `repo.remove` ops**, `ops.Admin`, with the CLI on top of them rather than beside them.
    3. **Dynamic registration.** Adding a repository must not restart the fleet: open its index, start its pipeline, register it. Removal is the reverse, and needs to stop the pipeline and close the index rather than leak both.
    4. **Create an empty repository** — `zit init` behind `repo.add --create`. This is the "host my project here" case and quarry cannot do it at all today.
    5. **Adopt by cloning a remote** — which is the mirror machinery pointed at a store that does not exist yet, so most of it is already written.
    6. **`serve` rejects unknown positionals**, so a malformed invocation fails loudly.
    
    ## Ordering
    
    Items 1–3 are the feature. Items 4–5 are what makes it useful to somebody who is not already holding a `.fossil` file. Item 6 is a few lines and should not wait for any of it.
    
    ## Related
    
    - Private repositories: a repository created through `repo.add` needs a visibility from the moment it exists, not after.
    - Account management in the API: both are cases of forge administration being shell-only.
    
    
  2. status changed to: "Open"
  3. title changed to:
    Repositories can only be added by restarting the server