Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 217 additions & 100 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ uses [Semantic Versioning](https://semver.org/).
### Fixed

- The README `/app` install steps now cover the storage-disk prerequisite (`/app/setup` or `/app/settings`, with sizing guidance): without a selected disk `/app/add` succeeds but the app sits idle with no error. The steps also note that the inline YAML's inner quotes must stay backslash-escaped. Phase 1 of #245.
- Release OCI images are smoke-tested with a real MCP session on both architectures before any version or floating tag moves. Each release runs `scripts/smoke-oci.ts` (initialize → tools/list → provenance match → search → chained get_page → command_tree → device_lookup) against the pushed image on native amd64 and arm64 Docker, asserting each leg pulled its own architecture; `:latest` / `:next` promote only after both legs pass. Previously only the amd64 image ran, and any non-404 HTTP response passed (#246).

## [0.12.0] — 2026-10-30

Expand Down
6 changes: 4 additions & 2 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ Published artifacts come from the GitHub Actions `Release` workflow (`workflow_d

- **Inputs:** `version` (optional override — see "npm channel" below for how this interacts with prerelease dispatches), `docs_date`, `full_versions`, and `republish_assets`.
- **`republish_assets`:** reuploads GitHub Release assets and OCI tags for an existing version. It does **not** republish npm because npm versions are immutable, and it never moves a floating OCI tag (`:latest`/`:next`) on any channel. See "Prerelease republish semantics" below for prerelease-specific caveats.
- **Job graph (Phase B, #42; #176):** `build` → `qa` → `publish` → {`verify-dist-tags`, `smoke`}.
- **Job graph (Phase B, #42; #176; #246):** `build` → `qa` → `publish` → {`smoke-oci` → `promote-oci`, `verify-dist-tags`, `smoke`}.
- **`build`:** npm channel detection (+ workspace-only prerelease version rewrite) → CHANGELOG gate (latest only) → npm publish-access preflight → fast-fail quality gate → live Docusaurus extraction (`extract-docusaurus.ts --check-counts --strict`, proving `V-docusaurus-docs-count` on every run) → extraction chain → transcript/Dude cache imports → skill extraction → command linking → `schema_node_presence` GC → DB-wipe guard → `db_meta` stamping → DB-stats collection. Uploads the built DB and the resolved `package.json` as artifacts.
- **`qa`:** `uses: ./.github/workflows/qa.yml` with `db_source=artifact` — the single definition of the release-locked gates (contract, retrieval evals, DB-content floors, `db_meta` presence) runs here against the exact DB `build` produced. Nothing publishes if it's red.
- **`publish`:** downloads the gated DB + resolved `package.json`, then OCI build/push → GitHub Release → npm publish (side effects only, keyed off `build`'s job outputs).
- **`publish`:** downloads the gated DB + resolved `package.json`, then sha-tagged OCI build/push → GitHub Release → npm publish (side effects only, keyed off `build`'s job outputs). Only the immutable `sha-<short>` OCI tag pushes here.
- **`smoke-oci`:** one native-Docker leg per architecture (amd64 on `ubuntu-latest`, arm64 on `ubuntu-24.04-arm`). Each leg pulls both registries' `sha-<short>` tag, asserts the pulled image is its own architecture, and runs `scripts/smoke-oci.ts` — a real MCP session (initialize → tools/list → provenance match → search → chained get_page → command_tree → device_lookup). HTTP status alone no longer passes. The multi-arch manifest digest + per-platform digests land in the job summary; failures keep the container inspect state/exit/OOM line, the container logs, and the MCP error. Rehearse the script locally against any reachable server: `bun scripts/smoke-oci.ts http://127.0.0.1:<port>/mcp <version>`.
- **`promote-oci`:** needs both `smoke-oci` legs, then copies the smoke-tested multi-arch manifest onto `$VERSION` (+ `:next`/`:latest` per the npm scheme) via `imagetools` — nothing is rebuilt. A failure in either leg leaves `:latest` / `:next` untouched.
- **`verify-dist-tags`:** reads the npm dist-tags back (up to 15 minutes; see "npm channel" below). It is a separate job so that slow registry propagation fails the run without skipping the install smoke.
- **`smoke`:** `uses: ./.github/workflows/release-smoke.yml`, the three-OS `bunx-smoke` and `bunx-upgrade-smoke` jobs. Both wait through the abbreviated install manifest Bun resolves from (`scripts/wait-for-registry.ts`, same 900s budget) — the full packument `npm view` sees can lead it, and that gap failed two releases (#202). `bunx-smoke` waits for the exact version, and its `--version` probe asserts the exact executed version; `bunx-upgrade-smoke` waits for the channel tag (`latest`/`next`) to resolve to the just-published version, then invokes the explicit-tag form with no `--refresh` and requires the new-release DB banner. The bare form is deliberately not gated: a warm bare `bunx` serves its cache with zero registry requests (decision B, #226); bare-form staleness is accepted behavior — see "How Updates Work".
- **Re-running a skipped smoke:** `release-smoke.yml` is also dispatchable on its own against an already-published version, e.g. `gh workflow run release-smoke.yml -f version=v0.11.3-next.116 -f previous_version=v0.11.3-next.115`. Leave `previous_version` empty to run `bunx-smoke` only. `bunx-upgrade-smoke` resolves the dist-tag, so it can only pass for the version that is currently the tag's head.
Expand Down
8 changes: 5 additions & 3 deletions VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ Tasks in `tasks/` reference these IDs in their `validation:` frontmatter. When a
| V-bunx-upgrade | An explicitly shared `DB_PATH` holds a real `bunx`-installed DB seeded from the previously-published version on the same dist-tag auto-refreshes to the just-published version on an explicit-tag invocation (`@latest`/`@next`, no `--refresh`); a warm bare `bunx` serves its cache and is deliberately not gated (decision B, #226). `ROSETTA_OFFLINE=1` against that same stale DB degrades gracefully instead of crashing (#76/#23) | `bunx-upgrade-smoke` matrix (macOS/Linux/Windows) in `release-smoke.yml`; skipped (not failed) when no prior publish exists yet on that channel | blocking (when a previous version exists) | #226 |
| V-stdio-handshake | MCP stdio handshake completes against a real `@modelcontextprotocol/sdk` client; no stdout pollution | `bun test src/mcp-stdio-client.test.ts` in `.github/workflows/test.yml` | blocking | — |
| V-http-handshake | MCP HTTP handshake + multi-session lifecycle works end-to-end | `src/mcp-http.test.ts` | blocking | — |
| V-app-mcp-x86 | The README `/app` install works end to end on x86: a fresh CHR runs the README's own `/app/add` (HTTP leg) and serves a real MCP session (initialize → tools/list → provenance match → nonempty search) through its ui-url | `app-integration.yml` x86 leg (`scripts/app-integration.ts --arch x86`); unit + workflow-structure pins in `src/app-integration.test.ts` | non-blocking (manual dispatch) | #245 |
| V-app-mcp-x86 | The README `/app` install works end to end on x86: a fresh CHR runs the README's own `/app/add` (HTTP leg) and serves a real MCP session (initialize → tools/list → provenance match → search → chained get_page → command_tree → device_lookup) through its ui-url | `app-integration.yml` x86 leg (`scripts/app-integration.ts --arch x86`, session via `scripts/smoke-oci.ts`); unit + workflow-structure pins in `src/app-integration.test.ts` | non-blocking (manual dispatch) | #245 |
| V-app-mcp-arm64 | Same on arm64 CHR | `app-integration.yml` arm64 leg (`scripts/app-integration.ts --arch arm64`) | non-blocking (manual dispatch) | #245 |
| V-tui-mcp-parity | Every MCP tool reachable via a `.routeros_*` dot-command in `browse` | `src/browse-parity.test.ts` via `bun test` in `.github/workflows/test.yml` | blocking | — |
| V-cli-flag-uniformity | CLI flags documented in `MANUAL.md` match `bun src/mcp.ts --help` output | `src/cli-help.test.ts` via `bun test` in `.github/workflows/test.yml` | blocking | — |
| V-cli-once-json | `browse --once .<tool>` prints exactly one JSON document to stdout (diagnostics on stderr) and exits non-zero when the dot-command fails | `src/browse-once.test.ts` via `bun test` in `.github/workflows/test.yml` | blocking | — |
| V-release-structure | Release artifacts, build constants, container entrypoint, the `release.yml` → `release-smoke.yml` job graph (smoke needs `publish` only, #176), the `bun` shebang on `bin/rosetta.js` (#175), and the CHANGELOG-first release body (#22) stay structurally consistent | `src/release.test.ts`; `src/release-notes.test.ts` (CHANGELOG block extraction) | blocking | — |
| V-release-structure | Release artifacts, build constants, container entrypoint, the `release.yml` → `release-smoke.yml` job graph (smoke needs `publish` only, #176), the `smoke-oci` → `promote-oci` OCI gate (#246), the `bun` shebang on `bin/rosetta.js` (#175), and the CHANGELOG-first release body (#22) stay structurally consistent | `src/release.test.ts`; `src/release-notes.test.ts` (CHANGELOG block extraction) | blocking | — |
| V-command-version-coverage | Every RouterOS version restraml lists has `command_versions` rows in the shipped DB. A failed child extraction fails `extract-all-versions.ts` (naming the versions); restraml fetches retry 5xx/network errors and fail at once on a 404; the db-content gate compares the distinct version count with the `command_versions_expected` count the extraction stamped (#178: next.116 shipped without 7.15) | `extract-all-versions.ts` in `release.yml`'s build; `qa.yml` db-content gate; `src/extract-all-versions.test.ts`, `src/restraml.test.ts`, `src/release.test.ts` | blocking | #178 |
| V-npm-channel-tags | Two channels only (#152): a `-next` package.json version publishes with `--tag next`, a bare version publishes with no `--tag` (`latest`), and any other prerelease identifier fails the run. `next` is never behind `latest`: a prerelease must be semver-newer than `latest` and `next` before build proceeds, a stable publish moves npm `next` and OCI `:next` when `next` is semver-lower, and a post-publish read-back fails the job unless the run's tag resolves to it and `next` ≥ `latest` | `src/release.test.ts` "npm prerelease channel" (structural, runs in test.yml on every push/PR); the `verify-dist-tags` job ("Read back npm dist-tags") on every `release.yml` publish | blocking | — |
| V-oci-latest-guard | The bare `:latest` OCI tag only pushes on a non-prerelease (latest-channel) release run — a prerelease dispatch can never clobber the production `/app` container's `:latest`. `:next` follows the same move decision as npm `next` | `src/release.test.ts` "OCI tags align with npm scheme..." (structural); functional behavior only exercised by an actual `release.yml` dispatch | blocking | — |
| V-oci-latest-guard | The bare `:latest` OCI tag only pushes on a non-prerelease (latest-channel) release run — a prerelease dispatch can never clobber the production `/app` container's `:latest`. `:next` follows the same move decision as npm `next`. Version and floating tags promote only after both `smoke-oci` legs pass, so a red leg leaves `:latest` / `:next` untouched | `src/release.test.ts` "OCI tags align with npm scheme..." + "promotion needs both smoke legs" (structural); functional behavior only exercised by an actual `release.yml` dispatch | blocking | #246 |
| V-oci-mcp-amd64 | The pushed linux/amd64 OCI image serves a full MCP session on native Docker: initialize → tools/list → provenance match → search → chained get_page → command_tree → device_lookup, all non-error with nonempty results (HTTP status alone no longer passes). The leg asserts the pulled image is amd64 | `smoke-oci` amd64 leg in `release.yml` (`scripts/smoke-oci.ts`); job-graph + leg pins in `src/release.test.ts`; assertion-helper units in `src/app-integration.test.ts` | blocking | #246 |
| V-oci-mcp-arm64 | Same for the linux/arm64 image on native arm64 Docker (`ubuntu-24.04-arm`); the leg asserts the pulled image is arm64 | `smoke-oci` arm64 leg in `release.yml` (`scripts/smoke-oci.ts`) | blocking | #246 |
| V-changelog-gate | A bare (latest-channel) `package.json` version can't release without a matching `## [<version>]` `CHANGELOG.md` heading already promoted by hand — CI no longer auto-bumps versions or promotes `[Unreleased]` for any channel | `Verify CHANGELOG promotion for latest-channel release` step in `release.yml` + `src/release.test.ts` | blocking | — |
| V-coverage-reported | `bun test --coverage` runs every release build; results are summarized in `$GITHUB_STEP_SUMMARY` and uploaded as a workflow artifact — informational only, not a gate | `Run tests (fast-fail)` + `Upload coverage artifact` steps in `release.yml` | non-blocking (informational, no threshold) | — |
| V-canonicalize | RouterOS CLI canonicalizer handles every input form + torture cases (H1–H8) | `src/canonicalize.test.ts` + `src/canonicalize.fuzz.test.ts` | blocking | — |
Expand Down
1 change: 1 addition & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ beamwidth
behavioural
behaviours
bfd
binfmt
blackhole
boresight
bridgingand
Expand Down
Loading
Loading