Author SHA1 Message Date
Defame1297 ae28d5452c ci(molecule): correct the stale fork claims
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 1m20s
Molecule / molecule (pull_request) Successful in 17m29s
The molecule.yml header said only trusted people can open pull
requests here; an outsider can open a fork pull request. It now names
the two boundaries: write access, and Gitea's approval gate on fork
runs, kept shut by the fork rule in reviewing.md. The fork guard in
the job's if: stays a convenience filter. The Molecule rule in
.gitea/workflows/AGENTS.md says the same, and issue-tracker.md says
fork pull requests are closed with a pointer to issues.

Closes #178

Assisted-by: Claude Code
2026-11-24 22:09:13 +00:00
Defame1297 79fed1f270 Merge pull request 'docs(agents): make issue-tracker.md tool-neutral and name tea as the supported tool' (#361) from docs/267-tea-issue-tracker into main
Reviewed-on: #361
2026-11-24 21:54:17 +00:00
Defame1297 abde765472 docs(agents): make issue-tracker.md tool-neutral and name tea as the supported tool
Build / build (pull_request) Successful in 22s
Lint / lint (pull_request) Successful in 1m13s
Molecule / molecule (pull_request) Successful in 13s
issue-tracker.md becomes Conventions (operations as Gitea concepts) and a
Tool section with one tea command per operation, tea api for blocked_by
dependencies. It names no skill or MCP tool, and drops the maintainer-only
token and account-lookup lines. setup.md adds The tracker: install tea
0.14.2 or later and log in with a token of your own account.
dev-setup.sh warns when tea is missing or older; it installs nothing.

Closes #267

Assisted-by: Claude Code
2026-11-24 21:43:11 +00:00
Defame1297 789b481b5d Merge pull request 'docs(contributing): write maintaining.md for the maintainer's standing procedures' (#359) from docs/262-maintaining-md into main
Reviewed-on: #359
Reviewed-by: Defame1297 <[email protected]>
2026-11-24 17:18:28 +00:00
Defame1297 084bddcae9 docs(contributing): complete the settings checklist in maintaining.md
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 1m8s
Molecule / molecule (pull_request) Successful in 3s
List the remaining decided main protection settings, the tag and
release/* allowlist members and the Owners rule; name the workflows
that use the job token; hold account creation as aspirational; define
a full run before its first use.

Assisted-by: Claude Code
2026-11-24 17:15:02 +00:00
Defame1297 dbe8d5d988 docs(contributing): write maintaining.md for the maintainer's standing procedures
Add docs/contributing/maintaining.md with what only the maintainer does:
the secret rotation list, granting and withdrawing a trusted contributor,
agent and bot accounts, the intended settings and releases. Point to it
from the root AGENTS.md and the CONTRIBUTING.md index.

The two release rules (red nightly, no release while red) are held by
aspirational until their controls exist.

Closes #262

Assisted-by: Claude Code
2026-11-24 17:13:31 +00:00
9 changed files with 238 additions and 19 deletions

No files matched your search

+5 -3
View File
@@ -64,9 +64,11 @@ issue.
## Molecule
- **Molecule runs on every same-repository pull request, Renovate's included, with no path
filter.** A fork pull request is skipped by the job's `if:`, which is a convenience: a fork
controls its own workflow file. *Why:* a check that always reports can be required, and a new
image is tested by its own pin pull request. *Held:* review.
filter.** A fork pull request is skipped by the job's `if:`, which is a convenience, not a
boundary: a fork controls its own workflow file. Gitea's approval gate keeps a fork's runs from
starting, and the fork rule in [reviewing.md](../../docs/contributing/reviewing.md) keeps it
shut. *Why:* a check that always reports can be required, and a new image is tested by its own
pin pull request. *Held:* review.
- **What a pull request runs is chosen by `scripts/select_molecule_scenarios.py`:** the scenarios
of the roles it changes and of the roles that use them (any file naming
`mortis.kamino.<role>`, transitively), none for a diff of only IGNORED paths, a failure for a
+2 -2
View File
@@ -8,8 +8,8 @@ name: Molecule
# Docker daemon; no job container is given the Docker socket. That makes the job
# root-equivalent on the runner, which is disposable and holds no secret from outside
# this repository. The `if:` guard is a convenience filter, not a boundary: a fork controls its
# own workflow file. So the repository does not accept fork pull requests; the real
# condition is that only trusted people can push branches or open pull requests here.
# own workflow file. The boundaries are write access, which only trusted people have, and Gitea's
# approval gate on fork runs, which the fork rule in docs/contributing/reviewing.md keeps shut.
#
# molecule runs in the pinned ci image via `docker run` with the runner's Docker socket, so the
# scenario containers start beside it on the runner's daemon; the job tree is mounted at the same
+2
View File
@@ -86,6 +86,8 @@ renovate.json dependency automation
## Before you start
- Before your first commit in a clone: [docs/contributing/setup.md](docs/contributing/setup.md).
- Before cutting a release, granting or withdrawing access, rotating a secret, or changing repository or
organisation settings: [docs/contributing/maintaining.md](docs/contributing/maintaining.md).
- Before filing an issue or opening a pull request: use the headings of the matching template in
`.gitea/`, never your tool's built-in body; read [docs/contributing/making-a-change.md](docs/contributing/making-a-change.md).
- Before bringing content in from another repository: [docs/contributing/making-a-change.md](docs/contributing/making-a-change.md).
+2
View File
@@ -24,6 +24,8 @@ vulnerability as [SECURITY.md](SECURITY.md) says, never in an issue.
- [code-style.md](docs/contributing/code-style.md): code style outside roles.
- [reviewing.md](docs/contributing/reviewing.md): closing a fork pull request, merging someone else's,
running an unmerged branch locally.
- [maintaining.md](docs/contributing/maintaining.md): the maintainer's procedures: secrets, access,
settings, releases.
Rules tied to one directory are in that directory's `AGENTS.md`: [roles/](roles/AGENTS.md),
[scripts/](scripts/AGENTS.md), [.gitea/workflows/](.gitea/workflows/AGENTS.md),
+34 -14
View File
@@ -1,30 +1,50 @@
# Issue tracker: Gitea
Issues and specs for this repo live as Gitea issues on `mortis/kamino` (https://git.rkdr.net/mortis/kamino). Use the `gitea-issues` skill and the Gitea MCP tools (`mcp__gitea__issue_read`, `issue_write`, `list_issues`, `search_issues`); there is no `gh` or `glab`. Pull requests are a different object: `gitea-prs`.
Issues and specs for this repo live as Gitea issues on `mortis/kamino` (https://git.rkdr.net/mortis/kamino).
The Conventions below hold whatever client you use; the Tool section gives the supported one.
## Conventions
- **Create an issue**: `issue_write` (method `create`) with `title` and `body`.
- **Read an issue**: `issue_read`, which returns the body, labels and comments.
- **List issues**: `list_issues` or `search_issues`, filtered by state and label.
- **Comment on an issue**: `issue_write` with the comment method.
- **Apply / remove labels**: label names are resolved to IDs with `label_read` (`list_repo_labels`); see `triage-labels.md`.
- **Close**: post the explanation as a comment first, then close the issue.
- **Operations**: create an issue (title, body, labels, milestone); read an issue with its comments;
comment; add and remove a label; assign; set the milestone; close; search by text, label or state;
add, list and remove a `blocked_by` dependency.
- **Number space**: issues and pull requests share one number space in Gitea, so confirm which one
`#N` refers to before acting on it. Pull requests are a different object from issues.
- **Sub-issues**: Gitea has no parent link. Put `Part of #<parent>` on the first line of the child body.
- **Blocking**: use Gitea's native dependencies (`issue_write`, method `add_dependency`, `dependency_type: blocked_by`), so the issue page shows what blocks it. A ticket is unblocked when every blocker is closed.
Issues and pull requests share one number space in Gitea, so confirm which one `#N` refers to before acting on it.
File issues only into `mortis/kamino`. The configured token holds `write:issue` and `write:repository` but not `read:organization`, so organisation-level labels cannot be read.
- **Blocking**: use Gitea's native dependencies (a `blocked_by` dependency on the blocked issue), so
the issue page shows what blocks it. A ticket is unblocked when every blocker is closed.
- **Close**: post the explanation as a comment first, then close the issue.
- **Labels**: the repo uses Gitea's scoped labels; see `triage-labels.md` for which to use.
- **Repository**: file issues only into `mortis/kamino`.
## Wayfinding operations
- **Map**: one issue labelled `Wayfinder/Map`.
- **Ticket**: a child issue of the map (`Part of #<map>`) with one type label: `Wayfinder/Grilling`, `Wayfinder/Research`, `Wayfinder/Prototype` or `Wayfinder/Task`. Maps and tickets carry no `Status/` label.
- **Claim**: assign the ticket to the Gitea account of the person driving the session, before any work. Ask for the account if it is not known; the token cannot look it up. An open, unassigned ticket is unclaimed.
- **Claim**: assign the ticket to the Gitea account of the person driving the session, before any work. An open, unassigned ticket is unclaimed.
- **Frontier**: the open, unassigned tickets of the map with no open blocker.
- **Resolve**: post the answer as a comment, close the ticket, then add one line to the map's "Decisions so far".
## Pull requests as a triage surface
**PRs as a request surface: no.** Fork and AGit pull requests are closed unmerged ([reviewing.md](../contributing/reviewing.md)), so PRs do not enter the triage queue. Set to `yes` only if that changes.
**PRs as a request surface: no.** Fork and AGit pull requests are closed unmerged with a pointer to issues ([reviewing.md](../contributing/reviewing.md)), so PRs do not enter the triage queue. Set to `yes` only if that changes.
## Tool
`tea` 0.14.2 or later is the supported client: the docs and skills assume it, and
`docs/contributing/setup.md` says how to install it and log in. It is not a rule; any client may be used if the Conventions hold. Run the
commands inside the clone, where `tea` finds the repository from `origin`, or add `--repo mortis/kamino`.
| Operation | Command |
| --- | --- |
| Create | `tea issues create --title '<title>' --description-file body.md --labels '<a>,<b>' --milestone '<name>'` |
| Read with comments | `tea issues <n> --comments` |
| Comment | `tea comment <n> '<body>'` |
| Add / remove a label | `tea issues edit <n> --add-labels '<label>'` / `--remove-labels '<label>'` |
| Assign | `tea issues edit <n> --add-assignees <account>` |
| Milestone | `tea issues edit <n> --milestone '<name>'` |
| Close | `tea issues close <n>` |
| Search | `tea issues list --state all --keyword '<text>' --labels '<label>'` |
| List blockers | `tea api 'repos/{owner}/{repo}/issues/<n>/dependencies'` |
| Add a blocker | `tea api -X POST 'repos/{owner}/{repo}/issues/<n>/dependencies' -d '{"index": <blocker>, "owner": "mortis", "repo": "kamino"}'` |
| Remove a blocker | `tea api -X DELETE 'repos/{owner}/{repo}/issues/<n>/dependencies' -d '{"index": <blocker>, "owner": "mortis", "repo": "kamino"}'` |
+88
View File
@@ -0,0 +1,88 @@
# Maintaining
Read this before cutting a release, granting or withdrawing access, rotating a secret, or changing
repository or organisation settings. Only the maintainer does these; this file records how, and what
the settings should be.
Every rule gives its reason and how it is held: by a control (a named hook, check or setting), by
review, or aspirational (checked by nothing and nobody). Most acts here are seen by nobody else, so
they are aspirational unless a control is named. The positions are defined in
[GLOSSARY.md](../../GLOSSARY.md).
## Secrets and rotation
Every secret the workflows in [.gitea/workflows/](../../.gitea/workflows/) reference:
| Secret | Used by | Account (role) | Token scope | Issued and stored |
|---|---|---|---|---|
| `PACKAGE_PUSH_USER` | `image.yml` | Package push bot | none: the account's login name | Organisation secret |
| `PACKAGE_PUSH_TOKEN` | `image.yml` | Package push bot | `write:package` | Token issued on the bot's account in this Gitea; organisation secret |
| `RENOVATE_BOT_TOKEN` | `renovate.yml` | Renovate bot | `write:repository`, `write:issue`, `read:package` | Token issued on the bot's account in this Gitea; organisation secret |
| `GITHUB_TOKEN` | `build.yml`, `lint.yml`, `molecule.yml`, `image.yml`, `gitea-release-key.yml` | none: the job token | set per workflow by `permissions:` | Issued by Gitea Actions for each run and expires with it; nothing to rotate |
- **When a trusted contributor's access is withdrawn, or a secret may have leaked, rotate every secret
in the table: issue a new token on the bot's account, replace the secret, then revoke the old token.**
*Reason:* any write-capable token can push a branch whose workflow reads every secret, so one
withdrawn or leaked credential exposes them all.
*Held by:* aspirational.
## Granting and withdrawing a trusted contributor
- **Grant: make the account a write collaborator on this repository and add it to the merge allowlist
of `main`; save, reload the page and check the name is still there.**
*Reason:* the allowlist silently drops an account without write access, and only a listed account
can merge.
*Held by:* aspirational.
- **Withdraw: remove the collaborator access and the merge-allowlist entry, then rotate every secret
(see above).**
*Reason:* write access is secret access, so the secrets the account could read must change.
*Held by:* aspirational.
## Agent and bot accounts
- **Only the maintainer creates agent and bot accounts.**
*Reason:* every account on this forge is then one the maintainer knows.
*Held by:* aspirational.
- **An agent account names its one accountable person in its Gitea profile.**
*Reason:* every change has a human who answers for it, and an agent is not that human.
*Held by:* aspirational.
- **Each account's token carries only the scopes its job needs:** the agent account `write:issue`,
`write:repository` and `read:organization`; the bots as in the secrets table.
*Reason:* least privilege limits what a leaked or misused token can do through the API.
*Held by:* aspirational.
## Intended settings
A checklist, not rules: what the repository and organisation settings should be. The maintainer
applies them and checks them against this list after any change.
- Branch protection on `main`: required checks Lint, Build and Molecule; zero required approvals;
"Require approval from code owners"; "Dismiss stale approvals"; block on rejected and on official
review requests; block on an outdated branch; administrators cannot override; the approvals
allowlist is the maintainer.
- Merge allowlist on `main`: the maintainer, each trusted contributor and the Renovate bot.
- Push allowlist on `release/*`: the maintainer; no rule for `renovate/*`.
- Tag protection on `v*`, with the maintainer on its allowlist.
- No bot or agent account in the organisation's Owners team.
- The agent account sits in an organisation team on this repository with Code, Issues and Pull
requests write and Actions read, so it cannot approve fork runs.
- Wiki off.
- The runner is registered for this repository only; the skills source's runner is isolated from it.
- Self-registration closed.
- Gitea 28.4.0 or later, because its fork-run approval gate keeps outsiders' forks from running.
## Releases
A **full run** is a `schedule` or `workflow_dispatch` run of `molecule.yml` on `main`.
- **The maintainer cuts a release by hand: an annotated tag `vX.Y.Z` on `main`, equal to the version
in `galaxy.yml`.**
*Reason:* consumers install by tag, so a tag is the release.
*Held by:* control: tag protection on `v*`, and Build's release tag check.
- **The maintainer owns triage of a failed full Molecule run; any trusted contributor may fix it.**
*Reason:* the nightly is the only run of the scenarios a pull request's diff did not select.
*Held by:* aspirational.
- **No release while the latest full run on `main` is red. After a fix, dispatch Molecule on `main`
and release only once it succeeds.**
*Reason:* a release must not ship drift the nightly has seen.
*Held by:* aspirational.
+17
View File
@@ -24,6 +24,23 @@ held by review until an offline link check exists.
*Reason:* a finding only that test reports stops the push instead of the Build check.
*Held by:* control: the pre-push hook, and the Build check.
## The tracker
- **Install `tea` 0.14.2 or later**, by any of its official routes: Homebrew (`brew install tea`),
your distribution's package, or a release binary from https://gitea.com/gitea/tea/releases checked
against that release's `checksums.txt`, whose `checksums.txt.sig` is signed by the Gitea release
key (`7C9E68152594688862D62AF62D9AE806EC1592E2`).
*Reason:* it is the client [issue-tracker.md](../agents/issue-tracker.md) gives commands for, and
those commands assume 0.14.2 or later.
*Held by:* aspirational (`scripts/dev-setup.sh` warns when `tea` is missing or older).
- **Log in with a token of your own account, with the scopes `write:issue` and `read:user` only:**
`tea login add --url https://git.rkdr.net --token '<your-token>'`. Create the token under
Settings > Applications on the forge. `tea login add` needs `read:user`; that `write:issue` covers
every command of the Tool section is checked in issue #360.
*Reason:* what you or your agent do on the tracker is then yours, and a token that leaks can do no
more than edit issues.
*Held by:* aspirational.
## Agent tools
- **Use Claude Code 2.1.281 or later.**
+21
View File
@@ -158,4 +158,25 @@ for hook in pre-commit commit-msg pre-push; do
fi
done
# tea is the supported tracker client (docs/agents/issue-tracker.md); only warn, the hooks do not need it.
tea_min=0.14.2
tea_see="see docs/contributing/setup.md (The tracker)"
if ! command -v tea >/dev/null 2>&1; then
echo "warning: tea $tea_min or later is not on PATH; $tea_see." >&2
else
# The first line reads `Version: 0.16.0<TAB>golang: ...`, the number possibly in ANSI bold.
tea_version="$(tea --version 2>/dev/null | tr -d '\033' \
| sed -nE '1s/^Version: (\[[0-9;]*m)?([0-9]+\.[0-9]+\.[0-9]+).*/\2/p' || true)"
if [ -z "$tea_version" ]; then
echo "warning: could not read the version of tea (need $tea_min or later); $tea_see." >&2
else
IFS=. read -r t_major t_minor t_patch <<< "$tea_version"
IFS=. read -r m_major m_minor m_patch <<< "$tea_min"
if [ "$t_major" -lt "$m_major" ] || { [ "$t_major" -eq "$m_major" ] && {
[ "$t_minor" -lt "$m_minor" ] || { [ "$t_minor" -eq "$m_minor" ] && [ "$t_patch" -lt "$m_patch" ]; }; }; }; then
echo "warning: tea $tea_version is older than $tea_min; $tea_see." >&2
fi
fi
fi
echo "Done: git commit now runs the hooks with the tools in $root/.venv/bin and the collections in $collections."
+67
View File
@@ -139,6 +139,39 @@ class DevSetupTest(unittest.TestCase):
check=False,
)
def path_without_tea(self) -> str:
"""The test PATH with every directory that holds a tea replaced by a copy without it.
Dropping the directory would also drop git and the shell tools a distribution installs
next to its tea package.
"""
dirs = []
for i, d in enumerate(self.env["PATH"].split(os.pathsep)):
if not os.access(os.path.join(d, "tea"), os.X_OK):
dirs.append(d)
continue
farm = self.tmp / f"no-tea-{i}"
farm.mkdir(exist_ok=True)
for entry in os.listdir(d):
if entry != "tea" and not (farm / entry).exists():
(farm / entry).symlink_to(os.path.join(d, entry))
dirs.append(str(farm))
return os.pathsep.join(dirs)
def path_with_tea(self, version_line: str) -> str:
"""The test PATH with a tea stub first whose `--version` prints `version_line`."""
bin_dir = self.tmp / "tea-bin"
bin_dir.mkdir(exist_ok=True)
tea = bin_dir / "tea"
tea.write_text(f"#!/bin/sh\nprintf '{version_line}\\n'\n")
tea.chmod(0o755)
return f"{bin_dir}{os.pathsep}{self.env['PATH']}"
@staticmethod
def tea_0_16_line(version: str) -> str:
"""The first line of `tea --version` as tea 0.16.0 prints it, number in ANSI bold."""
return f"Version: \\033[1m{version}\\033[0m\\tgolang: 1.26.6\\tgo-sdk: v1.2.0"
def hooks_z(self, repo: Path) -> bytes:
return self.git(
repo, "config", "--local", "-z", "--get-all", "core.hooksPath", check=False
@@ -196,6 +229,40 @@ class DevSetupTest(unittest.TestCase):
self.assertIn("# kamino-dev-setup: virtualenv first on PATH", text)
self.assertEqual(self.hooks_z(repo), b"")
def test_a_missing_tea_warns_and_setup_succeeds(self) -> None:
repo = self.make_repo()
proc = self.run_setup(repo, PATH=self.path_without_tea())
self.assertEqual(proc.returncode, 0, proc.stderr)
self.assertIn("warning: tea 0.14.2 or later is not on PATH", proc.stderr)
def test_a_tea_older_than_0_14_2_warns_and_setup_succeeds(self) -> None:
repo = self.make_repo()
for old in ("0.14.1", "0.9.2"):
with self.subTest(old=old):
proc = self.run_setup(
repo, PATH=self.path_with_tea(self.tea_0_16_line(old))
)
self.assertEqual(proc.returncode, 0, proc.stderr)
self.assertIn(f"warning: tea {old} is older than 0.14.2", proc.stderr)
def test_a_tea_of_0_14_2_or_later_gives_no_warning(self) -> None:
repo = self.make_repo()
for ok in ("0.14.2", "0.16.0", "1.0.0"):
with self.subTest(ok=ok):
proc = self.run_setup(
repo, PATH=self.path_with_tea(self.tea_0_16_line(ok))
)
self.assertEqual(proc.returncode, 0, proc.stderr)
self.assertNotIn("warning: tea", proc.stderr)
def test_an_unreadable_tea_version_warns_and_setup_succeeds(self) -> None:
repo = self.make_repo()
# A dev build: the version is not numeric, and the golang version must not stand in for it.
line = "Version: main-dev\\tgolang: 1.26.6\\tgo-sdk: v1.2.0"
proc = self.run_setup(repo, PATH=self.path_with_tea(line))
self.assertEqual(proc.returncode, 0, proc.stderr)
self.assertIn("warning: could not read the version of tea", proc.stderr)
def test_tools_are_installed_from_the_hashed_lock_with_its_pins(self) -> None:
repo = self.make_repo()
self.assertEqual(self.run_setup(repo).returncode, 0)