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
4 changes: 2 additions & 2 deletions .github/workflows/contract-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:

- name: Regenerate the screen registry from the specs
run: |
git clone --depth 1 https://github.com/CompositeCode/substratalapps-applications-specs.git "$RUNNER_TEMP/specs"
scripts/generate-screen-ids.py "$RUNNER_TEMP/specs/substratal-application-specs"
# The published spec: the specs repository is private, so it can't be cloned here.
scripts/generate-screen-ids.py https://specs.substratalapps.com/spec/

- name: Open a pull request if anything changed
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Help center rebuild

# The help center lives in CompositeCode/substratalapps-applications-specs and is shared by every Hub app.
# The help center lives in CompositeCode/substratal-hub-interface-specs (https://specs.substratalapps.com/help/) and is shared by every Hub app.
# When this app's main branch changes, ask it to rebuild so the published help reflects what shipped.
# Needs the secret SPECS_DOCS_TOKEN: a fine-grained token with Contents: read and write on the specs repo.
on:
Expand All @@ -25,7 +25,7 @@ jobs:
echo "::warning::SPECS_DOCS_TOKEN isn't set, so the help center will pick this up on its daily build instead."
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]=ios" \
-F "client_payload[repository]=$GITHUB_REPOSITORY" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Common tasks. Everything here also runs in CI (.github/workflows/ios.yml).
SIM ?= iPhone 17 Pro
SPECS ?= ../substratalapps-applications-specs/substratal-application-specs
SPECS ?= https://specs.substratalapps.com/spec/
XCODEBUILD = xcodebuild -project SubstratalHub.xcodeproj -scheme SubstratalHub -skipPackagePluginValidation

