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
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
repository: CompositeCode/substratalapps-applications-specs
path: _specs
- uses: actions/setup-node@v7
with:
node-version: 22
- name: Build the help center
working-directory: _specs
run: npm ci && npm run build
# The published help center: the specs repository is private, so this
# public repository's token can't check it out and build it.
- name: Check every screen page and Help menu link
run: ruby scripts/help-check.rb _specs/_site/help
run: ruby scripts/help-check.rb https://specs.substratalapps.com/help/
6 changes: 3 additions & 3 deletions .github/workflows/docs-dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Tells the shared Hub help center (CompositeCode/substratalapps-applications-specs)
# Tells the shared Hub help center (CompositeCode/substratal-hub-interface-specs)
# that this app changed, so it rebuilds and republishes straight away instead of
# waiting for its daily build. That help center is this app's documentation:
# every Help menu item and screen page the app opens lives there (HelpLinks.swift).
#
# Needs the secret SPECS_DOCS_TOKEN: a fine-grained token with Contents: read
# and write on substratalapps-applications-specs (see that repo's help/README.md
# and write on substratal-hub-interface-specs (see that repo's help/README.md
# → Automation). Without it, this job skips with a notice and the help center
# still picks changes up on its daily schedule.
name: Docs dispatch
Expand All @@ -31,7 +31,7 @@ jobs:
echo "::notice::SPECS_DOCS_TOKEN isn't set; the help center will rebuild on its daily schedule."
exit 0
fi
gh api repos/CompositeCode/substratalapps-applications-specs/dispatches \
gh api repos/CompositeCode/substratal-hub-interface-specs/dispatches \
-f event_type=app-docs-updated \
-F 'client_payload[app]=macos' \
-F "client_payload[sha]=$GITHUB_SHA"
11 changes: 3 additions & 8 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Keeps the app in step with its two upstreams:
# - the Platform API's openapi.yaml (CompositeCode/substratalapps.com, main = production)
# - the macOS screen inventory (CompositeCode/substratalapps-applications-specs)
# - the macOS screen inventory (the Hub specs, published at https://specs.substratalapps.com/spec/)
#
# When either changed, it opens (or updates) one pull request with the new
# vendored spec and screen catalog. CI then has to build the app's generated
Expand Down Expand Up @@ -38,16 +38,11 @@ jobs:
# so the sync PR is checked like any other.
token: ${{ secrets.SYNC_TOKEN || github.token }}

- uses: actions/checkout@v7
with:
repository: CompositeCode/substratalapps-applications-specs
path: _specs

- name: Pull the API spec and the screen catalog
id: sync
run: |
api=$(scripts/sync-openapi.sh)
ruby scripts/import-screens.rb _specs
ruby scripts/import-screens.rb https://specs.substratalapps.com/spec/
echo "api=$api" >> "$GITHUB_OUTPUT"
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
Expand All @@ -73,7 +68,7 @@ jobs:
Automated sync from upstream.

