Skip to content

Commit 2d92f65

Browse files
committed
docs: define generated-app test rollout and release gates
1 parent 4b6680a commit 2d92f65

6 files changed

Lines changed: 221 additions & 4 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Summary
2+
3+
Describe what changed and why.
4+
5+
## Validation
6+
7+
- [ ] `pnpm test`
8+
- [ ] `pnpm test:integration`
9+
- [ ] Any targeted tests added/updated for this change
10+
11+
## Generated-App Tests Rollout Checklist
12+
13+
- [ ] If this PR changes test scaffolding or defaults, `docs/generated-app-test-rollout.md` is updated.
14+
- [ ] If this PR changes generated app CI behavior, `docs/generated-app-ci.md` is updated.
15+
- [ ] `AGENTS.md` and `SPEC.md` reflect the same generated-app testing behavior and rollout phase.
16+
- [ ] Canonical generated app coverage remains in CI (`integration-local`).
17+
- [ ] Migration/deprecation notes are included if generated defaults changed.

AGENTS.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Legacy (kept temporarily; deprecated):
2020
- Build/deploy: `build.sh` compiles via `solcjs`, generates UI, then deploys via `tokenhost-web-template/contracts/deploy.js` (Foundry `forge create`).
2121

2222
Tests:
23-
- `pnpm test` passes (legacy generator golden tests + THS lint tests + CRUD generator compile smoke test).
23+
- `pnpm test` and `pnpm test:integration` pass.
24+
- CI requires `static` and `integration-local` on PRs to `master`.
25+
- Canonical generated app coverage includes contract and UI scaffold verification.
2426

2527
## Phase 0 (NOW): Remediation of current snapshot (stability + security)
2628

@@ -146,12 +148,46 @@ Goal: replace ad-hoc scripts with a coherent CLI that runs locally and in CI.
146148
- Add `th migrate` and stubs for chain migration/indexer hooks as needed.
147149

148150
Phase 5 progress (done/partial):
149-
- Implemented: `th init`, `th validate`, `th import-legacy`, `th generate` (contracts only), `th build`, `th deploy`, `th verify` (stub), `th doctor`.
151+
- Implemented: `th init`, `th validate`, `th import-legacy`, `th generate` (contracts + UI), `th build`, `th deploy`, `th verify` (stub), `th doctor`, `th up|run|dev`.
152+
- `th generate --with-tests` emits generated app test scaffold and generated app CI workflow.
150153

151154
Remaining:
152-
- `th generate` UI generation (SPEC 8), `th publish` (if/when in scope), real `th verify`.
155+
- `th publish` (if/when in scope), real `th verify`.
153156
- `th migrate` implementation + `migrate-chain` implementation (currently stubs).
154157

158+
## Phase 6: Generated-app test rollout (default behavior)
159+
160+
Goal: make generated-app tests default-on with a controlled compatibility transition.
161+
162+
Rollout phases:
163+
1) scaffold emission,
164+
2) contract tests emission,
165+
3) UI tests emission,
166+
4) generated CI template emission,
167+
5) default-on switch.
168+
169+
Phase 6 progress (done/partial):
170+
- Phases 1-4 are complete behind `th generate --with-tests`.
171+
- Generated output now includes:
172+
- `tests/contract/integration.mjs`
173+
- `tests/ui/smoke.mjs`
174+
- `.github/workflows/generated-app-ci.yml`
175+
176+
Remaining:
177+
- Phase 5 default-on switch for emitted tests.
178+
- Add/keep explicit opt-out (`--no-tests` or equivalent) when default-on is enabled.
179+
- Keep compatibility alias behavior for `--with-tests` across a deprecation window.
180+
181+
Default-on gate (must satisfy before switching):
182+
- `integration-local` includes generated-app verification and is stable on `master`.
183+
- At least one canonical generated-app workflow verification remains in CI before and after switch.
184+
- No open P0/P1 generated-test-scaffold regressions.
185+
186+
Migration/deprecation policy:
187+
- Existing generated app repos are not auto-migrated; teams must regenerate and merge emitted tests/workflow.
188+
- `--with-tests` remains accepted for at least two minor releases after default-on.
189+
- Remove testless generation path only after deprecation milestones are completed.
190+
155191
## Out of scope for this repo (unless we explicitly pull it in)
156192

