Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish specifications to GitHub Pages
# Builds every Building Block in publish/building-blocks.yml with this renderer and
# deploys them as one site: <pages root>/bb/<id>/, with a landing page at the root.
# Every build runs the renderer's built-output and HTTP checks; one failure stops
# the deploy, so the published site keeps its previous version.
# Deploying is opt-in: set the repository variable PUBLISH_PAGES to true. Without it,
# pushes, pull requests, and manual runs still build and check, and the daily run is skipped.
# It is not triggered by the Building Block repositories: a change there reaches the site at the
# next daily run, or sooner by running this workflow by hand (Actions → Run workflow).
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: '17 4 * * *'
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
if: github.event_name != 'schedule' || vars.PUBLISH_PAGES == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: '24'
- name: Install the renderer
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Test the renderer
run: npm test
- name: Build and check every Building Block
env:
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
#!/usr/bin/env bash
set -euo pipefail
# A <owner>.github.io repository is served at the domain root; any other at /<repository>/.
shopt -s nocasematch
if [[ "$REPOSITORY_NAME" == "$REPOSITORY_OWNER.github.io" ]]; then base=/; else base="/$REPOSITORY_NAME/"; fi
node scripts/publish.mjs --output "$RUNNER_TEMP/site" --checkouts "$RUNNER_TEMP/sources" --base "$base" --unofficial
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && vars.PUBLISH_PAGES == 'true'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ${{ runner.temp }}/site
deploy:
if: github.ref == 'refs/heads/main' && vars.PUBLISH_PAGES == 'true'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
.astro/
.generated/
dist/
mise.local.toml
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Changelog

All notable changes to the GovStack specification renderer are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## Unreleased

## 0.2.0 - 2026-11-24

This release renders the Specification Framework changes proposed for the Architecture Working Group meeting of 25 November 2026: conformance profiles (ARCH-ADR-7), options and conditional requirements (ARCH-ADR-6) and the removal of the `observability` classifier (ARCH-ADR-8). The Wallet Building Block 2.0 draft is the first specification to use all three. Specifications that still use `requirements/` render as before, with warnings, so that Building Blocks can migrate one at a time.

### Added

- **Conformance profiles (ARCH-ADR-7).**
- `toc.yml` accepts a `conformance-profiles` section with one subsection per profile folder. The subsection's pages resolve relative to `conformance-profiles/<id>/`, and its `introduction.md` comes first.
- Each profile's introduction is served at `/conformance-profiles/<id>/`, since the folder name is the profile id. A summary from its front matter (`type`, `description`, `requires`, `role`, `reference_architecture`) sits above it, along with the profiles it builds on and its number of functionalities.
- Every functionality page names the conformance profile whose folder holds it, and its capabilities by title from `metadata.yml`.
- The home page lists the profiles in a table: profile, id, type, what it builds on, description.
- The sidebar groups each profile, with a Core or Extension badge.
- The build manifest records each profile's id, type, title, `requires`, route and functionalities.
- Generation fails when:
- there is not exactly one `CORE` profile;
- a `type` is neither `CORE` nor `EXTENSION`;
- the core requires an extension;
- `requires` names something that is not an extension profile, or forms a cycle;
- a profile folder is not kebab-case, is listed twice, or does not list `introduction.md` first.
- Warnings report:
- functionalities that a profile's introduction does not link to, or that it links to in another profile;
- pages outside a profile's `functionalities/` folder;
- a remaining `requirements` section;
- ignored `conformance` and `extension` fields, and an ignored `extensions` block in `metadata.yml`.
- **Options and conditional requirements (ARCH-ADR-6).**
- Options listed under a variation point's `options` render as cards nested beneath it, each with its own id (such as `30.1`), level `OPTION`, key, badges, verification and test.
- A variation point shows its selection ("Meet at least *min* of its *n* options", plus *max* when set).
- An option met by claiming an extension links to that profile.
- `presented_by`, `applies_when` and `applies_when_all` (on a requirement, or on a functionality as a whole) show their keys, each linked to the key's view.
- A generated *Options and conditions* page is the "views by key" of ARCH-ADR-6. For every option key and every extension profile named in a condition, it lists the requirements that apply when it holds, grouped by functionality, with the option and its variation point at the top. It is in the sidebar under *Conformance profiles*.
- Options count towards the requirement total that the served checks compare.
- Warnings report:
- variation points with fewer than two options, an invalid `select`, or an `interaction`, `test` or `api_operation_id`;
- options without level `OPTION`, or with nested `select` or `options`;
- option ids not numbered `n.m` after their variation point;
- core variation points that cannot meet `min` without an extension;
- duplicate keys;
- conditions naming an unknown key or profile;
- options met by an unknown extension or declaring their own interaction, operation, or test while met by an extension;
- `option_of`.
- **Verification method (ARCH-ADR-8).** A requirement with an `interaction` identifies the boundary to test or the evidence to audit for `INTERNAL`. Variation points count the options that pass. Options met by claiming an extension use the extension's tests. Other requirements without a verification method appear as unclassified.
- `toc.yml` entries ending in `/` publish that folder's files, relative to their section, with a download index and a sidebar link. A listed folder that does not exist fails the build.
- `terminology.yml` renders as a page with one heading per term. It shows the definition, abbreviation, notes, source, origin and related terms, and accepts both the `terms` (`term`/`definition`) and the `entry` (`designation`/`description`) forms. `references.yml` supports both flat and grouped citations. Other YAML pages display their source.
- Decision records: a Markdown page under `ADR/` that a published page links to is published under *Resources*, with a warning, and its links to other decision records are followed. Unlinked records are not published.
- Publishing several Building Blocks:
- [`publish/building-blocks.yml`](publish/building-blocks.yml) lists the Building Blocks to publish: Wallet (`feat/v2.0`) and Document Management (`v0.6`).
- [`scripts/publish.mjs`](scripts/publish.mjs) (`npm run publish`) builds and checks the full site in staging, then moves it into a new or empty output directory. The landing page shows the fetched revision or the local checkout and any uncommitted changes.
- [`.github/workflows/pages.yml`](.github/workflows/pages.yml) runs the tests and builds every configured Building Block on pull requests, pushes to `main`, and manual runs. Setting `PUBLISH_PAGES` to `true` enables deployment from `main` and daily builds.
- Tests: [`tests/conformance-profiles.test.mjs`](tests/conformance-profiles.test.mjs) covers profiles, options, conditions, verification, folder entries, YAML pages, root paths and decision records with an abstract Building Block. [`tests/publish.test.mjs`](tests/publish.test.mjs) covers the publish list and landing page.
- README sections on conformance profiles, options and verification, and on publishing several Building Blocks.
- [`RELEASE_NOTES.md`](RELEASE_NOTES.md), with the steps for releasing a version of the renderer and the actions each kind of user takes when moving to it.

### Changed

- Version 0.2.0, up from 0.1.0.
- A local link or image path starting with `/` resolves against the specification's root and is published under the build base. For example, `/assets/cover.svg` built with `--base /bb/wallet/` becomes `/bb/wallet/assets/cover.svg`. A path that escapes the root fails. Previously such paths were left unchanged and their targets were not published.
- The renderer displays legacy `observability` when no requirement in the specification declares `interaction`. Once a requirement declares `interaction`, the renderer reports any legacy `observability` with a warning.
- Conditions are labelled *Applies when*, *Applies when any of* and *Applies when all of*, instead of *Any of* and *All of*.
- The requirements introduction counts options, and mentions "Unnumbered draft" only when a requirement has no id. It no longer calls every requirement an authoring draft.
- Sidebar section labels replace hyphens with spaces, so the section reads *Conformance profiles*, not *Conformance-profiles*.
- The adapter's source model (toc parsing, profiles, conditions, verification and YAML pages) moved into [`adapters/framework-model.mjs`](adapters/framework-model.mjs).

### Fixed

- Former routes defined in `.gitbook.yaml` can continue to serve moved pages, including their links to anchors.
- Linked decision records use `resources/adr/` so both the canonical page and the source-shaped alias build on case-insensitive filesystems.
- Functionality pages with empty requirements retain their profile and capabilities.
- `toc.yml` with subsections under any section, and an empty section such as `resources:` with no entries, no longer crash generation.
- Folder entries such as `api/` and `tests/` no longer fail with `EISDIR`, so `bb-template` builds again.
- `terminology.yml` and `references.yml` are no longer published as raw YAML under a Markdown page. They no longer get an HTML redirect written in place of the YAML file.
- An empty `documentation:` field no longer renders the text "null".
- A functionality description written as a YAML block scalar no longer ends with a stray line break.
- A `contract` or `test` given as a URN, such as `govstack:spec:bb:information-mediator`, is shown as written instead of becoming a broken local link. A web URL links as written. This fixes the Document Management build.

## 0.1.0

First version: the shared Astro/Starlight renderer with the `api-guide` and `framework` profiles, native Scalar OpenAPI references, built-output and HTTP checks, and the composite build action.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ Every profile requires an explicit source, either `--source` or the
`DOCS_SOURCE_ROOT` environment variable. There is no default, so a build cannot
silently pick up a different or dirty checkout.

## Conformance profiles, options and verification

Framework sources can use the layout of the Specification Framework's ARCH-ADR-7, ARCH-ADR-6 and ARCH-ADR-8. Sources that still use `requirements/` render as before, with warnings, so Building Blocks can migrate one at a time.

