diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index a6d29dc..0171c83 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -19,9 +19,10 @@ jobs: TAG: ${{ github.ref_name }} SERVER: ${{ github.server_url }} REPO: ${{ github.repository }} - # Where crate-kit lives on the forge (owner/name), independent of the owner of this repository. - # Override with the repository variable CRATE_KIT_REPO (Settings > Actions > Variables). - CRATE_KIT_REPO: ${{ vars.CRATE_KIT_REPO || 'LLM/crate-kit' }} + # crate-kit has ONE reference: gargoton (public repository, anonymous clone). It is not mirrored on + # this forge. Override only with the repository variable CRATE_KIT_URL (Settings > Actions > Variables). + # FORGETOKEN belongs to this forge and is never sent to another host. + CRATE_KIT_URL: ${{ vars.CRATE_KIT_URL || 'https://gargoton.petite-maison-orange.fr/LLM/crate-kit' }} steps: - name: System tools run: | @@ -32,8 +33,7 @@ jobs: run: | git -c http.extraHeader="Authorization: token $FORGETOKEN" \ clone --depth 1 --branch "$TAG" "$SERVER/$REPO.git" src - git -c http.extraHeader="Authorization: token $FORGETOKEN" \ - clone --depth 1 "$SERVER/$CRATE_KIT_REPO.git" crate-kit + git clone --depth 1 "$CRATE_KIT_URL" crate-kit - name: Kit archive working-directory: src diff --git a/.gitignore b/.gitignore index 1cf4433..178135c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -# Secrets of this workstation: never committed. -/secrets/ /dist/ diff --git a/README.md b/README.md index 667fc1a..9a69ef3 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,8 @@ run here (`make help`); those of a crate, in the crate. - `Makefile`: cluster targets (delegated to `crate-kit`), `ci`, `jjrelease`. - `tools/kit-assemble.sh`, `tools/kit-copy.sh`: set the overlay and call those of `crate-kit`. -- `overlay/kit/org.mk`: registry, forge, token file. `overlay/kit/VERSION`: extension version. +- `overlay/kit/org.mk`: registry, forge (no token: see `secrets/` of the cluster). `overlay/kit/VERSION`: extension version. - `overlay/templates/`: reserved for crate kinds; none is defined (no plugin kind, no catalog). -- `secrets/`: forge token (`secrets/forge-token`, one line; rights: packages, repository, wiki, releases), gitignored, - mode 0600, never committed. `FORGETOKEN` in the environment overrides it. - `tests/`: `make test`. ## Release diff --git a/ReleaseNotes/version-0.1.1.md b/ReleaseNotes/version-0.1.1.md new file mode 100644 index 0000000..cb47b12 --- /dev/null +++ b/ReleaseNotes/version-0.1.1.md @@ -0,0 +1,21 @@ +# Release Notes for obi-kit (obi extension of crate-kit), version 0.1.1 + +## Features + +- **Initial Release**: Registered `obi` on `forge.metabarcoding.org` with `KIT_LANG=en` under CeCILL-2.1 license. +- **MCP Configuration**: Added `overlay/claude/mcp.json` to define the 'qmd' MCP server (`qmd mcp`), noting that these collections are external. + +## Workflow & CI + +- **Clone Strategy**: Replaced `CRATE_KIT_REPO` with `CRATE_KIT_URL` in `.gitea/workflows/release.yaml` to support anonymous HTTPS cloning from gargoton using `git clone --depth 1`. +- **Secret Handling**: Removed `FORGE_TOKEN_FILE` from `overlay/kit/org.mk`; clarified that forge tokens reside in `secrets/` next to repositories, with `FORGETOKEN` overriding them in CI. + +## Testing + +- **Verification**: Updated `tests/overlay.sh` to verify the installation of the 'qmd' MCP configuration by checking `.mcp.json` and `.claude/settings.json`. + +## Documentation + +- **Pilot Risks**: Updated `docs/pilot-risks.md` to reflect that `crate-kit` resides only on gargoton and is cloned anonymously via HTTPS, removing references to local mirrors on `forge.metaboding.org`. +- **Readme**: Updated `README.md` to reflect the presence of `overlay/kit/org.mk` and `overlay/kit/VERSION`, and removed mentions of `secrets/` for forge tokens. +- **Git Ignore**: Added `/dist/` to `.gitignore` and removed the comment about workstation secrets. diff --git a/docs/pilot-risks.md b/docs/pilot-risks.md index b20a867..5955d65 100644 --- a/docs/pilot-risks.md +++ b/docs/pilot-risks.md @@ -55,7 +55,8 @@ same version on some setups: use a name and versions that are disposable). wiki and releases (`write:package`, `write:repository`, `write:organization` may be needed to see the organization's package registry); token owner must be a member of `obi` with write access. - Test: a workflow step that prints only `${FORGETOKEN:+set}`; never echo the token. -- Local: `secrets/forge-token` in `obi-kit` (gitignored, mode 0600). +- Local: `secrets/forge.metabarcoding.org.token` in `secrets/` of the cluster `obi` (outside every repository, + mode 0600; see crate-kit README, "Forge tokens"). ## 5. Runner @@ -69,12 +70,12 @@ same version on some setups: use a name and versions that are disposable). ## 6. `crate-kit` location for the extension-kit workflow -- `obi-kit/.gitea/workflows/release.yaml` clones `crate-kit` from `$SERVER/$CRATE_KIT_REPO`, default - `LLM/crate-kit`, on **the same forge as `obi-kit`** (`SERVER` = `forge.metabarcoding.org`). -- Risk: `crate-kit` currently lives on `gargoton.petite-maison-orange.fr`, another forge: `LLM/crate-kit` does - not exist on `forge.metabarcoding.org`, so the obi-kit release workflow fails at its second clone. -- Options to decide: mirror/push `crate-kit` to the `obi` organization and set the repository variable - `CRATE_KIT_REPO=obi/crate-kit`, or change the clone URL. Not decided. +- Decision (2026-12-01): `crate-kit` lives on `gargoton.petite-maison-orange.fr` and nowhere else; it is the + single reference, there is no `obi/crate-kit` mirror on `forge.metabarcoding.org`. +- `obi-kit/.gitea/workflows/release.yaml` clones it from `$CRATE_KIT_URL` (default + `https://gargoton.petite-maison-orange.fr/LLM/crate-kit`; override: repository variable `CRATE_KIT_URL`). + The repository is public: anonymous clone, no token. `FORGETOKEN` is never sent to gargoton. +- Test on the pilot: the runner must reach gargoton over HTTPS (network, certificate) and clone anonymously. ## 7. Other points seen while reading diff --git a/overlay/claude/mcp.json b/overlay/claude/mcp.json new file mode 100644 index 0000000..2ba986c --- /dev/null +++ b/overlay/claude/mcp.json @@ -0,0 +1,12 @@ +{ + "_doc": "MCP servers added by the obi extension to the kit's required set (add-only, see crate-kit/claude/mcp.json). qmd: on-device search (BM25 + vectors + rerank) over the markdown collections obikmer-devdoc and obikmer-userdoc (the DevDocMD/ and UserDocMD/ trees of obiskim; the collection names predate the rename). The collections themselves live in ~/.config/qmd/index.yml, outside any repository: repoint them with the qmd CLI, not here.", + "mcpServers": { + "qmd": { + "command": "qmd", + "args": ["mcp"] + } + }, + "signatures": { + "qmd": "qmd mcp" + } +} diff --git a/overlay/kit/VERSION b/overlay/kit/VERSION index 6e8bf73..17e51c3 100644 --- a/overlay/kit/VERSION +++ b/overlay/kit/VERSION @@ -1 +1 @@ -0.1.0 +0.1.1 diff --git a/overlay/kit/org.mk b/overlay/kit/org.mk index e94dc1e..2bfa790 100644 --- a/overlay/kit/org.mk +++ b/overlay/kit/org.mk @@ -3,8 +3,7 @@ REGISTRY ?= obi FORGE_URL ?= https://forge.metabarcoding.org REGISTRY_INDEX ?= sparse+$(FORGE_URL)/api/packages/$(REGISTRY)/cargo/ -# Forge token of a development workstation: file in obi-kit/secrets/ (gitignored, outside synchronization, -# never committed). FORGETOKEN overrides it. -FORGE_TOKEN_FILE ?= $(abspath $(or $(KIT_SRC),.)/secrets/forge-token) +# No token here: the forge tokens of a workstation are files of the cluster, in secrets/ next to the +# repositories (secrets/forge.metabarcoding.org.token, ...), outside every repository. FORGETOKEN (CI) overrides them. # Language of the documents an LLM generates (release notes, commit messages, Claude agents' notes). KIT_LANG ?= en diff --git a/tests/overlay.sh b/tests/overlay.sh index f2b10f4..258081c 100755 --- a/tests/overlay.sh +++ b/tests/overlay.sh @@ -11,3 +11,21 @@ printf 'include %s/kit/org.mk\nprint:\n\t@echo $(REGISTRY)\n' "$tmp" >"$tmp/prob reg=$(make -s -f "$tmp/probe.mk" print) [ -n "$reg" ] || { echo "✗ REGISTRY empty in org.mk" >&2; exit 1; } echo "✓ obi-kit overlay: registry $reg" + +# MCP: the overlay adds qmd to the kit's required servers (fictitious cluster, nothing written elsewhere). +crate_kit="${CRATE_KIT:-$root/../crate-kit}" +mkdir -p "$tmp/cluster" +python3 -I "$crate_kit/claude/mcp-config.py" install --root "$tmp/cluster" \ + --kit "$crate_kit/claude" --overlay "$root/overlay/claude" >/dev/null +python3 -I - "$tmp/cluster" <<'PY' +import json, sys +root = sys.argv[1] +servers = json.load(open(f"{root}/.mcp.json"))["mcpServers"] +need = {"backlog", "codebase-memory-mcp", "serena", "context7", "qmd"} +missing = need - set(servers) +assert not missing, f"servers missing from .mcp.json: {sorted(missing)}" +assert servers["qmd"]["args"] == ["mcp"], servers["qmd"] +enabled = json.load(open(f"{root}/.claude/settings.json"))["enabledMcpjsonServers"] +assert "qmd" in enabled, enabled +PY +echo "✓ obi-kit overlay: MCP qmd declared and installed"