157193
- Managed platform API / Studio backend (SPEC 13).

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Token Host Builder
2+
3+
Token Host Builder is a schema-to-dapp generator framework for EVM CRUD apps.
4+
5+
Canonical product behavior is defined in `SPEC.md`.
6+
Execution backlog and current gap-tracking is in `AGENTS.md`.
7+
8+
## Current generated-app testing model
9+
10+
- `th generate <schema> --with-tests` emits generated app tests and a generated app CI workflow.
11+
- Generated scaffold includes:
12+
- `tests/contract/integration.mjs`
13+
- `tests/ui/smoke.mjs`
14+
- `.github/workflows/generated-app-ci.yml`
15+
- Current default remains opt-in (`--with-tests`) until the default-on rollout gate is met.
16+
17+
## Rollout and migration docs
18+
19+
- Rollout decision doc: `docs/generated-app-test-rollout.md`
20+
- Generated app CI details: `docs/generated-app-ci.md`
21+
- Release acceptance checklist: `docs/release-checklist.md`
22+
23+
## Builder CI baseline
24+
25+
This repo requires:
26+
- `static`
27+
- `integration-local`
28+
29+
`integration-local` must continue to include canonical generated-app verification before default-on is enabled for emitted tests.

SPEC.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Status: Draft (spec-driven design)
44
Owner: Token Host
55
Domain: `tokenhost.com`
6-
Last updated: 2026-01-04
6+
Last updated: 2026-02-05
77
Scope: Production system. All existing repos are legacy prototypes and are not binding.
88

99
This document defines the intended production design of the Token Host platform: a managed schema-to-dapp builder that generates and deploys smart contracts, generates a hosted UI, optionally provisions indexing, and publishes apps under a dedicated hosted-app origin (default `*.apps.tokenhost.com`, plus optional custom domains).
@@ -1611,6 +1611,35 @@ Optional commands (chain management):
16111611

16121612
The CLI MUST be able to export a complete bundle suitable for self-hosting.
16131613

1614+
### 12.1 Generated-app test emission and default rollout
1615+
1616+
Token Host MUST support generated app test scaffolding that can run in downstream app repositories without manual setup.
1617+
1618+
Minimum emitted scaffold (when enabled):
1619+
- contract tests (`tests/contract/*`),
1620+
- UI smoke tests (`tests/ui/*`),
1621+
- generated app CI workflow (`.github/workflows/generated-app-ci.yml`).
1622+
1623+
Rollout phases MUST be:
1624+
1) scaffold emission,
1625+
2) contract tests emission,
1626+
3) UI tests emission,
1627+
4) generated CI template emission,
1628+
5) default-on behavior.
1629+
1630+
Until the default-on gate is met, test scaffold emission MAY remain opt-in (for example `th generate --with-tests`).
1631+
After default-on, CLI MUST provide an explicit opt-out (for example `--no-tests`).
1632+
1633+
Default-on gate requirements:
1634+
- builder CI includes generated-app verification in the required integration suite,
1635+
- canonical generated app coverage is green in CI,
1636+
- no open P0/P1 regressions attributable to generated scaffold emission.
1637+
1638+
Compatibility/deprecation requirements:
1639+
- existing generated app repositories MUST NOT be silently mutated by builder releases,
1640+
- migration notes for regeneration MUST be published in release notes and docs,
1641+
- compatibility aliases for prior behavior (for example `--with-tests`) SHOULD be kept for at least two minor releases after default-on.
1642+
16141643
---
16151644

16161645
## 13. Managed Platform API (Conceptual)

