Skip to content

plain: regenerate all twins, add content-drift guard, close detail gaps#51

Open
Alexgodoroja wants to merge 4 commits into
mainfrom
plain-mirror-investigation
Open

plain: regenerate all twins, add content-drift guard, close detail gaps#51
Alexgodoroja wants to merge 4 commits into
mainfrom
plain-mirror-investigation

Conversation

@Alexgodoroja

@Alexgodoroja Alexgodoroja commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Why

The plain (machine-UI) mirrors under src/pages/plain/ had drifted badly out of sync with their marketing/docs sources. Root cause:

  • The CI guard never checked content. check:plain enforced only 1:1 file existence (every human page has a twin, no orphans) — it explicitly did not compare content. So CI stayed green while every twin went stale.
  • The content generator was never automated. regen-plain.mjs was manual-only (needs an API key, not referenced in any workflow), so nobody re-ran it after editing a marketing page. Its manifest didn't even cover app-store/publish, which the guard still required.

Worst offenders before this change: app-store (9 source edits, twin never updated), index (6), publish (6), plus many docs pages 1–2 edits behind.

What changed

  • Regenerated all 39 twins from current sources (37 manifest pages + app-store/publish, now added to the manifest).
  • Content-drift guard. regen-plain.mjs stamps each twin with its source path + SHA-256; check-plain-coverage.mjs (in CI) now fails when a source changes without regeneration — turning silent staleness into a red check, and acting as the backstop on main.
  • Auto-regen on PRs (plain-sync.yml). On same-repo PRs, CI runs regen-plain.mjs --stale-only and pushes the refreshed twins back to the PR branch with a review comment, so drift self-heals with a human still reviewing the bot commit. Fork PRs (no secret / no push) fall back to the check:plain guard.
  • Closed residual detail gaps in ~12 twins where the summarizer had dropped material facts (CLI flags, verbatim commands, config keys, numeric specs, per-app version/license/method metadata).

Verification

  • npm run check:plain → green (39 stamped twins in sync, no orphans)
  • npm run build → green (190 pages), no escaping errors
  • regen-plain.mjs --stale-only → exits 0 with no work when twins are in sync (no API key required in that case)
  • skills/index.astro intentionally left unstamped — it renders live from upstream JSON at build time.

Ops notes

  • Requires the GEMINI_API_KEY Actions secret (added).
  • Optional: add a PLAIN_SYNC_TOKEN PAT so the auto-regen commit re-triggers the build check automatically; without it the fix still lands on the branch but the check must be re-run.

Alex Godoroja added 3 commits June 24, 2026 15:06
The plain (machine-UI) mirrors had drifted badly: the only CI guard
(check:plain) verifies 1:1 file existence but never content, and the
content generator (regen-plain.mjs) was manual-only and never wired into
CI — so twins silently rotted whenever a marketing page was edited.

Changes:
- Regenerate all 37 manifest twins from current sources via regen-plain.mjs.
- Add app-store and publish to the regen manifest (were required by the
  coverage guard but had no generator entry) and generate their twins.
- Content-drift guard: regen-plain now stamps each twin with its source
  path + SHA-256; check-plain-coverage now fails when a source changed
  without regeneration. Turns silent drift into a red CI check.
- Hand-patch ~12 twins where the summarizer dropped material facts
  (commands, CLI flags, config keys, numeric specs, per-app metadata).

Verified: check:plain green (39 stamped twins in sync), astro build green
(190 pages). skills/index.astro stays unstamped — it renders live from
upstream JSON at build time.
main merged #50 (add Miren app + app-card fixes), which changed
src/pages/app-store.astro. The drift guard correctly flagged the twin as
stale. Regenerate it against the updated source and restore the per-app
spec lines (methods, download size, category, version, license) that the
summarizer drops — now including the Miren entry.

Verified: check:plain green, astro build green (190 pages).
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

🚀 Preview deployed to Cloudflare Pages

  • Commit deploy URL: https://88d0381b.pilotprotocol.pages.dev
  • Branch alias: https://plain-mirror-investigation.pilotprotocol.pages.dev (may take ~30s to propagate)
  • Commit: 89168617d76087bf312a661f09ca9825fd4897a5

Wire the GEMINI_API_KEY secret into CI so drift self-heals instead of only
failing the guard.

- regen-plain.mjs: add --stale-only mode (regenerate only twins whose
  stamped source hash no longer matches the source); require the API key
  only when there is actually a page to regenerate, so it exits 0 with no
  key when nothing has drifted (incl. fork PRs without the secret).
- plain-sync.yml: on same-repo PRs, run regen --stale-only and push the
  refreshed twins back to the PR branch with a review comment. ci.yml's
  check:plain stays the source-of-truth gate (and the backstop on main);
  fork PRs fall back to it. Optional PLAIN_SYNC_TOKEN re-triggers CI on the
  auto-commit; otherwise falls back to GITHUB_TOKEN.
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