Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
71f3d5f
feat(migrations): freeze cumulative schema drafts at release
Zxf-xufeng Nov 18, 2026
69b39df
fix(migrations): enforce schema freeze and history guards
Zxf-xufeng Nov 18, 2026
a9e5a2a
fix(migrations): preserve native history and frozen operation references
Zxf-xufeng Nov 18, 2026
f935558
Merge remote-tracking branch 'origin/master' into codex/cumulative-sc…
Zxf-xufeng Nov 18, 2026
5ce729a
fix(migrations): protect frozen native schema extensions
Zxf-xufeng Nov 18, 2026
806032f
Merge remote-tracking branch 'origin/master' into codex/cumulative-sc…
Zxf-xufeng Nov 19, 2026
ff52ece
fix(ci): allow cold installer bootstrap to finish on slow mirrors
Zxf-xufeng Nov 19, 2026
3dd5040
Merge remote-tracking branch 'origin/master' into codex/cumulative-sc…
Zxf-xufeng Nov 19, 2026
3720f29
fix: reject empty migration baselines and narrow prompt revision types
Zxf-xufeng Nov 19, 2026
49e9d25
fix(ci): allow the full end-to-end matrix to complete
Zxf-xufeng Nov 19, 2026
1575cc4
fix(ci): budget cold setup and cleanup for validation jobs
Zxf-xufeng Nov 19, 2026
3318129
test(ci): align suite timeout budget assertions
Zxf-xufeng Nov 19, 2026
8797768
fix(ci): use writable caches for license checks
Zxf-xufeng Nov 19, 2026
fed60b8
fix(ci): allow cold license tool setup to finish
Zxf-xufeng Nov 19, 2026
539d5cc
fix(ci): isolate prek cache from runner home
Zxf-xufeng Nov 19, 2026
207ea6d
fix(ci): scope runner cache paths to steps
Zxf-xufeng Nov 19, 2026
47bb65a
fix(ci): provide writable Linux project tool caches
Zxf-xufeng Nov 19, 2026
fa34dc3
fix(migrations): rename native checkpoint revisions when freezing
Zxf-xufeng Nov 19, 2026
0ca58ec
fix(ci): merge master and accommodate cold acceptance jobs
Zxf-xufeng Nov 19, 2026
f8d9f2c
docs(migrations): define transition for open schema PRs
Zxf-xufeng Nov 20, 2026
3ea64a5
fix(ci): fall back to alternate Maven Central downloads
Zxf-xufeng Nov 20, 2026
e0bf754
test: allow slow accounting writes in statistics flow
Zxf-xufeng Nov 20, 2026
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
7 changes: 7 additions & 0 deletions .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ runs:
- name: Install Python dependencies
run: uv sync --frozen
shell: bash

- name: Use a writable cache directory for project tools
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p "$RUNNER_TEMP/project-cache"
echo "XDG_CACHE_HOME=$RUNNER_TEMP/project-cache" >> "$GITHUB_ENV"
2 changes: 1 addition & 1 deletion .github/ci-paths.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ kimi = ["integrations/kimi-code/**", "tests/*kimi*", ".github/workflows/kimi-cod
upgrade = [
"scripts/oceanbase_ci.py",
"scripts/run_atomic_memory_clean_migration.py", "scripts/build_ops_bundle.py",
"release/**", "scripts/upgrade_*.py", "scripts/ci_legacy_upgrade_rejection.py",
"release/**", "scripts/schema_release.py", "tests/test_schema*.py", "scripts/upgrade_*.py", "scripts/ci_legacy_upgrade_rejection.py",
"scripts/ci_release_smoke.py", "scripts/ci_ops_bundle_smoke.py", "scripts/capture_release_schema.py",
"tests/release_upgrades/**", "tests/test_upgrade*.py", "tests/test_registered_source_maintenance_cli.py",
"tests/test_managed_*maintenance.py", "tests/e2e/*migration*", "tests/e2e/*managed_startup*",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os == 'ubuntu-latest' && 'powercontext-ci-light' || matrix.os }}
timeout-minutes: 20
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
Expand Down
32 changes: 25 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
quality:
name: CI preflight
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
timeout-minutes: 30
timeout-minutes: 45
runs-on: powercontext-ci-light
outputs:
suites: ${{ steps.select.outputs.suites }}
Expand All @@ -202,11 +202,15 @@ jobs:
run: python3 scripts/ci_changes.py