- Platform API \`openapi.yaml\`: **${API}** (from \`CompositeCode/substratalapps.com@main\`)
- Screen catalog: re-imported from \`CompositeCode/substratalapps-applications-specs\`
- Screen catalog: re-imported from \`https://specs.substratalapps.com/spec/macos/SCREENS.md\`

CI rebuilds the generated client against the new spec and checks the app's Help links. Before merging:
- Breaking changes ship as a new \`Substratal-Version\`. If \`components.parameters.ApiVersion\` gained a value, moving to it is a deliberate code change (\`APIVersion.current\`), not part of this PR.
Expand Down
2 changes: 1 addition & 1 deletion App/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>SubstratalHelpBaseURL</key>
<string>https://compositecode.github.io/substratalapps-applications-specs/help/</string>
<string>https://specs.substratalapps.com/help/</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion App/Screens/ScreenPlaceholder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct ScreenPlaceholder: View {
}

private var specURL: URL {
URL(string: "https://compositecode.github.io/substratalapps-applications-specs/spec/macos/SCREENS.html")!
URL(string: "https://specs.substratalapps.com/spec/macos/SCREENS.html")!
}

@ViewBuilder
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ ui-test: project ## UI smoke tests (needs Accessibility permission for Xcode)
sync-api: ## Vendor the latest openapi.yaml from the API repo's main
scripts/sync-openapi.sh

sync-screens: ## Re-import the screen catalog from ../substratalapps-applications-specs
sync-screens: ## Re-import the screen catalog from https://specs.substratalapps.com/spec/
ruby scripts/import-screens.rb

SPECS ?= ../substratalapps-applications-specs

help-check: ## Check the app's Help links against a fresh build of the Hub help center in SPECS
cd $(SPECS) && npm ci --silent && npm run build
ruby scripts/help-check.rb $(SPECS)/_site/help
help-check: ## Check the app's Help links against https://specs.substratalapps.com/help/
ruby scripts/help-check.rb

check: test build help-check ## Everything CI runs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import Foundation

/// Links into the Substratal Hub help center, the one documentation reference
/// every Hub app shares. It's built from the specs repository
/// (`CompositeCode/substratalapps-applications-specs`, `help/` and
/// `site/help.mjs`) and published at `…/substratalapps-applications-specs/help/`.
/// (`CompositeCode/substratal-hub-interface-specs`, `help/` and
/// `site/help.mjs`) and published at `https://specs.substratalapps.com/help/`.
/// Every screen has a page at `screens/<id>.html`, generated from the same
/// spec this app's screen catalog is imported from. CI checks that every link
/// here exists in a fresh build of that site (`scripts/help-check.rb`).
public struct HelpLinks: Sendable {
public static let defaultBase = URL(string: "https://compositecode.github.io/substratalapps-applications-specs/help/")!
public static let defaultBase = URL(string: "https://specs.substratalapps.com/help/")!

public let base: URL

Expand Down
22 changes: 11 additions & 11 deletions Packages/SubstratalKit/Sources/SubstratalKit/Resources/screens.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_generated": "by scripts/import-screens.rb from substratalapps-applications-specs/macos/SCREENS.md; edit the spec, then re-run",
"spec": "Substratal Apps Platform API v1.8.0 (openapi 1.0.0-draft.9; send `Substratal-Version: 1` on every request, no `/v1` in paths) — https://compositecode.github.io/substratalapps.com/",
"_generated": "by scripts/import-screens.rb from the Hub specs' macos/SCREENS.md (https://specs.substratalapps.com/spec/); edit the spec, then re-run",
"spec": "Substratal Apps Platform API, `openapi.yaml` 1.0.0-draft.33 (API docs v1.9.2; send `Substratal-Version: 1` on every request, no `/v1` in paths) — https://compositecode.github.io/substratalapps.com/",
"screens": [
{
"id": "AUTH-01",
Expand All @@ -20,7 +20,7 @@
"archetype": "auth",
"phase": "MVP",
"audience": "Holder of mfa_token",
"purpose": "Complete sign-in with a TOTP code or a recovery code."
"purpose": "Complete sign-in with a passkey, a TOTP code or a recovery code."
},
{
"id": "AUTH-03",
Expand Down Expand Up @@ -128,7 +128,7 @@
"archetype": "wizard",
"phase": "MVP",
"audience": "Self",
"purpose": "Enroll an authenticator app (TOTP) and save recovery codes."
"purpose": "Turn on two-step verification with a passkey (recommended) or an authenticator app (TOTP), and save recovery codes."
},
{
"id": "ACC-06",
Expand Down Expand Up @@ -467,7 +467,7 @@
"route": "/admin/roles",
"archetype": "list",
"phase": "MVP",
"audience": "users.list (read), roles.manage (write)",
"audience": "users.list (read), roles.manage (write); an Application's owner reads and edits that Application's roles without a platform permission",
"purpose": "Platform and app roles.",
"sidebar": {
"section": "administration",
Expand All @@ -485,7 +485,7 @@
"route": "/admin/roles/:roleId",
"archetype": "detail",
"phase": "MVP",
"audience": "users.list (read), roles.manage (write)",
"audience": "users.list (read), roles.manage (write); an Application's owner, for that Application's roles",
"purpose": "View or edit a role's permissions."
},
{
Expand Down Expand Up @@ -516,7 +516,7 @@
"archetype": "list",
"phase": "MVP",
"audience": "Any (catalog), owner/applications.manage (manage)",
"purpose": "Applications you own or administer.",
"purpose": "Applications you own or administer, and (staff) the review queue.",
"sidebar": {
"section": "developer",
"label": "Applications",
Expand All @@ -543,8 +543,8 @@
"route": "/dev/apps/:appId",
"archetype": "detail",
"phase": "MVP",
"audience": "Owner (configure), applications.manage (anything)",
"purpose": "Configure an application."
"audience": "Owner (configure), applications.manage (anything, including retire and delete)",
"purpose": "Configure an application, and (staff) review, retire or delete it."
},
{
"id": "APL-04",
Expand Down Expand Up @@ -642,7 +642,7 @@
"archetype": "list",
"phase": "Phase 2",
"audience": "webhooks.manage or app owner",
"purpose": "Endpoints that receive access-change events.",
"purpose": "Endpoints that receive access-change events, and failed deliveries across all of them.",
"sidebar": {
"section": "developer",
"label": "Webhooks",
Expand Down Expand Up @@ -718,7 +718,7 @@
"archetype": "handoff",
"phase": "Phase 2",
"audience": "Self (individual); org_admin (org checkout); org_admin or billing.manage (org portal)",
"purpose": "Hand off to Stripe in the browser and confirm the result on return."
"purpose": "Hand off to the payment page or billing portal in the browser and confirm the result on return."
},
{
"id": "BIL-04",
Expand Down
2 changes: 1 addition & 1 deletion Packages/SubstratalKit/Sources/SubstratalKit/Theme.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SubstratalTheme.swift — generated from shared/themes/themes.json. Lives in SubstratalKit (shared by iOS and macOS).
// SubstratalTheme.swift — generated from 00-shared/themes/themes.json. Lives in SubstratalKit (shared by iOS and macOS).
// Five light and five dark themes. Defaults: Moss Paper (light) and Forest Floor (dark).
import SwiftUI
import Observation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct NavigationTests {
@Test("Help links point into the shared Hub help center")
func helpLinks() {
let help = HelpLinks()
let root = "https://compositecode.github.io/substratalapps-applications-specs/help/"
let root = "https://specs.substratalapps.com/help/"
#expect(help.screen("USR-01").absoluteString == root + "screens/usr-01.html")
#expect(help.apiExplorer.absoluteString == root + "api/v1/index.html")
#expect(help.shortcuts.absoluteString == root + "guides/macos.html#keyboard-shortcuts")
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

The native macOS client for the [Substratal Apps Platform API](https://compositecode.github.io/substratalapps.com/): the Hub that staff and app developers use to run the platform (users, access, roles, Applications, API keys, webhooks, tenants and the audit log), plus every person's own apps, inbox, account and plan.

- **UI spec:** [substratalapps-applications-specs → macOS](https://compositecode.github.io/substratalapps-applications-specs/) (75 screens, the source of truth for screens, copy and behavior)
- **Help:** the shared [Substratal Hub help center](https://compositecode.github.io/substratalapps-applications-specs/help/), the one documentation reference for every Hub app. Its source is `help/` in the [specs repo](https://github.com/CompositeCode/substratalapps-applications-specs); the macOS pages are [Using the Hub on macOS](https://compositecode.github.io/substratalapps-applications-specs/help/guides/macos.html) and [Troubleshooting](https://compositecode.github.io/substratalapps-applications-specs/help/guides/troubleshooting.html).
- **UI spec:** [Hub interface specifications → macOS](https://specs.substratalapps.com/platforms/macos.html) (75 screens, the source of truth for screens, copy and behavior)
- **Help:** the shared [Substratal Hub help center](https://specs.substratalapps.com/help/), the one documentation reference for every Hub app. Its source is `help/` in the [specs repo](https://github.com/CompositeCode/substratal-hub-interface-specs); the macOS pages are [Using the Hub on macOS](https://specs.substratalapps.com/help/guides/macos.html) and [Troubleshooting](https://specs.substratalapps.com/help/guides/troubleshooting.html).
- **Plans:** [docs/PLAN-management-app.md](docs/PLAN-management-app.md) · [docs/PLAN-api-gaps.md](docs/PLAN-api-gaps.md) · [docs/PREREQUISITES.md](docs/PREREQUISITES.md)

## Status
Expand Down Expand Up @@ -31,7 +31,7 @@ GET https://api.substratalapps.com/users/me ← no /v1
Substratal-Version: 1
```

`/v1/…` paths return `404`. The version is the compile-time constant `APIVersion.current` in `SubstratalKit`, and `VersionMiddleware` adds the header to every request, so no call can forget it. Moving to a new API version is a code change, never configuration. See [API versioning](https://compositecode.github.io/substratalapps-applications-specs/help/developers/api-versioning.html) in the help center.
`/v1/…` paths return `404`. The version is the compile-time constant `APIVersion.current` in `SubstratalKit`, and `VersionMiddleware` adds the header to every request, so no call can forget it. Moving to a new API version is a code change, never configuration. See [API versioning](https://specs.substratalapps.com/help/developers/api-versioning.html) in the help center.

## Layout

Expand Down Expand Up @@ -64,7 +64,7 @@ make build # or open SubstratalHub.xcodeproj and run the SubstratalHub sch
scripts/run-local.sh # build and launch against the production API (or pass http://localhost:8080)
make run # build and launch against production
make test # SubstratalKit unit tests
make help-check # check the app's Help links against ../substratalapps-applications-specs
make help-check # check the app's Help links against https://specs.substratalapps.com/help/
make check # everything CI runs
```

Expand Down Expand Up @@ -110,7 +110,7 @@ The screen catalog drives the sidebar, menus, routes and deep links. The help ce

The app's documentation is the shared Hub help center, in the specs repo, not here:

- **Writing docs:** edit `help/` in [substratalapps-applications-specs](https://github.com/CompositeCode/substratalapps-applications-specs) (guides, tutorials, developer pages, FAQ, optional per-screen notes). See its `help/README.md`. Per-screen pages, the versioned API reference and What's new are generated there on every build.
- **Writing docs:** edit `help/` in [substratal-hub-interface-specs](https://github.com/CompositeCode/substratal-hub-interface-specs) (guides, tutorials, developer pages, FAQ, optional per-screen notes). See its `help/README.md`. Per-screen pages, the versioned API reference and What's new are generated there on every build.
- **When this app changes:** `docs-dispatch.yml` sends `app-docs-updated` to the specs repo on every merge to `main`, which rebuilds and republishes the help center. It needs the `SPECS_DOCS_TOKEN` secret; without it, the help center rebuilds daily.
- **When the API changes:** the help center rebuilds its API reference from the live `openapi.yaml` daily and on `api-contract-updated`. This repo's `upstream-sync.yml` opens a PR that updates the app's generated client.
- **Links can't break:** CI builds the help center and runs `scripts/help-check.rb`, so a screen without a help page, or a Help menu item pointing nowhere, fails the build.
Expand Down
4 changes: 2 additions & 2 deletions docs/PREREQUISITES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Verified on production on 2026-10-23:
| `GET /permissions` without the header | `400 api_version_required`, `details.supported: ["1"]` |
| `GET /permissions` with `Substratal-Version: 1`, no token | `401 unauthenticated`, and the response echoes `substratal-version: 1` |

In this app: the base URL is the host root (`APIEnvironment.baseURL`). `APIVersion.current` is a compile-time constant, and `VersionMiddleware` stamps the header on every request, including the exempt ones, which is harmless. It also records `Deprecation`/`Sunset` and `400 unsupported_api_version` in `APIVersionMonitor`, which drives the GLB-03 banners. Unit tests cover each of these. The Hub help center documents the scheme for integrators ([API versioning](https://compositecode.github.io/substratalapps-applications-specs/help/developers/api-versioning.html)).
In this app: the base URL is the host root (`APIEnvironment.baseURL`). `APIVersion.current` is a compile-time constant, and `VersionMiddleware` stamps the header on every request, including the exempt ones, which is harmless. It also records `Deprecation`/`Sunset` and `400 unsupported_api_version` in `APIVersionMonitor`, which drives the GLB-03 banners. Unit tests cover each of these. The Hub help center documents the scheme for integrators ([API versioning](https://specs.substratalapps.com/help/developers/api-versioning.html)).

## Development machine

Expand Down Expand Up @@ -56,7 +56,7 @@ In this app: the base URL is the host root (`APIEnvironment.baseURL`). `APIVersi
|---|---|---|
| This repo's GitHub remote | ✅ | [`CompositeCode/substratalapps-macos`](https://github.com/CompositeCode/substratalapps-macos), **private**, created 2026-10-23; `main` pushed. |
| GitHub Actions | ❌ **billing** | The first runs (2026-10-23) weren't started: "recent account payments have failed or your spending limit needs to be increased". Fix under the CompositeCode org's **Settings → Billing & plans**. Until then CI doesn't run; run `make check` locally. macOS runners use the most minutes, so set a spending limit that covers them. |
| Help center | ✅ | Not hosted here. The app's documentation lives in the shared **Hub help center** in the public specs repo, published at `https://compositecode.github.io/substratalapps-applications-specs/help/`. The macOS guide and troubleshooting pages were moved there in [specs PR #2](https://github.com/CompositeCode/substratalapps-applications-specs/pull/2). This repo's Pages, which the plan doesn't support for a private repo, isn't needed. |
| Help center | ✅ | Not hosted here. The app's documentation lives in the shared **Hub help center** in the specs repo (private), published at `https://specs.substratalapps.com/help/`. The macOS guide and troubleshooting pages were moved there in [specs PR #2](https://github.com/CompositeCode/substratal-hub-interface-specs/pull/2). This repo's Pages, which the plan doesn't support for a private repo, isn't needed. |
| `SPECS_DOCS_TOKEN` secret | ❌ optional | Lets `docs-dispatch.yml` tell the help center to rebuild as soon as this app merges. Without it, the help center rebuilds daily. |
| API repo `openapi.yaml` (raw, `main`) | ✅ | `200`. `scripts/sync-openapi.sh` vendors it; a scheduled workflow keeps it current. |
| Specs repo | ✅ | Up to date (`cebf679`, targets API v1.8.0). `scripts/import-screens.rb` imports its 75 macOS screens. |
Expand Down
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ targets:
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
LSMinimumSystemVersion: $(MACOSX_DEPLOYMENT_TARGET)
# The shared Hub help center (specs repo, help/), which every Hub app links to.
SubstratalHelpBaseURL: https://compositecode.github.io/substratalapps-applications-specs/help/
SubstratalHelpBaseURL: https://specs.substratalapps.com/help/
CFBundleURLTypes:
- CFBundleURLName: com.substratalapps.hub.deeplink
CFBundleURLSchemes: [substratal]
Expand Down
Loading
Loading