synthesisui 0.16.138 → 0.16.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,9 +65,24 @@ const FRONTIERS = new Set(["component", "external"]);
65
65
  * its own box, because its styles already sit on the component's base.
66
66
  */
67
67
  const STRUCTURAL = /^(root|wrapper|base|el|outer)$/i;
68
- /** A pathological transcription of somebody's DOM, bounded. Six levels reaches
69
- * any real component; past that it is layout divs all the way down. */
70
- const MAX_DEPTH = 6;
68
+ /**
69
+ * A transcrição patológica do DOM de alguém, com teto - e o teto foi medido errado.
70
+ *
71
+ * "Seis níveis alcançam qualquer componente real; além disso são divs de layout até o fim" foi
72
+ * calibrado numa biblioteca de 36 componentes. Um app de 275 desmente: a leitura do
73
+ * `apps/web-dashboard` tem 64 nós além do 6, e a distribuição mostra que a cauda é fina e é
74
+ * CONTEÚDO (05/08):
75
+ *
76
+ * nível 0 1 2 3 4 5 6 7 8 9
77
+ * nós 923 935 871 609 405 231 139 50 12 2
78
+ *
79
+ * O que estava acontecendo com esses 64: `walk` retornava ali, então tudo abaixo do sexto nível era
80
+ * descartado em silêncio - a estrutura que o cliente escreveu, perdida sem uma linha de aviso.
81
+ *
82
+ * 10 cobre a população inteira com folga e mantém o teto contra recursão patológica, que é a razão
83
+ * de ele existir. Um número medido em vez de estimado.
84
+ */
85
+ const MAX_DEPTH = 10;
71
86
  /**
72
87
  * The same ceiling the sketch measured, for the same reason.
73
88
  *
@@ -74,6 +74,31 @@ and narrating it - *"registry is production, so no --registry flag needed"* - sp
74
74
  person's attention on a decision that was never theirs (dono, 01/08). Say something only when
75
75
  there is nothing to say to: no token, or the wrong host.
76
76
 
77
+ ### 0b. ASK THE REGISTRY WHAT EXISTS - never your notes
78
+
79
+ If your memory says this repo already produced a system, **verify it before you say it out loud**,
80
+ and verify it per SLUG:
81
+
82
+ \`\`\`
83
+ curl -s -o /dev/null -w "%{http_code}" <registry>/api/registry/ds/<slug>
84
+ \`\`\`
85
+
86
+ \`404\` means it does not exist. \`200\` means it does. That is the whole check, and it costs one call.
87
+
88
+ **\`synthesisui list\` does NOT answer this.** It returns the public gallery - 13 systems, none of
89
+ them private - so a private system of theirs is invisible to it and a \`list\` that does not mention
90
+ \`their-slug\` proves nothing.
91
+
92
+ This exists because of a real run (dono, 05/08). The owner had deleted every system on his account,
93
+ and the skill opened with *"my notes from the previous twelve runs say this repo has already
94
+ produced two published systems"* - then offered three options built on that: upgrade a slug the
95
+ registry answers \`404\` for, avoid a name collision that no longer existed, and warn that a \`--dry\`
96
+ would wipe files it does not touch. One \`curl\` would have replaced all of it.
97
+
98
+ **A memory may report the past; it may never assert the present.** *"The last run produced
99
+ \`signalui\`"* is a fine sentence. *"This repo has two published systems"* is a claim about the server,
100
+ and the server is the only thing that can make it.
101
+
77
102
  ## How to narrate
78
103
 
79
104
  The person cares about **what you found in their code** and **what you are about to create**.
@@ -880,6 +905,13 @@ Copying \`dark\` in at the top level of a recipe costs you that block, silently,
880
905
  component that has one - and \`import\` already converts it for the recipes IT writes, so the
881
906
  only place this can be lost is a recipe you hand-built (not-expressed.md, dono, 03/08).
882
907
 
908
+ **Which means: do NOT pre-convert the dark half inside \`looks[X]\`.** The conversion already
909
+ happens on the way in, so adding a \`scheme: "dark"\` layer to the census's own look while leaving
910
+ the \`dark\` key in place produces the SAME layer twice - measured at 28 components in one real
911
+ import, with the properties in a different key order so it did not even look like a duplicate
912
+ (dono, 05/08). \`validate_recipe\` telling you a top-level \`dark\` would be dropped is true about a
913
+ RECIPE and says nothing about the reading: you send a reading, and the reading's \`dark\` is read.
914
+
883
915
  **In ONE call.** Build every recipe in memory, then send the whole reading to
884
916
  \`validate_recipes\` - one round trip for 35 components instead of 35. \`validate_recipe\`
885
917
  (singular) is for the one recipe you rewrote after the batch named it; reaching for it in a
@@ -1157,15 +1189,40 @@ three biggest items so they know whether it is worth opening now.
1157
1189
  found in their code, a token that is not ramp-shaped, a name the document refused. Read them
1158
1190
  and pass on the ones that matter.
1159
1191
 
1192
+ **And the notes now judge YOUR reading, which nothing did before.** \`validate_recipes\` looks at
1193
+ the \`anatomy\` inside a recipe; the anatomy you author travels in \`reading.components[X].anatomy\`,
1194
+ and until 05/08 no one looked at it - so a note may name findings the batch validator never saw.
1195
+ Two kinds, and both are yours to act on:
1196
+
1197
+ - **structure that does not survive the reader.** Nine of these landed on a real import, every one
1198
+ the same shape: a \`button\` holding a \`stack\`. Only \`row\` and \`stack\` arrange, so the children are
1199
+ hoisted out and become siblings - the nesting they wrote is gone. Fix it in the reading and send
1200
+ again; the note tells you the component and the path.
1201
+ - **references pointing at components the system does not contain.** 215 of 660 on that same
1202
+ import. This one is usually NOT a mistake of yours: their component composes something the gate
1203
+ left out, or something outside the scope that was measured. Say the number to the person and name
1204
+ the top few, because a specimen there draws the reference and nothing else - and if the missing
1205
+ piece is central to their system, the answer is a wider \`--scope\`, not a rewritten reading.
1206
+
1160
1207
  ### 6. Close the loop in their repo
1161
1208
 
1162
1209
  The system is only worth something once it governs the code it came from:
1163
1210
 
1164
1211
  \`\`\`
1165
- npx synthesisui upgrade <slug> [--registry …] # brings the contract in
1212
+ npx synthesisui add <slug> [--registry …] # INSTALLS it: writes _synthesisui/ds/<slug>/
1166
1213
  npx synthesisui doctor [paths…] # the contract starts being enforced
1214
+ npx synthesisui upgrade <slug> [--registry …] # LATER, when a new version is published
1167
1215
  \`\`\`
1168
1216
 
1217
+ **The order is not a preference: \`upgrade\` reads the \`.lock\` of an installed DS and refuses
1218
+ without one** - \`"<slug>" is not installed here - run \\\`synthesisui add <slug>\\\` first.\` So
1219
+ offering \`upgrade\` to somebody who has never installed hands them a command that fails on contact
1220
+ (dono, 05/08). Check for \`_synthesisui/ds/<slug>/.lock\` before you recommend either one.
1221
+
1222
+ And say what each writes, because one of them rewrites code: \`add\` and \`upgrade\` write inside
1223
+ \`_synthesisui/\`, and \`upgrade\` ALSO regenerates components - but only files carrying the
1224
+ \`Generated by SynthesisUI\` header, so their own components are never touched.
1225
+
1169
1226
  \`doctor\` is where the promise pays off: every design value written by hand, the token their
1170
1227
  own system already has for it, and the components used outside the axes their contract
1171
1228
  declares. In a monorepo, scope it per app - one system, N consumers.
@@ -1186,8 +1243,16 @@ The user should end up with a system that reads like theirs and not like ours:
1186
1243
 
1187
1244
  ## What to resist
1188
1245
 
1246
+ - **Do not let memory speak for the server.** Notes report the past; a claim about what exists
1247
+ now needs the one \`curl\` in step 0b. Four statements in one real run were wrong this way, and
1248
+ every option offered on top of them was wrong too (dono, 05/08).
1189
1249
  - **Do not run \`import\` without \`--dry\` to explore.** It creates a real system on their
1190
1250
  account. Measure with \`--dry\`, read, then send once.
1251
+ - **\`--dry\` does not delete anything.** It writes \`census.json\` and creates the folder if needed -
1252
+ there is no \`rm\` in the import path. What it DOES do is overwrite that one file, so a reading
1253
+ injected into it is lost; everything else under \`_synthesisui/\` (the config, \`ds/<slug>/\`, the
1254
+ hook's marker, \`not-expressed.md\`) survives untouched. Telling somebody a measure will wipe their
1255
+ install talks them out of a safe command (dono, 05/08).
1191
1256
  - **Do not redo the arithmetic.** If you find yourself counting colours, you are in the wrong
1192
1257
  half of the pipeline.
1193
1258
  - **Do not fill \`roles\` with what looks nice.** It is a reading of what their code already
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.138",
3
+ "version": "0.16.140",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {