diff --git a/AGENTS.md b/AGENTS.md index ac2363b..63bfb5a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. - **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"). -- **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. ## Key documents diff --git a/README.md b/README.md index 704e54a..0ef4c9d 100644 --- a/README.md +++ b/README.md @@ -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). -**After merging a plugin version bump (maintainer):** +**After merging a plugin version bump:** 1. Run `git fetch origin --tags`. 2. Run `scripts/tag-plugin-releases.sh` (a dry run) and read the table. 3. Run `scripts/tag-plugin-releases.sh --apply`. 4. Run the `git push origin …` 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 diff --git a/docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md b/docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md index a53718b..9cf7fd6 100644 --- a/docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md +++ b/docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md @@ -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 landed on `main`, never a feature-branch commit. An `apm.yml` edit that leaves `version:` alone does not start a new run. -- **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 +- **Immutability.** Tags are never moved, overwritten or silently re-cut. A tag that is lightweight, + 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 `-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. - **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 `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 - is on `origin/main`; it never falls back to the local `main`. It then prints the - exact `git push origin …` line, naming each tag explicitly and never using `--tags`. The - script never fetches and never pushes. No hook gates any of this. + is on `origin/main`'s first-parent history; a commit of a merged feature branch is an ancestor of + `origin/main` but not on that line, so it is refused. It never falls back to the local `main`. It + then prints the exact `git push origin …` 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 `-v*` tag reachable from `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 @@ -67,13 +69,15 @@ Two facts limit where enforcement can live: `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 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 - ADR-0032.** ADR-0032's Propose tier ("branch, commit, push, open a PR, comment") covers pushes - that propose a change for review: a human still approves the change before it merges. A tag push - has no review step behind it. It publishes a release that consumers pin, and because tags are - immutable it cannot be quietly taken back. An agent may run the dry run, and may run `--apply` - locally once a version bump has merged. It then shows the maintainer the push command the - script printed and waits; the push itself is always the maintainer's. +- **The agent pushes release tags, each push gated on the maintainer's explicit approval. It is + not a free Propose-tier push under ADR-0032.** ADR-0032's Propose tier ("branch, commit, push, + open a PR, comment") covers pushes that propose a change for review: a human still approves the + change before it merges. A tag push has no review step behind it. It publishes a release that + consumers pin, and because tags are immutable it cannot be quietly taken back: it is an + irreversible publish. So after `--apply`, the agent shows the maintainer the exact tags and the + push command the script printed and asks for approval in the conversation. On an explicit yes it + runs exactly that `git push origin …` 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 `create_tag` (consequence 4) is a maintainer path. - **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 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 only be cut after merge, once the target commit exists on `main`. A checklist in review cannot check something that does not exist yet. ## 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: 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. @@ -146,6 +159,6 @@ rewrites it. **It is untested.** `git cat-file -t ` reports `tag` after fetching. That confirms it is annotated; the script 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 and is left as future work. diff --git a/docs/spec/gates.md b/docs/spec/gates.md index 615ec5a..fad7272 100644 --- a/docs/spec/gates.md +++ b/docs/spec/gates.md @@ -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 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`, -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`, `scripts/tag-plugin-releases.sh`.