Skip to content

feat(migrate): declared _gates key for sidebars + full lint:frontmatter coverage - #166

Open
herosjourney wants to merge 1 commit into
awslabs:mainfrom
herosjourney:feat/gates-key-frontmatter-coverage
Open

feat(migrate): declared _gates key for sidebars + full lint:frontmatter coverage#166
herosjourney wants to merge 1 commit into
awslabs:mainfrom
herosjourney:feat/gates-key-frontmatter-coverage

Conversation

@herosjourney

Copy link
Copy Markdown
Contributor

Summary

Two related CI-hardening changes, completing the sidebar-grammar proposal from the what-if workshop review (the checkpoint → sidebar rename landed in #162; this adds the third piece):

  1. _gates declared key. "Hold Generate until the workshop resolves" lived only in interpreter/invariants prose. It's now a declared, validator-enforced frontmatter key: a sidebar may carry _gates: <backbone-phase>, meaning that phase must not start while the sidebar is unresolved. Declining still resolves the sidebar ("completed"), so the key holds ordering, never participation. The construct generalizes — a future "re-probe Discover" sidebar would use the same key anchored elsewhere.
  2. lint:frontmatter now covers all four skills. It previously validated only heroku-to-aws and agent-advisor; vercel-to-aws (8 phase files with frontmatter today) and gcp-to-aws (0 today; guarded as frontmatter rolls out) are added. The validator already caught a real bug on vercel during the feat(heroku-to-aws): post-Estimate what-if workshop checkpoint #152 review round — it just wasn't wired into CI for that skill.

Changes

  • tools/frontmatter-validator/: _gates added to the closed phase-key vocab (parse.ts), typed model (types.ts), and checks (check.ts): sidebar-only; target must not be a terminal; target must exist on disk (same partial-rollout-tolerant resolution as the _advances_to dangling-edge check); backbone phases must not declare it.
  • tests/tools/frontmatter-validator.test.ts: 4 new cases (valid gate, dangling gate, terminal gate, gate on backbone) — 61 pass.
  • skills/shared/dsl/INTERPRETER.md (canonical): _gates row in the phase-key table + semantics in the sidebar section; synced to the vendored copies.
  • skills/shared/workshop/workshop-invariants.md (canonical): sidebar-state section now points at the declared key; synced to the 3 vendored copies.
  • skills/vercel-to-aws/references/phases/workshop/workshop.md: _gates: generate added to the frontmatter (the only workshop file with frontmatter today; heroku/gcp pick the key up when they adopt phase frontmatter).
  • mise.toml: two lint:frontmatter invocations added (vercel-to-aws, gcp-to-aws).

Relationship to other PRs

Independent — based on current main (post-#162, which did the sidebar rename this builds on). Touches the validator (no open PR does), vendored DSL/invariants trees via shared:sync (no open PR touches them), and one frontmatter line of vercel workshop.md.

Test plan

  • Validator suite: 61 pass, 0 fail (4 new _gates cases)
  • lint:frontmatter green on all four skills (heroku 10, agent-advisor, vercel 8 incl. the new _gates: generate, gcp 0)
  • shared:check green across the 4 vendored trees after sync
  • Full mise run build green (160/160 checks)

@herosjourney
herosjourney requested review from a team as code owners July 20, 2026 22:36

@leon1418 leon1418 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[🤖 AI review 🤖]

Reviewed all 14 changed files end-to-end: the validator implementation (parse.ts, types.ts, check.ts), all 4 test cases, the INTERPRETER.md additions (shared + 3 vendored copies), workshop-invariants (shared + 3 vendored), the vercel workshop.md frontmatter line, and mise.toml.

Summary: Clean, well-structured extension. _gates correctly mirrors the existing _advances_to on-disk resolution pattern, the closed-vocab addition is minimal, tests cover the four key invariants (valid, dangling, terminal, backbone-rejects), and the prose documentation is precise. One unimplemented check noted below (non-blocking).

Merge note: PR shows CONFLICTING state — main is 23 commits ahead and 8 of this PR's files were also touched on main (likely from other PRs merging into the vendored trees and mise.toml). A rebase will be needed before merge; the conflicts should be additive/trivial since the _gates content is entirely new.

Recommended for merge after rebase (no blocking findings).

// (a) the target must not be a terminal;
// (b) the target phase must EXIST ON DISK (same partial-rollout-tolerant
// resolution as the _advances_to dangling-edge check);
// (c) when the target's frontmatter is present, it must be a backbone phase

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[🤖 AI review 🤖]

Optional: The comment on lines 63-65 describes check (c): "when the target's frontmatter is present, it must be a backbone phase (gating one sidebar on another expresses nothing the trigger doesn't)." — but this check isn't actually implemented in the code below. The code only checks (a) terminal and (b) exists-on-disk.

This is fine to leave as a documented future intent (the partial-rollout tolerance means you'd need to look up whether the target has frontmatter and what its role is, which adds complexity for a scenario that may never arise). But if the comment is meant to be a guarantee rather than a TODO, the implementation is missing. Consider either implementing it or rewriting the comment as a // TODO: or // NOTE: not yet enforced to make the gap explicit.

…ter coverage

Declare `_gates` as a validator-enforced sidebar frontmatter key (hold a
backbone phase while unresolved). Cover heroku/agent-advisor/gcp in
lint:frontmatter. Enforce check (c): when the gate target declares
frontmatter it must be backbone. Carry `_gates: generate` on heroku's
workshop (vercel-to-aws was removed on main in awslabs#179).

Co-authored-by: Cursor <cursoragent@cursor.com>
@herosjourney

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and addressed the review note.

Merge conflicts (from #179 unshipping vercel-to-aws):

  • Dropped the three vercel vendored/workshop edits (plugin no longer in tree)
  • Removed the vercel lint:frontmatter invocation from mise.toml; kept gcp
  • Moved the live _gates: generate annotation onto heroku's workshop frontmatter (the only remaining workshop with phase frontmatter)

Review comment (check c): Implemented — when the _gates target exists on disk and declares frontmatter, it must be a backbone phase (reject sidebar→sidebar). Added a unit test. Suite now 62/62.

lint:frontmatter green on heroku / agent-advisor / gcp; shared:check green.

@herosjourney
herosjourney force-pushed the feat/gates-key-frontmatter-coverage branch from f00679d to 8e4f2ce Compare August 13, 2026 14:06
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.

2 participants