Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit ff1df44

Browse files
HerbHallclaude
andauthored
chore(rules): session review -- Gitea org lifecycle + transfer/rename gotcha (#446)
- AP#138: Two-org Gitea lifecycle model (samverk-research -> samverk) - KG#168: Gitea repo transfer does not rename, separate PATCH required Co-authored-by: Claude <noreply@anthropic.com>
1 parent bc37da8 commit ff1df44

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

claude/rules/autolearn-patterns.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Learned patterns from past sessions. Read when encountering similar situations.
33
tier: 2
4-
entry_count: 66
4+
entry_count: 67
55
last_updated: "2026-03-18"
66
---
77

@@ -685,3 +685,13 @@ MUI Popper needs `anchorEl` during render. `useRef` + `ref.current` triggers Rea
685685
**Category:** gotcha
686686
**Context:** Tests asserting exact counts (e.g., `len(tools) != 41`) fail whenever a new item is added. Common in tool-discovery tests, route-registration tests, and enum exhaustiveness checks.
687687
**Fix:** Before creating a PR that adds tools/routes/handlers, search for `len(...) != N` or `assert.Equal(t, N, len(...))` patterns and update the expected count. For non-correctness counts, prefer `>= N` over exact equality.
688+
689+
## 138. Two-Org Gitea Lifecycle Model for Samverk Projects
690+
691+
**Added:** 2026-03-18 | **Source:** DevKit | **Status:** active
692+
693+
**Category:** architecture-pattern
694+
**Context:** Gitea server hosts both dispatcher-managed production work and pre-intake exploratory research. Without org separation, research repos mix with production ones and become confusing.
695+
**Fix:** Use two orgs: (1) `samverk-research` -- new ideas, exploratory work, pre-viability repos; (2) `samverk` -- dispatcher-managed production projects (devkit, samverk, synapset). When a research project proves viable, transfer once from `samverk-research` to `samverk` and set `lifecycle.phase: intake` in `.samverk/project.yaml`. No further org transfers -- phase progression stays within the `samverk` org.
696+
**Why:** Keeps unmanaged exploratory repos from cluttering the dispatcher's project registry. Org membership signals management status at a glance.
697+
**See also:** KG#168 (Gitea transfer + rename sequence)

claude/rules/known-gotchas.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Known gotchas and platform-specific issues. Read when debugging unexpected behavior.
33
tier: 2
4-
entry_count: 47
4+
entry_count: 48
55
last_updated: "2026-03-18"
66
---
77

@@ -601,3 +601,25 @@ Note: reference the binary directly (`$HOME/.local/bin/trivy`) in the install st
601601
**Platform:** markdownlint-cli2 (all)
602602
**Issue:** Running `npx markdownlint-cli2` with a glob that accidentally includes non-`.md` files (e.g. `.gitignore`, `.sh` scripts) produces false positives. `#` comment lines are parsed as H1 headings, triggering MD022 (no blank line around headings), MD025 (multiple H1), and MD032 (no blank line around lists).
603603
**Fix:** Always scope markdownlint globs to `**/*.md` only. CI lint job already does this correctly — the issue only appears in manual local runs where a non-md file is passed directly or included via a broad glob.
604+
605+
## 168. Gitea Repo Transfer Does Not Rename -- Separate PATCH Required
606+
607+
**Added:** 2026-03-18 | **Source:** DevKit | **Status:** active
608+
609+
**Platform:** Gitea REST API
610+
**Issue:** `POST /api/v1/repos/{owner}/{repo}/transfer` moves a repo to a new org but keeps the original name. There is no `new_name` field in the transfer payload -- the request silently succeeds with the old name intact.
611+
**Fix:** Always follow transfer with a rename step:
612+
613+
```bash
614+
# Step 1: Transfer org
615+
curl -X POST "$GITEA_URL/api/v1/repos/old-org/my-repo/transfer" \
616+
-H "Authorization: token $TOKEN" \
617+
-d '{"new_owner": "new-org"}'
618+
619+
# Step 2: Rename (separate call, after transfer completes)
620+
curl -X PATCH "$GITEA_URL/api/v1/repos/new-org/my-repo" \
621+
-H "Authorization: token $TOKEN" \
622+
-d '{"name": "new-name"}'
623+
```
624+
625+
Full repo management sequence: (1) `POST /api/v1/orgs` -- create org, (2) transfer, (3) rename, (4) `PATCH` description.

0 commit comments

Comments
 (0)