|
| 1 | +# Kida Pre-1.0 Stabilization Rituals |
| 2 | + |
| 3 | +Kida is moving from pre-1.0 feature turbulence to a framework-author-ready |
| 4 | +surface. This is not a plan to cut a major release candidate; it is a plan to |
| 5 | +turn the behaviors framework authors already depend on into visible, repeatable |
| 6 | +project rituals. The stabilization posture is deliberately conservative: no new |
| 7 | +runtime dependencies, public APIs, template tags, or config knobs unless they |
| 8 | +are required to close a bug that blocks real users. |
| 9 | + |
| 10 | +Current baseline after the `0.8.0` work on `main`: |
| 11 | + |
| 12 | +- Pure Python remains the default contract; runtime dependencies stay empty. |
| 13 | +- `make lint`, `make ty`, and the full test suite are the required local gates. |
| 14 | +- Coverage currently targets the project floor in `pyproject.toml`; the |
| 15 | + stability gate should enforce the current 83% floor. |
| 16 | +- Existing strict xfails should stay at zero for stabilization work. |
| 17 | + |
| 18 | +## Phase 1: Stability Inventory and API Snapshot |
| 19 | + |
| 20 | +Freeze the public framework-author surface before changing behavior. |
| 21 | + |
| 22 | +- Add a public API snapshot test for: |
| 23 | + - `kida.__all__` |
| 24 | + - `ErrorCode` names and values |
| 25 | + - `Environment.__init__` |
| 26 | + - public `Template` render and metadata methods |
| 27 | + - metadata dataclass fields |
| 28 | + - CLI subcommands and flags |
| 29 | +- Update API and CLI docs to name stable surfaces and separate them from |
| 30 | + internal or still-provisional surfaces. |
| 31 | +- Treat snapshot changes as deliberate API changes that require changelog and |
| 32 | + docs updates in the same PR. |
| 33 | + |
| 34 | +Acceptance: |
| 35 | + |
| 36 | +- `make lint`, `make ty`, and focused tests pass. |
| 37 | +- Snapshot tests fail when public contracts drift. |
| 38 | + |
| 39 | +## Phase 2: Component and Metadata Contract Tests |
| 40 | + |
| 41 | +Harden component validation and metadata for framework integration. |
| 42 | + |
| 43 | +- Extend imported def validation tests for aliases, missing required props, |
| 44 | + unknown props, literal type mismatches, missing imported templates, and |
| 45 | + dynamic import skip behavior. |
| 46 | +- Stabilize metadata across `list_defs()`, `def_metadata()`, |
| 47 | + `block_metadata()`, `template_metadata()`, inheritance, regions, slots, and |
| 48 | + CLI JSON output. |
| 49 | +- Ensure `K-CMP-001` and `K-CMP-002` have docs entries with fix guidance. |
| 50 | + |
| 51 | +Acceptance: |
| 52 | + |
| 53 | +- Imported literal component validation is covered end to end. |
| 54 | +- Dynamic imports are explicitly documented as skipped. |
| 55 | + |
| 56 | +## Phase 3: Render, Sandbox, and Free-Threading Gates |
| 57 | + |
| 58 | +Convert safety invariants into local verification gates. |
| 59 | + |
| 60 | +- Add render-surface coverage meta-tests for every current render surface. |
| 61 | +- Assert there are no active strict xfails. |
| 62 | +- Add a fragment-render scaffold guard so block/fragment render methods use the |
| 63 | + shared scaffold path. |
| 64 | +- Promote sandbox fuzz, bytecode-cache concurrency, LRU concurrency, and render |
| 65 | + stress tests into stability verification. |
| 66 | + |
| 67 | +Acceptance: |
| 68 | + |
| 69 | +- `PYTHON_GIL=0 make verify-stability` passes locally on 3.14t. |
| 70 | +- Free-threaded shared state has an audit note for intentional sharing, |
| 71 | + locking, and copy-on-write behavior. |
| 72 | + |
| 73 | +## Phase 4: Diagnostics and Docs Truth Audit |
| 74 | + |
| 75 | +Make docs match actual behavior. |
| 76 | + |
| 77 | +- Add an ErrorCode docs coverage test for every public `ErrorCode`, including |
| 78 | + `K-CMP-*`. |
| 79 | +- Snapshot representative `kida check --validate-calls`, |
| 80 | + `kida components --json`, and error/warning formatting. |
| 81 | +- Reconcile API, CLI, components, type-checking, sandbox, thread-safety, and |
| 82 | + Jinja2 migration docs with current behavior. |
| 83 | + |
| 84 | +Acceptance: |
| 85 | + |
| 86 | +- Every public diagnostic has docs, fix guidance, and stable formatting. |
| 87 | + |
| 88 | +## Phase 5: Benchmark Baseline and Packaging Smoke |
| 89 | + |
| 90 | +Collect performance evidence and package smoke tests. |
| 91 | + |
| 92 | +- Refresh Linux 3.14t benchmark baselines using existing benchmark scripts for |
| 93 | + render, compile pipeline, streaming, inherited blocks, and concurrency. |
| 94 | +- Add benchmark comparison instructions to release docs. |
| 95 | +- Build wheel/sdist, install from the wheel in a clean temporary environment, |
| 96 | + and smoke-test import, render, CLI check, component metadata, and sandbox |
| 97 | + denial. |
| 98 | +- Fail the stability gate on more than 5% compile/render/stream regression or more than 10% |
| 99 | + concurrency regression versus the committed Linux 3.14t baseline unless the |
| 100 | + PR updates the baseline with justification. |
| 101 | + |
| 102 | +Acceptance: |
| 103 | + |
| 104 | +- Any user-facing behavior change has docs or changelog coverage. |
| 105 | +- The repo has enough evidence to make a release decision later without |
| 106 | + reconstructing what was tested. |
| 107 | + |
| 108 | +## Stability Gate Target |
| 109 | + |
| 110 | +`make verify-stability` should become the single local stabilization gate and |
| 111 | +run: |
| 112 | + |
| 113 | +- `ruff check` |
| 114 | +- `ruff format --check` |
| 115 | +- `ty` |
| 116 | +- full pytest |
| 117 | +- coverage with `--cov-fail-under=83` |
| 118 | +- sandbox fuzz and thread-safety tests |
| 119 | +- `PYTHON_GIL=0` free-threading pass where supported |
| 120 | +- wheel build/install smoke test |
| 121 | + |
| 122 | +`make verify-rc` may remain as an alias, but the ritual is about stability |
| 123 | +evidence rather than committing the project to a specific version tag. |
0 commit comments