Skip to content

v0.2.0 final release gate: governance hardening, benchmark/test harness fixes, packaging and upgrade validation - #70

Merged
akosidencio merged 6 commits into
devfrom
fix/v0.2.0-final-release-gate
Nov 22, 2026
Merged

akosidencio merged 6 commits into
devfrom
fix/v0.2.0-final-release-gate

Conversation

@akosidencio

Copy link
Copy Markdown
Member

Final release gate for v0.2.0: governance hardening, benchmark and test-harness fixes, packaging validation, upgrade/rollback validation. Do not merge until the owner reviews; nothing is tagged or published. Base: dev 4c722c8 (PR #69 merged).

Commits

Commit What
a027407 fix(security) Protected-environment creation bypass closed. In an environment with require_approval, a non-inert create (enabled, or a custom disabled_value) is now a pending change request with action: "create" (202, same contract as a queued PATCH). Nothing reaches flags, the snapshot or the stream until a different editor/admin approves; reject/cancel leave no flag. Inert creates (disabled, serving false) still apply at once; unprotected environments unchanged. Migration 20261122000030 (additive): change_requests.action + one pending creation per key. Dashboard, Go client (Terraform/operator: ErrApprovalRequired instead of decoding the CR as a flag), docs, CHANGELOG, upgrade guide. server/tests/governance.rs: 11 tests for the 12 review scenarios; 10 fail with the gate removed.
f57f740 bench Criterion panicked on 1/2/4-CPU hosts (duplicate readers/4 on GitHub's 4-vCPU runners): reader counts de-duplicated. New bench-smoke CI job (--test, pinned to 1/2/4 CPUs); public-benchmarks.yml fails when a run failed. scripts/release-benchmarks/v0.2.0-linux.sh: baseline-vs-candidate A/B for a dedicated Linux host (--help, --check, --quick, --analyze-only).
f1dc7c8 test reliability::g2 port race: servers bind port 0 and the harness reads the address from the process's own log, so another test's server answering /health is never mistaken for this one; restarts retry a lost bind at most 5 times. tests/harness.rs regression tests. CI now also runs playground and sdk_diagnostics, which no job ran before.
b247630 release scripts/check-npm-packages.mjs (pack, inspect, clean consumer install, type-check, smoke) and scripts/check-python-package.py (tags, metadata, RECORD, versions) with CI jobs that build the publishable artifacts on PRs, never publishing. bump-version.sh failed on GNU sed (Linux) at the first edit; lockfile versions now bumped too.
dc89b83 fix(security) Low findings: Python SSE line buffer quadratic copy (16 MiB in 4 KiB fragments: 13.4 s → 0.02 s); quickstart binds 127.0.0.1 by default; MCP warns for http:// to a remote host and no longer claims propose tokens can create flags.
ca3dcc7 docs, release bench/ab/upgrade_rollback_020.py (35 steps) and the upgrade guide: backup, restore, interrupted upgrade.

Verification (local, Linux workstation; PostgreSQL 16 on tmpfs, Redis 7)

  • Rust: fmt, clippy --workspace --all-targets --all-features -D warnings, cargo test --workspace, rustdoc -D warnings, cargo audit — clean.
  • Server integration: all 18 suites pass (incl. governance 11/11, harness 2/2, server unit tests 116/116); reliability 20/20 full runs and g2 10/10 under contention.
  • Node SDK 76, OpenFeature 16, node-integrations 64, CLI 57, edge 12, SSR 9, MCP 30 incl. e2e against the candidate server, dashboard 52 (+ typecheck/build), Go modules vet + test, Python 160 + 1 (installed wheel), Python fault conformance 16/16, live e2e (Node, Python), docs build + site check.
  • Upgrade/rollback: 35/35 (migrations 29+30 only, byte-identical snapshot, 0.1.31 refused next to 0.2.0, SQL rollback + re-upgrade, restore from pg_dump, SIGKILL mid-migration recovers).
  • Packages: npm pack/consumer smoke all pass; local Python wheel passes the checker and twine check --strict (CI builds the manylinux artifacts).
  • Benchmark workflow: one --quick end-to-end run (v0.1.31 vs a027407) completed and cleaned up after itself; INCONCLUSIVE by design — not performance evidence.

Not run locally: Docker image smoke, Miri, web/React Native/Flutter SDKs, Windows/macOS wheels — this PR's CI covers them.

Still open before tagging

  • Performance: pending the dedicated Linux run (scripts/release-benchmarks/v0.2.0-linux.sh, instructions in scripts/release-benchmarks/README.md).
  • PyPI: checkgate is unclaimed on PyPI (404 on 2026-11-22); no trusted publisher or publish job exists — owner action.
  • npm: the three new package names are unpublished; whether NPM_TOKEN may create them can only be confirmed by the owner.
  • Owner decisions listed in the release-gate report (inert creates in protected environments, accepted low findings).

…hrough a change request

A project editor could POST an enabled flag straight into an environment
with require_approval set, and SDKs were served it at once with no review
(inherited from 0.1.x; found by the v0.2.0 security review).

In such an environment, only an inert flag (disabled, no disabled_value, so
it serves the built-in false) is still created at once. Any other creation
is stored as a pending change request with action "create" and answered
202 Accepted, like a queued PATCH: nothing reaches flags, the snapshot or
the stream until a different editor/admin approves it. Approval inserts the
flag (409 and still pending if the key exists by then), audits CREATE with
the reviewer as actor plus change_request_id and requested_by. Reject and
cancel leave no flag. Environments without approval are unchanged.

- Migration 20261122000030 (additive): change_requests.action (default
  'update') and a partial unique index, one pending creation per key, so
  concurrent proposals and retrying automation get 409, not duplicates.
- Reuses the change-request infrastructure: same approve/reject/cancel
  routes, self-approval block, project RBAC and notifications.
- Dashboard: create handles 202, "New flag" badge, no Approve button on
  your own request (the server refuses it for admins too).
- Go client: CreateFlag returns ErrApprovalRequired on 202 instead of
  decoding the change request as a flag (Terraform, operator).
- Docs: API reference, governance guide, Terraform/operator notes,
  CHANGELOG, upgrade guide (second migration, rollback step, backup).
- Tests: server/tests/governance.rs, 11 tests covering the 12 review
  scenarios; 10 fail with the gate removed. integration.rs creates its
  chat-notification flag inert, since Production requires approval there.
…I, dedicated-host release A/B

The public Rust Criterion benchmark failed on GitHub runners for v0.1.31 and
the v0.2.0 candidate alike: concurrency() benchmarked reader counts
[1, 2, 4, available_parallelism()], which repeats 4 on a 4-vCPU runner, and
Criterion 0.8 panics on the duplicate ID. The workflow stayed green because
run.sh records a failed run and continues.

- bench/benches/evaluation.rs: sort and de-duplicate the reader counts (IDs
  unchanged wherever they were already unique). No evaluation code changes.
- ci.yml: bench-smoke job runs every Criterion benchmark once (--test),
  pinned to 1, 2 and 4 CPUs, plus snapshot_decode. Harness health is
  pass/fail; no timings are collected.
- public-benchmarks.yml: after uploading results, fail the job if any run
  in raw/runs.jsonl failed.
- scripts/release-benchmarks/v0.2.0-linux.sh (+ lib/, README): baseline vs
  candidate on a dedicated Linux host. Refs resolved to SHAs (branches
  refused), isolated worktrees and target dirs, identical harnesses
  (core_ab.rs compiled against each core; the candidate's load tools and
  SSE client for both servers), own pinned PostgreSQL/Redis containers,
  disjoint CPU sets, B-C-C-B rounds, idle check and per-second sampler per
  run, raw SSE audit for duplicated/out-of-order deliveries, explicit
  invalid-run rules, bootstrap-CI verdicts (PASS/FAIL/INCONCLUSIVE),
  --check, --quick, --analyze-only; cleans up only what it created.
…fixing the reliability::g2 port race

reliability::g2 failed with "Address already in use": free_port() released
its socket before the server bound it, a parallel test's server took the
same port, and the losing server's harness polled /health on that port,
got the other server's 200 and handed the test the wrong instance (its
setup/complete then answered 404).

- tests/common: Server::spawn binds PORT=0 (and tests set METRICS_ADDR to
  127.0.0.1:0); the harness reads the bound addresses from the process's own
  log lines (only bytes written after this spawn), so nothing can take the
  port between choosing and binding it, and an answer from another process
  is never mistaken for this one. A restart must reuse its port (clients
  point at it): a lost bind is detected from the process's own "Failed to
  bind" line and retried at most 5 times with backoff, then fails with the
  log. No sleeps stand in for synchronization. Unique working directories.
- Cluster instances start on port 0 and keep the bound port across restarts.
- tests/harness.rs: parallel spawns get distinct ports answered by their own
  process; a server that cannot bind because something else answers 200 on
  the port fails with a clear message instead of being used.
- CI also runs playground and sdk_diagnostics (added in 0.2.0): they skip
  without PostgreSQL/Redis, so no CI job ever ran them.

Verified: reliability 20/20 full runs, g2 10/10 while sse_faults runs
alongside, every server integration suite passes.
…bump-version.sh works on Linux

- scripts/check-npm-packages.mjs + ci.yml npm-packages job: packs
  @checkgate/openfeature-provider, @checkgate/node-integrations and
  @checkgate/mcp-server as real tarballs; every manifest path (main, types,
  every exports target, bin) packed, no development files, versions agree,
  peer ranges accept the release version; then a clean consumer install
  with @checkgate/node packed at the release version imports every entry
  point (require and import), type-checks the declarations through exports
  (NodeNext, strict) and runs the provider, the Express middleware and
  checkgate-mcp (tools/list over stdio) against a local stub stream.
  Replaces nothing in release.yml; runs on every pull request.
- scripts/check-python-package.py + python-wheels.yml release-artifacts job:
  the manylinux wheels built exactly as release.yml builds them, on pull
  requests instead of only on a tag; tags (cp311-abi3), METADATA, contents,
  RECORD hashes, version consistency (wheel, __version__, pyproject),
  twine check --strict, auditwheel show, clean-venv install and the test
  suite. Nothing is uploaded to PyPI.
- scripts/bump-version.sh: used `sed -i ''` unconditionally, which fails on
  GNU sed at the first edit (release prep only worked on macOS); now detects
  GNU vs BSD sed. Also sets the package's own version in npm lockfiles
  (top level and packages[""] only), which were left at the old version.
…uickstart binding, MCP cleartext warning

- Python SDK (_sse.py): the line buffer is a bytearray. Appending each
  fragment of a long line to immutable bytes copied the whole buffer every
  time: a 15-16 MiB line in 4 KiB writes cost ~12-13 s of GIL-holding CPU
  (measured), repeatable by a hostile server or MITM. Now ~0.02 s; parse
  identical on 200 random fragmentations; the 16 MiB bound is unchanged.
  Regression test in test_sse_and_revisions.py.
- quickstart/compose.yml: publish on 127.0.0.1 by default (plain HTTP,
  COOKIE_SECURE=false, development only); CHECKGATE_BIND overrides.
- @checkgate/mcp-server: warn at start for http:// to a non-loopback host;
  fix the 403 explanation that still said propose tokens can create
  disabled flags (removed by F-01).
- CHANGELOG: these, the bench/test/release-tooling fixes.
…restore and interrupted-upgrade procedures

- bench/ab/upgrade_rollback_020.py: 35 scripted PASS/FAIL steps on real
  databases with release builds: upgrade (exactly migrations 29 and 30,
  byte-identical snapshot, unchanged stream protocol, old token and pending
  change request keep working, new create requests and propose tokens),
  0.1.31 refusing to start next to 0.2.0, the documented SQL rollback and a
  re-upgrade, restore from pg_dump, and 0.2.0 killed by SIGKILL while
  migration 30 waits on a lock (29 applied, 30 not, no partial schema;
  restarting 0.2.0 completes it). 35/35 pass.
- docs/operations/upgrading-to-0-2-0.md: points at that script; adds
  rollback by restoring the backup and what to do after an interrupted
  upgrade (backup step, second migration and cancel-pending-creations step
  were added with the governance fix).
@akosidencio
akosidencio merged commit bf6accd into dev Nov 22, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant