Acceptance Criteria
- Normalizing
refrakt.config.json tags each site with its key as name, for named sites and for a flat single-site config; an authored name that differs from the key is reported buildPageContentVariables() sets $site.name from the site config, so every adapter's pages get it with no adapter change; with no site config there is no $site- The content-variables docs describe
$site - The intro data has one partition per site, keyed by site name; on
staging, a rune resolved from site/staged-runes/ is staged, with that file as its source - On the
staging site, a staged rune's intro shows a Staged badge in place of Composition, and its Source drawer shows site/staged-runes/<rune>.md - On the
main site, the same page is unchanged - The SPEC-181 D3 test that
staging matches main apart from runes still passes
References
- SPEC-187: D7.
- SPEC-181: D1, D3.
Resolution
Completed: 2026-11-04
Branch: claude/composition-usage-rune-pages-c87ar6 PR: refrakt-md/refrakt#772
What was done
packages/transform/src/config-normalize.ts: each site is tagged with its key as name (named sites, singular and flat shapes alike); an authored name that differs from the key throws. NamedSiteConfig (exported from @refrakt-md/transform/node) types it, so the authored SiteConfig and the published schema are unchanged.packages/content/src/site.ts: buildPageContentVariables sets $site.name from the site config — the one place page variables are built, which every adapter reaches with resolveSite().site. No adapter changed. Tests: config-normalize.test.ts, site-variable.test.ts.scripts/rune-intro.mjs / generate-rune-attributes.mjs: rune-intro.json has one partition per site whose contentDir is main's (main, staging); staging's records are main's, with a rune the site resolves from its project rune dir marked staged, its source / sourceUrl the staged file. compositionBadge carries "composed and not staged".site/content/_partials/rune-intro.md: root=$site.name; Staged (caution) in place of Composition.- Docs:
$site on docs/authoring/variables.md; partials README; SPEC-187 D7 amended.
Notes
- Per-site data rather than a value computed at build time: the record already decides everything the partial shows, and the staged state is a property of how a site resolves its runes, which the generator reads per site from
reference dump --site. - Built both sites:
steps on staging shows Staged and its drawer the staged definition; on main it is unchanged (native source, no badge); hero shows Composition on both. - A load with no site config has no
$site; data then reports "references $site.name, which is not defined here" rather than falling back.