Skip to content

fix(migration-to-aws): catch dangling _advances_to (validator false-green)#113

Merged
icarthick merged 1 commit into
awslabs:mainfrom
icarthick:rung/advances-to-membership
Jul 3, 2026
Merged

fix(migration-to-aws): catch dangling _advances_to (validator false-green)#113
icarthick merged 1 commit into
awslabs:mainfrom
icarthick:rung/advances-to-membership

Conversation

@icarthick

@icarthick icarthick commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What

The frontmatter validator silently passed a phase whose _advances_to names a phase that doesn't exist — a false green on a broken backbone.

Root cause

The backbone chain-consistency block is gated on advTargetsResolvable, which self-skips the moment any _advances_to is unresolvable (it assumes "that phase just isn't frontmatter-annotated yet — partial rollout"). And unlike _requires_phase, _advances_to had no independent membership check. So a genuine dangling/typo'd forward edge disables the very checks meant to catch it.

Reproduced: setting generate._advances_to to a non-existent phase (generate has no _re_entry_guard to incidentally trip) → validator reports OK, exit 0. CI would pass a backbone that dead-ends nowhere. (A typo on discover only went red by luck — its _re_entry_guard._stale_if_completed cross-check tripped a different rule.)

Fix

An independent dangling-forward-edge check: each non-terminal _advances_to target must resolve to a phase directory on disk (references/phases/<name>/<name>.md), not the frontmatter-declared set.

This preserves partial-rollout tolerance — an edge to a real phase whose file exists but has no frontmatter yet still resolves — while failing only on an edge to a phase that doesn't exist at all. (In the real heroku rollout the prose file was always present when frontmatter lagged, so this matches how rollout actually happened.)

Changes

  • check.ts — +independent dangling-forward-edge check (disk membership), placed before the rollout-gated chain block so it can't be self-skipped.
  • testsgoodSkill() now includes a frontmatter-less clarify.md stub so its partial-rollout test is faithful (real phase, no frontmatter → tolerated, resolves on disk); +1 regression test for a truly-absent target (typo → fail). 41 tests total.

Verification

  • mise run build green: lint:md, lint:types (tsc strict), lint:frontmatter (real skill clean), 41/41 tests, fmt:check.
  • Manually confirmed: broken generate._advances_to now fails with a clear message; real skill stays clean.

Ownership

Touches only team-owned validator + tests — no admin-owned paths.

…reen)

The frontmatter validator did not catch a phase whose _advances_to names a
phase that does not exist. The backbone chain-consistency block is gated on
`advTargetsResolvable` — it SELF-SKIPS the instant any _advances_to is
unresolvable, assuming "that phase just isn't annotated yet (partial rollout)".
So a genuine dangling/typo'd forward edge slipped through as a false "OK", and
unlike _requires_phase there was no independent membership check on _advances_to.

Reproduced: setting generate._advances_to to a non-existent phase (generate has
no _re_entry_guard to incidentally trip) reported OK / exit 0 — CI would pass a
backbone that dead-ends nowhere.

Fix: an independent _advances_to membership check that resolves each non-terminal
target against the phase DIRECTORY on disk (references/phases/<name>/<name>.md),
not the frontmatter-declared set. This preserves partial-rollout tolerance — an
edge to a real phase whose file exists but has no frontmatter yet still resolves
— while failing only on an edge to a phase that does not exist at all (the real
heroku rollout always kept the prose file present when frontmatter lagged).

- check.ts: +independent dangling-forward-edge check (disk membership).
- tests: goodSkill now includes a frontmatter-less clarify.md stub so its
  partial-rollout test is FAITHFUL (real phase, no frontmatter → tolerated);
  +1 regression test for a truly-absent target (typo → fail). 41 tests total.
@icarthick icarthick requested a review from a team as a code owner July 2, 2026 23:29
@icarthick icarthick merged commit 816c15e into awslabs:main Jul 3, 2026
7 of 8 checks passed
@icarthick icarthick deleted the rung/advances-to-membership branch July 3, 2026 13:03
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