docs(adr): let the agent push release tags on explicit approval

Why: the maintainer decided the agent pushes release tags itself. A
pushed tag is an immutable release (an irreversible publish), so each
push still needs the maintainer's explicit yes in the conversation; the
approval, not who types the command, is the control.

Implementation Notes:
- ADR-0033 Decision: after --apply the agent shows the exact tags and
  the printed push line, and on an explicit yes runs exactly that
  `git push origin <tag>...` (never --tags, never other refs). The
  maintainer-only and free Propose-tier variants are recorded as
  rejected options.
- ADR-0033: --apply requires origin/main's first-parent history, and a
  tag on a later landing of its version is an error.
- AGENTS.md, README.md and gates.md state the same rule; exit 2 still
  means stop and report, never hand-fix, move or delete a tag.

Refs: #223
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-11-27 18:35:12 +00:00
1 parent 03bacd6e5a
commit 0a52c8597d
4 files changed
+34 -19

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ Fall back to raw shell only when no skill covers it.
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again. - **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again.
- **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `apm install` deploys from the lock; `apm update` is what re-resolves refs. - **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `apm install` deploys from the lock; `apm update` is what re-resolves refs.
- **No pre-push hook needs the network — once `apm install` has run.** Root `apm.yml`'s marketplace has no remote package entries, so every hook resolves locally. The guarantee is a property of a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. Run `apm install` once on a new checkout and the offline guarantee holds from then on (`docs/spec/gates.md`, "Pushing without a network"). - **No pre-push hook needs the network — once `apm install` has run.** Root `apm.yml`'s marketplace has no remote package entries, so every hook resolves locally. The guarantee is a property of a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. Run `apm install` once on a new checkout and the offline guarantee holds from then on (`docs/spec/gates.md`, "Pushing without a network").
- **A plugin `version:` bump that has merged to `main` gets its release tag.** Run `git fetch origin --tags`, then `scripts/tag-plugin-releases.sh`; exit 1 means a tag is missing, and `--apply` creates it locally and prints the push command. Pushing a release tag is the maintainer's action, not a Propose-tier push (ADR-0032): show them that command and wait for their yes. Agents cut release tags only with the script, which never moves or deletes one; exit 2 means stop and report it to the maintainer, never hand-fix, move or delete a tag (ADR-0033). - **A plugin `version:` bump that has merged to `main` gets its release tag.** Run `git fetch origin --tags`, then `scripts/tag-plugin-releases.sh`; exit 1 means a tag is missing, and `--apply` creates it locally and prints the push command. A tag push is an irreversible publish, not a free Propose-tier push (ADR-0032): show the maintainer the exact tags and that command, and only on their explicit yes in this conversation run exactly it yourself (named tags, never `--tags` or other refs). Agents cut release tags only with the script, which never moves or deletes one; exit 2 means stop and report it to the maintainer, never hand-fix, move or delete a tag (ADR-0033).
- **This repo and Gitea are the only source of truth.** All project state, decisions, and working conventions live here. Do not use an external memory system for this project — cached state diverges from the repo and you get a split brain. Before answering any design or architecture question, check `docs/adr/` for an existing decision. - **This repo and Gitea are the only source of truth.** All project state, decisions, and working conventions live here. Do not use an external memory system for this project — cached state diverges from the repo and you get a split brain. Before answering any design or architecture question, check `docs/adr/` for an existing decision.
## Key documents ## Key documents
+2 -2
View File
@@ -99,14 +99,14 @@ See [`docs/spec/gates.md`](docs/spec/gates.md) for what each hook enforces and w
Full model, including what's exempt and why: [`docs/spec/architecture.md`](docs/spec/architecture.md). Full model, including what's exempt and why: [`docs/spec/architecture.md`](docs/spec/architecture.md).
**After merging a plugin version bump (maintainer):** **After merging a plugin version bump:**
1. Run `git fetch origin --tags`. 1. Run `git fetch origin --tags`.
2. Run `scripts/tag-plugin-releases.sh` (a dry run) and read the table. 2. Run `scripts/tag-plugin-releases.sh` (a dry run) and read the table.
3. Run `scripts/tag-plugin-releases.sh --apply`. 3. Run `scripts/tag-plugin-releases.sh --apply`.
4. Run the `git push origin <tag>…` line it prints. 4. Run the `git push origin <tag>…` line it prints.
Pushing tags is the maintainer's step. Tags are never moved or re-cut. Details are in [ADR-0033](docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md). An agent may run all four steps, but it runs step 4 only after the maintainer explicitly approves those exact tags in the conversation: a pushed tag is an immutable release. Tags are never moved or re-cut. Details are in [ADR-0033](docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md).
## For external consumers ## For external consumers
@@ -37,8 +37,9 @@ Two facts limit where enforcement can live:
contiguous run carrying that version. That is the merge or squash commit where the version first contiguous run carrying that version. That is the merge or squash commit where the version first
landed on `main`, never a feature-branch commit. An `apm.yml` edit that leaves `version:` alone landed on `main`, never a feature-branch commit. An `apm.yml` edit that leaves `version:` alone
does not start a new run. does not start a new run.
- **Immutability.** Tags are never moved, overwritten or silently re-cut. A tag that is lightweight - **Immutability.** Tags are never moved, overwritten or silently re-cut. A tag that is lightweight,
or that peels to no landing of its version is reported as an error for a human to resolve. Every that peels to no landing of its version, or that peels to a later landing than the version's
first is reported as an error for a human to resolve. Every
reachable `<plugin>-v*` tag is checked this way, not only those of the wanted runs, and an reachable `<plugin>-v*` tag is checked this way, not only those of the wanted runs, and an
invalid one never decides where the wanted runs start, so it cannot hide the versions before it. invalid one never decides where the wanted runs start, so it cannot hide the versions before it.
- **A version is released once, at its first landing.** When a version comes back (a reverted - **A version is released once, at its first landing.** When a version comes back (a reverted
@@ -50,9 +51,10 @@ Two facts limit where enforcement can live:
history and cuts the tags after merge. Without arguments it is a dry run: it prints a history and cuts the tags after merge. Without arguments it is a dry run: it prints a
`plugin version commit status` table and exits 1 if any tag is missing. `--apply` creates the `plugin version commit status` table and exits 1 if any tag is missing. `--apply` creates the
missing tags locally, and only when no error exists anywhere (all or nothing) and the commit read missing tags locally, and only when no error exists anywhere (all or nothing) and the commit read
is on `origin/main`; it never falls back to the local `main`. It then prints the is on `origin/main`'s first-parent history; a commit of a merged feature branch is an ancestor of
exact `git push origin <tag>…` line, naming each tag explicitly and never using `--tags`. The `origin/main` but not on that line, so it is refused. It never falls back to the local `main`. It
script never fetches and never pushes. No hook gates any of this. then prints the exact `git push origin <tag>…` line, naming each tag explicitly and never using
`--tags`. The script never fetches and never pushes. No hook gates any of this.
- **Which versions are wanted.** If a plugin already has a valid `<plugin>-v*` tag reachable from - **Which versions are wanted.** If a plugin already has a valid `<plugin>-v*` tag reachable from
`main`, the script wants every version run from the newest such tag onward, including a reverted `main`, the script wants every version run from the newest such tag onward, including a reverted
version's run, which then reports `RELEASED` as above. If it has none, the script wants every run version's run, which then reports `RELEASED` as above. If it has none, the script wants every run
@@ -67,13 +69,15 @@ Two facts limit where enforcement can live:
`scripts/tag-plugin-releases.sh --ref 32fbe39fb8923854ca8e743a0d2cad81720c736c --plugin git --apply`, `scripts/tag-plugin-releases.sh --ref 32fbe39fb8923854ca8e743a0d2cad81720c736c --plugin git --apply`,
which tags git alone; without `--plugin git` that `--ref` would tag every plugin's version at which tags git alone; without `--plugin git` that `--ref` would tag every plugin's version at
that commit. After it, the "from the newest tag onward" rule covers git like every other plugin. that commit. After it, the "from the newest tag onward" rule covers git like every other plugin.
- **Pushing a release tag is a maintainer-only action. It is not a Propose-tier push under - **The agent pushes release tags, each push gated on the maintainer's explicit approval. It is
ADR-0032.** ADR-0032's Propose tier ("branch, commit, push, open a PR, comment") covers pushes not a free Propose-tier push under ADR-0032.** ADR-0032's Propose tier ("branch, commit, push,
that propose a change for review: a human still approves the change before it merges. A tag push open a PR, comment") covers pushes that propose a change for review: a human still approves the
has no review step behind it. It publishes a release that consumers pin, and because tags are change before it merges. A tag push has no review step behind it. It publishes a release that
immutable it cannot be quietly taken back. An agent may run the dry run, and may run `--apply` consumers pin, and because tags are immutable it cannot be quietly taken back: it is an
locally once a version bump has merged. It then shows the maintainer the push command the irreversible publish. So after `--apply`, the agent shows the maintainer the exact tags and the
script printed and waits; the push itself is always the maintainer's. push command the script printed and asks for approval in the conversation. On an explicit yes it
runs exactly that `git push origin <tag>…` itself: the named tags only, never `--tags`, never
any other ref. Without an explicit yes in the current conversation it does not push.
- **Agents cut release tags only with the script.** Cutting one by hand or with Gitea's - **Agents cut release tags only with the script.** Cutting one by hand or with Gitea's
`create_tag` (consequence 4) is a maintainer path. `create_tag` (consequence 4) is a maintainer path.
- **Wiring elsewhere:** - **Wiring elsewhere:**
@@ -113,13 +117,22 @@ person pushing usually cannot act on, is noise people learn to ignore.
skill, used by consumers with their own tagging schemes. This is holocron's release policy, and it skill, used by consumers with their own tagging schemes. This is holocron's release policy, and it
belongs in holocron's own docs and script. belongs in holocron's own docs and script.
**The maintainer pushes release tags by hand (rejected).** An earlier draft of this ADR made the
tag push maintainer-only. The control that matters is the maintainer's explicit approval of the
exact tags, not who types the command, and an agent running exactly the approved line keeps that
control while removing a manual step.
**The agent pushes release tags as a free Propose-tier push (rejected).** A tag push publishes an
immutable release with no review behind it, so it cannot share the Propose tier's no-approval
rule; each push needs the maintainer's explicit yes.
**A review-held checklist item alone (rejected).** Review happens before merge, but the tag can **A review-held checklist item alone (rejected).** Review happens before merge, but the tag can
only be cut after merge, once the target commit exists on `main`. A checklist in review cannot only be cut after merge, once the target commit exists on `main`. A checklist in review cannot
check something that does not exist yet. check something that does not exist yet.
## Consequences ## Consequences
**1. An untagged window is accepted.** Between a merge and the maintainer's next tagging run, the **1. An untagged window is accepted.** Between a merge and the next approved tagging run, the
new version has no tag. Consumers' pins lag behind, but nothing breaks. Lateness also heals itself: new version has no tag. Consumers' pins lag behind, but nothing breaks. Lateness also heals itself:
targets are computed from history rather than taken from the checkout, so a run made days later targets are computed from history rather than taken from the checkout, so a run made days later
cuts the same tags on the same commits. cuts the same tags on the same commits.
@@ -146,6 +159,6 @@ rewrites it. **It is untested.**
`git cat-file -t <tag>` reports `tag` after fetching. That confirms it is annotated; the script `git cat-file -t <tag>` reports `tag` after fetching. That confirms it is annotated; the script
reports a lightweight tag as an error. reports a lightweight tag as an error.
**5. Enforcement is by convention for now.** Nothing fails when a maintainer forgets to tag. A **5. Enforcement is by convention for now.** Nothing fails when a merged version goes untagged. A
`post-merge:` assertion that the verify stage checks on version-bump PRs is the natural next step `post-merge:` assertion that the verify stage checks on version-bump PRs is the natural next step
and is left as future work. and is left as future work.
+4 -2
View File
@@ -1353,9 +1353,11 @@ checks for it, for two reasons:
whose remote sha is all zeros and that has no commits outside `--remotes=origin`. That is exactly whose remote sha is all zeros and that has no commits outside `--remotes=origin`. That is exactly
a new tag on an already-pushed `main` commit, so no hook runs. a new tag on an already-pushed `main` commit, so no hook runs.
Tagging is a maintainer step after merge instead. After `git fetch origin --tags`, run Tagging is a step after merge instead. After `git fetch origin --tags`, run
`scripts/tag-plugin-releases.sh` (a dry run; it exits 1 while tags are missing), then `--apply`, `scripts/tag-plugin-releases.sh` (a dry run; it exits 1 while tags are missing), then `--apply`,
then push the tags it names. then push the tags it names. An agent may run the push itself, but only the exact printed line and
only after the maintainer explicitly approves those tags in the conversation, because a pushed tag
is an immutable release.
See also: `docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md`, See also: `docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md`,
`scripts/tag-plugin-releases.sh`. `scripts/tag-plugin-releases.sh`.