Skip to content

docs: sync with branding white-label, SM022/SM023, Docker scaffold - #255

Merged
antosubash merged 2 commits into
mainfrom
worktree-docs-refresh
Aug 9, 2026
Merged

docs: sync with branding white-label, SM022/SM023, Docker scaffold#255
antosubash merged 2 commits into
mainfrom
worktree-docs-refresh

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Documentation had drifted behind several merged features. This brings it back in line and fixes accuracy problems found along the way.

What was stale

docs/modules/branding.md — the page still described the pre-#237 module (name, logo, favicon, colour). Rewritten to cover the dark-background logo variant, design pack, announcement banner, configurable footer (limits + the http(s)-or-app-path href allow-list), presets, the anonymous asset routes and their versioned cache policy, the asset lifecycle, and the upload guard-rails.

It also advertised image/svg+xml as an allowed upload type, which is wrong and security-relevant — SVG is excluded on purpose, being XML that can carry <script> and would be served back from the app's own origin.

docs/reference/diagnostic-codes.md — SM022/SM023 (shipped in #238) were the only framework codes with no rows.

docs/reference/deployment.md — the Build section told operators to hand-roll a Dockerfile that every scaffold has shipped since #252. Worse, the example used a Node-only frontend stage, which cannot work: the Vite build imports modules.generated.{ts,css}, which gen-pages emits from the installed Python modules. Replaced with the shipped assets and why the single builder stage is load-bearing.

alembic upgrade headheads across guide and reference. Every real command — Makefile, smpy new, the container CMD — uses the plural; the singular errors once a second module ships a branch label. test_cli_new_scaffold_layout already calls the singular "the buggy singular form".

docs/framework/discovery.mdi18n_audience and requires_framework added to the ModuleMeta section.

Module count eleven → twelve across index.md, modules/index.md and framework/overview.md; branding was missing from the home-page list entirely.

One non-docs file

templates/host/README.md.tpl shipped alembic upgrade head into every generated project, while that same project's Makefile and Dockerfile use heads. Plainly an oversight rather than a deliberate choice, so it's fixed here.

Also worth a look

The deployment page now carries a warning that the default SQLite compose stack pins SM_ENVIRONMENT=production and a SQLite URL — which contradicts the production checklist directly above it. It's a local/demo stack, and moving to Postgres isn't a one-env-var swap because migration histories are dialect-frozen at autogenerate time.

Verification

  • Every factual claim read out of the source rather than recalled — routes, permission codes, footer limits, cache-control values, preset list, settings fields.
  • vitepress build clean. Note ignoreDeadLinks: true is set, so the build does not validate links — the cross-page anchors were checked against the generated HTML instead.
  • 216 CLI tests pass (1 skipped) after the template edit.

Findings from a /code-review pass are fixed in 1337b83, including one real error of mine: the magic-number check description overstated what validate_image does (it matches any allowed signature, not the declared type's).

https://claude.ai/code/session_013W1MJ3T4FJEBcx1Xs9Tea2

…3, Docker scaffold)

The docs had drifted behind several merged features:

- modules/branding: rewritten. The page still described the pre-#237 module
  (name, logo, favicon, colour). Adds the dark-background logo variant,
  design pack, announcement banner, configurable footer + its limits and
  href allow-list, presets, the anonymous asset routes and their cache
  policy, and the magic-number upload check. Corrects the allowed-types
  list, which still advertised image/svg+xml — SVG is excluded on purpose
  (XML that can carry <script>, i.e. stored XSS from our own origin).

- reference/diagnostic-codes: add the missing SM022/SM023 rows. Every other
  code in the framework was documented; these two shipped with #238.

- framework/discovery: document i18n_audience and requires_framework in the
  ModuleMeta section, cross-linked to the i18n page.

- reference/deployment: the Build section told operators to hand-roll a
  Dockerfile that every scaffold has shipped since #252 — and the example
  used a Node-only frontend stage, which cannot work, since gen-pages reads
  the installed Python modules. Replaced with the shipped assets plus why
  the single builder stage is load-bearing.

- alembic upgrade head -> heads across guide/reference. Every real command
  (Makefile, smpy new, the container CMD) uses the plural; the singular
  errors once a second module ships a branch label.

- Module count eleven -> twelve; branding was missing from the home page
  list, and its index row predated the white-label work.

Verified: vitepress build clean, and the four cross-page anchors checked
against the generated HTML (ignoreDeadLinks is on, so the build itself
does not catch them).

Claude-Session: https://claude.ai/code/session_013W1MJ3T4FJEBcx1Xs9Tea2
- branding: the magic-number check was overstated. validate_image matches
  the head against *any* allowed signature, not the one the declared
  Content-Type implies, so a genuine PNG sent as image/jpeg passes and is
  stored as image/jpeg. Reworded to the property that actually holds
  (non-images are kept out) rather than type/content agreement.

- branding: the file_storage download permission is `file_storage.download`,
  not `file-storage.download`. Copied the hyphen from the stale comment at
  branding/constants.py:76; the constant is FileStoragePermissions.DOWNLOAD.

- framework/overview: module count said "ten first-party modules" — missed
  in the eleven -> twelve sweep, so two pages one click apart disagreed.

- module-authoring: one more `alembic upgrade head` -> `heads`, in the
  publish-a-module flow whose very next subsection tells the author to add
  branch_labels — i.e. exactly the case the plural exists for.

- deployment: the new "run make docker-up" Build section sat three lines
  under a checklist item requiring Postgres, while the default SQLite
  compose pins SM_ENVIRONMENT=production *and* a SQLite URL. Added a
  warning that the SQLite stack is local/demo only, and why it isn't a
  one-env-var swap (migration histories are dialect-frozen).

Also fixes the scaffold README template, which shipped `upgrade head` into
every generated project while that project's own Makefile and Dockerfile
use `heads`. test_cli_new_scaffold_layout already asserts the singular form
is gone from the Makefile, so the README was simply missed.

Verified: 216 CLI tests pass, vitepress build clean.

Claude-Session: https://claude.ai/code/session_013W1MJ3T4FJEBcx1Xs9Tea2
@antosubash
antosubash merged commit 0f744c4 into main Aug 9, 2026
12 checks passed
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.

1 participant