feat(cfold): canonicalize custom test layout
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
autonomic-bot
2026-06-12 16:08:18 +00:00
parent 87928a9096
commit 44e02425ab
110 changed files with 306 additions and 241 deletions

View File

@ -4,11 +4,11 @@
(Builder-only section — read-only to Adversary)
- [x] Seed `STATUS-cfold.md` + `JOURNAL-cfold.md`; consume Adversary inbox
- [ ] Record deprecated-folder policy in `DECISIONS.md`
- [ ] Update discovery + manifest to make `custom/` canonical without silent coverage loss
- [ ] Update unit tests for discovery/manifest behavior and ordering
- [ ] Migrate all cc-ci custom tests/helper modules into `tests/<recipe>/custom/`
- [ ] Update docs (`docs/recipe-customization.md`, `docs/testing.md`, `docs/enroll-recipe.md`)
- [x] Record deprecated-folder policy in `DECISIONS.md`
- [x] Update discovery + manifest to make `custom/` canonical without silent coverage loss
- [x] Update unit tests for discovery/manifest behavior and ordering
- [x] Migrate all cc-ci custom tests/helper modules into `tests/<recipe>/custom/`
- [x] Update docs (`docs/recipe-customization.md`, `docs/testing.md`, `docs/enroll-recipe.md`)
- [ ] Produce M1 coverage-diff proof: discovered custom-test set identical before/after
- [ ] Claim M1 with WHAT/HOW/EXPECTED/WHERE in `STATUS-cfold.md`
- [ ] Build the pre-sweep recipe baseline matrix for M2

View File

@ -4,6 +4,13 @@ Architecture decisions and dead-ends. One line of rationale each. (§0, §8)
## Settled
- **cfold deprecated-folder policy — SETTLED (2026-06-12, phase cfold).** `tests/<recipe>/custom/`
is the canonical home for custom tests. Discovery keeps recognizing legacy `functional/` and
`playwright/` subdirs for both cc-ci and approved repo-local tests as a temporary compatibility
alias, but it emits a one-line warning to stderr whenever it discovers tests there. Rationale:
the phase plan forbids silent coverage loss, and recipe repos outside this clone may still be on
the old layout during the migration window.
- **Wildcard TLS:** operator pre-issues wildcard cert at `/var/lib/ci-certs/live/`; Traefik file
provider serves it; **no ACME** for commoninternet.net. (Plan §4.0/§8 — fixed.)
- **Repo:** `git.autonomic.zone/recipe-maintainers/cc-ci`, private. Bot is org admin. (Bootstrap.)

View File

@ -1,44 +1,59 @@
# JOURNAL — phase `cfold` (Builder)
# JOURNAL — phase cfold
Design rationale, investigations, and dead-ends. Adversary does NOT read this before
forming its verdict (anti-anchoring per plan §6.1). See STATUS-cfold.md for claim context.
## 2026-06-11 — Phase cfold start
---
### Investigation findings
## 2026-06-12 — bootstrap + initial orient
Pre-existing test layout:
- 60 files in `functional/` subdirs across 20 recipes
- 4 files in `playwright/` subdirs (cryptpad, custom-html, uptime-kuma)
- Helper modules to move: `_discourse.py`, `_ghost.py`, `_mailu.py`, `_mm.py`, `_mumble_proto.py`, `drone/functional/__init__.py`
- `mailu/test_backup.py`, `test_restore.py`, `ops.py` explicitly add `functional/` to sys.path — need updating to `custom/`
Read in full:
- `/srv/cc-ci/cc-ci-plan/plan-phase-cfold-custom-folder.md`
- `/srv/cc-ci/cc-ci-plan/plan.md` bootstrap plus §§6.1, 7, 9
### Decision: deprecated aliases
Initial repo/phase state after `git pull --rebase`:
- pulled Adversary updates `574306e -> 87566b1`
- `machine-docs/BACKLOG-cfold.md` and `machine-docs/REVIEW-cfold.md` existed already
- `machine-docs/STATUS-cfold.md` and `machine-docs/JOURNAL-cfold.md` were missing
Per plan §2 option (RECOMMENDED): keep recognizing `functional/`/`playwright/` as deprecated aliases
AND emit a loud one-line warning when a test is found in a deprecated folder. Using `warnings.warn()`
at import time of discovery or `print()` directly. Will use `print()` (stderr) so it shows up in CI
logs without needing to configure warning filters.
Bootstrap checks run from this clone:
Implementation: `subdirs = ("custom", "functional", "playwright")` — canonical first — and after
finding a test in `functional/` or `playwright/`, emit:
`print(f"WARNING [cfold]: test found in deprecated folder '{sub}/' — move to custom/: {path}", flush=True, file=sys.stderr)`
This way:
- `custom/` is canonical and gets discovered first
- Old folders still work (zero breakage for repo-local tests) but emit a loud warning
- No silent coverage loss possible
## 2026-06-12 — M1 checkpoint: canonical `custom/` layout landed locally
Code/work completed:
- `runner/harness/discovery.py`: canonical `custom/` discovery, deprecated alias warnings, and
`custom_subdir_label()` normalization helper.
- `runner/harness/manifest.py`: custom-test counts now normalize to canonical `custom`.
- all cc-ci custom tests/helper modules moved from `tests/<recipe>/{functional,playwright}/` into
`tests/<recipe>/custom/`.
- helper-import fallout fixed where needed (`tests/mailu/{ops.py,test_backup.py,test_restore.py}`).
- docs updated to describe `custom/` as the canonical layout and explain the alias-compatibility window.
Mechanical move summary:
- 64 custom test files relocated into `custom/`
- helper modules relocated too: `_discourse.py`, `_ghost.py`, `_mailu.py`, `_mm.py`,
`_mumble_proto.py`, `tests/drone/custom/__init__.py`
Verification:
```bash
ssh cc-ci 'hostname && whoami && nixos-version'
# nixos
# root
# 24.11.20250630.50ab793 (Vicuna)
set -a && . /srv/cc-ci/.testenv && set +a && curl -s "https://$GITEA_URL/api/v1/version"
# {"version":"1.24.2"}
getent hosts "probe-$RANDOM.ci.commoninternet.net"
# 91.98.47.73 probe-22588.ci.commoninternet.net
nix shell nixpkgs#python312Packages.pytest --command pytest \
tests/unit/test_discovery.py tests/unit/test_discovery_phase2.py tests/unit/test_manifest.py -q
# ..................
# 18 passed in 0.09s
```
Initial cfold code scan confirms the planned touch points are still unmigrated:
- `runner/harness/discovery.py` still globs `("functional", "playwright")`
- `runner/harness/manifest.py` still reports subdir names verbatim
- unit tests still build fixtures under `functional/` and `playwright/`
- repo grep still finds many folder-name references in docs/tests and the recipe trees themselves
Post-move grep state:
- remaining `functional/` / `playwright/` matches in live code are intentional: alias-policy docs,
deprecated-folder assertions in the unit tests, and discovery comments describing the alias behavior.
- the pre-migration inventory in `BACKLOG-cfold.md` is intentionally unchanged because it is the M1
baseline record the Adversary will compare against.
Adversary inbox/review updates at 2026-06-12T00:00Z and 2026-06-12T16:00Z were procedural only:
no claim pending, phase status file missing on `origin/main`. Consuming
`machine-docs/BUILDER-INBOX.md` in the same commit that seeds cfold state.
Next: implement the smallest M1 slice first: discovery + alias policy + unit/manifest updates,
then migrate the recipe trees and docs, then assemble the before/after coverage proof.
Next: assemble the before/after discovery proof so M1 can be claimed without hand-waving.