- name: Check License Header
timeout-minutes: 10
# Include a cold Go toolchain download and license-eye build.
timeout-minutes: 20
uses: apache/skywalking-eyes/header@a196742f472feaffafea537ce5a2a4c3c53a8de4 # v0.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INSTALL_DIR: ${{ runner.temp }}
# Self-hosted runner home caches may be owned by the image build user.
GOCACHE: ${{ runner.temp }}/license-go-build
GOMODCACHE: ${{ runner.temp }}/license-go-mod
PATH: ${{ runner.temp }}:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
with:
config: .licenserc.yaml
Expand All @@ -222,12 +226,23 @@ jobs:
- name: Cache prek environments
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ~/.cache/prek
key: prek-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.python.outputs.version }}-${{ hashFiles('.pre-commit-config.yaml') }}
path: ${{ runner.temp }}/prek
key: prek-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.python.outputs.version }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run checks
env:
PREK_HOME: ${{ runner.temp }}/prek
run: make check

- name: Validate cumulative migration against the PR base
if: github.event_name == 'pull_request'
env:
SCHEMA_BASE: ${{ github.event.pull_request.base.sha }}
run: uv run --locked python scripts/schema_release.py check --base-ref "$SCHEMA_BASE"

- name: Test cumulative schema freezing and replay
run: uv run --locked pytest tests/test_schema_release.py tests/test_schema_draft.py -q

- name: Check OpenAPI contract
run: make contract-test