- **Conformance profiles (ARCH-ADR-7).** `toc.yml` lists `conformance-profiles` as one subsection per profile folder, with `introduction.md` first. The pages of a subsection resolve relative to that folder. Each introduction is served at the folder's route (`/conformance-profiles/<id>/`), because the folder name is the profile id. Its front matter (`type`, `description`, `requires`, `role`, `reference_architecture`) becomes a summary above the page. Functionality pages name their profile, the home page lists the profiles, and the sidebar groups each profile with a Core or Extension badge. Generation fails unless there is exactly one `CORE`, `requires` names only extension profiles without cycles, and the core requires nothing. A functionality missing from its introduction's links, `conformance` and `extension` fields, and `metadata.yml` `extensions` produce warnings and are ignored.
- **Options and conditions (ARCH-ADR-6).** Options listed under a variation point's `options` render as cards nested beneath it, with `select`, `key`, `extension` (linked to the profile that meets the option), `presented_by`, `applies_when` and `applies_when_all`. A generated *Options and conditions* page lists, for every option key and every extension profile used in a condition, the requirements that apply when it holds. Conditions link to it. Options count towards the requirement total. Structural rules (at least two options, `select.min`, `n.m` ids, no `interaction` on a variation point, the core meeting `min` without extensions) are reported as warnings.
- **Verification (ARCH-ADR-8).** A card identifies the boundary to test or the evidence to audit for `INTERNAL`. When any requirement declares `interaction`, requirements without it appear as unclassified, except variation points and options verified through an extension. The renderer warns about `observability` in that mode. It displays `observability` for specifications where no requirement declares `interaction`, such as the cross-functional requirements.

A local link or image path that starts with `/` resolves against the specification's root, and is published under the build's `--base`. With `--base /bb/wallet/`, `/assets/cover.svg` becomes `/bb/wallet/assets/cover.svg`, so a specification only ever refers to its own assets. A path that escapes the root fails.

A published page can link to an unlisted Markdown decision record under `ADR/`. The renderer adds the record to Resources at `resources/adr/` and follows its links to other decision records. Unlinked records stay outside the publication. Other Markdown pages must appear in `toc.yml`.

`toc.yml` entries ending in `/` publish that folder's files with a download index, relative to their section. The build fails if the folder is missing. `terminology.yml` (`terms` with `term`/`definition`, or `entry` with `designation`/`description`) renders with one heading per term. `references.yml` supports both lists of citations and citations grouped by subject. Other YAML pages display their source.

The root `.gitbook.yaml` can map former URLs to published pages, anchors, and
support files. A page mapping from a directory-style URL emits a directory and an
`.html` alias. The mapping sets its explicit query values and fragment, with the
incoming URL supplying other query values and a fallback fragment.

## OpenAPI references

Framework sources can opt into Scalar references with `api-references.yml`:
Expand Down Expand Up @@ -76,10 +95,43 @@ works as follows:
npm run check -- --profile api-guide --source /absolute/path/to/api-design-guide --base /api-guide/ --output /absolute/path/to/scratch-output
```

All previews bind to loopback. No deployment or publication command is included.
All previews bind to loopback. `npm run publish` builds several specifications into one site; see [Publishing several Building Blocks](#publishing-several-building-blocks).
`dev` generates source content once; regenerate after editing the authoritative
input. Use a static build plus `preview` to verify the Pagefind search index.

## Publishing several Building Blocks

[`publish/building-blocks.yml`](publish/building-blocks.yml) lists the Building Blocks to publish, each with an `id`, `title`, `repository` (`owner/name` on GitHub), `ref` (branch, tag or commit) and an optional `description`. `npm run publish` builds them into one static site:

```text
<output>/index.html landing page listing the Building Blocks and the commit each was built from
<output>/bb/<id>/ one specification site per Building Block, built with the base <base>bb/<id>/
```

Use a new or empty output directory. The publisher builds and checks every
Building Block in a staging directory and moves the complete site into the
output directory after all checks pass. Root paths in a specification resolve
under its own `bb/<id>/` folder. The landing page identifies local checkouts and
marks any uncommitted changes when you build with `--sources`.

```sh
# Fetch each source at its ref, as CI does
npm run publish -- --output /absolute/path/to/site --base / --unofficial
# Or build from local checkouts named after each repository, such as ../bb-wallet
npm run publish -- --sources .. --output /absolute/path/to/site --base /
python3 -m http.server 4336 --directory /absolute/path/to/site
```

[`.github/workflows/pages.yml`](.github/workflows/pages.yml) tests and builds
the combined site on pull requests, pushes to `main`, and manual runs. To enable
deployments from `main` and the daily run at 04:17 UTC, set the repository
variable `PUBLISH_PAGES` to `true` and select **GitHub Actions** in **Settings →
Pages → Source**. The unofficial site is at
`https://<owner>.github.io/<repository>/bb/<id>/`. The base is `/<repository>/`,
or `/` for a `<owner>.github.io` repository. To publish a Building Block change
before the next daily run, start the workflow on `main` from the Actions tab.
Every repository in the publication list must be public.

## Unofficial deployments

Pass `--unofficial` (or set `DOCS_UNOFFICIAL=1`) when a build is published
Expand Down
Loading