@plasius/ai-game 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -8
- package/README.md +18 -3
- package/dist/index.cjs +355 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +121 -1
- package/dist/index.d.ts +121 -1
- package/dist/index.js +337 -0
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0009-protected-main-release-preparation-and-version-reconciliation.md +57 -0
- package/docs/adrs/index.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ADR 0009: Protected-main releases use release-prep PRs and reconciled version state
|
|
2
|
+
|
|
3
|
+
- Status: Accepted
|
|
4
|
+
- Date: 2026-06-13
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
`@plasius/ai-game` publishes from `.github/workflows/cd.yml`, but the original workflow mutated `package.json`, created tags, and pushed release metadata directly back to protected `main`.
|
|
9
|
+
|
|
10
|
+
That path failed under branch protection, and the repository also drifted behind already-published release state:
|
|
11
|
+
|
|
12
|
+
- `package.json` on `main` remained at `0.1.2`,
|
|
13
|
+
- npm latest and the published GitHub release were already `0.1.3`,
|
|
14
|
+
- origin still carried the `v0.1.3` release tag.
|
|
15
|
+
|
|
16
|
+
Without reconciling package, tag, and npm state first, future release attempts can either fail on protected-branch writes or try to reuse a version that is already published.
|
|
17
|
+
|
|
18
|
+
## Decision
|
|
19
|
+
|
|
20
|
+
Protected `main` releases will use a two-phase workflow:
|
|
21
|
+
|
|
22
|
+
1. `workflow_dispatch` prepares a `release/vX.Y.Z` branch and PR from `main`.
|
|
23
|
+
2. Merging that PR back to `main` makes the unpublished versioned metadata available on `main`, where the publish job can tag, draft the GitHub release, publish to npm, and then publish the GitHub release.
|
|
24
|
+
|
|
25
|
+
Release preparation must derive its base version from the highest known semantic version across:
|
|
26
|
+
|
|
27
|
+
- `package.json`,
|
|
28
|
+
- the latest published npm version, and
|
|
29
|
+
- existing `v*` Git tags on origin.
|
|
30
|
+
|
|
31
|
+
The workflow will then apply the requested bump on top of that reconciled base so lagging `package.json` values cannot reuse or collide with an already-published release number.
|
|
32
|
+
|
|
33
|
+
When repository settings prevent GitHub Actions from creating pull requests, the workflow will still push the release-preparation branch and emit the manual PR URL instead of failing the run.
|
|
34
|
+
|
|
35
|
+
When a release version is already present on `main`, operators may run the workflow with `bump: none` to publish that prepared version directly without opening another release-preparation branch.
|
|
36
|
+
|
|
37
|
+
Release preparation must create the `release/vX.Y.Z` branch from the currently checked out commit before committing version and changelog edits so those metadata changes are preserved on the release branch instead of being discarded by a reset to `origin/main`.
|
|
38
|
+
|
|
39
|
+
Release preparation must promote the `## [Unreleased]` section through a tested helper instead of fragile inline shell text processing so the versioned release section is actually written into the release-preparation commit.
|
|
40
|
+
|
|
41
|
+
## Consequences
|
|
42
|
+
|
|
43
|
+
- Release metadata now flows through an approved pull-request path instead of an unauthorized direct push to protected `main`.
|
|
44
|
+
- Existing published/tagged versions remain authoritative when repository version metadata lags.
|
|
45
|
+
- The release-preparation commit always carries the versioned changelog section that the publish gate requires on `main`.
|
|
46
|
+
- Publish no longer depends on merge-commit text matching a release prefix; it keys off unpublished versioned metadata on `main` instead.
|
|
47
|
+
- Changelog promotion now runs through a tested helper, preventing silent release-prep commits that only bump `package.json`.
|
|
48
|
+
- The version-selection logic is isolated in a helper with regression tests so future release-drift bugs are easier to catch locally.
|
|
49
|
+
|
|
50
|
+
## Alternatives considered
|
|
51
|
+
|
|
52
|
+
- Keeping direct workflow pushes to `main`.
|
|
53
|
+
Rejected because branch protection forbids that path and it already failed in production.
|
|
54
|
+
- Using `package.json` as the sole release source of truth.
|
|
55
|
+
Rejected because it can lag behind already-published npm and GitHub release state.
|
|
56
|
+
- Manually bumping repository version metadata after every release drift incident.
|
|
57
|
+
Rejected because it is error-prone and does not prevent recurrence.
|
package/docs/adrs/index.md
CHANGED
|
@@ -8,3 +8,4 @@
|
|
|
8
8
|
- [ADR-0006: Perspective-gated relative knowledge projection](./adr-0006-perspective-gated-relative-knowledge-projection.md)
|
|
9
9
|
- [ADR-0007: Gossip spread, decay, correction, and resolution](./adr-0007-gossip-spread-decay-correction-and-resolution.md)
|
|
10
10
|
- [ADR-0008: Quiet Measure public contracts and hidden runtime boundary](./adr-0008-quiet-measure-public-contracts-and-hidden-runtime-boundary.md)
|
|
11
|
+
- [ADR-0009: Protected-main releases use release-prep PRs and reconciled version state](./adr-0009-protected-main-release-preparation-and-version-reconciliation.md)
|