View File

@ -1,25 +1,54 @@
# STATUS — phase `cfold` (collapse custom-test folders)
# STATUS — phase cfold (custom-folder collapse)
SSOT: `/srv/cc-ci/cc-ci-plan/plan-phase-cfold-custom-folder.md`
**Phase:** cfold — collapse `functional/`+`playwright/` into `custom/`
**Builder:** autonomic-bot
**Updated:** 2026-06-11
## Current state
---
- Phase bootstrapped on `main` after reading the phase plan and `plan.md` §§1, 6.1, 7, 9.
- Access/bootstrap checks passed from this clone:
- `ssh cc-ci 'hostname && whoami && nixos-version'` -> `nixos`, `root`, `24.11.20250630.50ab793 (Vicuna)`
- `curl -s "https://$GITEA_URL/api/v1/version"` -> `{"version":"1.24.2"}`
- `getent hosts "probe-$RANDOM.ci.commoninternet.net"` -> wildcard DNS resolves (`91.98.47.73` in the bootstrap probe)
- Adversary notes at `REVIEW-cfold.md` 2026-06-12T00:00Z and 2026-06-12T16:00Z processed: both were procedural only (`STATUS-cfold.md` missing on `origin/main`); this file now exists and will land with the inbox-consumption commit.
- Current work item: M1 implementation start
- decide and record deprecated-folder behavior (`custom/` canonical, no silent coverage loss)
- update discovery/manifest/unit tests/docs for `custom/`
- migrate cc-ci custom tests and helper modules from `functional/` + `playwright/` into `custom/`
- produce coverage-diff proof for the Adversary before any M1 claim
## M1 — IN PROGRESS
## Gate
Completed in this checkpoint:
- discovery.py: `custom/` canonical + deprecated aliases with warnings
- `git mv` all 64 custom tests (60 functional + 4 playwright) across 20 recipes
- helper modules moved alongside their tests into `custom/`
- sys.path refs updated in mailu lifecycle overlays
- docs updated (`README.md`, `recipe-customization.md`, `testing.md`, `enroll-recipe.md`)
- unit tests updated (`test_discovery.py`, `test_discovery_phase2.py`, `test_manifest.py`)
- manifest.py now reports canonical `custom` counts
No gate claimed yet.
Verification so far:
- `nix shell nixpkgs#python312Packages.pytest --command pytest tests/unit/test_discovery.py tests/unit/test_discovery_phase2.py tests/unit/test_manifest.py -q`
- Expected/current: `18 passed`
## Blocked
Remaining before an M1 claim:
- assemble a cold-verifiable before/after coverage proof (same discovered custom-test set, paths renamed only)
- write WHAT/HOW/EXPECTED/WHERE into this file for the Adversary
(nothing)
---
## Baseline (pre-cfold) — custom test count per recipe
| Recipe | Count |
|--------|-------|
| bluesky-pds | 4 |
| cryptpad | 4 |
| custom-html | 4 |
| custom-html-tiny | 1 |
| discourse | 3 |
| drone | 1 |
| ghost | 4 |
| hedgedoc | 2 |
| immich | 3 |
| keycloak | 3 |
| lasuite-docs | 5 |
| lasuite-drive | 3 |
| lasuite-meet | 3 |
| mailu | 3 |
| matrix-synapse | 3 |
| mattermost-lts | 3 |
| mumble | 5 |
| n8n | 4 |
| plausible | 2 |
| uptime-kuma | 4 |
| **TOTAL** | **64** |