|
| 1 | +// SPDX-License-Identifier: MPL-2.0 |
| 2 | +// Copyright (c) 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 3 | += Resite execution — Codex agent handoff |
| 4 | +:toc: left |
| 5 | + |
| 6 | +Status: READY TO EXECUTE (pending repo access). Source repo baseline: `main`. |
| 7 | + |
| 8 | +== Audience & how to use this |
| 9 | +You are an autonomous coding agent (e.g. Codex) executing the resite of the |
| 10 | +`hyperpolymath/nextgen-databases` *coordination repo*: every database / query language is |
| 11 | +being moved to its own repo so this repo becomes thin. This file is self-contained — follow |
| 12 | +it top to bottom. `REGISTRY.adoc` is the authoritative map; this file is the command sheet. |
| 13 | + |
| 14 | +== Preconditions (verify first; STOP if unmet) |
| 15 | +. `gh` CLI authenticated to the `hyperpolymath` org with `repo` + repo-creation rights: |
| 16 | + `gh auth status` and `gh repo view hyperpolymath/verisimdb` must succeed. |
| 17 | +. `git filter-repo` installed: `git filter-repo --version` |
| 18 | + (install via `pipx install git-filter-repo`, `brew install git-filter-repo`, or distro pkg). |
| 19 | +. Write access to existing repos: `verisimdb`, `quandledb`, `vcl-ut`. |
| 20 | +. Create access for new repos: `lithoglyph`, `glyphbase`, `gnpl`, `nqc`, `VerisimCore.jl`. |
| 21 | +If any check fails, STOP and report exactly which access is missing. Do not work around it. |
| 22 | + |
| 23 | +== Golden safety rules (do not violate) |
| 24 | +. *Never* `git push` to `main`/`master` of an *existing* repo. Existing repos |
| 25 | + (`verisimdb`, `quandledb`, `vcl-ut`) get an `import/from-monorepo` branch + PR only. |
| 26 | +. *Reconcile before delete*: never `git rm` a directory from the coordination repo until its |
| 27 | + destination demonstrably contains the content (diff clean or PR merged). |
| 28 | +. *One repo at a time*; verify each before moving on. |
| 29 | +. Operate on throwaway clones under `/tmp`, never on a working clone you intend to keep. |
| 30 | +. New repos: default visibility *public* (matches the org). Change to `--private` if told to. |
| 31 | + |
| 32 | +== Final mapping (authoritative: REGISTRY.adoc) |
| 33 | +[cols="2,2,1,2",options=header] |
| 34 | +|=== |
| 35 | +| Source (monorepo) | Destination | Exists? | Action |
| 36 | +| `nqc/` | hyperpolymath/nqc | create | extract as-is |
| 37 | +| `verisim-core/` | hyperpolymath/VerisimCore.jl | create | extract (Julia package) |
| 38 | +| `lithoglyph/glyphbase/` | hyperpolymath/glyphbase | create | un-nest |
| 39 | +| `lithoglyph/gql-dt/` + `lithoglyph/core-factor/gql/` | hyperpolymath/gnpl | create | un-nest (2 paths) |
| 40 | +| `lithoglyph/` (minus the two above) | hyperpolymath/lithoglyph | create | slimmed parent |
| 41 | +| `typeql-experimental/` | hyperpolymath/vcl-ut | exists | reconcile -> delete copy |
| 42 | +| `quandledb/` (stub) | hyperpolymath/quandledb | exists | reconcile -> delete copy |
| 43 | +| `verisimdb/` (incl. `src/vcl/`) | hyperpolymath/verisimdb | exists | reconcile -> delete copy; VCL stays nested |
| 44 | +| `verisim-modular-experiment/` | hyperpolymath/verisimdb | exists | FOLD IN as standard feature -> delete |
| 45 | +| (no KRL content here) | hyperpolymath/krl | exists | no-op |
| 46 | +|=== |
| 47 | + |
| 48 | +== Step 0 — setup |
| 49 | +[source,sh] |
| 50 | +---- |
| 51 | +git filter-repo --version |
| 52 | +gh auth status |
| 53 | +git clone https://github.com/hyperpolymath/nextgen-databases /tmp/ngdb |
| 54 | +cd /tmp/ngdb && git rev-parse HEAD # record baseline SHA in your final report |
| 55 | +# sanity-check the un-nest subpaths exist before extracting: |
| 56 | +ls -d lithoglyph/glyphbase lithoglyph/gql-dt lithoglyph/core-factor/gql |
| 57 | +---- |
| 58 | + |
| 59 | +== Step 1 — create + populate NEW repos (no risk to existing) |
| 60 | +Do smallest first to prove the pattern. Generic single-path helper: |
| 61 | +[source,sh] |
| 62 | +---- |
| 63 | +extract() { # $1 = subdir/ (trailing slash) $2 = /tmp workdir name |
| 64 | + rm -rf "/tmp/$2" |
| 65 | + git clone --no-local /tmp/ngdb "/tmp/$2" |
| 66 | + ( cd "/tmp/$2" && git filter-repo --path "$1" --path-rename "$1:" ) |
| 67 | + ( cd "/tmp/$2" && git log --oneline -1 && echo "files: $(git ls-files | wc -l)" ) |
| 68 | +} |
| 69 | +publish() { # $1 = /tmp workdir $2 = owner/repo $3 = description |
| 70 | + gh repo create "$2" --public --description "$3" --disable-wiki |
| 71 | + ( cd "$1" && git remote add dest "https://github.com/$2.git" && git push dest HEAD:main ) |
| 72 | +} |
| 73 | +---- |
| 74 | + |
| 75 | +=== 1a. nqc |
| 76 | +[source,sh] |
| 77 | +---- |
| 78 | +extract nqc/ nqc |
| 79 | +publish /tmp/nqc hyperpolymath/nqc "NQC — Nested Query Calculus (Gleam)" |
| 80 | +---- |
| 81 | + |
| 82 | +=== 1b. VerisimCore.jl |
| 83 | +[source,sh] |
| 84 | +---- |
| 85 | +extract verisim-core/ VerisimCore.jl |
| 86 | +publish /tmp/VerisimCore.jl hyperpolymath/VerisimCore.jl "VerisimCore.jl — slim Julia identity-core of VeriSimDB" |
| 87 | +---- |
| 88 | + |
| 89 | +=== 1c. glyphbase (un-nest) |
| 90 | +[source,sh] |
| 91 | +---- |
| 92 | +extract lithoglyph/glyphbase/ glyphbase |
| 93 | +publish /tmp/glyphbase hyperpolymath/glyphbase "Glyphbase — Lithoglyph web UI / data layer" |
| 94 | +---- |
| 95 | + |
| 96 | +=== 1d. gnpl (un-nest, two source paths) |
| 97 | +[source,sh] |
| 98 | +---- |
| 99 | +rm -rf /tmp/gnpl && git clone --no-local /tmp/ngdb /tmp/gnpl |
| 100 | +( cd /tmp/gnpl && git filter-repo \ |
| 101 | + --path lithoglyph/gql-dt/ --path lithoglyph/core-factor/gql/ \ |
| 102 | + --path-rename lithoglyph/gql-dt/:gql-dt/ \ |
| 103 | + --path-rename lithoglyph/core-factor/gql/:core-factor-gql/ ) |
| 104 | +publish /tmp/gnpl hyperpolymath/gnpl "GNPL — Glyph query language (dependently-typed)" |
| 105 | +---- |
| 106 | + |
| 107 | +=== 1e. lithoglyph (slimmed: drop the un-nested subdirs; two filter-repo passes) |
| 108 | +[source,sh] |
| 109 | +---- |
| 110 | +rm -rf /tmp/lithoglyph && git clone --no-local /tmp/ngdb /tmp/lithoglyph |
| 111 | +( cd /tmp/lithoglyph \ |
| 112 | + && git filter-repo --path lithoglyph/ --path-rename lithoglyph/: \ |
| 113 | + && git filter-repo --invert-paths --path glyphbase/ --path gql-dt/ --path core-factor/gql/ ) |
| 114 | +publish /tmp/lithoglyph hyperpolymath/lithoglyph "Lithoglyph — narrative-first, reversible, audit-grade database" |
| 115 | +---- |
| 116 | + |
| 117 | +== Step 2 — reconcile EXISTING repos (never clobber) |
| 118 | +For each, compare the monorepo copy against the live canonical repo, then decide. |
| 119 | +[source,sh] |
| 120 | +---- |
| 121 | +reconcile() { # $1 = subdir/ $2 = owner/repo |
| 122 | + name="${2##*/}" |
| 123 | + rm -rf "/tmp/mono-$name"; git clone --no-local /tmp/ngdb "/tmp/mono-$name" |
| 124 | + ( cd "/tmp/mono-$name" && git filter-repo --path "$1" --path-rename "$1:" ) |
| 125 | + rm -rf "/tmp/canon-$name"; git clone "https://github.com/$2" "/tmp/canon-$name" |
| 126 | + echo "===== DIFF $1 vs $2 =====" |
| 127 | + diff -rq --exclude=.git "/tmp/mono-$name" "/tmp/canon-$name" || true |
| 128 | +} |
| 129 | +reconcile quandledb/ hyperpolymath/quandledb # stub here; expect canonical is ahead |
| 130 | +reconcile typeql-experimental/ hyperpolymath/vcl-ut |
| 131 | +reconcile verisimdb/ hyperpolymath/verisimdb |
| 132 | +---- |
| 133 | +Decision per repo, from the diff: |
| 134 | + |
| 135 | +* *No monorepo-unique content* (canonical already has it) -> nothing to push; mark |
| 136 | + "safe to delete" for Step 4. |
| 137 | +* *Monorepo has unique/newer content worth keeping* -> open an import PR (never push main): |
| 138 | +[source,sh] |
| 139 | +---- |
| 140 | +cd /tmp/mono-<name> |
| 141 | +git remote add dest "https://github.com/hyperpolymath/<name>.git" |
| 142 | +git push dest HEAD:refs/heads/import/from-monorepo |
| 143 | +gh pr create --repo hyperpolymath/<name> --base main --head import/from-monorepo \ |
| 144 | + --title "Import unique work from the nextgen-databases monorepo copy" \ |
| 145 | + --body "Reconciles the stale monorepo duplicate before it is deleted from the coordination repo." |
| 146 | +---- |
| 147 | + Mark "delete after this PR merges". |
| 148 | + |
| 149 | +== Step 3 — fold modular-experiment into verisimdb |
| 150 | +The capability is being standardised (no longer an experiment). Bring it in via a feature |
| 151 | +branch + PR; do not create a separate repo. |
| 152 | +[source,sh] |
| 153 | +---- |
| 154 | +rm -rf /tmp/mod && git clone --no-local /tmp/ngdb /tmp/mod |
| 155 | +( cd /tmp/mod && git filter-repo \ |
| 156 | + --path verisim-modular-experiment/ --path-rename verisim-modular-experiment/:modular-core/ ) |
| 157 | +cd /tmp/mod |
| 158 | +git remote add dest https://github.com/hyperpolymath/verisimdb.git |
| 159 | +git push dest HEAD:refs/heads/feature/modular-core |
| 160 | +gh pr create --repo hyperpolymath/verisimdb --base main --head feature/modular-core \ |
| 161 | + --title "Standardise modular-core (from verisim-modular-experiment)" \ |
| 162 | + --body "Folds the proven modular-experiment in as a standard verisimdb feature." |
| 163 | +---- |
| 164 | + |
| 165 | +== Step 4 — thin the coordination repo (one PR on nextgen-databases) |
| 166 | +Only after each destination above is confirmed (diff clean or PR merged). |
| 167 | +[source,sh] |
| 168 | +---- |
| 169 | +cd /tmp/ngdb |
| 170 | +git checkout -b resite/thin-coordination |
| 171 | +git rm -r nqc verisim-core lithoglyph typeql-experimental verisim-modular-experiment quandledb verisimdb |
| 172 | +git submodule add https://github.com/hyperpolymath/verisimdb.git verisimdb |
| 173 | +git submodule add https://github.com/hyperpolymath/lithoglyph.git lithoglyph |
| 174 | +---- |
| 175 | +Then edit, in this repo: |
| 176 | + |
| 177 | +* `REGISTRY.adoc` — set every row to its final state / link. |
| 178 | +* `0-AI-MANIFEST.a2ml` — empty the LEGACY directory list (nothing legacy remains). |
| 179 | +* `EXPLAINME.adoc`, `TOPOLOGY.md`, `README.adoc` — describe the thin structure (submodules + |
| 180 | + registry links). |
| 181 | +* `.github/workflows/placement-guard.yml` — empty the `GRANDFATHER` regex so ANY database |
| 182 | + path is now a hard error (not a warning). |
| 183 | +* `.claude/hooks/block-db-writes.sh` — keep the dest map (for helpful messages) but the |
| 184 | + directories no longer exist, so any reintroduction is blocked outright. |
| 185 | +* `docs/migration/RESITE-DATABASES-TO-OWN-REPOS.adoc` — set `Status: DONE`. |
| 186 | + |
| 187 | +[source,sh] |
| 188 | +---- |
| 189 | +git add -A |
| 190 | +git commit -m "chore(resite): thin coordination repo to references; remove extracted databases" |
| 191 | +git push -u origin resite/thin-coordination |
| 192 | +gh pr create --base main --title "Resite: thin the coordination repo" \ |
| 193 | + --body "Removes extracted databases (now in their own repos), adds verisimdb + lithoglyph as submodules, and points REGISTRY.adoc at the canonical repos. Closes the resite." |
| 194 | +---- |
| 195 | + |
| 196 | +== Verification (run before declaring done) |
| 197 | +* Each NEW repo: `git -C /tmp/<name> log --oneline -1` shows preserved history; the GitHub |
| 198 | + repo has files at root and an `0-AI-MANIFEST.a2ml`. |
| 199 | +* Each EXISTING repo: the Step-2 diff is empty, or the import PR is merged. |
| 200 | +* Coordination repo after Step 4: |
| 201 | + `git ls-tree HEAD verisimdb lithoglyph` shows `commit` (submodule) entries, not trees; |
| 202 | + `git ls-files | grep -E '^(nqc|verisim-core|typeql-experimental|quandledb|verisim-modular-experiment)/'` |
| 203 | + returns nothing; the placement-guard `GRANDFATHER` regex is empty; |
| 204 | + `git clone --recurse-submodules` of the coordination repo still yields verisimdb + lithoglyph. |
| 205 | + |
| 206 | +== Final report (post this back) |
| 207 | +For every row in the mapping: action taken, destination URL, PR link (if any), and |
| 208 | +verification result. List anything skipped and why. |
0 commit comments