.PHONY: project build test test-kit test-ui contract screens run-demo check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
/// Links into the shared Substratal Hub help center, published with the specs site so every Hub app
/// (web, iOS, Android, macOS, Windows, Linux) points at one documentation reference.
public enum HelpCenter {
public static let base = URL(string: "https://compositecode.github.io/substratalapps-applications-specs/help/")!
public static let base = URL(string: "https://specs.substratalapps.com/help/")!

public static var home: URL { base }
public static var faq: URL { base.appending(path: "faq.html") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct ScreenPlaceholder: View {
}
Section {
Button("Open the screen spec", systemImage: "doc.text") {
openURL(URL(string: "https://compositecode.github.io/substratalapps-applications-specs/spec/00-shared/SCREEN-SPECS.html#\(screen.info.anchor)")!)
openURL(URL(string: "https://specs.substratalapps.com/spec/00-shared/SCREEN-SPECS.html#\(screen.info.anchor)")!)
}
Button("Help for this screen", systemImage: "questionmark.circle") { openURL(HelpCenter.url(for: screen)) }
}
Expand Down
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The native iOS/iPadOS client of the [Substratal Apps Platform API](https://compositecode.github.io/substratalapps.com/):
the management app for the platform (users, access, roles, applications, API keys, webhooks, audit), and in time the
full Substratal Hub for every user. It's built from the shared
[Hub specifications](https://compositecode.github.io/substratalapps-applications-specs/) and links to the shared
[help center](https://compositecode.github.io/substratalapps-applications-specs/help/).
[Hub specifications](https://specs.substratalapps.com/) and links to the shared
[help center](https://specs.substratalapps.com/help/).

- **Plan:** [docs/management-app-plan.md](docs/management-app-plan.md)
- **API gaps:** [docs/api-gaps.md](docs/api-gaps.md), which maps to the API repo's `[api-gaps]` issues
Expand Down Expand Up @@ -50,7 +50,7 @@ Substratal-Version: 1
Account → About.
- A unit test fails if the pinned header value isn't one the vendored contract declares.

See the help center's [API versioning](https://compositecode.github.io/substratalapps-applications-specs/help/developers/api-versioning.html) page.
See the help center's [API versioning](https://specs.substratalapps.com/help/developers/api-versioning.html) page.

## Layout

Expand Down
6 changes: 3 additions & 3 deletions docs/management-app-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Plan for the first client of the Substratal Apps Platform API: a native iOS/iPad
Sources reviewed on 2026-10-21:

- API spec site and repo: [compositecode.github.io/substratalapps.com](https://compositecode.github.io/substratalapps.com/), `CompositeCode/substratalapps.com` at `967e114` (2026-10-20). Covers `openapi.yaml` 3.1, 118 operations, the Go implementation, Terraform, `plan-remaining.md` and `remaining_manual_steps.md`.
- Client specs: [compositecode.github.io/substratalapps-applications-specs](https://compositecode.github.io/substratalapps-applications-specs/), `CompositeCode/substratalapps-applications-specs` at `e296d7e` (2026-10-18). Covers the shared spec, the iOS handoff, the 75-screen inventory and the themes.
- Client specs: [specs.substratalapps.com](https://specs.substratalapps.com/), `CompositeCode/substratalapps-applications-specs` at `e296d7e` (2026-10-18). Covers the shared spec, the iOS handoff, the 75-screen inventory and the themes.
- Live probes (2026-10-21, when paths still carried `/v1`): `GET /health` returned `200`, `GET /applications` without a token returned `401` with the documented error envelope, and `/.well-known/jwks.json` serves an RS256 key. `dashboard.substratalapps.com` and `auth.substratalapps.com` don't resolve in DNS.

The companion document [api-gaps.md](api-gaps.md) lists what the API is missing.

> **Update, 2026-10-23.** Superseded where this conflicts:
>
> - **API versioning moved from the URL to a header.** Every path is at the host root (`https://api.substratalapps.com/users`, not `/v1/users`), and every request sends `Substratal-Version: 1`. `/v1/…` returns `404`. Missing the header returns `400 api_version_required`. `Deprecation`/`Sunset` response headers announce retirement, and `400 unsupported_api_version` follows it. The app implements this in `APIVersionMiddleware` and the GLB-03 Update available / Update required states. See the [help center's versioning page](https://compositecode.github.io/substratalapps-applications-specs/help/developers/api-versioning.html).
> - **API versioning moved from the URL to a header.** Every path is at the host root (`https://api.substratalapps.com/users`, not `/v1/users`), and every request sends `Substratal-Version: 1`. `/v1/…` returns `404`. Missing the header returns `400 api_version_required`. `Deprecation`/`Sunset` response headers announce retirement, and `400 unsupported_api_version` follows it. The app implements this in `APIVersionMiddleware` and the GLB-03 Update available / Update required states. See the [help center's versioning page](https://specs.substratalapps.com/help/developers/api-versioning.html).
> - **The API is now `1.0.0-draft.9`, with 124 operations.** Since this plan was written it gained test-mode user expiry, self-service app registration, audit exports, SCIM, `GET /users?role_id=` and `POST /users/{id}/sessions/revoke-all`.
> - **API gaps are tracked as `[api-gaps]` issues in the API repo** (#38–#65). See [api-gaps.md](api-gaps.md) for the mapping.
> - **The Operations section (§4–§5.1–5.3, §5.9) is web-only for now.** The specs adopted the console screens (OPS-*, SEC-01, CFG-*, RPT-01, INT-01) for the web Hub only, behind its same-origin Ops gateway. iOS skips them (PRODUCT-SPEC §2a, OPEN-QUESTIONS #27), and this app follows that.
> - **Help and documentation live in the shared help center** at <https://compositecode.github.io/substratalapps-applications-specs/help/>. Every screen's **?** button opens its page there.
> - **Help and documentation live in the shared help center** at <https://specs.substratalapps.com/help/>. Every screen's **?** button opens its page there.

---

Expand Down
25 changes: 20 additions & 5 deletions scripts/generate-screen-ids.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
#!/usr/bin/env python3
"""Regenerates Packages/SubstratalKit/Sources/SubstratalCore/Routing/ScreenID.swift from the shared screen index.

scripts/generate-screen-ids.py [path/to/substratal-application-specs]
scripts/generate-screen-ids.py [SPECS]

Defaults to ../substratalapps-applications-specs/substratal-application-specs (a sibling checkout).
SPECS is the published spec (default: https://specs.substratalapps.com/spec/), a checkout of
CompositeCode/substratal-hub-interface-specs, or its package directory (specs/, or
substratal-application-specs/ before spec 2.0.0). The specs repository is private; the site needs no token.
Console (domain C) screens are skipped: they are web-only (PRODUCT-SPEC §2a, OPEN-QUESTIONS #27).
"""
import pathlib, re, sys
import pathlib, re, sys, urllib.request

root = pathlib.Path(__file__).resolve().parent.parent
specs = pathlib.Path(sys.argv[1]) if len(sys.argv) > 1 else root.parent / "substratalapps-applications-specs" / "substratal-application-specs"
index = (specs / "00-shared" / "SCREEN-SPECS.md").read_text(encoding="utf-8")
specs = sys.argv[1] if len(sys.argv) > 1 else "https://specs.substratalapps.com/spec/"


def read_spec(rel):
if re.match(r"https?://", specs):
with urllib.request.urlopen(specs.rstrip("/") + "/" + rel, timeout=30) as r:
return r.read().decode("utf-8")
base = pathlib.Path(specs)
for d in (base, base / "specs", base / "substratal-application-specs"):
if (d / "00-shared").is_dir():
return (d / rel).read_text(encoding="utf-8")
sys.exit(f"generate-screen-ids: no 00-shared/ under {specs}")


index = read_spec("00-shared/SCREEN-SPECS.md")
row = re.compile(r'^\| \[([A-Z]{3,4}-\d{2})\]\(#([^)]+)\) \| (.+?) \| (\S+) \| `([^`]+)` \| (\S+) \| (.+?) \|$')
rows = [m.groups() for m in map(row.match, (l.strip() for l in index.splitlines())) if m]
hub = [r for r in rows if r[3] != "C"]
Expand Down
Loading