Expand All @@ -237,7 +252,8 @@ jobs:
if: ${{ !cancelled() && needs.quality.result == 'success' && (fromJSON(needs.quality.outputs.suites || '{}').tests) }}
# Unit jobs must outlast pytest plus uv cache publication. End-to-end jobs
# also need time for subprocess tails on internal runners.
timeout-minutes: ${{ matrix.suite == 'e2e' && 55 || 50 }}
# Python 3.11/3.12 can exceed 55 minutes while the full E2E suite is still progressing.
timeout-minutes: ${{ matrix.suite == 'e2e' && 90 || 75 }}
runs-on: powercontext-ci-standard
strategy:
fail-fast: true
Expand Down Expand Up @@ -374,7 +390,8 @@ jobs:
docs-tests:
needs: [quality]
if: ${{ !cancelled() && needs.quality.result == 'success' && (fromJSON(needs.quality.outputs.suites || '{}').docs_tests) }}
timeout-minutes: 15
# Include cold checkout, environment setup, and cache publication.
timeout-minutes: 30
runs-on: powercontext-ci-light
steps:
- name: Check out
Expand Down Expand Up @@ -1345,7 +1362,8 @@ jobs:
check-website:
needs: [quality]
if: ${{ !cancelled() && needs.quality.result == 'success' && (fromJSON(needs.quality.outputs.suites || '{}').website) }}
timeout-minutes: 20
# Include cold checkout, environment setup, and cache publication.
timeout-minutes: 40
runs-on: powercontext-ci-standard
steps:
- name: Check out
Expand Down
40 changes: 22 additions & 18 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,32 @@ The operational field contract is documented in [Logs, metrics, and tracing](doc

Use [REVIEW.md](REVIEW.md) when reviewing changes.

## Database Migration Names
## Database Migrations

Read the migration guide before changing managed storage:
[English](docs/en/docs/operate/database-migrations.md) / [中文](docs/zh/docs/operate/database-migrations.md).

- New Server revisions use `v<major>_<minor>_<patch>_pr<PR number>`, for example
`v1_5_2_pr2674`. Create a draft PR first. Use its number in this repository; keep the full ID within 32 characters.
Each PR adds at most one logical schema revision, shared by its backend implementations.
It may contain multiple DDL operations, data tasks and validations. If independent revision
checkpoints are necessary, split the work into dependent PRs.
- Agree on the target release before registering migrations, using the version declared in
`openapi/powercontext.yaml` and `release/upgrade-support.json`. At registration, the new prefix must
match both declarations. This does not require existing prefixes to track later version bumps. Feature PRs do not independently
bump the release. Once registered, keep the ID even if the change ships in a later release.
- Before merging, update against master, reconcile unpublished dependencies and conflicting schema
changes, and rerun migration validation. Keep a single head; `down_revision` determines order,
not PR numbers or lexical sorting. Check for duplicate IDs across the combined changes.
- Release preparation records the package-to-head mapping and verifies upgrades; it does not rename
revisions or postpone dependency reconciliation until publication. No schema change means no new revision.
- Preserve existing revision IDs, frozen resources, plans and checksums. Do not rewrite published
migrations. A development database that ran an earlier branch chain must be rebuilt or use an
explicitly validated conversion; changing `down_revision` alone does not migrate that database.
- Schema changes accumulate in one unpublished Server revision `000`, using
`server_resources/versions/000.py` and the matching `mysql/versions/000.py` under
`src/powercontext/builtin/persistence/migrations/`. Its `down_revision` is the last frozen head.
Create this draft only when storage changes; subsequent PRs edit the same draft rather than add revisions.
- Keep SQL, snapshots, native recovery layouts, domain tasks and all source/profile registrations in sync.
Give draft-owned resources names containing `000` (for example `schemas/sqlite-000.json`), and use
literal revision IDs and resource paths so the freeze tool can update references safely.
Never change frozen scripts or dependencies to accommodate a draft.
- Before merging, update against master, reconcile conflicts in the cumulative SQL and registrations,
and pass CI on the merged result. CI validates the chain, checks frozen history against the PR base,
replays registered SQLite sources and runs the selected installed-release upgrade acceptance.
Repository administrators must require these checks and an up-to-date branch or merge queue.
- Only released-version upgrades are supported. A database or recovery plan created by unpublished `000`
is disposable: rebuild it when the draft changes or freezes. Do not stamp it as a released revision.
- Release PRs run `make version-bump VERSION=X.Y.Z`, then `make schema-freeze VERSION=X.Y.Z`.
Freezing renames `000` to `vX_Y_Z`, including owned paths and registrations, and refreshes the
persistence digest after validating unchanged frozen history. Review the compatibility rationale,
record the version/head in release notes, and pass `make release-check` and artifact upgrade acceptance.
Publication rejects unfrozen drafts. No pending schema change means no new revision.
- After release, the next schema PR starts a new `000` after the frozen head. Published revisions,
including legacy sequence and PR-based names, retain their identities and resources permanently.

## Generated API Contract

Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ notebooks-test: ## Execute provider-free tutorials in fresh kernels; use ARGS fo
@uv run --locked --group notebooks python examples/jupyter/run.py $(ARGS)

.PHONY: check
check: version-check upgrade-policy-check workflow-actions-check integration-manifest-check integration-guidance-check integration-lifecycle-check ## Run code quality tools.
check: schema-check version-check upgrade-policy-check workflow-actions-check integration-manifest-check integration-guidance-check integration-lifecycle-check ## Run code quality tools.

.PHONY: integration-guidance integration-guidance-check
integration-guidance: ## Copy shared Skills into native packages.
Expand Down Expand Up @@ -280,7 +280,7 @@ version-check: ## Check release references and generated API code; optionally as
@$(MAKE) api-generate-check js-api-generate-check

.PHONY: release-check
release-check: version-check upgrade-policy-check docs-install ## Check version references and require matching bilingual notes for a stable release.
release-check: schema-release-check version-check upgrade-policy-check docs-install ## Check version references and require matching bilingual notes for a stable release.
@cd website && node --import tsx --test tests/releases.test.ts

.PHONY: upgrade-policy-check
Expand Down Expand Up @@ -339,3 +339,13 @@ help:
[[print(f'\033[36m{m[0]:<20}\033[0m {m[1]}') for m in re.findall(r'^([a-zA-Z0-9_-]+):.*?## (.*)$$', open(makefile).read(), re.M)] for makefile in ('$(MAKEFILE_LIST)').strip().split()]"

.DEFAULT_GOAL := help

.PHONY: schema-check schema-release-check schema-freeze
schema-check: ## Validate the shared draft and registered Server migration chains.
@uv run --locked python scripts/schema_release.py check

schema-release-check: ## Reject an unfrozen 000 migration before publication.
@uv run --locked python scripts/schema_release.py check --release

schema-freeze: ## Freeze shared 000 resources after version-bump: VERSION=X.Y.Z.
@uv run --locked python scripts/schema_release.py freeze
Loading
Loading