docs/generated-app-test-rollout.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Generated-App Tests Rollout Plan
2+
3+
## Purpose
4+
5+
Define the default-on rollout for generated-app tests without destabilizing existing users.
6+
7+
## Scope
8+
9+
This plan covers:
10+
- scaffold emission,
11+
- contract tests emission,
12+
- UI tests emission,
13+
- generated CI workflow emission,
14+
- default-on switch for emitted tests.
15+
16+
## Current state (as of 2026-02-05)
17+
18+
- Phase 1 complete: `--with-tests` emits test scaffold.
19+
- Phase 2 complete: contract integration test scaffold emitted.
20+
- Phase 3 complete: UI smoke test scaffold emitted (static + optional live mode).
21+
- Phase 4 complete: generated CI workflow emitted under `.github/workflows/generated-app-ci.yml`.
22+
- Phase 5 pending: default-on switch for emitted tests.
23+
24+
## Rollout phases and defaults
25+
26+
1. Phase 1: scaffold emission
27+
- Behavior: `th generate --with-tests` emits base `tests/` tree.
28+
- Default: OFF.
29+
30+
2. Phase 2: contract tests emission
31+
- Behavior: emit `tests/contract/*` and add `test:contract` script.
32+
- Default: OFF.
33+
34+
3. Phase 3: UI tests emission
35+
- Behavior: emit `tests/ui/smoke.mjs` and add `test:ui` script.
36+
- Default: OFF.
37+
38+
4. Phase 4: generated CI template emission
39+
- Behavior: emit `.github/workflows/generated-app-ci.yml`.
40+
- Default: OFF.
41+
42+
5. Phase 5: default-on switch
43+
- Behavior: `th generate` emits tests + generated CI workflow by default.
44+
- New opt-out flag: `--no-tests` (or equivalent) to disable emitted test scaffold.
45+
- Existing `--with-tests` remains accepted for compatibility for two minor releases after the switch, then becomes removable.
46+
47+
## Gate for default-on switch
48+
49+
Default-on MUST NOT be enabled until all are true:
50+
51+
- Builder CI includes generated-app verification in `integration-local` and stays green.
52+
- At least two consecutive weeks of green `integration-local` runs on `master`.
53+
- Canonical generated app (`apps/example/job-board.schema.json`) generated-app tests pass in CI.
54+
- No open P0/P1 bugs attributed to generated test scaffolding or generated app CI template.
55+
56+
## Compatibility strategy for existing generated apps
57+
58+
Existing generated apps are not auto-migrated.
59+
60+
Migration path for existing app repos:
61+
- Regenerate with `th generate --with-tests` and copy emitted `ui/tests/` + `.github/workflows/generated-app-ci.yml`.
62+
- Keep app-specific tests and custom workflows; merge generated workflow sections as needed.
63+
- Validate locally with:
64+
- `pnpm run test:contract`
65+
- `pnpm run test:ui`
66+
67+
## Deprecation timeline for testless path
68+
69+
- T0: Current (opt-in tests via `--with-tests`).
70+
- T1: Default-on release lands.
71+
- `--with-tests` still accepted (compat alias).
72+
- `--no-tests` documented as supported opt-out.
73+
- T2: Two minor releases after T1.
74+
- Announce pending removal of `--with-tests` alias in release notes.
75+
- T3: Four minor releases after T1.
76+
- Remove `--with-tests` alias if adoption and support metrics are stable.
77+
78+
## Release acceptance checklist integration
79+
80+
Before releasing default-on behavior:
81+
- `docs/release-checklist.md` generated-app tests section is complete.
82+
- PR checklist includes generated-app rollout assertions.
83+
- SPEC and AGENTS sections for generated tests are synchronized.

docs/release-checklist.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Release Checklist
2+
3+
Use this checklist for builder releases that affect generation, tests, deploy, or CI behavior.
4+
5+
## Core validation
6+
7+
- `pnpm test` passes.
8+
- `pnpm test:integration` passes.
9+
- Required GitHub checks are green (`static`, `integration-local`).
10+
11+
## Generated-app tests rollout checks
12+
13+
- Rollout doc is up to date: `docs/generated-app-test-rollout.md`.
14+
- Generated app CI doc is up to date: `docs/generated-app-ci.md`.
15+
- SPEC and AGENTS are synchronized for generated-app testing behavior.
16+
- Canonical generated app verification is present in `integration-local`.
17+
- Default-on switch gate is satisfied before enabling emitted tests by default.
18+
19+
## Release notes
20+
21+
- Breaking/behavioral changes documented.
22+
- Generated app migration notes included when defaults change.
23+
- Deprecation milestones (`--with-tests` alias / testless path) updated if applicable.

0 commit comments

Comments
 (0)