Repository navigation
Commit 7b047b4
feat(cli): the console document carries the runtime branding in its title, description and Open Graph tags, written on the server, so a link preview shows the product's name (#25317)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuSQfvzuV2ZjD9aZ44eAhnVq)_
Fixes #25264
Clause-②: no
Metadata-protocol: none
Why `Clause-②: no`: no accept set and no public surface changes.
`createConsoleStaticPlugin`'s signature and options are byte-identical,
no route is added, and no schema or export moves. What changes is the
content of the console HTML document the plugin already served.
## What changed
`createConsoleStaticPlugin` (`packages/cli/src/utils/console.ts`, what
`os serve` mounts at `/_console/`) writes the console document's head
per request. Besides the base tag it already added, it now writes:
- the `title` element and `og:title` from `branding.productName`;
- `meta name="description"` and `og:description` from
`branding.pwaDescription`;
- `og:image` from `branding.logoUrl`, resolved against the request
origin, written only when that gives an `http(s)` URL;
- `og:url`, the request origin. Its scheme comes from
`x-forwarded-proto` when a proxy states `http` or `https`, the same
header REST discovery's `servers[0]` reads.
**One source.** The values are read from `GET /api/v1/runtime/config`,
the door the shell's early-branding script reads to set
`document.title`. They are read in-process, for the visitor's own
request (same host and cookies), the way the existing `/forms/:slug`
redirect asks the form door. So whatever decides the served name (a
saved Branding setting, the host option, `OS_PRODUCT_NAME`, a hosted
runtime's per-hostname answer, a distribution's subclass) decides the
tags too. Nothing is resolved a second time. The probe drops
`accept-encoding`, `if-none-match`, `if-modified-since` and `range`,
which would change the encoding or status of the answer rather than its
content.
**Values and absence.** Every value is HTML-escaped (element body and
double-quoted attributes). The shell's existing `title` element is
replaced (objectui ships it empty), or one is added. A missing or blank
value writes no tag. With no branding at all, `og:url` is not written
either and the document is byte-identical to what was served before. A
composition with no `runtime/config` door (`404`) is not a failure. Any
other failed read (a non-200 answer, a body that is not JSON, a thrown
dispatch) serves the document as before and logs one `warn`, once per
plugin instance. That is a functional degradation, so `warn`, per
AGENTS.md's log-level rule.
Also: a changeset (`@objectstack/cli` patch) and one paragraph in
`content/docs/deployment/environment-variables.mdx` saying link previews
read the same branding values. The docs file is outside the surface the
claim declared; it is declared here and in the report.
## Branch
The harness assigned the branch `claude/project-thread-c4vx2u`, not the
repo-convention `claude/issue-25264-…`. This note is for the Duplicate
Fix Guard. The card's `Claim:` names this branch.
## Lane
The card carries `domain:services`, but the fix is wholly `packages/cli`
(`domain:cli`). The fleet director ruled that cli seat 1 claims it; the
claim comment asks triage to relabel the card.
## Tests
`packages/cli/src/utils/console.branded-head.test.ts`, 17 cases, unit
tier (no spawn, no kernel). The "one source" cases mount the REAL
`RuntimeConfigPlugin` on a REAL `HonoHttpServer` beside the real plugin.
They compare the served tags with what `GET /api/v1/runtime/config`
answers to the same request, including the door's derived description.
The value-shape cases use a stub door: escaping (markup, quotes, `$&` in
a replacement string, `&` in a logo query), a blank or absent value
writing no tag and no empty `content`, a `data:` logo writing no
`og:image`, an absolute logo passing through, a shell with no `title`
element, `x-forwarded-proto` taken and a bogus value ignored, and the
probe forwarding host and cookies while dropping the four headers. The
preservation cases pin the document byte for byte to the pre-change
answer with no door, with no branding block, with a door that answers
500 (one `warn` over two requests) and with a door that throws.
Ablation (committed fix first, `scripts/ablation-replace.mjs`):
`readIndexHtml`'s head-writing return was replaced by a plain return. 13
of 17 went red. The 4 that stayed green are the preservation cases,
which is the expected direction. Restored: blob equals HEAD, `git diff
HEAD` empty.
Runs (on `1bfcd481`, before the main merge):
- `pnpm --filter @objectstack/cli exec vitest run --project unit`: 325
files / 4799 tests. Two files
(`test/published-subpath-console.pin.test.ts`,
`test/published-subpath-hook-body.pin.test.ts`) refused because
`packages/cli` was not built yet. After building cli they passed: 2
files, 29 tests.
- `pnpm --filter @objectstack/cli typecheck`: exit 0.
- `dispatch-gates --commands`: 97 derived families, all exit 0. `--ran`
reconciliation: 97 run, 0 NOT-MEASURED.
- The dogfood files that mount this plugin:
`showcase-public-form-redirect` 9/9 passed.
`principal-session-console-boot` and `print-service-render` skipped
themselves (no built console on this host), so NOT MEASURED here.
After merging `origin/main` (`43e5a2b6`; the incoming change touched
only `cloud-connection-plugin.ts`): the three console test files passed,
75/75. The integration tier is declared to CI. The full dogfood battery
is n/a: no `!` in the title and no `(narrowing)` arm.
## Acceptance notes
- `og:url` is the request ORIGIN, as the card specifies, not the full
document URL. A deep link's preview therefore names the site root as its
canonical URL. Changing that would be a separate decision on the card's
wording. Carrier: none.
- No localized meta, per the card's "Not here" line.
---
_Generated by [Claude
Code](https://claude.ai/code/session_014FFTcf6msoLbXiD6BR7wHW)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_014FFTcf6msoLbXiD6BR7wHW
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9dc1f42 commit 7b047b4
4 files changed
Lines changed: 498 additions & 4 deletions
File tree
- .changeset
- content/docs/deployment
- packages/cli/src/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
0 commit comments